From b064621c2a14d241aa77329e9a62af2d596d32c7 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 14:46:51 +0800 Subject: [PATCH] fix bug --- .../voucher-view/voucher-view.component.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts index 5b8fa7ba..efcaeeaf 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -574,20 +574,15 @@ export class orderManagementVoucherViewComponent implements OnInit { } openlaod(value: any) { if (value === 1) { + // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 if (!this.datas?.loadingElectronicsLadingBillFilePath) { this.service.request(this.service.$api_createBillTakeGoods, [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_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { - console.log(res); if(res[0]?.esignFlowStatus == '2') { this.service.msgSrv.success('电子装货单已生效!') this.modal.destroy(true); @@ -604,26 +599,19 @@ export class orderManagementVoucherViewComponent implements OnInit { 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 { - + // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 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); @@ -639,7 +627,6 @@ export class orderManagementVoucherViewComponent implements OnInit { 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); //下载完成移除元素 }