From 684ea81b6acc3bbe0f4fb9738890fc3c0e4c2212 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 20 Jan 2021 11:26:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BA=BF=E4=B8=8A=E8=BD=AC?= =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E6=89=93=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PaymentController.class.php | 23 ++++++++++++++++++ Application/Payment/View/Payment/lists.html | 24 +++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index e77835c58..60390aef6 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -317,6 +317,29 @@ class PaymentController extends BaseController $companyInfo['ali_account'] = $newInfo['ali_account']; return json_encode($companyInfo,JSON_UNESCAPED_UNICODE); } + //线上转线下 + public function setStatementPayTapy() + { + $id = I("post.id",0); + $PayStatementDB = M("pay_statement_info","tab_"); + //判断线上打款 + $sWhere = [ + 'company_id' => $oldInfo['company_id'], + 'statement_info_id' => $id + ]; + $sCount = $PayStatementDB->where($sWhere)->where("pay_status = 1")->count(); + if($sCount > 0) { + $this->ajaxReturn(['status' =>0 ,'msg'=>'已有付款成功的子单,无法转线下','data'=>[]]); + } + //删除打款 + $PayStatementDB->where($sWhere)->delete(); + //修改自身 + $res = M("company_statement_info","tab_")->where("id = {$id}")->save(['verify_status' => 2, 'pay_check' => 0, 'pay_check_member_id' => 0, 'pay_check_time' => 0]); + if(empty($res)){ + $this->ajaxReturn(['status' =>0 ,'msg'=>'转换失败','data'=>[]]); + } + $this->ajaxReturn(['status' =>1 ,'msg'=>'成功转为线下确认','data'=>[]]); + } //导出 public function export() { diff --git a/Application/Payment/View/Payment/lists.html b/Application/Payment/View/Payment/lists.html index 73e141960..1ba38c90e 100644 --- a/Application/Payment/View/Payment/lists.html +++ b/Application/Payment/View/Payment/lists.html @@ -281,7 +281,7 @@ 支付信息更新 - 转线下支付 + 转线下支付 @@ -517,7 +517,6 @@ ChangePayInfo.remove(); layer.msg(""+rep.msg+""); } - console.log(data); }) } ,doChangeCompanyInfo(){ @@ -581,10 +580,31 @@ $("body").append(iframeExcel); } }); + //修改公司信息 $(".changeCompanyInfo").on("click",function() { const id = $(this).data('id'); ChangePayInfo.dataInit(id); }) + //线上转线下 + $(".changePayTapy").on("click",function() { + const id = $(this).data('id'); + //执行 + layer.confirm('是否确定直接转为线下打款?转为线下打款后,该打款单将从线上打款移出转入“管理后台>财务>线下打款确认”中。如需回退需要进行重算,请慎重操作,是否确定?', {}, function(index){ + var url = "{:U('setStatementPayTapy')}"; + $.post(url,{id:id},function(rep){ + if(rep.status == 1){ + layer.msg(""+rep.msg+"",{time:1000},function(){ + window.location.reload(); + }); + }else{ + layer.msg(""+rep.msg+""); + } + }) + },function(index) { + layer.close(index); + }); + }) + var company_id = "{$_GET['company_id']??0}"; $("#company_type").on("change",function(){