This commit is contained in:
wangshiming
2022-04-21 14:46:51 +08:00
parent 837d9de547
commit b064621c2a

View File

@ -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); //下载完成移除元素
}