|
|
|
@ -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)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|