This commit is contained in:
wangshiming
2022-02-18 10:55:34 +08:00
parent cd4d216ec7
commit 149742b163
2 changed files with 43 additions and 16 deletions

View File

@ -412,19 +412,25 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
widget: 'custom'
}
},
insureInfo: {
insurancePremium: {
type: 'string',
title: '',
ui: {
widget: 'custom'
}
},
insuranceRate: {
type: 'string',
title: '保险费率',
ui: {
hidden: true
}
}
},
required: ['goodsValue']
}
};
this.ui5 = {
'*': {
spanLabelFixed: 90,
spanLabelFixed: 115,
grid: { span: 12 }
}
};
@ -1007,11 +1013,32 @@ export class SupplyManagementReleasePublishComponent 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) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
// 计算里程,时间
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;
});
}
}
goodsValuesChange(value: any) {
console.log(value);
console.log(this.totalDistance);
if(value >= 50000 && this.totalDistance > 0){
const params = {
goodsValue: value,
insuranceType: this.sf55.value.insuranceType,
km: this.totalDistance
};
this.service
.request(this.service.$api_getWholeInsuranceInfo, params)
.subscribe(res => {
if (res) {
this.sf5.setValue('/insurancePremium',res.insurancePremium);
}else{
this.sf5.setValue('/insurancePremium',null);
}
});
}
}