批量审核

This commit is contained in:
wangshiming
2022-01-17 17:05:49 +08:00
parent c34f6ffd63
commit d93fd449af
14 changed files with 194 additions and 96 deletions

View File

@ -74,7 +74,7 @@ loadTime: any; // 货源单设置回显
public service: OrderManagementService,
private modalService: NzModalService,
private amapService: AmapService,
public service2: ShipperBaseService,
public shipperservice: ShipperBaseService,
fb: FormBuilder,
private envSrv: EAEnvironmentService,
) {
@ -528,7 +528,7 @@ initSF3() {
// ui: {
// placeholder: '请选择',
// widget: 'select',
// asyncData: () => this.service2.getNetworkFreightForwarder(),
// asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
// visibleIf: {
// _$expand: (value: boolean) => value,
// },

View File

@ -68,7 +68,7 @@ tabs = {
constructor(
public service: OrderManagementService,
private modal: NzModalService,
public service2: ShipperBaseService,
public shipperservice: ShipperBaseService,
private router: Router,
) { }
@ -243,7 +243,7 @@ tabs = {
.request(this.service.$api_get_getCarLicenseListByCarNo, {
carNo: q
})
.pipe(map((res: any) => (res?.records as any[]).map(i => ({ label: i.carNo, value: i.carNo } as SFSchemaEnum))))
.pipe(map((res: any) => (res?.records as any[]).map(i => ({ label: i.carNo, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
@ -302,13 +302,13 @@ tabs = {
}
} as SFDateWidgetSchema
},
isRiskSheet: {
riskStatus: {
type: 'string',
title: '是否风险单',
enum: [
{ label: '全部', value: '' },
{ label: '是', value: '1' },
{ label: '否', value: '2' }
{ label: '是', value: '3' },
{ label: '否', value: '1' }
],
ui: {
widget: 'select',
@ -328,7 +328,7 @@ tabs = {
_$expand: (value: boolean) => value,
},
allowClear: true,
asyncData: () => this.service2.getNetworkFreightForwarder(),
asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
},
},
// goodsName: {
@ -355,7 +355,7 @@ tabs = {
_$expand: (value: boolean) => value,
},
asyncData: () =>
this.service2.loadConfigByKey('goods.name.config.type').pipe(
this.shipperservice.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => {
return data[0].children?.map((m: any) => {
return { label: m.name, value: m.id };
@ -494,7 +494,7 @@ tabs = {
title: '创建时间',
width: '180px',
className: 'text-left',
index: 'creationTime',
index: 'createTime',
},
{
title: '操作',
@ -714,6 +714,7 @@ tabs = {
nzWidth: 580,
nzContent: UpdateFreightComponent,
nzComponentParams: { data: { ...data, billId: item.id } },
nzFooter: null
});
modal.afterClose.subscribe(_ =>

View File

@ -36,7 +36,7 @@ export class OrderManagementRiskComponent implements OnInit {
};
constructor(
public service: OrderManagementService,
public service2: ShipperBaseService,
public shipperservice: ShipperBaseService,
private modal: NzModalService,
public router: Router
) {}
@ -190,18 +190,18 @@ export class OrderManagementRiskComponent implements OnInit {
}
} as SFSelectWidgetSchema
},
enterpriseInfoName: {
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
_$expand: (value: boolean) => value
_$expand: (value: boolean) => value,
},
allowClear: true,
asyncData: () => this.service2.getNetworkFreightForwarder()
}
asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
},
},
createTime: {
title: '创建时间',

View File

@ -74,7 +74,7 @@ loadTime: any; // 货源单设置回显
public service: OrderManagementService,
private modalService: NzModalService,
private amapService: AmapService,
public service2: ShipperBaseService,
public shipperservice: ShipperBaseService,
fb: FormBuilder,
private envSrv: EAEnvironmentService,
) {
@ -523,7 +523,7 @@ initSF3() {
// ui: {
// placeholder: '请选择',
// widget: 'select',
// asyncData: () => this.service2.getNetworkFreightForwarder(),
// asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
// visibleIf: {
// _$expand: (value: boolean) => value,
// },

View File

@ -70,7 +70,7 @@ resourceStatus: any;
constructor(
public service: OrderManagementService,
private modal: NzModalService,
public service2: ShipperBaseService,
public shipperservice: ShipperBaseService,
public router: Router,
) { }
@ -91,11 +91,25 @@ resourceStatus: any;
const a:any = {};
if(this.resourceStatus) {
a.billStatus = this.resourceStatus;
}
return {
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
return {
...a,
...this.sf?.value,
};
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || '',
},
};
// const a:any = {};
// if(this.resourceStatus) {
// a.billStatus = this.resourceStatus;
// }
// return {
// ...a,
// ...this.sf?.value,
// };
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
@ -225,7 +239,7 @@ resourceStatus: any;
} as SFSelectWidgetSchema
},
plateNumber: {
CarNo: {
title: '车牌号',
type: 'string',
ui: {
@ -239,7 +253,7 @@ resourceStatus: any;
.request(this.service.$api_get_getCarLicenseListByCarNo, {
carNo: q
})
.pipe(map((res: any) => (res?.records as any[]).map(i => ({ label: i.carNo, value: i.carNo } as SFSchemaEnum))))
.pipe(map((res: any) => (res?.records as any[]).map(i => ({ label: i.carNo, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
@ -286,7 +300,7 @@ resourceStatus: any;
},
} as SFSelectWidgetSchema,
},
creationTime: {
createTime: {
title: '创建时间',
type: 'string',
ui: {
@ -298,13 +312,13 @@ resourceStatus: any;
}
} as SFDateWidgetSchema
},
isRiskSheet: {
riskStatus: {
type: 'string',
title: '是否风险单',
enum: [
{ label: '全部', value: '' },
{ label: '是', value: '1' },
{ label: '否', value: '2' }
{ label: '是', value: '3' },
{ label: '否', value: '1' }
],
ui: {
widget: 'select',
@ -314,6 +328,19 @@ resourceStatus: any;
},
},
},
// riskStatus: {
// title: '是否风险单',
// type: 'string',
// default: '',
// ui: {
// widget: 'dict-select',
// params: { dictKey: 'bill:risk:status' },
// containAllLable:true,
// visibleIf: {
// _$expand: (value: boolean) => value,
// },
// } as SFSelectWidgetSchema,
// },
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
@ -324,7 +351,7 @@ resourceStatus: any;
_$expand: (value: boolean) => value,
},
allowClear: true,
asyncData: () => this.service2.getNetworkFreightForwarder(),
asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
},
},
goodsNameId: {
@ -338,7 +365,7 @@ resourceStatus: any;
_$expand: (value: boolean) => value,
},
asyncData: () =>
this.service2.loadConfigByKey('goods.name.config.type').pipe(
this.shipperservice.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => {
return data[0].children?.map((m: any) => {
return { label: m.name, value: m.id };
@ -428,7 +455,7 @@ resourceStatus: any;
{
title: '创建时间',
className: 'text-left',
index: 'creationTime',
index: 'createTime',
width: '170px',
},
{

View File

@ -1,17 +1,22 @@
<!--
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2022-01-17 14:53:10
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-01-17 17:02:31
* @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
-->
<sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 90, grid: { span:24 } } }" [button]="'none'">
</sf>
<nz-divider style="margin-top: 0;"></nz-divider>
<sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 90, grid: { span: 24 } } }" [button]="'none'"> </sf>
<nz-divider style="margin-top: 0"></nz-divider>
<div>
<p style="font-size: 16px;">
<span style="font-weight: bolder">总运费:<span style="color: #dc112a">{{ data.totalFreight | currency }}</span></span>
</p>
<p style="margin-bottom: 0;"> 运输费:{{ data.freight | currency}},附加费:{{ data.surcharge | currency }}</p>
</div>
<p style="font-size: 16px">
<span style="font-weight: bolder"
>总运费:<span style="color: #dc112a">{{ data.totalFreight |currency }}</span></span
>
</p>
<p style="margin-bottom: 0"> 运输费:{{ data.freight |currency }},附加费:{{ data.surcharge |currency}}</p>
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="submit" nzType="primary" (click)="save(sf.value)">确定</button>
</div>

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2022-01-13 13:33:14
* @LastEditTime: 2022-01-17 17:02:25
* @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,7 @@ import {
SFSelectWidgetSchema,
SFStringWidgetSchema, SFTextWidgetSchema
} from '@delon/form';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { Subscription } from 'rxjs';
import { OrderManagementService } from '../../../services/order-management.service';
@ -28,7 +29,7 @@ export class UpdateFreightComponent implements OnInit {
data: any;
calculateSub!: Subscription;
constructor(private service: OrderManagementService) {}
constructor(private service: OrderManagementService,private modal: NzModalRef, ) {}
ngOnInit(): void {
this.schema = this.initSF(this.data);
@ -44,8 +45,10 @@ export class UpdateFreightComponent implements OnInit {
type: 'object',
properties: {
freightPrice: {
type: 'string',
type: 'number',
title: '运费单价',
minimum:0,
maximum:99999,
ui: {
addOnAfter: data.freightTypeLabel,
placeholder: '请输入',
@ -104,6 +107,8 @@ export class UpdateFreightComponent implements OnInit {
type: 'number',
title: '装货重量',
default: data.acceptWeight,
minimum:0,
maximum:99999,
ui: {
unit: '吨',
placeholder: '请输入',
@ -118,8 +123,10 @@ export class UpdateFreightComponent implements OnInit {
type: 'number',
title: '装货体积',
default: data.acceptVolume,
minimum:0,
maximum:99999,
ui: {
unit: '',
unit: '',
placeholder: '请输入',
grid: {
span: 12
@ -132,6 +139,8 @@ export class UpdateFreightComponent implements OnInit {
type: 'number',
title: '卸货重量',
default: data.settlementWeight,
minimum:0,
maximum:99999,
ui: {
unit: '吨',
placeholder: '请输入',
@ -146,8 +155,10 @@ export class UpdateFreightComponent implements OnInit {
type: 'number',
title: '卸货体积',
default: data.settlementVolume,
minimum:0,
maximum:99999,
ui: {
unit: '',
unit: '',
placeholder: '请输入',
grid: {
span: 12
@ -179,23 +190,36 @@ export class UpdateFreightComponent implements OnInit {
}
changeNumVal() {
console.log(this.sf.valid)
if(this.sf.valid) {
console.log(this.sf.valid)
if (this.calculateSub) {
this.calculateSub.unsubscribe();
}
// 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
// });
// }
// });
this.calculateSub = this.service
.request(this.service.$api_calculate_cost, { billId: this.data.billId, ...this.sf.value, changeCause: '' })
.subscribe(res => {
if (res) {
Object.assign(this.data, {
totalFreight: res.totalFreight,
freight: res.freight,
surcharge: res.surcharge
});
}
});
}
save(value: any): void {
if(!this.sf.valid){
this.sf.validator({ emitError: true });
return;
}
this.service.request(this.service.$api_change_bulk, { billId: this.data.billId, ...this.sf.value }).subscribe(res => {
if (res) {
this.service.msgSrv.success('变更运费成功');
this.modal.destroy(true);
}
});
}
close(): void {
this.modal.destroy();
}
}

View File

@ -2,7 +2,7 @@ import { Params } from '@angular/router';
/*
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2022-01-04 09:37:50
* @LastEditTime: 2022-01-17 16:20:06
* @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,7 @@ import {SFComponent, SFNumberWidgetSchema, SFSchema, SFUISchema} from '@delon/fo
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { OrderManagementService } from '../../../services/order-management.service';
import { ShipperBaseService } from '@shared';
@Component({
@ -28,7 +29,12 @@ export class VehicleFreightPeopleComponent implements OnInit {
data: any;
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService, ) {}
constructor(
private modal: NzModalRef,
private msgSrv: NzMessageService,
public service: OrderManagementService,
public shipperservice: ShipperBaseService,
) {}
ngOnInit(): void {
console.log(this.data)
@ -37,7 +43,7 @@ export class VehicleFreightPeopleComponent implements OnInit {
initSF() {
this.schema = {
properties: {
enterpriseInfoName: {
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
ui: {
@ -47,7 +53,7 @@ export class VehicleFreightPeopleComponent implements OnInit {
_$expand: (value: boolean) => value,
},
allowClear: true,
asyncData: () => this.service.getNetworkFreightForwarderHistory(this.data),
asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
},
},
},