This commit is contained in:
wangshiming
2022-04-21 15:49:49 +08:00
parent 72cacd590e
commit 4d521c068f

View File

@ -576,10 +576,10 @@ export class orderManagementVoucherViewComponent implements OnInit {
openlaod(value: any) { openlaod(value: any) {
if (value === 1) { if (value === 1) {
// 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览
let time = 10 let time = 10;
setInterval (function () { setInterval(function () {
time-=1 time -= 1;
}, 1000); //反复执行函数本身 }, 1000); //反复执行函数本身
const modal = this.modalService.success({ const modal = this.modalService.success({
nzTitle: '电子装货单签署中!', nzTitle: '电子装货单签署中!',
nzContent: ` nzContent: `
@ -593,22 +593,23 @@ export class orderManagementVoucherViewComponent implements OnInit {
case 1: case 1:
case '1': case '1':
setTimeout(() => { setTimeout(() => {
this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => {
if(res[0]?.esignFlowStatus == '2') { if (res[0]?.esignFlowStatus == '2') {
this.service.msgSrv.success('电子装货单已生效!') this.service.msgSrv.success('电子装货单已生效!');
this.modal.destroy(true); this.modal.destroy(true);
} }
}); });
modal.destroy() modal.destroy();
}, 10000); }, 10000);
return ; return;
case 2: case 2:
modal.destroy() modal.destroy();
return;
case '13':
case 13:
this.service.msgSrv.error('签署异常!');
modal.destroy();
return; return;
case 13:
this.service.msgSrv.error('签署异常!')
modal.destroy()
return;
} }
} }
}); });
@ -620,36 +621,42 @@ export class orderManagementVoucherViewComponent implements OnInit {
document.body.removeChild(a); //下载完成移除元素 document.body.removeChild(a); //下载完成移除元素
} }
} else { } else {
// 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览
let time = 10 let time = 10;
setInterval (function () { setInterval(function () {
time-=1 time -= 1;
}, 1000); //反复执行函数本身 }, 1000); //反复执行函数本身
const modal = this.modalService.success({ const modal = this.modalService.success({
nzTitle: '电子卸货单签署中!', nzTitle: '电子卸货单签署中!',
nzContent: ` nzContent: `
请等待${time}秒后自动关闭 请等待${time}秒后自动关闭
` `
}); });
if (!this.datas?.unloadingElectronicsLadingBillFilePath) { if (!this.datas?.unloadingElectronicsLadingBillFilePath) {
this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => { this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => {
if (res) { if (res) {
switch (res[0]?.esignFlowStatus) { switch (res[0]?.esignFlowStatus) {
case 1: case 1:
case '1': case '1':
setTimeout(() => { setTimeout(() => {
this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => {
if(res[0]?.esignFlowStatus == '2') { if (res[0]?.esignFlowStatus == '2') {
this.service.msgSrv.success('电子卸货单已生效!') this.service.msgSrv.success('电子卸货单已生效!');
this.modal.destroy(true); this.modal.destroy(true);
} }
}); });
modal.destroy() modal.destroy();
}, 10000); }, 10000);
return ; return;
case 2: case 2:
modal.destroy();
return;
case '13':
case 13:
this.service.msgSrv.error('签署异常!');
modal.destroy();
return; return;
} }
} }