fix bug
This commit is contained in:
		| @ -574,20 +574,15 @@ export class orderManagementVoucherViewComponent implements OnInit { | |||||||
|   } |   } | ||||||
|   openlaod(value: any) { |   openlaod(value: any) { | ||||||
|     if (value === 1) { |     if (value === 1) { | ||||||
|  |       // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 | ||||||
|       if (!this.datas?.loadingElectronicsLadingBillFilePath) { |       if (!this.datas?.loadingElectronicsLadingBillFilePath) { | ||||||
|         this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => { |         this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => { | ||||||
|           console.log(res); |  | ||||||
|           if (res) { |           if (res) { | ||||||
|             console.log(res[0].esignFlowStatus); |  | ||||||
|              |  | ||||||
|             switch (res[0]?.esignFlowStatus) { |             switch (res[0]?.esignFlowStatus) { | ||||||
|               case 1: |               case 1: | ||||||
|               case '1': |               case '1': | ||||||
|                 console.log(res[0]?.esignFlowStatus); |  | ||||||
|                  |  | ||||||
|                 this.service.msgSrv.success('电子装货单签署中!') |                 this.service.msgSrv.success('电子装货单签署中!') | ||||||
|                 this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { |                 this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { | ||||||
|                   console.log(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); | ||||||
| @ -604,26 +599,19 @@ export class orderManagementVoucherViewComponent implements OnInit { | |||||||
|         const a = document.createElement('a'); |         const a = document.createElement('a'); | ||||||
|         a.href = this.datas?.loadingElectronicsLadingBillFilePath; |         a.href = this.datas?.loadingElectronicsLadingBillFilePath; | ||||||
|         document.body.appendChild(a); |         document.body.appendChild(a); | ||||||
|         console.log(document.body.contains(a)); |  | ||||||
|         a.click(); //点击下载 |         a.click(); //点击下载 | ||||||
|         document.body.removeChild(a); //下载完成移除元素 |         document.body.removeChild(a); //下载完成移除元素 | ||||||
|       } |       } | ||||||
|     } else { |     } else { | ||||||
|  |    // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 | ||||||
|       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 => { | ||||||
|           console.log(res); |  | ||||||
|           if (res) { |           if (res) { | ||||||
|             console.log(res[0].esignFlowStatus); |  | ||||||
|              |  | ||||||
|             switch (res[0]?.esignFlowStatus) { |             switch (res[0]?.esignFlowStatus) { | ||||||
|               case 1: |               case 1: | ||||||
|               case '1': |               case '1': | ||||||
|                 console.log(res[0]?.esignFlowStatus); |  | ||||||
|                  |  | ||||||
|                 this.service.msgSrv.success('电子卸货单签署中!') |                 this.service.msgSrv.success('电子卸货单签署中!') | ||||||
|                 this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { |                 this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { | ||||||
|                   console.log(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); | ||||||
| @ -639,7 +627,6 @@ export class orderManagementVoucherViewComponent implements OnInit { | |||||||
|         const a = document.createElement('a'); |         const a = document.createElement('a'); | ||||||
|         a.href = this.datas?.unloadingElectronicsLadingBillFilePath; |         a.href = this.datas?.unloadingElectronicsLadingBillFilePath; | ||||||
|         document.body.appendChild(a); |         document.body.appendChild(a); | ||||||
|         console.log(document.body.contains(a)); |  | ||||||
|         a.click(); //点击下载 |         a.click(); //点击下载 | ||||||
|         document.body.removeChild(a); //下载完成移除元素 |         document.body.removeChild(a); //下载完成移除元素 | ||||||
|       } |       } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user