车辆对接
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-21 14:56:26
|
||||
* @LastEditTime: 2022-01-13 13:38:13
|
||||
* @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
|
||||
@ -22,6 +22,7 @@ import { _HttpClient } from '@delon/theme';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { OrderManagementService } from '../../../services/order-management.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-order-management-vehicle-update-freight',
|
||||
@ -38,6 +39,8 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
@Input()
|
||||
data: any;
|
||||
|
||||
calculateSub!: Subscription;
|
||||
|
||||
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@ -55,6 +58,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: info.prePay?.price || 0,
|
||||
minimum:0,
|
||||
readOnly: info.prePay?.paymentStatus === '2' || info.prePay?.paymentStatus === '4',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
@ -67,6 +71,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: info.toPay?.price || 0,
|
||||
minimum:0,
|
||||
readOnly: info.toPay?.paymentStatus === '2' || info.toPay?.paymentStatus === '4',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
@ -79,6 +84,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
// type: 'number',
|
||||
// title: '油卡',
|
||||
// default: 0.0,
|
||||
// minimum:0,
|
||||
// readOnly: this.i.oilCardPayStatus === '1' || this.i.oilCardPayStatus === '3',
|
||||
// ui: {
|
||||
// prefix: '¥',
|
||||
@ -91,6 +97,7 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: info.receiptPay?.price || 0,
|
||||
minimum:0,
|
||||
readOnly: info.receiptPay?.paymentStatus === '2' || info.receiptPay?.paymentStatus === '4',
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
@ -120,6 +127,39 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
}
|
||||
|
||||
save(value: any): void {
|
||||
this.service.request(this.service.$api_get_insertFreightChangeWhole, this.getParams()).subscribe(res => {
|
||||
if (res) {
|
||||
this.modal.destroy();
|
||||
this.service.msgSrv.success('变更运费成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
}
|
||||
/**
|
||||
* 更新数字框
|
||||
*
|
||||
*/
|
||||
changeNumVal() {
|
||||
if (this.calculateSub) {
|
||||
this.calculateSub.unsubscribe();
|
||||
}
|
||||
this.calculateSub = this.service.request(this.service.$api_getWholeSurchargeDetail, this.getParams()).subscribe((res: any) => {
|
||||
if (res) {
|
||||
Object.assign(this.data, {
|
||||
totalFreight: res.totalFreight,
|
||||
freight: res.freight,
|
||||
surcharge: res.surcharge
|
||||
});
|
||||
}
|
||||
});
|
||||
// this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay;
|
||||
// this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice;
|
||||
}
|
||||
|
||||
getParams() {
|
||||
const editItems = this.data.list?.filter((info: any) => info.toPay?.paymentStatus !== '2' && info.toPay?.paymentStatus !== '4');
|
||||
editItems.forEach((item: any) => {
|
||||
switch (item.costName) {
|
||||
@ -142,24 +182,6 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
dtos: editItems,
|
||||
changeCause: this.sf.value.changeCause
|
||||
};
|
||||
|
||||
this.service.request(this.service.$api_get_insertFreightChangeWhole, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.modal.destroy();
|
||||
this.service.msgSrv.success('变更运费成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
}
|
||||
/**
|
||||
* 更新数字框
|
||||
*
|
||||
*/
|
||||
changeNumVal() {
|
||||
// this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay;
|
||||
// this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice;
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user