Bladeren bron

核保因子条件配置

lihongxiao 2 jaren geleden
bovenliggende
commit
318167af3f
1 gewijzigde bestanden met toevoegingen van 50 en 39 verwijderingen
  1. 50 39
      src/views/AgreementManage/CarInsurance/components/PremiumFactor.vue

+ 50 - 39
src/views/AgreementManage/CarInsurance/components/PremiumFactor.vue

@@ -305,7 +305,7 @@
         </div>
         <div
           class="often-content-classify"
-          v-for="(cele, cindex) in ele.options"
+          v-for="(cele, cindex) in ele.concant"
           :key="cindex"
         >
           <div class="classify-title">{{ cele.name }}</div>
@@ -426,7 +426,7 @@ export default {
       conditiondata: [
         {
           title: "保单信息",
-          options: [
+          concant: [
             {
               name: "险种",
               // cities:['机动车损失险','第三者责任险']
@@ -474,7 +474,7 @@ export default {
         },
         {
           title: "车辆信息",
-          options: [
+          concant: [
             {
               name: "车辆",
               cities: [
@@ -507,7 +507,7 @@ export default {
         },
         {
           title: "关系人信息",
-          options: [
+          concant: [
             {
               name: "车主",
               cities: [
@@ -567,6 +567,7 @@ export default {
       natureOfVehicleUseoptions: [],
       licenseOptions: [],
       energyTypeoptions: [],
+      circularContentPro:[],
     };
   },
   computed: {
@@ -836,6 +837,7 @@ export default {
               hide: true,
               col: 24,
               labelWidth: "0",
+              roleType:1
             },
             {
               label: "车主年龄(女)(岁)",
@@ -866,6 +868,7 @@ export default {
               hide: true,
               col: 24,
               labelWidth: "0",
+              roleType:2
             },
             {
               label: "投保人年龄(女)(岁)",
@@ -897,6 +900,7 @@ export default {
               hide: true,
               col: 24,
               labelWidth: "0",
+              roleType:3
             },
             {
               label: "被保人年龄(女)(岁)",
@@ -928,7 +932,7 @@ export default {
     this.getDicType("natureOfVehicleUse"); //车辆使用性质
     this.getDicType("trafficManagementVehicleType"); //车辆类型
     this.getDicType("energyType"); //能源种类
-
+    this.circularContentPro=JSON.parse(JSON.stringify(this.circularContent))
     this.$api.insCompany.license().then((res) => {
       this.licenseOptions = res.data;
     });
@@ -937,7 +941,7 @@ export default {
         checkAll: false,
         isIndeterminate: false,
         checkedCities: [],
-        option:[]
+        concant:[]
       };
     });
   },
@@ -1035,6 +1039,8 @@ export default {
     },
     addConditions(type) {
       this.dialogVisible = true;
+      console.log(this.circularContentPro,this.circularContent,111111111)
+
       if (type == "1") {
         this.dialogTitle = "条件配置";
       } else {
@@ -1044,8 +1050,8 @@ export default {
     // 全选
     handleCheckAllChange(index) {
       let arr = [];
-      this.conditiondata[index].options.forEach((val) =>{
-        this.checkedmData[index].option.push(...val.cities)
+      this.conditiondata[index].concant.forEach((val) =>{
+        this.checkedmData[index].concant.push(...val.cities)
         arr.push(...val.cities.map(ele=>ele.label))
       });
 
@@ -1058,49 +1064,54 @@ export default {
     // 单选
     handleCheckedCitiesChange(value,cities, index, cindex) {
       if(value.checkedCities.length>0){
-        this.checkedmData[index].option=[]
+        this.checkedmData[index].concant=[]
         value.checkedCities.forEach(ele=>{
-          this.checkedmData[index].option.push(cities.find(val=>val.label==ele)) 
+          this.checkedmData[index].concant.push(cities.find(val=>val.label==ele)) 
         })
       }
         let checkedCount = value.checkedCities.length;
         // 全选按钮是否打勾
-        this.checkedmData[index].checkAll =checkedCount === this.conditiondata[index].options[cindex].cities.length||checkedCount === this.conditiondata[index].options.length;
-        this.checkedmData[index].isIndeterminate =  checkedCount > 0 && checkedCount < this.conditiondata[index].options[cindex].cities.length|| checkedCount < this.conditiondata[index].options.length;
+        this.checkedmData[index].checkAll =checkedCount === this.conditiondata[index].concant[cindex].cities.length||checkedCount === this.conditiondata[index].concant.length;
+        this.checkedmData[index].isIndeterminate =  checkedCount > 0 && checkedCount < this.conditiondata[index].concant[cindex].cities.length|| checkedCount < this.conditiondata[index].concant.length;
         this.checkedmData = [...this.checkedmData];
     },
     // 条件配置保存
     conditionSave() {
-      console.log( this.checkedmData,this.circularContent,6666666666666666)
       this.dialogVisible = false;
-      this.conditiondata.forEach((val,index)=>{
-        this.checkedmData[index].title=val.title
-      })
-      // 页面数据
-      let arr=[]
-      let arr1=[]
-      this.circularContent.forEach(ele=>{
-        // 条件配置返回数据
-        this.checkedmData.forEach(ele1=>{
-          if(ele.title==ele1.title){
-            // 将条件配置返回的数据插入到页面对应模块位置中
-            ele.concant.forEach((ele2,index2)=>ele1.option.find((ele3,index3)=>{
-              if(ele3.name==ele2.name && ele2.label==''){
-              // console.log(ele3,index2,900000000000)
-              arr.push(ele3)
-              arr1.push(index2)
-                  ele.concant.splice(index2,0,ele3)
-              }
-            }))
-           let aaa= ele.concant.find((ele2,index2)=>ele1.option.map((ele3,index3)=>ele3.name==ele2.name && ele2.label=='' ))
-           console.log(aaa,88888888888888)
+     let checkedmData=[]
+     checkedmData.push(...this.circularContent.slice(0,2),...this.checkedmData)
+     checkedmData.forEach((val,index)=>{
+      val.title=this.circularContent[index].title
+     })
+     checkedmData.forEach((ele,index)=>{
+      if(ele.title==this.circularContent[index].title){
+        this.circularContent[index].concant=Array.from(new Set([...this.circularContent[index].concant,...ele.concant])) 
 
-            // ele.concant.splice(ele.concant.findIndex(ele2=>ele1.option.find(ele3=>ele3.name==ele2.name && ele2.label==''))+1,0,ele1.option)
-          }
-        })
+      }
+     })
+    if(checkedmData[4].concant.length>0){
+      checkedmData[4].concant.forEach((ele1,index1)=>{
+        if(ele1.name=='chezhu'){
+          let aaa1=this.circularContent[4].concant.findIndex((ele,index)=>{
+          return ele.name=='chezhu'
+          })
+          this.circularContent[4].concant.splice(aaa1+1,0,ele1)
+        } 
+        if(ele1.name=='toubaoren'){
+          let aaa2=this.circularContent[4].concant.findIndex((ele,index)=>{
+          return ele.name=='toubaoren'
+          })
+          this.circularContent[4].concant.splice(aaa2+1,0,ele1)
+        }
+        if(ele1.name=='beibaoren'){
+          let aaa3=this.circularContent[4].concant.findIndex((ele,index)=>{
+          return ele.name=='beibaoren'
+          })
+          this.circularContent[4].concant.splice(aaa3+1,0,ele1)
+        }
       })
-              console.log(Array.from(new Set(arr)) ,arr1,900000000000)
-
+    }
+    console.log(this.circularContent,this.circularContentPro,22222222222222)
 
     },