diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.html b/src/app/routes/supply-management/components/release-publish/release-publish.component.html index 28ba80fa..70a8d08c 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.html +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.html @@ -293,14 +293,53 @@
- ¥{{ i.value | number: '0.2-2' }} + + + + + + + + + + + + + {{ i.value | currency }} ¥{{ i.value | number: '0.2-2' }}(费率:{{ currentRate | number: '0.2-4' }}%){{ i.value | currency }}(费率:{{ currentRate | number: '0.2-4' }}%) - ¥{{ i.value | number: '0.2-2' }} + {{ i.value | currency }}
-
+
-
-    天内支付运费 +
+  天内支付运费
diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index bd2a9238..2f1616bf 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -42,6 +42,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { sf6data: any; // 货源单设置回显 sf7data: any; // 货源单设置回显 id = ''; + envCache: any; type = 'add'; // // 单位 startInfo: any[] = []; @@ -100,6 +101,15 @@ export class SupplyManagementReleasePublishComponent implements OnInit { @ViewChild('sf7', { static: false }) sf7!: SFComponent; schema7: SFSchema = {}; ui7!: SFUISchema; + formatterRmb = (value: number): string =>{ + if(value){ + let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2}); + return `¥ ${value2}`; + } + return `¥ 0.00` + + } ; + parserRmb = (value: string): string => value.replace('¥ ', '').replace(',',''); // 页面初始化 ngOnInit(): void { this.initSF1(); @@ -569,49 +579,19 @@ export class SupplyManagementReleasePublishComponent implements OnInit { type: 'number', title: '预付', default: 0, - minimum: 0, - maximum: 999999, - ui: { - prefix: '¥', - widgetWidth: 300, - change: _args => this.payChange() - } as SFNumberWidgetSchema + ui: {widget: 'custom'} }, toPay: { type: 'number', title: '到付', - minimum: 0, - maximum: 999999, default: 0, - ui: { - prefix: '¥', - widgetWidth: 300, - change: _args => this.payChange() - } as SFNumberWidgetSchema + ui: { widget: 'custom'} }, - // oilCardPay: { - // type: 'number', - // title: '油卡', - // maximum: 999999, - // minimum: 0, - // default: 0, - // ui: { - // prefix: '¥', - // widgetWidth: 300, - // change: _args => this.payChange() - // } as SFNumberWidgetSchema - // }, receiptPay: { type: 'number', title: '回单付', - maximum: 999999, - minimum: 0, default: 0, - ui: { - prefix: '¥', - widgetWidth: 300, - change: _args => this.payChange() - } as SFNumberWidgetSchema + ui: {widget: 'custom'} }, subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, @@ -621,7 +601,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit { title: '到货后', ui: { widget: 'custom', - placeholder: '请输入', errors: { required: '请输入付款承诺天数' } } } @@ -630,7 +609,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { }; this.ui7 = { '*': { - spanLabelFixed: 90, + spanLabelFixed: 115, grid: { span: 24 } } }; @@ -654,22 +633,36 @@ export class SupplyManagementReleasePublishComponent implements OnInit { }); } payChange() { - const subtotal = this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.receiptPay || 0; - const oilCardPay = 0 + const prePay = this.sf7.value.prePay || 0; + const toPay = this.sf7.value.toPay || 0 + const receiptPay = this.sf7.value.receiptPay || 0; + const oilCardPay = 0; + const subtotal = prePay + toPay + receiptPay; + const params = { + shipperId: this.envCache?.enterpriseId, + enterpriseInfoId: this.envCache?.networkTransporterId, + totalFreight:subtotal, + fuelCardAmount:oilCardPay, + resourcetype:'1' + } this.service - .request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`) - .subscribe((res: any) => { + .request(this.service.$api_getCalculatedSurcharge,params) + .subscribe(res => { if (res) { this.sf7.setValue('/appendFee', res.surcharge); this.sf7.setValue('/subtotal', subtotal); this.sf7.setValue('/total', subtotal + res.surcharge); this.service .request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`) - .subscribe((res: any) => { + .subscribe(res => { if (res) { - this.currentRate = res.rate; + this.currentRate = res.rate * 100; + } else { + this.service.msgSrv.error(res.msg); } }); + } else { + this.service.msgSrv.error(res.msg); } }); }