From fedcbd605b19668ed8475fdc7632f0e058d7d83c Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 21 Sep 2020 15:49:35 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementController.class.php | 9 +++- .../CompanyStatementPoolController.class.php | 25 ++++++++++ .../View/CompanyStatementPool/lists.html | 48 ++++++++++++++++++- .../Admin/View/PromoteCompany/add.html | 2 +- Data/update.sql | 6 +++ 5 files changed, 87 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 22be3cb28..c17ccba7b 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -242,7 +242,14 @@ class CompanyStatementController extends ThinkController $statement_info = json_decode($dbres['statement_info'],true); foreach ($statement_info as $key => $value) { - if ($value['game_name'] == "罚款" || $value['game_name'] == "奖励") { + if ($value['game_name'] == "罚款" ) { + $dbres['pay_amount'] = $dbres['pay_amount'] + $statement_info[$key]['pay_amount']; + $statement_info[$key]['pay_amount'] = "-"; + + } + + if ($value['game_name'] == "奖励") { + $dbres['pay_amount'] = $dbres['pay_amount'] - $statement_info[$key]['pay_amount']; $statement_info[$key]['pay_amount'] = "-"; } } diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index f18a6fbac..3444c95e7 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -458,6 +458,30 @@ class CompanyStatementPoolController extends ThinkController public function verifyRefuse(){ $this->setVerifyStatus(0,-1,"verify"); } + //审批撤回 + public function verifyReturn() { + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select(); + + foreach($dbres as $k=>&$v){ + + if($v['verify_status'] != -1&&$v['verify_status'] != 1) continue; + + $v['verify_log'] = json_decode($v['verify_log'],true); + unset($v['verify_log']['verify_user']); + unset($v['verify_log']['verify_time']); + $v['verify_log'] = json_encode($v['verify_log']); + $v['verify_status']=0; + $this->DBModel->save($v); + addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"审批撤回",'url'=>U('lists')]); + } + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"审批撤回成功" + )); + } + //线下打款 public function setUlPayment() { @@ -1054,6 +1078,7 @@ class CompanyStatementPoolController extends ThinkController $mentBtn = [ "verifyAgree"=>"审批通过", "verifyRefuse"=>"审核拒绝", + "verifyReturn"=>"审批撤回", "export"=>"导出" ]; $resarr = []; diff --git a/Application/Admin/View/CompanyStatementPool/lists.html b/Application/Admin/View/CompanyStatementPool/lists.html index d613b7420..85097f6d0 100644 --- a/Application/Admin/View/CompanyStatementPool/lists.html +++ b/Application/Admin/View/CompanyStatementPool/lists.html @@ -373,7 +373,53 @@ } }); } - }) + }); + + $("#verifyReturn").on("click",function(){ + + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + return $(elem).val(); + }).get(); + + if(text.length > 40){ + layer.msg("" + '为保证效率暂不支持超过40条的批量操作' + ""); + return; + } + if(text.length < 1){ + layer.msg("" + '无需要汇总的操作'+""); + return; + } + text = text.join(","); + + layer.confirm('【提示】点击确认后,审批即撤回', { + btn: ['确认','取消'], + title:false + }, function(){ + _doAgreeApply(); + }); + + function _doAgreeApply(){ + //执行 + $.ajax({ + type: "POST", + url: "{:U('verifyReturn')}", + 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; + } + } + }); + } + }); $("#export").click(function () { var flag = false; diff --git a/Application/Admin/View/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html index fed50aad2..ec840acee 100644 --- a/Application/Admin/View/PromoteCompany/add.html +++ b/Application/Admin/View/PromoteCompany/add.html @@ -184,7 +184,7 @@ diff --git a/Data/update.sql b/Data/update.sql index e85adbad5..8bc7dccf0 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2496,3 +2496,9 @@ ADD COLUMN `performance_profit` decimal(13, 2) NULL DEFAULT 0.00 COMMENT '维护 ALTER TABLE `sys_ucenter_member` ADD COLUMN `work_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '离职状态' AFTER `openid_sign`; + +ALTER TABLE `tab_market_altogether` +ADD COLUMN `market_check` tinyint(2) NULL DEFAULT 0 COMMENT '市场确认 0 未确认 1 确认' AFTER `performance_profit`, +ADD COLUMN `market_check_detail` varchar(100) NULL DEFAULT '' COMMENT '市场确认详情' AFTER `market_check`, +ADD COLUMN `finance_check` tinyint(2) NULL DEFAULT 0 COMMENT '财务确认 0 未确认 1 确认' AFTER `market_check_detail`, +ADD COLUMN `finance_check_detail` varchar(100) NULL DEFAULT '' COMMENT '财务确认详情' AFTER `finance_check`; \ No newline at end of file