This commit is contained in:
wangshiming
2022-04-21 14:39:31 +08:00
parent fa3e5abe74
commit 33c6fc64e8
3 changed files with 159 additions and 96 deletions

View File

@ -397,25 +397,25 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
{ {
text: '生成电子单据', text: '生成电子单据',
click: _record => this.generate(_record, 2), click: _record => this.generate(_record, 2),
iif: item => !item?.loadingElectronicsLadingBillFilePath, iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] }, acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] },
}, },
{ {
text: '通过', text: '通过',
click: _record => this.sign(_record), click: _record => this.sign(_record),
iif: item => !item?.loadingElectronicsLadingBillFilePath, iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] }, acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] },
}, },
{ {
text: '修改', text: '修改',
click: _record => this.modification(_record), click: _record => this.modification(_record),
iif: item => !item?.loadingElectronicsLadingBillFilePath, iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] }, acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] },
}, },
{ {
text: '查看凭证', text: '查看凭证',
click: _record => this.generate(_record, 3), click: _record => this.generate(_record, 3),
iif: item => item?.loadingElectronicsLadingBillFilePath, iif: item => item?.loadingElectronicsLadingBillFilePath && item?.unloadingElectronicsLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-view'] }, acl: { ability: ['ORDER-RECEIPTS-view'] },
}, },
] ]

View File

@ -1,4 +1,3 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { DatePipe } from '@angular/common'; import { DatePipe } from '@angular/common';
import { import {
@ -41,20 +40,25 @@ export class orderManagementVoucherViewComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent; @ViewChild('sf', { static: false }) sf!: SFComponent;
schema: SFSchema = {}; schema: SFSchema = {};
ui: SFUISchema = {}; ui: SFUISchema = {};
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: OrderManagementService, private datePipe: DatePipe, private envSrv: EAEnvironmentService,) { } constructor(
private modal: NzModalRef,
private msgSrv: NzMessageService,
public http: _HttpClient,
public service: OrderManagementService,
private datePipe: DatePipe,
private envSrv: EAEnvironmentService
) {}
ngOnInit(): void { ngOnInit(): void {
console.log(this.i) console.log(this.i);
this.initData() this.initData();
this.i.time = this.i.loadingTime; this.i.time = this.i.loadingTime;
this.initSF(); this.initSF();
} }
initSF() { initSF() {
console.log(this.Status) console.log(this.Status);
if (this.Status == 1) { if (this.Status == 1) {
this.schema = { this.schema = {
properties: { properties: {
loadingLadingBillFilePath: { loadingLadingBillFilePath: {
type: 'string', type: 'string',
@ -73,7 +77,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.loadingAddressArr[0]}`, `上传位置:${this.i?.loadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -98,8 +102,8 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
}, },
loadingPeopleVehiclesGoodsFilePath: { loadingPeopleVehiclesGoodsFilePath: {
type: 'string', type: 'string',
@ -118,7 +122,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.loadingAddressArr[0]}`, `上传位置:${this.i?.loadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -143,16 +147,16 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
}, },
no4: { no4: {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
widget: 'text', widget: 'text'
}, },
default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式', default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式'
}, },
unloadingLadingBillFilePath: { unloadingLadingBillFilePath: {
type: 'string', type: 'string',
@ -171,7 +175,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.unloadingAddressArr[0]}`, `上传位置:${this.i?.unloadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -196,8 +200,8 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
}, },
unloadingPeopleVehiclesGoodsFilePath: { unloadingPeopleVehiclesGoodsFilePath: {
type: 'string', type: 'string',
@ -216,7 +220,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.unloadingAddressArr[0]}`, `上传位置:${this.i?.unloadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -241,11 +245,16 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
} }
}, },
required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath', 'unloadingLadingBillFilePath', 'unloadingPeopleVehiclesGoodsFilePath'] required: [
'loadingLadingBillFilePath',
'loadingPeopleVehiclesGoodsFilePath',
'unloadingLadingBillFilePath',
'unloadingPeopleVehiclesGoodsFilePath'
]
}; };
} else { } else {
this.schema = { this.schema = {
@ -254,8 +263,8 @@ export class orderManagementVoucherViewComponent implements OnInit {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom'
}, }
}, },
loadingLadingBillFilePath: { loadingLadingBillFilePath: {
type: 'string', type: 'string',
@ -275,7 +284,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.loadingAddressArr[0]}`, `上传位置:${this.i?.loadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -300,8 +309,8 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
}, },
loadingPeopleVehiclesGoodsFilePath: { loadingPeopleVehiclesGoodsFilePath: {
type: 'string', type: 'string',
@ -321,7 +330,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.loadingAddressArr[0]}`, `上传位置:${this.i?.loadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -346,24 +355,24 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
}, },
no4: { no4: {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
widget: 'text', widget: 'text'
}, },
default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式', default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式'
}, },
no6: { no6: {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom'
}, }
}, },
unloadingLadingBillFilePath: { unloadingLadingBillFilePath: {
type: 'string', type: 'string',
@ -383,7 +392,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.unloadingAddressArr[0]}`, `上传位置:${this.i?.unloadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -408,8 +417,8 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
}, },
unloadingPeopleVehiclesGoodsFilePath: { unloadingPeopleVehiclesGoodsFilePath: {
type: 'string', type: 'string',
@ -429,7 +438,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
content: [ content: [
`上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`,
`上传位置:${this.i?.unloadingAddressArr[0]}`, `上传位置:${this.i?.unloadingAddressArr[0]}`,
`上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`
], ],
position: '2', position: '2',
fontSize: '100' fontSize: '100'
@ -454,11 +463,16 @@ export class orderManagementVoucherViewComponent implements OnInit {
}); });
}, },
multiple: false, multiple: false,
listType: 'picture-card', listType: 'picture-card'
} as SFUploadWidgetSchema, } as SFUploadWidgetSchema
} }
}, },
required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath', 'unloadingLadingBillFilePath', 'unloadingPeopleVehiclesGoodsFilePath'] required: [
'loadingLadingBillFilePath',
'loadingPeopleVehiclesGoodsFilePath',
'unloadingLadingBillFilePath',
'unloadingPeopleVehiclesGoodsFilePath'
]
}; };
} }
this.ui = { this.ui = {
@ -469,42 +483,42 @@ export class orderManagementVoucherViewComponent implements OnInit {
$unloadingLadingBillFilePath: { grid: { span: 12 } }, $unloadingLadingBillFilePath: { grid: { span: 12 } },
$unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, $unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } },
$loadingLadingBillFilePath: { grid: { span: 12 } }, $loadingLadingBillFilePath: { grid: { span: 12 } },
$loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, $loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }
}; };
} }
save(value: any): void { save(value: any): void {
if (!this.sf.valid) { if (!this.sf.valid) {
this.service.msgSrv.warning('必填项为空!') this.service.msgSrv.warning('必填项为空!');
return; return;
} }
console.log(value) console.log(value);
const params = { const params = {
id: this.i?.id, id: this.i?.id,
loadingLadingBillFilePath: value?.loadingLadingBillFilePath?.data?.fullFilePath, loadingLadingBillFilePath: value?.loadingLadingBillFilePath?.data?.fullFilePath,
loadingPeopleVehiclesGoodsFilePath: value?.loadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath, loadingPeopleVehiclesGoodsFilePath: value?.loadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath,
unloadingLadingBillFilePath: value?.unloadingLadingBillFilePath?.data?.fullFilePath, unloadingLadingBillFilePath: value?.unloadingLadingBillFilePath?.data?.fullFilePath,
unloadingPeopleVehiclesGoodsFilePath: value?.unloadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath, unloadingPeopleVehiclesGoodsFilePath: value?.unloadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath
} };
console.log(params) console.log(params);
this.service.request(this.service.$api_get_updateBillExamine, params).subscribe((res) => { this.service.request(this.service.$api_get_updateBillExamine, params).subscribe(res => {
if (res) { if (res) {
this.service.msgSrv.success('修改成功!') this.service.msgSrv.success('修改成功!');
this.modal.destroy(true); this.modal.destroy(true);
} }
}) });
} }
sure() { sure() {
const params = [this.i?.id]; const params = [this.i?.id];
this.service.downloadFile(this.service.$api_createBillTakeGoods, params) this.service.downloadFile(this.service.$api_createBillTakeGoods, params);
this.service.downloadFile(this.service.$api_createBillDischargeGoods, params) this.service.downloadFile(this.service.$api_createBillDischargeGoods, params);
this.service.msgSrv.success('生成电子单据成功!') this.service.msgSrv.success('生成电子单据成功!');
this.modal.destroy(true); this.modal.destroy(true);
} }
// 确认到车界面信息(两个只能看的图片) // 确认到车界面信息(两个只能看的图片)
initData() { initData() {
this.service.request(this.service.$api_get_getCredentials, { id: this.i?.id }).subscribe((res) => { this.service.request(this.service.$api_get_getCredentials, { id: this.i?.id }).subscribe(res => {
console.log(res) console.log(res);
this.datas = res this.datas = res;
if (res.unloadingLadingBillFilePath) { if (res.unloadingLadingBillFilePath) {
this.formData = { this.formData = {
loadingLadingBillFilePath: [ loadingLadingBillFilePath: [
@ -514,9 +528,9 @@ export class orderManagementVoucherViewComponent implements OnInit {
status: 'done', status: 'done',
url: res.loadingLadingBillFilePath, url: res.loadingLadingBillFilePath,
response: { response: {
url: res.loadingLadingBillFilePath, url: res.loadingLadingBillFilePath
}, }
}, }
], ],
loadingPeopleVehiclesGoodsFilePath: [ loadingPeopleVehiclesGoodsFilePath: [
{ {
@ -525,9 +539,9 @@ export class orderManagementVoucherViewComponent implements OnInit {
status: 'done', status: 'done',
url: res.loadingPeopleVehiclesGoodsFilePath, url: res.loadingPeopleVehiclesGoodsFilePath,
response: { response: {
url: res.loadingPeopleVehiclesGoodsFilePath, url: res.loadingPeopleVehiclesGoodsFilePath
}, }
}, }
], ],
unloadingLadingBillFilePath: [ unloadingLadingBillFilePath: [
{ {
@ -536,9 +550,9 @@ export class orderManagementVoucherViewComponent implements OnInit {
status: 'done', status: 'done',
url: res.unloadingLadingBillFilePath, url: res.unloadingLadingBillFilePath,
response: { response: {
url: res.unloadingLadingBillFilePath, url: res.unloadingLadingBillFilePath
}, }
}, }
], ],
unloadingPeopleVehiclesGoodsFilePath: [ unloadingPeopleVehiclesGoodsFilePath: [
{ {
@ -547,44 +561,88 @@ export class orderManagementVoucherViewComponent implements OnInit {
status: 'done', status: 'done',
url: res.unloadingPeopleVehiclesGoodsFilePath, url: res.unloadingPeopleVehiclesGoodsFilePath,
response: { response: {
url: res.unloadingPeopleVehiclesGoodsFilePath, url: res.unloadingPeopleVehiclesGoodsFilePath
}, }
}, }
], ]
}; };
} }
}) });
} }
close(): void { close(): void {
this.modal.destroy(true); this.modal.destroy(true);
} }
openlaod(value: any) { openlaod(value: any) {
if (value === 1) { if (value === 1) {
if(this.datas?.esignFlowStatus == '1') { if (!this.datas?.loadingElectronicsLadingBillFilePath) {
this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe((res) => { this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => {
console.log(res); console.log(res);
}) if (res) {
console.log(res[0].esignFlowStatus);
switch (res[0]?.esignFlowStatus) {
case 1:
case '1':
console.log(res[0]?.esignFlowStatus);
this.service.msgSrv.success('电子装货单签署中!')
this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => {
console.log(res);
if(res[0]?.esignFlowStatus == '2') {
this.service.msgSrv.success('电子装货单已生效!')
this.modal.destroy(true);
}
});
return ;
case 2:
return;
}
}
});
} else {
const a = document.createElement('a');
a.href = this.datas?.loadingElectronicsLadingBillFilePath;
document.body.appendChild(a);
console.log(document.body.contains(a));
a.click(); //点击下载
document.body.removeChild(a); //下载完成移除元素
} }
const a = document.createElement('a');
a.href = this.datas?.loadingElectronicsLadingBillFilePath;
document.body.appendChild(a);
console.log(document.body.contains(a))
a.click(); //点击下载
document.body.removeChild(a); //下载完成移除元素
} else { } else {
if(this.datas?.esignFlowStatus == '1') {
this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe((res) => {
console.log(res);
})
}
const a = document.createElement('a');
a.href = this.datas?.unloadingElectronicsLadingBillFilePath;
document.body.appendChild(a);
console.log(document.body.contains(a))
a.click(); //点击下载
document.body.removeChild(a); //下载完成移除元素
}
if (!this.datas?.unloadingElectronicsLadingBillFilePath) {
this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => {
console.log(res);
if (res) {
console.log(res[0].esignFlowStatus);
switch (res[0]?.esignFlowStatus) {
case 1:
case '1':
console.log(res[0]?.esignFlowStatus);
this.service.msgSrv.success('电子卸货单签署中!')
this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => {
console.log(res);
if(res[0]?.esignFlowStatus == '2') {
this.service.msgSrv.success('电子卸货单已生效!')
this.modal.destroy(true);
}
});
return ;
case 2:
return;
}
}
});
} else {
const a = document.createElement('a');
a.href = this.datas?.unloadingElectronicsLadingBillFilePath;
document.body.appendChild(a);
console.log(document.body.contains(a));
a.click(); //点击下载
document.body.removeChild(a); //下载完成移除元素
}
}
} }
} }

View File

@ -214,6 +214,11 @@ export class OrderManagementService extends ShipperBaseService {
public $api_getBillTakeEsignFile = `/api/sdc/billOperate/getBillTakeEsignFile`; public $api_getBillTakeEsignFile = `/api/sdc/billOperate/getBillTakeEsignFile`;
// 获取电子卸货单签章附件 // 获取电子卸货单签章附件
public $api_getBillDischargeEsignFile = `/api/sdc/billOperate/getBillDischargeEsignFile`; public $api_getBillDischargeEsignFile = `/api/sdc/billOperate/getBillDischargeEsignFile`;
// // 生成卸货单
// public $api_createBillDischargeGoods = `/api/sdc/billOperate/createBillDischargeGoods`;
// // 生成提货单
// public $api_createBillTakeGoods = `/api/sdc/billOperate/createBillTakeGoods`;
/** /**
* 根据企业ID获取企业历史网络货运人 * 根据企业ID获取企业历史网络货运人
* @returns * @returns