Merge branch 'feature/finance_statement_three' of wmtx/platform into release

master
陈志 4 years ago committed by Gogs
commit be2851cecc

@ -241,6 +241,30 @@ class CompanyStatementLackController extends ThinkController
"info"=>"汇总成功"
));
}
public function export(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = $this->DBModel->where("id in ({$ids})")->select();
$is_export= false;
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
$is_export = true;
}
if($dbres[0]['company_type'] == 3){
//上游
$this->assign("title","上游公司未汇总");
A("CompanyStatementPool")->viewCpPool($dbres,$is_export);
}elseif($dbres[0]['company_type'] == 1){
//下游公司
$this->assign("title","下游公司未汇总");
A("CompanyStatementPool")->viewPcPool($dbres,$is_export);
}else{
$this->assign("title","下游个人未汇总");
A("CompanyStatementPool")->viewPuPool($dbres,$is_export);
}
}
protected function addStatementInfo($va,$ke,&$v,$k){
if($k=="ups" || $k=='downs' || $k =="users"){
$verify_status = 0;

@ -177,7 +177,7 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]" data-companytype="{$data['company_type']}"></td>
<td>{$data.company_name}</td>
<td>{$data.company_type_str}</td>
<td>{$data.valid}</td>
@ -327,24 +327,23 @@
})
$("#export").click(function () {
var company = [];
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length > 20){
layer.msg("<font style='color:white'>" + '暂不支持超过20条的批量导出' + "</font>");
return;
}
if(text.length < 1){
layer.msg("<font style='color:white'>" + '请先选择要导出的结算单' + "</font>");
return;
}
for (var index = 0; index < text.length; index++) {
var id = text[index];
var url ="{:U('viewStatement')}"+"&id="+id+"&export=1";
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
var cid = $(elem).data("companytype");
try {
company[cid].push($(elem).val());
} catch (error) {
company[cid] = [];
company[cid].push($(elem).val());
}
});
company.forEach(function(e){
var ids = e.join(",");
var url ="{:U('export')}"+"&ids="+ids+"&export=1";
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel)
}
});
})

Loading…
Cancel
Save