车辆对接
This commit is contained in:
@ -2,7 +2,7 @@ import { preloaderFinished } from '@delon/theme';
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 14:03:07
|
||||
* @LastEditTime: 2021-12-20 15:57:37
|
||||
* @LastEditTime: 2021-12-20 17:57:19
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts
|
||||
@ -43,6 +43,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.record)
|
||||
this.i = {
|
||||
prePay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.price || 0,
|
||||
toPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.price || 0,
|
||||
@ -53,6 +54,11 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
oilCardPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.paymentStatus,
|
||||
receiptPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'BACK')[0]?.paymentStatus
|
||||
};
|
||||
this.record.list.forEach((element: any) => {
|
||||
if(element.costCode === 'PRE') {
|
||||
|
||||
}
|
||||
});
|
||||
this.tranPrice = this.i.prePay + this.i.toPay + this.i.oilCardPay + this.i.receiptPay;
|
||||
this.totalPrice = this.i.prePay + this.i.toPay + this.i.oilCardPay + this.i.receiptPay + this.otherPrice;
|
||||
this.initSF();
|
||||
@ -69,7 +75,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: 0.0,
|
||||
readOnly: this.i.prePayStatus !== '3',
|
||||
readOnly: this.i.prePayStatus === '2',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
widgetWidth: 200,
|
||||
@ -81,7 +87,19 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: 0.0,
|
||||
readOnly: this.i.toPayStatus !== '3',
|
||||
readOnly: this.i.toPayStatus === '2',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
widgetWidth: 200,
|
||||
precision: 2,
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
oilCardPay: {
|
||||
type: 'number',
|
||||
title: '油卡',
|
||||
default: 0.0,
|
||||
readOnly: this.i.oilCardPayStatus === '1' || this.i.oilCardPayStatus === '3',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
widgetWidth: 200,
|
||||
@ -89,23 +107,11 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
// oilCardPay: {
|
||||
// type: 'number',
|
||||
// title: '油卡',
|
||||
// default: 0.0,
|
||||
// readOnly: this.i.oilCardPayStatus === '1' || this.i.oilCardPayStatus === '3',
|
||||
// ui: {
|
||||
// prefix: '¥',
|
||||
// widgetWidth: 200,
|
||||
// precision: 2,
|
||||
// change: (val: any) => this.changeNumVal()
|
||||
// } as SFNumberWidgetSchema
|
||||
// },
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: 0.0,
|
||||
readOnly: this.i.receiptPayStatus !== '3',
|
||||
readOnly: this.i.receiptPayStatus === '2',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
widgetWidth: 200,
|
||||
@ -133,7 +139,9 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
};
|
||||
}
|
||||
save(value: any): void {
|
||||
const editItems = this.record?.mybidDetailInfo.filter((data: any) => data.receiptPayStatus === '3');
|
||||
console.log(this.record?.mybidDetailInfo)
|
||||
console.log(this.sf.value)
|
||||
const editItems = this.record?.mybidDetailInfo.filter((data: any) => data.receiptPayStatus !== '2');
|
||||
editItems.forEach((item: any) => {
|
||||
switch (item.expenseName) {
|
||||
case '预付':
|
||||
@ -155,14 +163,14 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
dtos: editItems,
|
||||
changeCause: this.sf.value.changeCause
|
||||
};
|
||||
|
||||
// this.service.request(this.service.$api_insertFreightChangeWhole, params).subscribe((res: any) => {
|
||||
// if (res) {
|
||||
// this.modal.destroy();
|
||||
// } else {
|
||||
// this.service.msgSrv.error(res.msg);
|
||||
// }
|
||||
// });
|
||||
console.log(params)
|
||||
this.service.request(this.service.$api_get_insertFreightChangeWhole, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.modal.destroy();
|
||||
} else {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close(): void {
|
||||
|
||||
Reference in New Issue
Block a user