From 63f5354dc30d3a0d29c834495fa489df55e7c16e Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sun, 26 Apr 2020 16:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=8D=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 18 ++++- ...regateFinanceStatementController.class.php | 21 +++-- .../View/AggregateFinanceStatement/lists.html | 79 ++++++++++++------- 3 files changed, 77 insertions(+), 41 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php index d6db14fbf..6f3b4f3ab 100644 --- a/Application/Admin/Controller/AggregateFinanceSetController.class.php +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -168,7 +168,7 @@ class AggregateFinanceSetController extends Controller { //更新信息 $begintimestr = date("Y-m-d",$info['begintime']); $endtimestr = date("Y-m-d",$info['endtime']); - var_dump($rsp); + if($rsp['count'] > 0){ //插入数据 foreach ($rsp['data'] as $k => $v) { @@ -183,6 +183,14 @@ class AggregateFinanceSetController extends Controller { $v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username']; $v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid']; $v['verify_status'] = 0; + + $first_party_info = json_decode($info['first_party_info'], 1); + if($first_party_info['partner'] == $info['channel_name']){ + $v['second_party_info'] = $info['first_party_info']; + $v['first_party_info'] = $info['second_party_info']; + $v['pay_type'] =0; + } + $res = $Aggregate->where("id='{$id}'")->save($v); if(empty($res)){ return false; @@ -198,6 +206,14 @@ class AggregateFinanceSetController extends Controller { "ratio_money"=>0, "pay_money"=>0 ]; + + $first_party_info = json_decode($info['first_party_info'], 1); + if($first_party_info['partner'] == $info['channel_name']){ + $savedata['second_party_info'] = $info['first_party_info']; + $savedata['first_party_info'] = $info['second_party_info']; + $savedata['pay_type'] =0; + } + $res = $Aggregate->where("id='{$id}'")->save($savedata); if(empty($res)){ return false; diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index c3918e0bb..4868093eb 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -417,7 +417,6 @@ class AggregateFinanceStatementController extends ThinkController $ids = explode(",",$_REQUEST['ids']); foreach ($ids as $k => $v) { $res = A("AggregateFinanceSet")->updateAggregateFinanceData($v); - var_dump($res); if(!$res){ $this->ajaxReturn(array( 'status' => 0, @@ -588,7 +587,7 @@ class AggregateFinanceStatementController extends ThinkController $optist = []; switch ($info['verify_status']) { case '-1': - $optist = ["viewStatement","cancelVerify","addRemark","editRemark","viewRemark"]; + $optist = ["viewStatement","cancelVerify","addRemark","viewRemark","editRemark"]; break; case '0': $optist = ["viewStatement","createStatement"]; @@ -597,16 +596,16 @@ class AggregateFinanceStatementController extends ThinkController $optist = ["viewStatement","editStatement","cancelApply"]; break; case '2': - $optist = ["viewStatement","cancelVerify","addRemark","editRemark","viewRemark"]; + $optist = ["viewStatement","cancelVerify","addRemark","viewRemark","editRemark"]; break; case '3': - $optist = ["viewStatement","uploadVoucher","addRemark","editRemark","viewRemark"]; + $optist = ["viewStatement","uploadVoucher","viewVoucher","editVoucher","addRemark","viewRemark","editRemark"]; break; case '4': - $optist = ["viewStatement","viewVoucher","editVoucher","addRemark","editRemark","viewRemark"]; + $optist = ["viewStatement","viewVoucher","editVoucher","addRemark","viewRemark","editRemark"]; break; case '5': - $optist = ["viewStatement","uploadVoucher","viewVoucher","editVoucher","addRemark","editRemark","viewRemark"]; + $optist = ["viewStatement","uploadVoucher","viewVoucher","editVoucher","addRemark","viewRemark","editRemark"]; break; default: break; @@ -614,17 +613,15 @@ class AggregateFinanceStatementController extends ThinkController //判断凭证和备注 if(empty($info['ext_field'])){ //未上传凭证 - if($optist['viewVoucher']) unset($optist['viewVoucher']); - if($optist['editVoucher']) unset($optist['editVoucher']); + $optist = array_diff($optist, ["viewVoucher", "editVoucher"]); }else{ - if($optist['uploadVoucher']) unset($optist['uploadVoucher']); + $optist = array_diff($optist, ["uploadVoucher"]); } if(empty($info['remark'])){ //未上传备注 - if($optist['editRemark']) unset($optist['editRemark']); - if($optist['viewRemark']) unset($optist['viewRemark']); + $optist = array_diff($optist, ["editRemark", "viewRemark"]); }else{ - if($optist['addRemark']) unset($optist['addRemark']); + $optist = array_diff($optist, ["addRemark"]); } // $resarr = []; diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index 302016bf2..574ea63af 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -116,12 +116,6 @@ {$vo} - @@ -618,30 +612,59 @@ var remark = $(this).data("remark"); layer.prompt({ formType: 2, - value: remark, title: '修改备注', - area: ['360px', '300px'] //自定义文本域宽高 - }, function(value, index, elem){ - if(value != ''){ - $.ajax({ - type: "POST", - url: "{:U('saveRemark')}", - dataType: 'json', - async: false, - data: {id:id,remark:value}, - success:function(data){ - if(data.status==1){ - layer.msg("" + data.info + ""); - setTimeout(function(){ - window.location.reload(); - },1500); - } + value:remark, + area: ['360px', '300px'], + btnAlign: 'c', + id: 'prompt', + yes: function (index, layero) { + // 获取文本框输入的值 + var value = layero.find(".layui-layer-input").val(); + $.ajax({ + type: "POST", + url: "{:U('saveRemark')}", + dataType: 'json', + async: false, + data: {id:id,remark:value}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); } - }); - }else{ - layer.closeAll(); - } - }); + } + }); + } + }); + + + // layer.prompt({ + // formType: 2, + // value: remark, + // title: '修改备注', + // area: ['360px', '300px'] //自定义文本域宽高 + // }, function(value, index, elem){ + // if(value != ''){ + // $.ajax({ + // type: "POST", + // url: "{:U('saveRemark')}", + // dataType: 'json', + // async: false, + // data: {id:id,remark:value}, + // success:function(data){ + // if(data.status==1){ + // layer.msg("" + data.info + ""); + // setTimeout(function(){ + // window.location.reload(); + // },1500); + // } + // } + // }); + // }else{ + // layer.closeAll(); + // } + // }); }) //查看批注 $(".viewRemark").click(function () {