lihongxiao 2 лет назад
Родитель
Сommit
bca929d9c8
1 измененных файлов с 34 добавлено и 25 удалено
  1. 34 25
      src/views/AgreementManage/CarInsurance/components/PremiumFactor.vue

+ 34 - 25
src/views/AgreementManage/CarInsurance/components/PremiumFactor.vue

@@ -9,7 +9,7 @@
       >
     </div>
     <el-form ref="CostfactorForm" :model="formData" label-width="190px">
-      <div v-for="(item, index) in circular" :key="index">
+      <div v-for="(item, index) in circularContent" :key="index">
         <el-card
           class="box-card"
           :body-style="{ display: item.hideAll ? 'block' : 'none' }"
@@ -923,18 +923,18 @@ export default {
       ]
     };
   },
-  computed: {
-    circular:{
-      get: function () {
-        if (this.circularContent) {
-          return this.circularContent
-        }
-      },
-      set: function (newValue) {
-        this.circularContent=newValue
-      },
-    },
-  },
+  // computed: {
+  //   circular:{
+  //     get: function () {
+  //       if (this.circularContent) {
+  //         return this.circularContent
+  //       }
+  //     },
+  //     set: function (newValue) {
+  //       this.circularContent=newValue
+  //     },
+  //   },
+  // },
   props:{
     energyType:{
       type:Array,
@@ -1041,8 +1041,16 @@ export default {
     },
     addConditions(type) {
       this.dialogVisible = true;
-      this.circular=[]
-      this.circular=JSON.parse(JSON.stringify(this.circularContentPro)) 
+      this.circularContent=[]
+      // this.conditiondata.forEach((val, index) => {
+    //   this.checkedmData[index] = {
+    //     checkAll: false,
+    //     isIndeterminate: false,
+    //     checkedCities: [],
+    //     concant:[]
+    //   };
+    // });
+      this.circularContent=JSON.parse(JSON.stringify(this.circularContentPro)) 
       if (type == "1") {
         this.dialogTitle = "条件配置";
       } else {
@@ -1054,9 +1062,8 @@ export default {
       let arr = [];
       this.conditiondata[index].concant.forEach((val) =>{
         this.checkedmData[index].concant.push(...val.cities)
-        arr.push(...val.cities.map(ele=>ele.label))
+        arr.push(... val.cities.map(ele=>ele.label))
       });
-
       this.checkedmData[index].checkedCities = this.checkedmData[index].checkAll
         ? arr
         : [];
@@ -1076,26 +1083,24 @@ export default {
         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.circularContent,this.circularContentPro,this.checkedmData,22222222222222)
+
       this.dialogVisible = false;
      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])) 
-
-      }
-     })
+   
     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'
+            return ele.name=='chezhu'
           })
           this.circularContent[4].concant.splice(aaa1+1,0,ele1)
         } 
@@ -1113,7 +1118,11 @@ export default {
         }
       })
     }
-    console.log(this.circularContent,this.circularContentPro,22222222222222)
+    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])) 
+      }
+     })
 
     },