车辆对接

This commit is contained in:
wangshiming
2021-12-22 20:14:59 +08:00
parent 2a91d9fd80
commit c914ee023e
5 changed files with 51 additions and 12 deletions

View File

@ -633,7 +633,7 @@ tabs = {
nzTitle: '变更运费',
nzWidth: 580,
nzContent: UpdateFreightComponent,
nzComponentParams: { data },
nzComponentParams: { data: { ...data, billId: item.id } },
nzOnOk: sin => {
this.service.request(this.service.$api_insertFreightChangeBulk, { billId: item.id, ...sin.sf.value }).subscribe(res => {
if (res) {

View File

@ -585,7 +585,16 @@ resourceStatus: any;
nzWidth: 580,
nzContent: VehicleUpdateFreightComponent,
nzComponentParams: { data: { ...data, id: item.id } },
nzFooter: null
nzOnOk: sin => {
this.service.request(this.service.$api_change_bulk, { billId: item.id, ...sin.sf.value }).subscribe(res => {
if (res) {
this.service.msgSrv.success('变更运费成功');
modal.destroy();
this.st.reload();
}
});
return false;
}
});
modal.afterClose.subscribe(_ => this.st.reload());
}

View File

@ -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

View File

@ -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
});
}
});
}
}

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-12-03 15:31:52
* @LastEditTime: 2021-12-22 10:09:37
* @LastEditTime: 2021-12-22 20:06:45
* @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\services\order-management.service.ts
@ -81,7 +81,12 @@ export class OrderManagementService extends BaseService {
public $api_getChangeRecordBulkDetail = `/api/sdc/billFreightChangeRecord/getChangeRecordBulkDetail`;
// 查看运费变更记录详情-整车
public $api_getChangeRecordWholeDetail = `/api/sdc/billFreightChangeRecord/getChangeRecordWholeDetail`;
//运费变更申请计算费用-大宗
$api_calculate_cost = `/api/sdc/billFreightChangeApplication/getBulkSurchargeDetail`;
//运费变更申请计算费用-大宗
$api_getWholeSurchargeDetail = `/api/sdc/billFreightChangeApplication/getWholeSurchargeDetail`;
//运费变更申请-大宗
$api_change_bulk = `/api/sdc/billFreightChangeApplication/insertFreightChangeBulk`;
constructor(public injector: Injector) {
super(injector)
}