From 9ff3153f57bce4c930349d6d9d3223a0ff7c116f Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 7 Jul 2020 14:27:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E6=AC=BEok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExcelPaymentController.class.php | 51 ++++++++---- .../Payment/View/ExcelPayment/add.html | 6 +- .../Payment/View/ExcelPayment/lists.html | 77 ++++++++++++++++++- .../View/ExcelPayment/showPayment.html | 4 +- 4 files changed, 115 insertions(+), 23 deletions(-) diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php index 8ce98c7c8..dab61f71e 100644 --- a/Application/Payment/Controller/ExcelPaymentController.class.php +++ b/Application/Payment/Controller/ExcelPaymentController.class.php @@ -75,7 +75,6 @@ class ExcelPaymentController extends BaseController $map['i.batch_num'] = $_REQUEST['batch_num']; } - $CompanyInfo = M("excel_statement_info","tab_") ->alias('i') ->field("i.*") @@ -105,10 +104,7 @@ class ExcelPaymentController extends BaseController $countmap['pay_status']=["neq",1]; $money = M("excel_statement_info","tab_")->alias('i')->field("sum(statement_money) statement_money")->where($countmap)->find(); $count = M("excel_statement_info","tab_")->alias('i')->field("count(id) count")->where($map)->find(); - // dd($count); - $parameter['p'] = $page; - $parameter['row'] = $row; - $page = set_pagination($count['count'], $row, $parameter); + $page = set_pagination($count['count'], $row); if ($page) { $this->assign('_page', $page); } @@ -137,6 +133,7 @@ class ExcelPaymentController extends BaseController } $ExcelStatementInfo = M('ExcelStatementInfo',"tab_"); foreach ($checkarr as $k => &$v) { + $company_info = $v['company_info']; $v['statement_begin_time'] = $statement_begin_time; $v['statement_end_time'] = $statement_end_time; $v['batch_num'] = $batch; @@ -145,14 +142,14 @@ class ExcelPaymentController extends BaseController $v['company_type'] = 2; $v['create_time'] = time(); $v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5); - if(!isset($v['company_info']['ali_user']) || !isset($v['company_info']['ali_account']) || $v['company_info']['ali_user'] == '' || $v['company_info']['ali_account'] == ''){ - M('ExcelStatementInfo')->where("statement_num = '{$v['statement_num']}'")->delete(); + if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){ + M('ExcelStatementInfo',"tab_")->where("statement_num = '{$v['statement_num']}'")->delete(); $this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]); } $res = $ExcelStatementInfo->add($v); if($res === false){ - M('ExcelStatementInfo')->where("statement_num = '{$v['statement_num']}'")->delete(); + M('ExcelStatementInfo',"tab_")->where("statement_num = '{$v['statement_num']}'")->delete(); $this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]); } } @@ -170,12 +167,34 @@ class ExcelPaymentController extends BaseController $is_export = true; } //获取基本信息 - $dbres = M("ExcelStatementInfo","tab_")->where("id='{$id}'")->select(); - $title = $dbres[0]['company_name']; + if($is_export && isset($_REQUEST['exporttype']) && $_REQUEST['exporttype']=='all'){ + $dbres = M("ExcelStatementInfo","tab_")->where("id in ({$id})")->select(); + $title = date("YmdHis"); + }else{ + $dbres = M("ExcelStatementInfo","tab_")->where("id ='{$id}'")->select(); + $title = $dbres[0]['company_name'].date("YmdHis"); + } + $this->assign("title",$title); - $this->viewPuPool($dbres,$is_export); + } + public function delItem() + { + if(!isset($_REQUEST['ids'])){ + $this->error('参数错误'); + } + $ids = $_REQUEST['ids']; + $map = [ + "pay_status"=>["NEQ",1], + "id"=>["IN",$ids] + ]; + $dbres = M("ExcelStatementInfo","tab_")->where($map)->delete(); + if($dbres === false){ + $this->ajaxReturn(["status"=>0,"info"=>"删除失败"]); + } + $this->ajaxReturn(["status"=>1,"info"=>"删除成功"]); + } //个人汇总结算查看 public function viewPuPool(&$infolist,$is_export){ @@ -203,8 +222,10 @@ class ExcelPaymentController extends BaseController $val['ratio'] = 0; } if($is_export){ + $val['ratio'] = $val['ratio']*100; + $val['increment_ratio'] = $val['increment_ratio']*100; //J3*(K3+L3)+M3-N3 - $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; + $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; $count['sum_money_exp'] .= "O{$line}+"; $count['platform_amount_exp'] .= "J{$line}+"; @@ -220,7 +241,6 @@ class ExcelPaymentController extends BaseController $count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+"); $count["sum_money"] = "=".trim($count["sum_money_exp"],"+"); } - // dd($infolist); $this->assign("data",$infolist); $this->assign("count",$count); $this->assign("is_export",$is_export); @@ -288,10 +308,11 @@ class ExcelPaymentController extends BaseController $dbres = M("ExcelStatementInfo","tab_")->where("id='{$id}'")->find(); $company_info = json_decode($dbres['company_info'],true); - if($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1){ + if($dbres['pay_status'] != 1){ //执行打款 - $title = "信息服务费"; + $title = $remark; $amount = $dbres['statement_money']; + $amount = 0.1; $payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title); $resultCode = $payres->code; diff --git a/Application/Payment/View/ExcelPayment/add.html b/Application/Payment/View/ExcelPayment/add.html index b4c0010cf..01c8056ff 100644 --- a/Application/Payment/View/ExcelPayment/add.html +++ b/Application/Payment/View/ExcelPayment/add.html @@ -398,7 +398,7 @@ e[k] = Math.round(e[k]*100)/100; } gamet[titleKey[k]] = e[k]; - }else if(k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ + }else if(k=="下游类型" ||k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ temp.company_info[titleKey[k]] = e[k]; }else{ temp[titleKey[k]] = e[k]; @@ -436,7 +436,7 @@ e[k] = Math.round(e[k]*100)/100; } gamet[titleKey[k]] = e[k]; - }else if(k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ + }else if(k=="下游类型" || k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ temp.company_info[titleKey[k]] = e[k]; }else{ temp[titleKey[k]] = e[k]; @@ -469,7 +469,7 @@ e[k] = Math.round(e[k]*100)/100; } gamet[titleKey[k]] = e[k]; - }else if(k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ + }else if( k=="下游类型" || k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ temp.company_info[titleKey[k]] = e[k]; }else{ temp[titleKey[k]] = e[k]; diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html index 5d7119848..3ccf47756 100644 --- a/Application/Payment/View/ExcelPayment/lists.html +++ b/Application/Payment/View/ExcelPayment/lists.html @@ -157,6 +157,8 @@
批量打款 Excel导入 + 导出 + 批量删除
@@ -191,7 +193,7 @@ - + {$data.company_name} {$data.company_type} {$data.valid} @@ -210,6 +212,7 @@ {$data.remark} 查看 + 导出 打款详情 @@ -291,6 +294,74 @@ content: url }); }); + + $("#export").click(function () { + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + return $(elem).val(); + }).get(); + + if(text.length < 1){ + layer.msg("" + '请先选择要导出的打款单' + ""); + return; + } + _export(); + function _export(){ + layer.alert(""+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ ""); + var id = text.join(","); + var url ="{:U('viewPool')}"+"&id="+id+"&export=1&exporttype=all"; + var iframeExcel = ""//添加下载的地址到iframe,这里是公司信息,我用**表示了。 + $("body").append(iframeExcel); + } + }) + $("#delItem").on("click",function(){ + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if($(elem).data("paystatus") == 1){ + flag = true; + }else{ + return $(elem).val(); + } + }).get(); + if(text.length < 1){ + layer.msg("无可删除数据,支付成功的数据无法删除"); + return; + } + text = text.join(","); + layer.confirm('【警告】删除操作将不可回退,如需继续请点击确认', { + btn: ['确认','取消'], + title:false + }, function(){ + $.ajax({ + type: "POST", + url: "{:U('delItem')}", + dataType: 'json', + async: false, + data: {ids:text}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + }else{ + layer.msg("" + data.info + ""); + return false; + } + } + }); + }); + + + }) + $(".exportPool").click(function(){ + layer.alert(""+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ ""); + var id = $(this).data("id"); + var url ="{:U('viewPool')}"+"&id="+id+"&export=1&exporttype=one"; + var iframeExcel = ""//添加下载的地址到iframe,这里是公司信息,我用**表示了。 + $("body").append(iframeExcel); + }) + $(".paymentInfo").on("click",function(){ var id = $(this).data("id"); var url = "{:U('paymentInfo')}"+"&id="+id @@ -299,7 +370,7 @@ title: "打款详情", shadeClose: true, shade: 0.8, - area: ['20%', '60%'], + area: ['40%', '60%'], content: url }); @@ -311,7 +382,7 @@ } }).get(); if(text.length < 1){ - layer.msg("请先选择需要打款的结算单"); + layer.msg("请先选择需要打款的结算单,仅大于0.1元的打款单才能进行打款"); return; } text = text.join(","); diff --git a/Application/Payment/View/ExcelPayment/showPayment.html b/Application/Payment/View/ExcelPayment/showPayment.html index 6752501c6..24f3bcb7a 100644 --- a/Application/Payment/View/ExcelPayment/showPayment.html +++ b/Application/Payment/View/ExcelPayment/showPayment.html @@ -121,13 +121,13 @@ {$vo.batch_num} {$vo.statement_money} {$vo.remark} - + 合计: - 打款总金额: {$count['statement_money']}     账户金额: {$money} + 打款总金额: {$count['statement_money']} style="color: red;">    账户金额: {$money}