Explorar o código

自选方案驾意险

@dongkboy %!s(int64=2) %!d(string=hai) anos
pai
achega
1ba26999db

+ 33 - 9
src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/Fuel/OptionalsolutionConfig.vue

@@ -120,7 +120,7 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;" @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +244,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +310,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if(list.includes(undrvingList.id)){
                   undrvingList.switch = true;
-                  Insurances.switch = true
-                } else {
-                  Insurances.switch = false;
+                }else{
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +423,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 33 - 8
src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/NewEnergy/OptionalsolutionConfig.vue

@@ -120,7 +120,8 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"
+                            @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +245,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +311,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if (list.includes(undrvingList.id)) {
                   undrvingList.switch = true;
-                  Insurances.switch = true
                 } else {
-                  Insurances.switch = false;
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +424,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 32 - 8
src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/Fuel/OptionalsolutionConfig.vue

@@ -120,7 +120,7 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;" @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +244,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +310,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if (list.includes(undrvingList.id)) {
                   undrvingList.switch = true;
-                  Insurances.switch = true
                 } else {
-                  Insurances.switch = false;
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +423,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 32 - 8
src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/NewEnergy/OptionalsolutionConfig.vue

@@ -120,7 +120,7 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;" @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +244,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +310,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if (list.includes(undrvingList.id)) {
                   undrvingList.switch = true;
-                  Insurances.switch = true
                 } else {
-                  Insurances.switch = false;
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +423,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 34 - 9
src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/Fuel/OptionalsolutionConfig.vue

@@ -120,7 +120,8 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"
+                            @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +245,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +311,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if(list.includes(undrvingList.id)){
                   undrvingList.switch = true;
-                  Insurances.switch = true
-                } else {
-                  Insurances.switch = false;
+                }else{
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +424,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 33 - 9
src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/NewEnergy/OptionalsolutionConfig.vue

@@ -120,7 +120,7 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;" @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +244,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +310,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if(list.includes(undrvingList.id)){
                   undrvingList.switch = true;
-                  Insurances.switch = true
-                } else {
-                  Insurances.switch = false;
+                }else{
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +423,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 32 - 8
src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/Fuel/OptionalsolutionConfig.vue

@@ -120,7 +120,7 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;" @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +244,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +310,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if (list.includes(undrvingList.id)) {
                   undrvingList.switch = true;
-                  Insurances.switch = true
                 } else {
-                  Insurances.switch = false;
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +423,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })

+ 32 - 8
src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/NewEnergy/OptionalsolutionConfig.vue

@@ -120,7 +120,7 @@
                       :key="undrvingListindex">
                       <div class="flex f-c ">
                         <div style="width: 100%;">
-                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;"></el-checkbox>
+                          <el-checkbox v-model="undrvingListitem.switch" style="margin-right: 20px;" @change="event => superiordrvingcheckboxChange(event, drvingListindex, undrvingListitem)"></el-checkbox>
                           <span>{{ undrvingListitem.projectName }}</span>
                           <span style="color: #2D4D89;cursor: pointer;text-align: right;"
                             @click="Drivedetails(undrvingListitem)">详情</span>
@@ -244,6 +244,22 @@ export default {
   },
   // 方法函数
   methods: {
+    superiordrvingcheckboxChange(e, drvingListindex, undrvingListitem) {
+      if (!undrvingListitem.insDrivingIntentionInsurances) {
+        if (e) {
+          this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
+            title: undrvingListitem.projectName,
+            id: undrvingListitem.id,//id
+            projectName: undrvingListitem.projectName,
+          })
+        } else {
+          let list = this.CustomPlanData.drvingList[drvingListindex].isOptions.filter(val => val.id !== undrvingListitem.id)
+          this.CustomPlanData.drvingList[drvingListindex].isOptions = list;
+        }
+      } else {
+        return;
+      }
+    },
     drvingcheckboxChange(e, drvingListindex, Insurancesitem) {
       if (e) {
         this.CustomPlanData.drvingList[drvingListindex].isOptions.push({
@@ -294,15 +310,23 @@ export default {
             const list = val.isOptions.map(item => { return item.id });
             val.undrvingList.map(undrvingList => {
               undrvingList.switch = false;
-              undrvingList.insDrivingIntentionInsurances.map(Insurances => {
-                if (list.includes(Insurances.id)) {
+              if (undrvingList.insDrivingIntentionInsurances) {
+                undrvingList.insDrivingIntentionInsurances.map(Insurances => {
+                  if (list.includes(Insurances.id)) {
+                    undrvingList.switch = true;
+                    Insurances.switch = true
+                  } else {
+                    Insurances.switch = false;
+                  }
+                  return Insurances;
+                })
+              } else {
+                if (list.includes(undrvingList.id)) {
                   undrvingList.switch = true;
-                  Insurances.switch = true
                 } else {
-                  Insurances.switch = false;
+                  undrvingList.switch = false;
                 }
-                return Insurances;
-              })
+              }
               return undrvingList;
             })
             return val;
@@ -399,7 +423,7 @@ export default {
         if (res.code == '200') {
           res.data.map(val => {
             val.switch = false;
-            val.insDrivingIntentionInsurances.map(val2 => {
+            if (val.insDrivingIntentionInsurances) val.insDrivingIntentionInsurances.map(val2 => {
               val2.switch = false;
               return val2;
             })