车辆对接
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 14:03:07
|
||||
* @LastEditTime: 2021-12-21 15:03:17
|
||||
* @LastEditTime: 2021-12-22 20:04:15
|
||||
* @LastEditors: your name
|
||||
* @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.html
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 14:03:07
|
||||
* @LastEditTime: 2021-12-14 15:16:27
|
||||
* @LastEditTime: 2021-12-22 20:08: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
|
||||
@ -12,6 +12,8 @@ import {
|
||||
SFSelectWidgetSchema,
|
||||
SFStringWidgetSchema, SFTextWidgetSchema
|
||||
} from '@delon/form';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { OrderManagementService } from '../../../services/order-management.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-order-management-update-freight',
|
||||
@ -25,7 +27,8 @@ export class UpdateFreightComponent implements OnInit {
|
||||
@Input()
|
||||
data: any;
|
||||
|
||||
constructor() {}
|
||||
calculateSub!: Subscription;
|
||||
constructor(private service: OrderManagementService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.schema = this.initSF(this.data);
|
||||
@ -48,7 +51,8 @@ export class UpdateFreightComponent implements OnInit {
|
||||
placeholder: '请输入',
|
||||
grid: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFStringWidgetSchema,
|
||||
default: data.freightPrice
|
||||
},
|
||||
@ -106,7 +110,8 @@ export class UpdateFreightComponent implements OnInit {
|
||||
grid: {
|
||||
span: 12
|
||||
},
|
||||
hideStep: true
|
||||
hideStep: true,
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
acceptVolume: {
|
||||
@ -119,7 +124,8 @@ export class UpdateFreightComponent implements OnInit {
|
||||
grid: {
|
||||
span: 12
|
||||
},
|
||||
hideStep: true
|
||||
hideStep: true,
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
settlementWeight: {
|
||||
@ -132,7 +138,8 @@ export class UpdateFreightComponent implements OnInit {
|
||||
grid: {
|
||||
span: 12
|
||||
},
|
||||
hideStep: true
|
||||
hideStep: true,
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
settlementVolume: {
|
||||
@ -145,7 +152,8 @@ export class UpdateFreightComponent implements OnInit {
|
||||
grid: {
|
||||
span: 12
|
||||
},
|
||||
hideStep: true
|
||||
hideStep: true,
|
||||
change: (val: any) => this.changeNumVal()
|
||||
} as SFNumberWidgetSchema
|
||||
}
|
||||
},
|
||||
@ -169,4 +177,21 @@ export class UpdateFreightComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
changeNumVal() {
|
||||
if (this.calculateSub) {
|
||||
this.calculateSub.unsubscribe();
|
||||
}
|
||||
this.calculateSub = this.service
|
||||
.request(this.service.$api_calculate_cost, { billId: this.data.billId, ...this.sf.value, changeCause: '' })
|
||||
.subscribe((res: any) => {
|
||||
if (res) {
|
||||
Object.assign(this.data, {
|
||||
totalFreight: res.totalFreight,
|
||||
freight: res.freight,
|
||||
surcharge: res.surcharge
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user