车辆对接

This commit is contained in:
wangshiming
2021-12-21 10:52:28 +08:00
parent 4aad1e6a47
commit f27a6bddbc
20 changed files with 1021 additions and 477 deletions

View File

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-12-03 11:10:14
* @LastEditTime: 2021-12-20 17:07:17
* @LastEditTime: 2021-12-21 10:36:16
* @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\supply-management\components\vehicle\vehicle.component.html
@ -38,10 +38,15 @@
</nz-card>
<nz-card>
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" >
<nz-tab *ngFor="let tab of tabs; let i = index" [nzTitle]="tab.name + ' (' + tab.count + ') '" (nzClick)="tabChange(i)">
</nz-tab>
</nz-tabset>
<nz-tabset (nzSelectedIndexChange)="selectChange($event)"
[nzTabBarExtraContent]="extraTemplate">
<nz-tab [nzTitle]="'全部'"></nz-tab>
<nz-tab [nzTitle]="'待发车('+tabs?.stayQuantity+')'"></nz-tab>
<nz-tab [nzTitle]="'运输中('+tabs?.receivedQuantity+')'"></nz-tab>
<nz-tab [nzTitle]="'待签收('+tabs?.cancelQuantity+')'"></nz-tab>
<nz-tab [nzTitle]="'已完成'"></nz-tab>
<nz-tab [nzTitle]="'已取消'"></nz-tab>
</nz-tabset>
<div style="margin-top: 15px;">
<st
#st
@ -204,4 +209,22 @@
<button nz-button nzType="default" (click)="handleCancel('2')">取消</button>
<button nz-button nzType="primary" (click)="handleOK()">确定</button>
</ng-template>
</nz-modal>
</nz-modal>
<ng-template #extraTemplate>
<div>
<button nz-button nzType="primary" nzGhost nz-popconfirm
[nzPopconfirmTitle]="enable" (nzOnConfirm)="userAction()" nzPopconfirmPlacement="bottomRight">
批量签收
</button>
</div>
</ng-template>
<ng-template #enable>
<div class="ant-popover-message">
<i nz-icon nzType="info-circle" nzTheme="fill"></i>
<div class="ant-popover-message-title ng-star-inserted self-ant-popover-title" style="font-size: 16px">已选择{{selectedRows?.length || 0}}条订单,确认批量签收吗?
</div>
<div class="ant-popover-message-title ng-star-inserted">
签收后不可再修改运费,请确保运费等信息准确无误后,再进行签收。
</div>
</div>
</ng-template>

View File

@ -6,6 +6,7 @@ import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { OneCarOrderCancelComponent } from '../../modal/vehicle/cancel/cancel.component';
import { VehicleConfirReceiptComponent } from '../../modal/vehicle/confir-receipt/confir-receipt.component';
import { VehicleSureArriveComponent } from '../../modal/vehicle/sure-arrive/sure-arrive.component';
import { VehicleSureDepartComponent } from '../../modal/vehicle/sure-depart/sure-depart.component';
@ -51,47 +52,18 @@ export class OrderManagementVehicleComponent implements OnInit {
id: 2
},
];
tabs = [ {
name: '全部',
type: 5,
count: 0,
},
{
name: '待发车',
type: 5,
count: 0,
},
{
name: '运输中',
type: 5,
count: 0,
},
{
name: '代签收',
type: 5,
count: 0,
},
{
name: '已完成',
type: 5,
count: 0,
},
{
name: '已取消',
type: 5,
count: 0,
},
];
tabs = {
totalQuantity: 0,
cancelQuantity: 0,
receivedQuantity: 0,
stayQuantity: 0
};
resourceStatus: any;
constructor(public service: OrderManagementService, private modal: NzModalService,public service2: ShipperBaseService,) { }
/**
* 查询参数
*/
get reqParams() {
return {
...this.sf?.value,
};
}
get changeParams() {
return {
id: this.changeId
@ -102,6 +74,16 @@ export class OrderManagementVehicleComponent implements OnInit {
id: this.changeViewId
};
}
get reqParams() {
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) || [];
}
@ -391,15 +373,8 @@ export class OrderManagementVehicleComponent implements OnInit {
},
{
text: '取消订单',
click: (_record) => this.confirmReceipt(_record),
},
{
text: '确认发车',
click: (_record) => this.sureDepart(_record),
},
{
text: '确认到车',
click: (_record) => this.sureArrive(_record),
click: (_record) => this.cancellation(_record),
iif: item => item.externalSn === '1' || item.externalSn === 1,
},
],
},
@ -439,6 +414,7 @@ export class OrderManagementVehicleComponent implements OnInit {
{
text: '撤销',
click: (_record) => this.revoke(_record),
iif: item => item.handleStatus === '1' || item.handleStatus === 1,
},
],
},
@ -502,6 +478,11 @@ export class OrderManagementVehicleComponent implements OnInit {
selectChange(e: number) {
console.log(e);
this.resourceStatus = e;
this.initST();
setTimeout(() => {
this.st.load();
}, 500);
}
/**
* 导入货源
@ -567,7 +548,7 @@ export class OrderManagementVehicleComponent implements OnInit {
nzWidth: '50%',
nzContent: VehicleUpdateFreightComponent,
nzComponentParams: {
i: item
record: item
},
nzFooter: null
});
@ -581,37 +562,12 @@ export class OrderManagementVehicleComponent implements OnInit {
nzWidth: '50%',
nzContent: VehicleConfirReceiptComponent,
nzComponentParams: {
i: item
i: item,
Status: 2
},
nzFooter: null
});
}
// *确认发车
sureDepart(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认发车',
nzWidth: '50%',
nzContent: VehicleSureDepartComponent,
nzComponentParams: {
i: item,
Status: 2
},
nzFooter: null
});
}
// 确认到车
sureArrive(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认到车',
nzWidth: '50%',
nzContent: VehicleSureArriveComponent,
nzComponentParams: {
i: item
},
nzFooter: null
});
}
revoke(item: any) {
this.modal.confirm({
nzTitle: '是否确定立即撤销费用变更!</i>',
@ -627,4 +583,35 @@ export class OrderManagementVehicleComponent implements OnInit {
})
});
}
// 取消订单
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();
this.initST();
}
}),
})
}
userAction() {
let params: any[] = [];
this.selectedRows.forEach(item => {
params.push(item.id);
});
console.log(this.selectedRows)
console.log(params)
this.service.request(this.service.$api_get_batchSignWholeOrder, params).subscribe(res => {
if (res) {
console.log(res);
} else {
this.service.msgSrv.error(res.msg);
}
});
}
}