导出所有

master
tping 4 years ago
parent 1c150f290e
commit a5b977aa00

@ -67,6 +67,18 @@ class CompanyStatementLackController extends ThinkController
// $this->checkListOrCountAuthRestMap($map);//导出权限
//条件end
if (isset($_REQUEST['export']) && $_REQUEST['export']==1) {
$map['company_type'] = $_REQUEST['export_company_type'];
$data = $this->DBModel
->field("*")
->where($map)
->order("id desc")
->select();
$ids = array_column($data, 'id');
$ids = implode(',', $ids);
$this->export($ids);
return ;
}
$data = $this->DBModel
->field("*")
->where($map)
@ -265,9 +277,12 @@ class CompanyStatementLackController 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 = $this->DBModel->where("id in ({$ids})")->select();
$is_export= false;
@ -411,7 +426,8 @@ class CompanyStatementLackController extends ThinkController
{
$mentBtn = [
"pool"=>"<a class='butn' id='pool'>发起汇总</a>",
"export"=>"<a class='butn' id='export'>批量导出</a>"
"export"=>"<a class='butn' id='export'>批量导出</a>",
"export_all"=>"<a class='butn' id='export_all'>导出所有</a>"
];
$resarr = [];
foreach ($mentBtn as $k => $v) {

@ -274,6 +274,11 @@ class SocietyInfoController extends ThinkController
}
if ($save['province'] == "请选择省份") $save['province'] = '';
if ($save['city'] == "请选择城市") $save['city'] = '';
foreach ($save['game_types'] as $v) {
$save['game_type'] .= $v . "/";
}
$save['game_type'] = trim($save['game_type'], '/');
$save['create_time'] = time();
$save['update_time'] = time();
$save['communication_time'] = time();

@ -348,8 +348,45 @@
})
$("#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(){

@ -83,6 +83,18 @@ class ExcelPaymentController extends BaseController
$map['i.batch_num'] = ["LIKE","%{$_REQUEST['batch_num']}%"];
}
if (isset($_REQUEST['export']) && $_REQUEST['export']==1) {
$data = M("excel_statement_info","tab_")
->alias('i')
->field("i.*")
->where($map)
->order("FIELD(pay_status,0,-1,1)")
->select();
$ids = array_column($data, 'id');
$ids = implode(',', $ids);
$this->viewPool($ids);
return ;
}
$CompanyInfo = M("excel_statement_info","tab_")
->alias('i')
->field("i.*")
@ -200,12 +212,12 @@ class ExcelPaymentController extends BaseController
$this->ajaxReturn(["status"=>1,"msg"=>"ok"]);
}
//查看
public function viewPool()
public function viewPool($id)
{
if(!isset($_REQUEST['id'])){
$this->error('参数错误');
if (!$id) {
if (!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
}
$id = $_REQUEST['id'];
$is_export= false;
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
$is_export = true;

@ -92,6 +92,21 @@ class PaymentController extends BaseController
$map['s.pay_type'] = $_REQUEST['pay_type'];
}
if (isset($_REQUEST['export']) && $_REQUEST['export']==1) {
$map['s.company_type'] = $_REQUEST['export_company_type'];
$data = M("company_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
->join("left join tab_company_statement_pool p ON p.id = s.pool_id")
->where($map)
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->select();
$ids = array_column($data, 'id');
$ids = implode(',', $ids);
$this->export($ids);
return ;
}
// dump($map);die();
$sum = M("pay_statement_info","tab_")
->alias('c')
@ -231,12 +246,12 @@ class PaymentController extends BaseController
}
//导出
public function export() {
public function export($id) {
if(!isset($_REQUEST['id'])){
$this->error('参数错误');
if (!$id) {
if (!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
}
$id = $_REQUEST['id'];
$data = M("company_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")

@ -187,7 +187,8 @@
<a class='butn' id='doPayment'>打款</a>
</if>
<a class='butn' id='leadExcel'>Excel导入</a>
<a class='butn' id='export'>导出</a>
<a class='butn' id='export'>批量导出</a>
<a class='butn' id='export_all'>导出所有</a>
<!-- <a class='butn verify' data-value='1'>审核通过</a>-->
<!-- <a class='butn verify' data-value='2'>审核拒绝</a>-->
@ -550,6 +551,35 @@
$("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;
}
url += "&export=1&exporttype=all";
layer.alert("<font style='color:#333'>"+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ "</font>");
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel);
});
$("#delItem").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {

@ -219,7 +219,8 @@
<!-- <a class='butn return_verify' data-value='0' style="background-color: red;">审核撤回</a>-->
<a class='butn setPayment'>打款信息确认</a>
<a class='butn returnSetPayment' id="returnSetPayment">打款信息确认撤回</a>
<a class='butn' id='export'>导出</a>
<a class='butn' id='export'>批量导出</a>
<a class='butn' id='export_all'>导出所有</a>
</div>
</div>
@ -620,6 +621,33 @@
}
});
$("#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;
}
url += "&export=1&export_company_type=" + $("#company_type").val();
layer.alert("<font style='color:#333'>"+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ "</font>");
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel);
});
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){
var val = $(this).find("option:selected").val();

Loading…
Cancel
Save