From 656639f2467ba384f035932c2042de516141ae24 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Fri, 22 Apr 2022 15:35:14 +0800 Subject: [PATCH] fix bug --- .../voucher-view/voucher-view.component.html | 6 +- .../voucher-view/voucher-view.component.ts | 171 +++++++----------- 2 files changed, 72 insertions(+), 105 deletions(-) diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html index dc423d83..99fd484e 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html @@ -4,14 +4,14 @@ * @Author : Shiming * @Date : 2021-12-15 13:17:42 * @LastEditors : Shiming - * @LastEditTime : 2022-04-22 11:03:26 + * @LastEditTime : 2022-04-22 15:27:20 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\audit\\voucher-view\\voucher-view.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. -->
-
+
电子装货单
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 c8ae7969..80ec4a45 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 @@ -509,11 +509,75 @@ export class orderManagementVoucherViewComponent implements OnInit { }); } sure() { - const params = [this.i?.id]; - this.service.downloadFile(this.service.$api_createBillTakeGoods, params); - this.service.downloadFile(this.service.$api_createBillDischargeGoods, params); - this.service.msgSrv.success('生成电子单据成功!'); - this.modal.destroy(true); + // const params = [this.i?.id]; + // this.service.downloadFile(this.service.$api_createBillTakeGoods, params); + // this.service.downloadFile(this.service.$api_createBillDischargeGoods, params); + // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 + let time = 10; + setInterval(function () { + time -= 1; + }, 1000); + const modal = this.modalService.success({ + nzTitle: '电子装货单和电子卸货单签署中!', + nzContent: ` + 请等待${time}秒后自动关闭 + ` + }); + this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => { + if (res) { + switch (res[0]?.esignFlowStatus) { + case 1: + case '1': + setTimeout(() => { + this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { + if (res[0]?.esignFlowStatus == '2') { + } + }); + }, 9000); + return; + case 2: + return; + case '13': + default: + this.service.msgSrv.error('电子装货单签署异常!'); + modal.destroy(); + return; + } + } else { + this.service.msgSrv.error('电子装货单签署异常!'); + modal.destroy(); + } + }); + this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => { + if (res) { + switch (res[0]?.esignFlowStatus) { + case 1: + case '1': + setTimeout(() => { + this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { + if (res[0]?.esignFlowStatus == '2') { + this.service.msgSrv.success('生成电子单据成功!'); + this.modal.destroy(true); + } + }); + modal.destroy(); + }, 9000); + + return; + case 2: + modal.destroy(); + return; + default: + this.service.msgSrv.error('电子卸货单签署异常!'); + modal.destroy(); + return; + } + } else { + this.service.msgSrv.error('电子卸货单签署异常!'); + modal.destroy(); + } + }); + } // 确认到车界面信息(两个只能看的图片) initData() { @@ -590,101 +654,4 @@ export class orderManagementVoucherViewComponent implements OnInit { }); } } - // openlaod2(value: any) { - // if (value === 1) { - // // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 - // let time = 10; - // setInterval(function () { - // time -= 1; - // }, 1000); - // const modal = this.modalService.success({ - // nzTitle: '电子装货单签署中!', - // nzContent: ` - // 请等待${time}秒后自动关闭 - // ` - // }); - // if (!this.datas?.loadingElectronicsLadingBillFilePath) { - // this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => { - // if (res) { - // switch (res[0]?.esignFlowStatus) { - // case 1: - // case '1': - // setTimeout(() => { - // this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { - // if (res[0]?.esignFlowStatus == '2') { - // this.service.msgSrv.success('电子装货单已生效!'); - // this.modal.destroy(true); - // } - // }); - // modal.destroy(); - // }, 10000); - // return; - // case 2: - // modal.destroy(); - // return; - // case '13': - // case 13: - // this.service.msgSrv.error('签署异常!'); - // modal.destroy(); - // return; - // } - // } - // }); - // } else { - // const a = document.createElement('a'); - // a.href = this.datas?.loadingElectronicsLadingBillFilePath; - // document.body.appendChild(a); - // a.click(); //点击下载 - // document.body.removeChild(a); //下载完成移除元素 - // } - // } else { - // // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 - // let time = 10; - // setInterval(function () { - // time -= 1; - // }, 1000); //反复执行函数本身 - // const modal = this.modalService.success({ - // nzTitle: '电子卸货单签署中!', - // nzContent: ` - // 请等待${time}秒后自动关闭 - // ` - // }); - // if (!this.datas?.unloadingElectronicsLadingBillFilePath) { - // this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => { - // if (res) { - // switch (res[0]?.esignFlowStatus) { - // case 1: - // case '1': - // setTimeout(() => { - // this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { - // if (res[0]?.esignFlowStatus == '2') { - // this.service.msgSrv.success('电子卸货单已生效!'); - // this.modal.destroy(true); - // } - // }); - // modal.destroy(); - // }, 10000); - - // return; - // case 2: - // modal.destroy(); - - // return; - // case '13': - // case 13: - // this.service.msgSrv.error('签署异常!'); - // modal.destroy(); - // return; - // } - // } - // }); - // } else { - // const a = document.createElement('a'); - // a.href = this.datas?.unloadingElectronicsLadingBillFilePath; - // document.body.appendChild(a); - // a.click(); //点击下载 - // document.body.removeChild(a); //下载完成移除元素 - // } - // } - // } }