导出所有

master
tping 4 years ago
parent cfd4368fe5
commit c59b8d1419

@ -59,10 +59,24 @@ class CompanyStatementOfflineController extends ThinkController
if(isset($_REQUEST['statement_pool_num'])){
$map['p.statement_num'] =["LIKE","%{$_REQUEST['statement_pool_num']}%"];
}
//条件end
if (isset($_REQUEST['export']) && $_REQUEST['export']==1) {
$map['c.company_type'] = $_REQUEST['export_company_type'];
$data = SM("company_statement_info","tab_")
->alias("c")
->field("c.*,p.statement_num,p.verify_status")
->where($map)
->where(['p.verify_status'=>['neq',6]])
->join("tab_company_statement_pool as p ON c.pool_id = p.id")
->order("id desc")
->select();
$ids = array_column($data, 'id');
$ids = implode(',', $ids);
$this->export($ids);
return ;
}
$data = SM("company_statement_info","tab_")
->alias("c")
->field("c.*,p.statement_num,p.verify_status")
@ -287,9 +301,12 @@ class CompanyStatementOfflineController extends ThinkController
}
}
public function export(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
public function export($ids=''){
if (!$ids) {
if (!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
}
$dbres = SM("company_statement_info","tab_")->where("id in ({$ids})")->select();
$is_export= false;
@ -351,6 +368,7 @@ class CompanyStatementOfflineController extends ThinkController
"returnSetPayment"=>"<a class='butn' id='returnSetPayment'>打款信息确认撤回</a>",
"doPayment"=>"<a class='butn' id='doPayment'>打款确认</a>",
"export"=>"<a class='butn' id='export'>批量导出</a>",
"export_all"=>"<a class='butn' id='export_all'>导出所有</a>",
];
$resarr = [];
foreach ($mentBtn as $k => $v) {

@ -467,9 +467,46 @@
$("body").append(iframeExcel)
});
})
$("#export_all").click(function() {
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
var url = $('#search').attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
if ($("#company_type").val()) {
url += "&export=1&export_company_type=" + $("#company_type").val();
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel);
return ;
}
url += "&export=1&export_company_type=1";
var iframeExcel1 = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel1);
url += "&export=1&export_company_type=2";
var iframeExcel2 = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel2);
url += "&export=1&export_company_type=3";
var iframeExcel3 = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel3);
});
$("#search").click(function(){

Loading…
Cancel
Save