车辆接口更新

This commit is contained in:
wangshiming
2022-01-19 13:47:07 +08:00
parent a212b6200f
commit fce0c56506
3 changed files with 394 additions and 365 deletions

View File

@ -11,7 +11,6 @@ import { of } from 'rxjs';
import { ShipperBaseService } from '@shared';
import { Router } from '@angular/router';
@Component({
selector: 'app-supply-management-bulk',
templateUrl: './bulk.component.html',
@ -27,10 +26,10 @@ export class OrderManagementBulkComponent implements OnInit {
isVisibleEvaluate = false;
isVisible = false;
_$expand = false;
changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录
changeViewId: any; // 查看运费变更记录id - 用于查看
ViewCause: any; // 变更运费查看数据
sfViewFormData: any; // 变更运费查看的sf 数据
changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录
changeViewId: any; // 查看运费变更记录id - 用于查看
ViewCause: any; // 变更运费查看数据
sfViewFormData: any; // 变更运费查看的sf 数据
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('stFloat') private readonly stFloat!: STComponent;
@ViewChild('stFloatView') private readonly stFloatView!: STComponent;
@ -44,56 +43,55 @@ export class OrderManagementBulkComponent implements OnInit {
resourceStatus: any;
datass: any = [
{
one: '1',
two: '1',
three: '1',
id: 1
},
one: '1',
two: '1',
three: '1',
id: 1
},
{
one: '2',
two: '2',
three: '2',
id: 2
},
];
tabs = {
cancelQuantity: 0,
receivedQuantity: 0,
stayQuantity: 0,
signQuantity: 0,
compolatelQuantity: 0,
GoingQuantity: 0,
totalCount: 0
};
one: '2',
two: '2',
three: '2',
id: 2
}
];
tabs = {
cancelQuantity: 0,
receivedQuantity: 0,
stayQuantity: 0,
signQuantity: 0,
compolatelQuantity: 0,
GoingQuantity: 0,
totalCount: 0
};
constructor(
public service: OrderManagementService,
private modal: NzModalService,
public shipperservice: ShipperBaseService,
private router: Router,
) { }
private router: Router
) {}
/**
* 查询参数
*/
get reqParams() {
const a:any = {};
if(this.resourceStatus) {
* 查询参数
*/
get reqParams() {
const a: any = {};
if (this.resourceStatus) {
a.billStatus = this.resourceStatus;
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
return {
return {
...a,
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || '',
},
};
end: this.sf?.value?.createTime?.[1] || ''
}
};
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
return this.st?.list.filter(item => item.checked) || [];
}
get changeParams() {
return {
@ -102,7 +100,7 @@ tabs = {
}
search() {
this.st?.load(1);
this.getGoodsSourceStatistical()
this.getGoodsSourceStatistical();
}
getGoodsSourceStatistical() {
this.tabs = {
@ -114,39 +112,39 @@ tabs = {
GoingQuantity: 0,
totalCount: 0
};
this.service.request(this.service.$api_getBulkStatistical, {...this.reqParams}).subscribe(res => {
this.service.request(this.service.$api_getBulkStatistical, { ...this.reqParams }).subscribe(res => {
if (res) {
let totalCount = 0;
res.forEach((element: any) => {
if(element.billStatusLabel === '待发车') {
this.tabs.stayQuantity = element.quantity
} else if (element.billStatusLabel === '待接单') {
this.tabs.receivedQuantity = element.quantity
} else if (element.billStatusLabel === '待签收') {
this.tabs.signQuantity = element.quantity
} else if (element.billStatusLabel === '已完成') {
this.tabs.compolatelQuantity = element.quantity
} else if (element.billStatusLabel === '已取消') {
this.tabs.cancelQuantity = element.quantity
} else if (element.billStatusLabel === '运输中') {
this.tabs.GoingQuantity = element.quantity
}
totalCount += element.quantity
});
this.tabs.totalCount = totalCount
res.forEach((element: any) => {
if (element.billStatusLabel === '待发车') {
this.tabs.stayQuantity = element.quantity;
} else if (element.billStatusLabel === '待接单') {
this.tabs.receivedQuantity = element.quantity;
} else if (element.billStatusLabel === '待签收') {
this.tabs.signQuantity = element.quantity;
} else if (element.billStatusLabel === '已完成') {
this.tabs.compolatelQuantity = element.quantity;
} else if (element.billStatusLabel === '已取消') {
this.tabs.cancelQuantity = element.quantity;
} else if (element.billStatusLabel === '运输中') {
this.tabs.GoingQuantity = element.quantity;
}
totalCount += element.quantity;
});
this.tabs.totalCount = totalCount;
}
})
});
}
selectChange(e: number) {
this.resourceStatus = e;
this.initST();
setTimeout(() => {
this.st.load();
this.getGoodsSourceStatistical()
this.getGoodsSourceStatistical();
}, 500);
}
ngOnInit(): void {
this.getGoodsSourceStatistical()
this.getGoodsSourceStatistical();
this.initSF();
this.initST();
this.initSTFloat();
@ -154,11 +152,9 @@ tabs = {
this.initSFView();
}
/**
* 初始化查询表单
*/
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
@ -183,14 +179,14 @@ tabs = {
onSearch: (q: any) => {
if (!!q) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.request(this.service.$api_enterpriceList, { enterpriseName: q })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
} as SFSelectWidgetSchema,
}
} as SFSelectWidgetSchema
},
enterpriseProjectId: {
type: 'string',
@ -247,10 +243,10 @@ tabs = {
type: 'string',
ui: {
visibleIf: {
_$expand: (value: boolean) => value,
},
_$expand: (value: boolean) => value
}
}
},
},
paymentstatus: {
title: '支付状态',
type: 'string',
@ -259,9 +255,9 @@ tabs = {
params: { dictKey: 'overall:payment:status' },
containsAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
createTime: {
title: '创建时间',
@ -288,9 +284,9 @@ tabs = {
widget: 'select',
placeholder: '请选择',
visibleIf: {
_$expand: (value: boolean) => value,
},
},
_$expand: (value: boolean) => value
}
}
},
enterpriseInfoId: {
type: 'string',
@ -300,10 +296,10 @@ tabs = {
placeholder: '请选择',
allowClear: true,
visibleIf: {
_$expand: (value: boolean) => value,
_$expand: (value: boolean) => value
},
asyncData: () => this.shipperservice.getNetworkFreightForwarder(),
},
asyncData: () => this.shipperservice.getNetworkFreightForwarder()
}
},
serviceType: {
title: '服务类型',
@ -314,9 +310,9 @@ tabs = {
params: { dictKey: 'service:type' },
containsAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
settlementBasis: {
title: '结算依据',
@ -325,26 +321,26 @@ tabs = {
widget: 'dict-select',
containsAllLable: true,
params: { dictKey: 'goodresource:settlement:type' },
containAllLable:true,
containAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
},
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
}
},
type: 'object'
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
}
/**
* 初始化查询表单
*/
* 初始化查询表单
*/
initSFView() {
this.schemaView = {
properties: {
freightPrice: {
type: 'string',
title: '运费单价',
title: '运费单价'
},
rule: {
title: '',
@ -353,9 +349,9 @@ tabs = {
widget: 'dict-select',
params: { dictKey: 'goodresource:rounding:rules' },
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
settlementBasis: {
type: 'string',
@ -364,11 +360,11 @@ tabs = {
widget: 'dict-select',
params: { dictKey: 'goodresource:settlement:type' },
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
},
},
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
}
}
};
this.uiView = { '*': { spanLabelFixed: 80, grid: { span: 12, gutter: 4 } } };
}
@ -378,7 +374,7 @@ tabs = {
*/
initST() {
this.columns = [
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
{
title: '订单号',
width: '180px',
@ -390,7 +386,7 @@ tabs = {
title: '运费明细',
width: '250px',
className: 'text-right',
render: 'mybidDetailInfo',
render: 'mybidDetailInfo'
},
{ title: '网络货运人', index: 'enterpriseInfoName', width: '220px', className: 'text-left' },
{ title: '货主', index: 'shipperAppUserName', width: '220px', className: 'text-left' },
@ -409,7 +405,8 @@ tabs = {
className: 'text-left',
width: '250px',
render: 'goodsName'
}, {
},
{
title: '运费单价',
className: 'text-right',
width: '180px',
@ -419,13 +416,13 @@ tabs = {
title: '接单数量',
className: 'text-right',
index: 'goodsNumber',
width: '180px',
width: '180px'
},
{
title: '结算重量',
className: 'text-right',
index: 'settlementWeight',
width: '150px',
width: '150px'
},
{
title: '承运司机',
@ -439,7 +436,7 @@ tabs = {
className: 'text-left',
width: '180px',
index: 'payeeName',
render: 'payeeName',
render: 'payeeName'
},
{
title: '装卸货时间',
@ -451,7 +448,7 @@ tabs = {
title: '创建时间',
width: '180px',
className: 'text-left',
index: 'createTime',
index: 'createTime'
},
{
title: '操作',
@ -461,36 +458,38 @@ tabs = {
buttons: [
{
text: '查看评价 ',
click: (_record) => this.viewEvaluate(_record),
iif: item => item.billStatus == '5',
click: _record => this.viewEvaluate(_record),
iif: item => item.billStatus == '5'
},
{
text: '运费变更记录',
click: (_record) => this.OpenPrice(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '6',
click: _record => this.OpenPrice(_record),
iif: item =>
item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '6'
},
{
text: '变更运费 ',
click: (_record) => this.updateFreight(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3',
click: _record => this.updateFreight(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3'
},
{
text: '确认签收 ',
click: (_record) => this.confirmReceipt(_record),
iif: item => item.billStatus == '4',
click: _record => this.confirmReceipt(_record),
iif: item => item.billStatus == '4'
},
{
text: '取消订单 ',
click: (_record) => this.cancellation(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1',
click: _record => this.cancellation(_record),
iif: item =>
item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1'
},
{
text: '修改订单 ',
click: (_record) => this.changeOrder(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3',
},
],
},
click: _record => this.changeOrder(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3'
}
]
}
];
}
initSTFloat() {
@ -510,7 +509,7 @@ tabs = {
className: 'text-center',
index: 'applyUserName'
},
{ title: '状态', index: 'handleStatusLabel', className: 'text-center' },
{ title: '状态', index: 'handleStatusLabel', className: 'text-center' },
{
title: '操作',
fixed: 'right',
@ -518,7 +517,7 @@ tabs = {
buttons: [
{
text: '查看',
click: (_record) => this.FloatView(_record),
click: _record => this.FloatView(_record)
},
// {
// text: '查看协议',
@ -526,11 +525,11 @@ tabs = {
// },
{
text: '撤销',
click: (_record) => this.revoke(_record),
iif: item => item.handleStatus === '1' || item.handleStatus === 1,
},
],
},
click: _record => this.revoke(_record),
iif: item => item.handleStatus === '1' || item.handleStatus === 1
}
]
}
];
}
initSTFloatView() {
@ -548,17 +547,8 @@ tabs = {
index: 'amountAfterChange',
render: 'amountAfterChange'
},
{ title: '变更值',
index: 'amountchangeValue',
width: '120px',
className: 'text-center',
render: 'amountchangeValue'
},
{ title: '变更后',
index: 'amountBeforeChange',
render: 'amountBeforeChange',
width: '120px',
className: 'text-center' }
{ title: '变更值', index: 'amountchangeValue', width: '120px', className: 'text-center', render: 'amountchangeValue' },
{ title: '变更后', index: 'amountBeforeChange', render: 'amountBeforeChange', width: '120px', className: 'text-center' }
];
}
/**
@ -573,14 +563,13 @@ tabs = {
};
}
/**
* 伸缩查询条件
*/
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
tabChange(item: any) {
}
tabChange(item: any) {}
/**
* 重置表单
*/
@ -592,58 +581,53 @@ tabs = {
/**
* 导入货源
*/
importGoodsSource() {
importGoodsSource() {}
audit(item: any) {}
}
audit(item: any) {
}
/*
/*
* 审核关闭弹窗
view: 1
浮动费用: 0
查看评价: 3
*/
handleCancel(type: string) {
if(type === '0') {
this.isVisible = false
} else if(type === '1') {
console.log(type)
this.isVisibleView = false
} else if(type === '2') {
this.isVisibleEvaluate = false
if (type === '0') {
this.isVisible = false;
} else if (type === '1') {
console.log(type);
this.isVisibleView = false;
} else if (type === '2') {
this.isVisibleEvaluate = false;
}
}
/**
* 审核通过按钮
*/
handleOK() {
}
/**
* 审核通过按钮
*/
handleOK() {}
OpenPrice(item: any) {
this.changeId = item.id;
this.isVisible = true
this.isVisible = true;
}
/**
* 浮动费用查看
*/
/**
* 浮动费用查看
*/
FloatView(item: any) {
this.changeViewId = item.id;
this.service.request(this.service.$api_getChangeRecordBulkDetail, {id: this.changeViewId}).subscribe((res) => {
this.service.request(this.service.$api_getChangeRecordBulkDetail, { id: this.changeViewId }).subscribe(res => {
this.ViewCause = res;
})
this.isVisibleView = true
});
this.isVisibleView = true;
}
/**
*查看评价
*/
/**
*查看评价
*/
viewEvaluate(item: any) {
this.isVisibleEvaluate = true
this.isVisibleEvaluate = true;
}
/**
/**
*变更运费
*/
updateFreight(item: any) {
updateFreight(item: any) {
this.service.request(this.service.$api_getFreightChangeBulkDetail, { id: item.id }).subscribe(data => {
if (data) {
const modal = this.modal.create({
@ -651,22 +635,19 @@ tabs = {
nzWidth: 580,
nzContent: UpdateFreightComponent,
nzComponentParams: { data: { ...data, billId: item.id } },
nzFooter: null
nzFooter: null
});
modal.afterClose.subscribe(_ => {
this.st.reload(1);
this.getGoodsSourceStatistical();
});
modal.afterClose.subscribe(_ =>
{
this.st.reload(1);
this.getGoodsSourceStatistical();
}
);
}
});
}
// *确认签收
confirmReceipt(item: any) {
confirmReceipt(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认签收',
nzWidth: '50%',
@ -678,8 +659,8 @@ tabs = {
nzFooter: null
});
modalRef.afterClose.subscribe((result: any) => {
this.st.load(1);
this.getGoodsSourceStatistical()
this.st.load(1);
this.getGoodsSourceStatistical();
});
}
userAction() {
@ -690,45 +671,45 @@ tabs = {
this.service.request(this.service.$api_get_batchSignBulkOrder, params).subscribe(res => {
if (res) {
this.st.load(1);
this.getGoodsSourceStatistical()
this.getGoodsSourceStatistical();
}
});
}
// 取消订单
cancellation(item: any) {
// api_get_cancelAnOrder
this.modal.confirm({
nzTitle: '<b>确定取消该订单吗?</b>',
nzContent: `<b>取消后无法恢复,请确认</b>`,
nzOnOk: () =>
this.service.request(this.service.$api_get_cancelAnOrder, {id: item.id}).subscribe((res) => {
if (res === true) {
this.service.msgSrv.success('操作成功!');
this.st?.reload(1);
this.getGoodsSourceStatistical()
this.initST();
}
this.st?.reload(1);
this.getGoodsSourceStatistical()
}),
// 取消订单
cancellation(item: any) {
// api_get_cancelAnOrder
this.modal.confirm({
nzTitle: '<b>确定取消该订单吗?</b>',
nzContent: `<b>取消后无法恢复,请确认</b>`,
nzOnOk: () =>
this.service.request(this.service.$api_get_cancelAnOrder, { id: item.id }).subscribe(res => {
if (res === true) {
this.service.msgSrv.success('操作成功!');
this.st?.reload(1);
this.getGoodsSourceStatistical();
this.initST();
}
this.st?.reload(1);
this.getGoodsSourceStatistical();
})
}
revoke(item: any) {
this.modal.confirm({
nzTitle: '是否确定立即撤销费用变更!</i>',
nzOnOk: () =>
this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id}).subscribe((res) => {
if(res) {
this.service.msgSrv.success('撤销成功!')
this.stFloat.reload()
this.st?.reload(1);
this.getGoodsSourceStatistical()
}
})
});
}
// 修改订单
changeOrder(value: any) {
this.router.navigate(['order-management/bulk-detailChange', value.id])
}
});
}
revoke(item: any) {
this.modal.confirm({
nzTitle: '是否确定立即撤销费用变更!</i>',
nzOnOk: () =>
this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id }).subscribe(res => {
if (res) {
this.service.msgSrv.success('撤销成功!');
this.stFloat.reload();
this.st?.reload(1);
this.getGoodsSourceStatistical();
}
})
});
}
// 修改订单
changeOrder(value: any) {
this.router.navigate(['order-management/bulk-detailChange', value.id]);
}
}