|
|
@@ -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;
|
|
|
})
|