Forráskód Böngészése

核保因子页面数据

lihongxiao 2 éve
szülő
commit
33bbda1e2e

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

@@ -299,8 +299,7 @@
           <el-checkbox
             :indeterminate="checkedmData[index].isIndeterminate"
             v-model="checkedmData[index].checkAll"
-            @change="handleCheckAllChange(index)"
-            >全选</el-checkbox
+            @change="(event) => handleCheckAllChange(event, index)">全选</el-checkbox
           >
         </div>
         <div
@@ -1042,14 +1041,6 @@ export default {
     addConditions(type) {
       this.dialogVisible = true;
       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 = "条件配置";
@@ -1058,17 +1049,23 @@ export default {
       }
     },
     // 全选
-    handleCheckAllChange(index) {
-      let arr = [];
-      this.conditiondata[index].concant.forEach((val) =>{
-        this.checkedmData[index].concant.push(...val.cities)
-        arr.push(... val.cities.map(ele=>ele.label))
-      });
-      this.checkedmData[index].checkedCities = this.checkedmData[index].checkAll
-        ? arr
-        : [];
-      this.checkedmData[index].isIndeterminate = false;
-      this.checkedmData = [...this.checkedmData];
+    handleCheckAllChange(event,index) {
+        let arr = [];
+        let arr1 = [];
+        this.conditiondata[index].concant.forEach((val) =>{
+          // this.checkedmData[index].concant.push(...val.cities)
+          arr1.push(... val.cities)
+          arr.push(... val.cities.map(ele=>ele.label))
+        });
+
+        this.checkedmData[index].checkedCities = this.checkedmData[index].checkAll
+          ? arr
+          : [];
+          this.checkedmData[index].concant = this.checkedmData[index].checkAll
+          ? arr1
+          : [];
+        this.checkedmData[index].isIndeterminate = false;
+        this.checkedmData = [...this.checkedmData];
     },
     // 单选
     handleCheckedCitiesChange(value,cities, index, cindex) {
@@ -1087,15 +1084,12 @@ export default {
     },
     // 条件配置保存
     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
      })
-   
     if(checkedmData[4].concant.length>0){
       checkedmData[4].concant.forEach((ele1,index1)=>{
         if(ele1.name=='chezhu'){
@@ -1123,7 +1117,6 @@ export default {
         this.circularContent[index].concant=Array.from(new Set([...this.circularContent[index].concant,...ele.concant])) 
       }
      })
-
     },
 
     // 另存为模板