From b5a604d385b259695cbbf8639bf2a3cc09b0a139 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sat, 23 May 2020 16:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyRelationController.class.php | 41 ++++++++++++++++++- .../Admin/View/CompanyGameRatio/addRatio.html | 1 + .../View/CompanyRelation/addRelation.html | 12 ++++-- .../Admin/View/GameRatioMould/add.html | 1 + 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/CompanyRelationController.class.php b/Application/Admin/Controller/CompanyRelationController.class.php index 4fa12d3dd..b0b97eb2a 100644 --- a/Application/Admin/Controller/CompanyRelationController.class.php +++ b/Application/Admin/Controller/CompanyRelationController.class.php @@ -55,8 +55,45 @@ class CompanyRelationController extends AdminController public function addRelation() { - $this->assign('companyType',$this->CompanyType); - $this->display(); + if ($_POST) { + $params = I('post.'); + if ($params['first_company_type'] == $params['second_company_type']) { + $this->error('合作甲乙双方不能是同类型公司'); + } + if ($params['first_company_type']!=0 && $params['second_company_type']!=0) { + $this->error('合作甲乙双方必须有个是己方公司'); + } + $params['remark'] = $params['remark'] ?? ''; + $params['status'] = 0; + $params['verify_log']=json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s")]); + //判断已有未审核 + $where = " + ( + (first_company_type ='{$params['first_company_type']}' and first_company_id = '{$params['first_company_id']}') + OR + (first_company_type ='{$params['second_company_type']}' and first_company_id = '{$params['second_company_id']}') + ) + AND + ( + (second_company_type ='{$params['first_company_type']}' and second_company_id = '{$params['first_company_id']}') + OR + (second_company_type ='{$params['second_company_type']}' and second_company_id = '{$params['second_company_id']}') + ) + AND + status < 2 + "; + $hasdb = $this->DBlogModel->field("count(id) count")->where($where)->find()['count']; + if($hasdb > 0){ + $this->error('当前甲乙双方已有审批单,请直接搜索后修改'); + } + $id = $this->DBlogModel->add($params); + addOperationLog(['op_type'=>0,'key'=>$id,'op_name'=>'新增','url'=>U('lists')]); + $this->ajaxReturn(["msg"=>"添加成功","code"=>1,"url"=>U("lists")]); + + } else { + $this->assign('companyType',$this->CompanyType); + $this->display(); + } } public function editRelation() { diff --git a/Application/Admin/View/CompanyGameRatio/addRatio.html b/Application/Admin/View/CompanyGameRatio/addRatio.html index da5ed1606..3986541fc 100644 --- a/Application/Admin/View/CompanyGameRatio/addRatio.html +++ b/Application/Admin/View/CompanyGameRatio/addRatio.html @@ -305,6 +305,7 @@ $(function(){ } },1500); }else{ + $(that).removeClass('disabled').prop('disabled',false); layer.msg(data.msg,{icon: 2}); } }); diff --git a/Application/Admin/View/CompanyRelation/addRelation.html b/Application/Admin/View/CompanyRelation/addRelation.html index b389e2b0c..4fb008ce0 100644 --- a/Application/Admin/View/CompanyRelation/addRelation.html +++ b/Application/Admin/View/CompanyRelation/addRelation.html @@ -95,7 +95,7 @@
-
+
@@ -193,6 +193,13 @@ + + 开票内容: + + + + + 是否有打款流程: @@ -287,8 +294,6 @@ $(function(){ var target = $('form').get(0).action; var query = $('form').serialize(); var that = this; - console.log(query); - return false; $(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true); $.post(target,query).success(function(data){ if(layer) {layer.closeAll('loading');} @@ -309,6 +314,7 @@ $(function(){ } },1500); }else{ + $(that).removeClass('disabled').prop('disabled',false); layer.msg(data.msg,{icon: 2}); } }); diff --git a/Application/Admin/View/GameRatioMould/add.html b/Application/Admin/View/GameRatioMould/add.html index 2b85ce4c9..9943dc648 100644 --- a/Application/Admin/View/GameRatioMould/add.html +++ b/Application/Admin/View/GameRatioMould/add.html @@ -330,6 +330,7 @@ $(function(){ } },1500); }else{ + $(that).removeClass('disabled').prop('disabled',false); layer.msg(data.msg,{icon: 2}); } });