车辆对接

This commit is contained in:
wangshiming
2022-01-04 14:35:04 +08:00
parent 251b40ece6
commit ba501195b9

View File

@ -538,21 +538,26 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}; };
} }
payChange() { payChange(value?: any) {
const subtotal = this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay || 0; let subtotal: any ={}
const oilCardPay = this.sf7.value.oilCardPay || 0; let oilCardPay: any ={}
this.service if(value) {
.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`) subtotal = (value.prePay +value.toPay + value.oilCardPay + value.receiptPay) || 0;
.subscribe(res => { oilCardPay = value.oilCardPay || 0;
} else {
subtotal = (this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay) || 0;
oilCardPay = this.sf7.value.oilCardPay || 0;
}
console.log(this.sf7.value)
this.service.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe(res => {
if (res) { if (res) {
this.sf7.setValue('/appendFee', res.surcharge); this.sf7.setValue('/appendFee', res.surcharge);
this.sf7.setValue('/subtotal', subtotal); this.sf7.setValue('/subtotal', subtotal);
this.sf7.setValue('/total', subtotal + res.surcharge); this.sf7.setValue('/total', subtotal + res.surcharge);
this.service this.service.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`).subscribe(res => {
.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`)
.subscribe(res => {
if (res) { if (res) {
this.currentRate = res.rate; this.currentRate = res.rate * 100;
} else { } else {
this.service.msgSrv.error(res.msg); this.service.msgSrv.error(res.msg);
} }
@ -561,6 +566,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.service.msgSrv.error(res.msg); this.service.msgSrv.error(res.msg);
} }
}); });
} }
addStartInfo(event: any) { addStartInfo(event: any) {
@ -922,10 +928,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
toPay: res?.shippingInformationVO?.toPay, toPay: res?.shippingInformationVO?.toPay,
oilCardPay: res?.shippingInformationVO?.oilCardPay, oilCardPay: res?.shippingInformationVO?.oilCardPay,
receiptPay: res?.shippingInformationVO?.receiptPay, receiptPay: res?.shippingInformationVO?.receiptPay,
// subtotal: res?.shippingInformationVO?.oilCardPay , subtotal: res?.shippingInformationVO?.totalFee,
total: res?.shippingInformationVO?.totalFee,
appendFee: res?.shippingInformationVO?.appendFee, appendFee: res?.shippingInformationVO?.appendFee,
paymentDays: res?.paymentDays paymentDays: res?.paymentDays
}; };
this.payChange(this.sf7data);
} }
backBillChange() { backBillChange() {
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({