From 2b4ed15a300eb44d934d78327daedda7446082de Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 30 Sep 2020 13:35:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=9A=E5=90=88=E5=85=AC=E5=8F=B8=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=B5=81=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateRelationController.class.php | 20 +++++++++++++ .../View/AggregateRelation/addRelation.html | 29 ++++++++++++------- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index 7cd7c8a5a..5703b6540 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -400,6 +400,7 @@ class AggregateRelationController extends AdminController (second_company_type ='{$params['second_company_type']}' and second_company_id = '{$params['second_company_id']}') "; } + $params['first_company_info'] = $this->getCompanyInfo($params['first_company_type'],$params['first_company_id']); $params['first_company_info']['type'] = 'first_party_info'; $params['first_company_info'] = json_encode($params['first_company_info']); @@ -408,6 +409,25 @@ class AggregateRelationController extends AdminController $params['second_company_info']['type'] = 'second_party_info'; $params['second_company_info'] = json_encode($params['second_company_info']); + if(!$params['settlement_type']) { + $params['settlement_type'] = 0; + } + + if(!$params['invoice_type']) { + $params['invoice_type'] = 0; + } + + if ($params['first_company_type'] == 3) { + $company_info = json_decode($params['first_company_info'],true); + $company_info['invoice_item'] = $params['invoice_content']; + $params['first_company_info'] = json_encode($company_info); + + }else if ($params['second_company_type'] == 3) { + $company_info = json_decode($params['second_company_info'],true); + $company_info['invoice_item'] = $params['invoice_content']; + $params['second_company_info'] = json_encode($company_info); + } + $r_res = $this->DBModel->where($where)->find(); if(!empty($r_res)){ $this->error('当前合作方已有绑定关系'); diff --git a/Application/Admin/View/AggregateRelation/addRelation.html b/Application/Admin/View/AggregateRelation/addRelation.html index 656eadf4a..4bc8c5701 100644 --- a/Application/Admin/View/AggregateRelation/addRelation.html +++ b/Application/Admin/View/AggregateRelation/addRelation.html @@ -198,7 +198,7 @@ 开票内容: - + @@ -277,7 +277,11 @@ $(function(){ layer.msg("合作甲乙双方必须有个是己方公司", {icon: 2}); return false; } - + $("select[disabled]").each(function() { + if (parseInt($(this).val()) != -1) { + $(this).attr("disabled", false); + } + }); var target = $('form').get(0).action; var query = $('form').serialize(); @@ -386,26 +390,29 @@ $(function(){ }); function setAggregateInfo(invoice_content,settlement_type,invoice_type) { + if (invoice_content) { + $('.invoice_content').val(invoice_content); + $('#invoice_content').val(invoice_content); + } - $('.invoice_content').val(invoice_content); $('#settlement_type').find("option").each(function() { $(this).removeAttr("selected"); }); - if (!settlement_type) { - $('#settlement_type').removeAttr("disabled"); - } else { + // if (!settlement_type) { + // $('#settlement_type').removeAttr("disabled"); + // } else { $('#settlement_type').prop("disabled",true); - } + // } $('#invoice_type').find("option").each(function() { $(this).removeAttr("selected"); }); - if (!invoice_type) { - $('#invoice_type').removeAttr("disabled"); - } else { + // if (!invoice_type) { + // $('#invoice_type').removeAttr("disabled"); + // } else { $('#invoice_type').prop("disabled",true); - } + // } $("#settlement_type").find("option[value="+settlement_type+"]").prop("selected",true); $("#invoice_type").find("option[value="+invoice_type+"]").prop("selected",true); $("#settlement_type").change();