This commit is contained in:
wangshiming
2022-02-18 10:45:58 +08:00
parent 2660fea880
commit 35d19d4d7e
4 changed files with 86 additions and 50 deletions

View File

@ -446,19 +446,25 @@ export class SupplyManagementOnecarPublishComponent 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 }
}
};
@ -1059,6 +1065,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
}
// 计算里程,时间
if (this.startInfo?.[0]?.area && this.endInfo?.[0]?.area) {
console.log(this.startInfo[0]?.area);
console.log(this.endInfo[0]?.area);
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
});
this.sf3data = {
@ -1086,21 +1102,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
};
if (res?.loadingTime) {
this.loadingTime = res?.loadingTime;
// this.validateForm1.patchValue(
// {
// loadingTime: res?.loadingTime,
// },
// { onlySelf: true },
// );
}
if (res?.unloadingTime) {
this.unloadingTime = res?.unloadingTime;
// this.validateForm1.patchValue(
// {
// unloadingTime: res?.unloadingTime,
// },
// { onlySelf: true },
// );
}
if (this.PageStatus === '整车修改') {
@ -1108,7 +1112,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}
this.totalFees = res?.shippingInformationVO?.totalFee || '0';
this.sf5data = {
goodsValue: res?.goodsValue
goodsValue: res?.goodsValue,
insurancePremium: res?.insurancePremium || '',
insuranceRate: res?.insuranceRate || ''
};
this.sf55data = {
insuranceType: res?.insuranceType || ''
@ -1122,9 +1128,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
receiptAddress: res?.receiptAddress || '',
remarks: res?.supplementaryInformationVO?.remarks || ''
};
// if (this.PageStatus === '整车修改') {
// this.sf6data.id = res?.supplementaryInformationVO?.id
// }
this.sf7data = {
prePay: res?.shippingInformationVO?.prePay,
toPay: res?.shippingInformationVO?.toPay,
@ -1250,7 +1253,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
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 => {
@ -1259,4 +1261,25 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
});
}
}
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);
}
});
}
}
}