This commit is contained in:
wangshiming
2022-03-04 15:08:30 +08:00
parent 05b878ddcd
commit 2c46fd77bd
9 changed files with 143 additions and 91 deletions

View File

@ -411,7 +411,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
properties: {
insuranceType: {
type: 'string',
title: '增值服务套餐',
title: '服务包',
ui: {
widget: 'select',
asyncData: () => {
@ -419,10 +419,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
map((res: any) => {
return [...res];
})
);
)
},
change: (tag: any, org: any) => {
this.getInsurersPrice(tag);
if(tag === '3'){
this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null);
}else {
this.getInsurersPrice(tag);
}
}
},
default: '3'
@ -430,31 +435,39 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
type1: {
type: 'string',
title: '',
enum: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'],
enum: ['资源曝光率 +10', '车源匹配率 +10'],
readOnly: true,
ui: {
widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '0' }
} as SFCheckboxWidgetSchema,
default: ['资源曝光率 +10', '车源匹配率 +10']
},
type2: {
type: 'string',
title: '',
enum: ['资源曝光率 +20', '车源匹配率 +20'],
readOnly: true,
ui: {
widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '1' }
} as SFCheckboxWidgetSchema,
default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险']
default: ['资源曝光率 +20', '车源匹配率 +20']
},
type2: {
freeInsurance1: {
type: 'string',
title: '',
enum: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'],
readOnly: true,
ui: {
widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '2' }
} as SFCheckboxWidgetSchema,
default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险']
},
freeInsurance: {
type: 'string',
title: '赠送保险',
title: '赠送基本险',
ui: {
widget: 'custom',
visibleIf: { insuranceType: (value: string) => value !== '3' }
visibleIf: { insuranceType: (value: string) => value === '0' }
}
},
freeInsurance2: {
type: 'string',
title: '赠送综合险',
ui: {
widget: 'custom',
visibleIf: { insuranceType: (value: string) => value === '1' }
}
},
insurancePackagedGoods: {
@ -480,7 +493,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '货物价值',
ui: {
widget: 'custom',
descriptionI18n: '输入50000-3000000之间数值',
visibleIf: { insuranceType: (value: string) => value !== '3' }
}
},
@ -514,7 +526,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
$type2: {
grid: { span: 24 }
},
$freeInsurance: {
$freeInsurance1: {
grid: { span: 24 }
},
$freeInsurance2: {
grid: { span: 24 }
}
};
@ -1199,13 +1214,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
}
// 计算里程,时间
if (this.startInfo?.[0]?.area && this.endInfo?.[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
// 计算里程,时间
if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
this.getInsurersPrice(); //计算保费金额
});
}
});
this.sf3data = {
@ -1314,14 +1330,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
default:
break;
}
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
this.getInsurersPrice(); //计算保费金额
});
}
// 计算里程,时间
if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
this.getInsurersPrice(); //计算保费金额
});
}
}
});
}
@ -1365,7 +1381,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
});
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;