Przeglądaj źródła

增加协议过滤配置

@dongkboy 2 lat temu
rodzic
commit
709a655463
1 zmienionych plików z 138 dodań i 86 usunięć
  1. 138 86
      src/views/Task/daikeComponents/KtLetter.vue

+ 138 - 86
src/views/Task/daikeComponents/KtLetter.vue

@@ -691,7 +691,7 @@
               </span>
             </div>
             <el-select v-if="insureitem.amtList" filterable v-model="insureitem.amount" placeholder="请选择"
-              @change="insureitemChange" size="small" style="width: 300px">
+              @change="insureitemChange($event, insureitem)" size="small" style="width: 300px">
               <el-option :label="item.label" :value="item.value" v-for="(item, index) in insureitem.amtList"
                 :key="index"></el-option>
             </el-select>
@@ -918,12 +918,12 @@
             <el-row>
               <el-col :span="1" style="margin-left: 20px">
                 <el-checkbox v-model="reslistitem.checked" :disabled="reslistitem.disabled" @change="(event) =>
-                    initchange(
-                      event,
-                      reslistitem.id,
-                      reslistitem.cnName,
-                      reslistindex
-                    )
+                  initchange(
+                    event,
+                    reslistitem.id,
+                    reslistitem.cnName,
+                    reslistindex
+                  )
                   "></el-checkbox>
               </el-col>
               <el-col :span="3">
@@ -941,28 +941,31 @@
                   :clearable="true"></el-select>
                 <el-select size="small" v-else :disabled="!reslistitem.checked" v-model="reslistitem.agreementId"
                   placeholder="请选择协议" style="width: 230px" :clearable="true" @change="(val) =>
-                      agreementChange(
-                        val,
-                        reslistitem.agreement,
-                        reslistindex,
-                        reslistitem
-                      )
+                    agreementChange(
+                      val,
+                      reslistitem.agreement,
+                      reslistindex,
+                      reslistitem
+                    )
                     ">
                   <div v-for="(
                       agreementitem, agreementindex
                     ) in reslistitem.agreement" :key="agreementindex">
                     <div v-if="agreementitem.licenseNo &&
-                        agreementitem.licenseNo.length > 0 &&
-                        carInfo.licenseNo.length > 0
-                        ? agreementitem.licenseNo.includes(
-                          carInfo.licenseNo.slice(0, 2)
-                        )
-                        : 'true'
+                      agreementitem.licenseNo.length > 0 &&
+                      carInfo.licenseNo.length > 0
+                      ? agreementitem.licenseNo.includes(
+                        carInfo.licenseNo.slice(0, 2)
+                      )
+                      : 'true'
                       ">
                       <!-- <el-option :label="agreementitem.agreementName" :value="agreementitem.id"
                         :disabled="agreementitem.disabled"></el-option> -->
-                        <el-option :label="agreementitem.jobDescription ? agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' : agreementitem.businessDescription" :value="agreementitem.id"
-                        :disabled="agreementitem.disabled">{{ agreementitem.jobDescription ? agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' : agreementitem.businessDescription }}</el-option>
+                      <el-option
+                        :label="agreementitem.jobDescription ? agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' : agreementitem.businessDescription"
+                        :value="agreementitem.id" :disabled="agreementitem.disabled">{{ agreementitem.jobDescription ?
+                          agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' :
+                          agreementitem.businessDescription }}</el-option>
                     </div>
                   </div>
                 </el-select>
@@ -1446,7 +1449,8 @@
                       :value="item.projectCode"></el-option>
                   </el-select>
                   <div v-else>
-                    <el-select clearable placeholder="未选择" @change="djcxchange" v-model="dajiaaccidentForm.parentCode" @clear="clearAccidentFormDJ">
+                    <el-select clearable placeholder="未选择" @change="djcxchange" v-model="dajiaaccidentForm.parentCode"
+                      @clear="clearAccidentFormDJ">
                       <el-option v-for="(item, index) in dajiaInsuranceData" :key="index" :label="item.projectName"
                         :value="item.projectCode"></el-option>
                     </el-select>
@@ -1514,12 +1518,12 @@
             <el-row>
               <el-col :span="1" style="margin-left: 20px">
                 <el-checkbox v-model="reslistitem.checked" :disabled="reslistitem.disabled" @change="(event) =>
-                    initchange(
-                      event,
-                      reslistitem.id,
-                      reslistitem.cnName,
-                      reslistindex
-                    )
+                  initchange(
+                    event,
+                    reslistitem.id,
+                    reslistitem.cnName,
+                    reslistindex
+                  )
                   "></el-checkbox>
               </el-col>
               <el-col :span="3">
@@ -1537,28 +1541,31 @@
                   :clearable="true"></el-select>
                 <el-select size="small" v-else :disabled="!reslistitem.checked" v-model="reslistitem.agreementId"
                   placeholder="请选择协议" style="width: 230px" :clearable="true" @change="(val) =>
-                      agreementChange(
-                        val,
-                        reslistitem.agreement,
-                        reslistindex,
-                        reslistitem
-                      )
+                    agreementChange(
+                      val,
+                      reslistitem.agreement,
+                      reslistindex,
+                      reslistitem
+                    )
                     ">
                   <div v-for="(
                       agreementitem, agreementindex
                     ) in reslistitem.agreement" :key="agreementindex">
                     <div v-if="agreementitem.licenseNo &&
-                        agreementitem.licenseNo.length > 0 &&
-                        carInfo.licenseNo.length > 0
-                        ? agreementitem.licenseNo.includes(
-                          carInfo.licenseNo.slice(0, 2)
-                        )
-                        : 'true'
+                      agreementitem.licenseNo.length > 0 &&
+                      carInfo.licenseNo.length > 0
+                      ? agreementitem.licenseNo.includes(
+                        carInfo.licenseNo.slice(0, 2)
+                      )
+                      : 'true'
                       ">
                       <!-- <el-option :label="agreementitem.agreementName" :value="agreementitem.id"
                         :disabled="agreementitem.disabled"></el-option> -->
-                        <el-option :label="agreementitem.jobDescription ? agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' : agreementitem.businessDescription" :value="agreementitem.id"
-                        :disabled="agreementitem.disabled">{{ agreementitem.jobDescription ? agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' : agreementitem.businessDescription }}</el-option>
+                      <el-option
+                        :label="agreementitem.jobDescription ? agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' : agreementitem.businessDescription"
+                        :value="agreementitem.id" :disabled="agreementitem.disabled">{{ agreementitem.jobDescription ?
+                          agreementitem.businessDescription + '(' + agreementitem.jobDescription + ')' :
+                          agreementitem.businessDescription }}</el-option>
                     </div>
                   </div>
                 </el-select>
@@ -2422,8 +2429,8 @@
               <el-button size="small" v-show="scope.row.orderstatus == '2'" type="text"
                 @click="Payment(scope.row.id, scope.row)">付款码</el-button>
               <el-button size="mini" type="text" v-if="(scope.row.orderstatus == '1' ||
-                  scope.row.orderstatus == '2' ||
-                  scope.row.orderstatus == '4') &&
+                scope.row.orderstatus == '2' ||
+                scope.row.orderstatus == '4') &&
                 ['紫金财险'].includes(scope.row.inscompany)
                 " @click="cancelorder(scope.row)">撤单</el-button>
               <el-button type="text" size="mini" style="color: #2d4d89" v-if="scope.row.orderstatus == '2'"
@@ -2856,7 +2863,7 @@
             <div class="aaa">
               <span>1.新车合格证</span>
               <el-upload action="#" list-type="picture-card" :auto-upload="false" :limit="1" drag :on-change="(file) =>
-                  drivingupload(file, 'imageList5', 'imgList9', 'XC00')
+                drivingupload(file, 'imageList5', 'imgList9', 'XC00')
                 " :file-list="imgList9" multiple ref="upload3" :class="{ styleB: imgList9.length === 1 }">
                 <img v-show="imgList9.length == 0" src="../../../../static/userfront.png"
                   style="width: 100%; height: 100%" />
@@ -2874,7 +2881,7 @@
             <div class="aaa">
               <span>2.购车发票</span>
               <el-upload action="#" list-type="picture-card" :auto-upload="false" :limit="1" drag :on-change="(file) =>
-                  drivingupload(file, 'imageList5', 'imgList10', 'GC00')
+                drivingupload(file, 'imageList5', 'imgList10', 'GC00')
                 " :file-list="imgList10" multiple ref="upload4" :class="{ styleB: imgList10.length === 1 }">
                 <img v-show="imgList10.length == 0" src="../../../../static/userfront.png"
                   style="width: 100%; height: 100%" />
@@ -3047,7 +3054,7 @@
             <div class="aaa">
               <span>1.关系证明</span>
               <el-upload action="#" list-type="picture-card" :auto-upload="false" :limit="1" drag :on-change="(file) =>
-                  drivingupload(file, 'imageList5', 'imgList11', 'GX00')
+                drivingupload(file, 'imageList5', 'imgList11', 'GX00')
                 " :file-list="imgList11" multiple ref="upload3" :class="{ styleB: imgList11.length === 1 }">
                 <img v-show="imgList11.length == 0" src="../../../../static/userfront.png"
                   style="width: 100%; height: 100%" />
@@ -3185,7 +3192,7 @@
       <el-form :model="policyNumberForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
         <el-form-item label="交强保单:" prop="jqPolicy">
           <el-upload class="upload-demo" ref="jqPolicyupload" action="#" :limit="1" :auto-upload="false"
-          :on-remove="(file) => removePhoto(file,policyNumberForm.jqPolicyList,'jqPolicyList')"
+            :on-remove="(file) => removePhoto(file, policyNumberForm.jqPolicyList, 'jqPolicyList')"
             :file-list="policyNumberForm.jqPolicyList" :on-change="(file) => policydrivingupload(file, 'jqPolicy')">
             <el-button size="small" type="primary">点击上传</el-button>
             <el-button size="small" type="primary" @click.stop="policyNumberForm.jqPolicyList = []">清空</el-button>
@@ -3193,7 +3200,7 @@
         </el-form-item>
         <el-form-item label="商业保单:" prop="syPolicy">
           <el-upload class="upload-demo" ref="syPolicyupload" action="#" :limit="1" :auto-upload="false"
-          :on-remove="(file) => removePhoto(file,policyNumberForm.syPolicyList,'syPolicyList')"
+            :on-remove="(file) => removePhoto(file, policyNumberForm.syPolicyList, 'syPolicyList')"
             :file-list="policyNumberForm.syPolicyList" :on-change="(file) => policydrivingupload(file, 'syPolicy')">
             <el-button size="small" type="primary">点击上传</el-button>
             <el-button size="small" type="primary" @click.stop="policyNumberForm.syPolicyList = []">清空</el-button>
@@ -3201,7 +3208,7 @@
         </el-form-item>
         <el-form-item label="非车保单:" prop="noPolicy">
           <el-upload class="upload-demo" ref="noPolicyupload" action="#" :limit="1" :auto-upload="false"
-    :on-remove="(file) => removePhoto(file,policyNumberForm.noPolicyList,'noPolicyList')"
+            :on-remove="(file) => removePhoto(file, policyNumberForm.noPolicyList, 'noPolicyList')"
             :file-list="policyNumberForm.noPolicyList" :on-change="(file) => policydrivingupload(file, 'noPolicy')">
             <el-button size="small" type="primary">点击上传</el-button>
             <el-button size="small" type="primary" @click.stop="policyNumberForm.noPolicyList = []">清空</el-button>
@@ -3209,7 +3216,7 @@
         </el-form-item>
         <el-form-item label="交强电子标志:" prop="jqSign">
           <el-upload class="upload-demo" ref="jqSignupload" action="#" :limit="1" :auto-upload="false"
-         :on-remove="(file) => removePhoto(file,policyNumberForm.jqSignList,'jqSignList')"
+            :on-remove="(file) => removePhoto(file, policyNumberForm.jqSignList, 'jqSignList')"
             :file-list="policyNumberForm.jqSignList" :on-change="(file) => policydrivingupload(file, 'jqSign')">
             <el-button size="small" type="primary">点击上传</el-button>
             <el-button size="small" type="primary" @click.stop="policyNumberForm.jqSignList = []">清空</el-button>
@@ -4797,12 +4804,12 @@ export default {
   },
   methods: {
     //清空保单图片
-    removePhoto(file, fileList,type){
-     
-        // console.log(file, fileList);
-        this.policyNumberForm[type]=[]
-        console.log( this.policyNumberForm[type])
-      
+    removePhoto(file, fileList, type) {
+
+      // console.log(file, fileList);
+      this.policyNumberForm[type] = []
+      console.log(this.policyNumberForm[type])
+
     },
     editingWay(paramsEdit) {
       if (paramsEdit) {
@@ -4832,6 +4839,7 @@ export default {
         _this.orderno = orderno;
         _this.tbczcarShow = applyinfo.owner;
         _this.bbczcarShow = insureinfo.owner;
+        _this.kindList = paramsEdit.king;
         _this.bbtbcarShow = insureinfo.insuranceHolder;
         _this.ownerInfo.age = getAgeByIdCard(_this.ownerInfo.identifyNumber);
         _this.policyHolderInfo.age = getAgeByIdCard(
@@ -4847,6 +4855,9 @@ export default {
           if (ele.riskCode == "0507") {
             _this.jqchecked = true;
             this.protocolJudge("0507", true);
+            _this.riskList.push({
+              riskCode: "0507",
+            });
             // _this.jqstartDate = ele.startDate;
             // _this.jqendDate = ele.endDate;
             //       this.jqstartDate = this.$route.query.data.jqstartdate
@@ -4857,6 +4868,9 @@ export default {
           } else if (ele.riskCode == "0510") {
             _this.sychecked = true;
             this.protocolJudge("0510", true);
+            _this.riskList.push({
+              riskCode: "0510",
+            });
             // _this.systartDate = ele.startDate;
             // _this.syendDate = ele.endDate;
             _this.systartDate = this.transformTime1();
@@ -5401,26 +5415,26 @@ export default {
       }
     },
     djcxchangeChild(index) {
-      if(index){
+      if (index) {
         let list = this.dajiaaccidentDataListChild.find(
-        (val) => val.projectCode == index
+          (val) => val.projectCode == index
         );
         this.dajiaaccidentForm = {
-        ...this.dajiaaccidentForm,
-        prodCode: index,
-        projectName: list.projectName,
-        sumAmount: Number(list.sumAmount),
-        riskCode: list.riskCode,
-        sumPremium: Number(list.sumPremium),
-      };
-      list.productId = list.id;
-      this.dajiaInsuranceDataTable = list.son;
-      this.dajiaaccidentalDrivingVo = Object.assign({
-        ...this.dajiaaccidentalDrivingVo,
-        ...list,
-      });
-      }else{
-        this.dajiaInsuranceDataTable=[];
+          ...this.dajiaaccidentForm,
+          prodCode: index,
+          projectName: list.projectName,
+          sumAmount: Number(list.sumAmount),
+          riskCode: list.riskCode,
+          sumPremium: Number(list.sumPremium),
+        };
+        list.productId = list.id;
+        this.dajiaInsuranceDataTable = list.son;
+        this.dajiaaccidentalDrivingVo = Object.assign({
+          ...this.dajiaaccidentalDrivingVo,
+          ...list,
+        });
+      } else {
+        this.dajiaInsuranceDataTable = [];
       }
 
     },
@@ -5678,11 +5692,33 @@ export default {
             });
           });
         }
-      }
-      res.data.forEach((e) => {
-        e.agreement.forEach((el) => (el.disabled = false));
-      });
-      this.totalCompanyList = res.data;
+        // //险种合并集合
+      }
+      const combinedArray = [
+					...this.riskList.map(item => item.riskCode),
+					...this.kindList.map(item => item.kindCode),
+				];
+				res.data = res.data.filter(obj => {
+					obj.agreement = obj.agreement.filter(agreementObj => {
+						// 险种配置为空,则过滤掉该协议
+						if (agreementObj.productsCodes == null) {
+							return true;
+						} else {
+							// 检查是否包含 A 的特殊处理
+							if (combinedArray.includes('A') && !agreementObj.productsCodes.includes(
+									'A')) {
+								return false;
+							}
+							return agreementObj.productsCodes.some(item => combinedArray.includes(
+								item));
+						}
+					});
+					return obj.agreement.length > 0; // 返回true保留,返回false移除该保险公司
+				});
+          res.data.forEach((e) => {
+          e.agreement.forEach((el) => (el.disabled = false));
+        });
+        this.totalCompanyList = res.data;
     },
     //获取保险公司列表
     // commpanyList() {
@@ -6337,12 +6373,17 @@ export default {
     //   this.insureLength = 5;
     // },
     //险别选择框事件
-    insureitemChange(e) {
-      this.protocolJudge("A", e);
+    insureitemChange(e, item) {
       if (e != 0) {
         this.sychecked = true;
         this.systartDate = this.transformTime1();
         this.syendDate = this.oneYearPast1(this.systartDate);
+        this.kindList.push(item)
+        this.obtainProtocol();
+      } else {
+        let list = this.kindList.filter(item => item.kindCode !== item.kindCode);
+        this.kindList = list;
+        this.obtainProtocol();
       }
     },
     all() {
@@ -6402,29 +6443,40 @@ export default {
       });
     },
     jqcheckedChange(e) {
-      this.protocolJudge("0507", e);
       if (e) {
         this.jqstartDate = this.transformTime1();
         this.jqendDate = this.oneYearPast1(this.jqstartDate);
+        this.riskList.push({
+          riskCode: "0507",
+        });
+        this.obtainProtocol();
       } else {
         this.jqstartDate = "";
         this.jqendDate = "";
+        let list = this.riskList.filter(item => item.riskCode !== "0507");
+        this.riskList = list;
+        this.obtainProtocol();
+
       }
     },
     sycheckedChange(e) {
-      this.protocolJudge("0510", e);
       if (e) {
         this.systartDate = this.transformTime1();
         this.syendDate = this.oneYearPast1(this.systartDate);
+        this.riskList.push({
+          riskCode: "0510",
+        });
+        this.obtainProtocol();
       } else {
         this.systartDate = "";
         this.syendDate = "";
+        let list = this.riskList.filter(item => item.riskCode !== "0510");
+        this.riskList = list;
+        this.obtainProtocol();
       }
     },
     // 保存
     preserveQuote(type, btnLoading) {
-      //
-
       if (
         this.userId == "" ||
         this.userId == null ||
@@ -8295,7 +8347,7 @@ export default {
       this.imageUploaddialogVisible = true;
     },
     policyUpload() {
-      
+
       this.policyNumberForm.jqPolicyList = !this.policyNumberForm.jqPolicyList
         ? []
         : this.policyNumberForm.jqPolicyList;