fix bug
This commit is contained in:
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user