This commit is contained in:
wangshiming
2022-04-22 14:50:58 +08:00
parent b67401d311
commit 33963ed45d
11 changed files with 431 additions and 238 deletions

View File

@ -4,27 +4,33 @@
* @Author : Shiming
* @Date : 2021-12-15 13:17:42
* @LastEditors : Shiming
* @LastEditTime : 2022-04-21 14:41:44
* @LastEditTime : 2022-04-22 11:03:26
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\audit\\voucher-view\\voucher-view.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div class="sfBox" [ngClass]="Status !== 1 ? 'hideBtn' : ''">
<sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="formData" button="none">
<ng-template sf-template="no0" let-me let-ui="ui" let-schema="schema">
<div style="color: #1890FF" >
<div (click)="openlaod(1)">电子装货单 <span style="color: red;">
<sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="formData" button="none">
<ng-template sf-template="no0" let-me let-ui="ui" let-schema="schema">
<div style="color: #1890ff">
<div (click)="openlaod(1)"
>电子装货单
<!-- <span style="color: red;">
{{datas?.loadingElectronicsLadingBillFilePath ? '已签署' :'未签署'}}
</span></div>
</div>
</ng-template>
<ng-template sf-template="no6" let-me let-ui="ui" let-schema="schema">
<div style="color: #1890FF" (click)="openlaod(2)">电子卸货单<span style="color: red;"> {{datas?.unloadingElectronicsLadingBillFilePath ? '已签署' :'未签署'}}</span></div>
</ng-template>
</sf>
</span> -->
</div>
</div>
</ng-template>
<ng-template sf-template="no6" let-me let-ui="ui" let-schema="schema">
<div style="color: #1890ff" (click)="openlaod(2)"
>电子卸货单
<!-- <span style="color: red;"> {{datas?.unloadingElectronicsLadingBillFilePath ? '已签署' :'未签署'}}</span> -->
</div>
</ng-template>
</sf>
</div>
<div class="modal-footer">
<button nz-button type="button" *ngIf="Status === 1" (click)="close()">关闭</button>
<button nz-button type="submit" *ngIf="Status === 1" nzType="primary" (click)="save(sf.value)" [nzLoading]="http.loading">确定</button>
<button nz-button type="submit" nzType="primary" *ngIf="Status == 2" (click)="sure()" [nzLoading]="http.loading">生成电子单据</button>
<button nz-button type="button" *ngIf="Status === 1" (click)="close()">关闭</button>
<button nz-button type="submit" *ngIf="Status === 1" nzType="primary" (click)="save(sf.value)" [nzLoading]="http.loading">确定</button>
<button nz-button type="submit" nzType="primary" *ngIf="Status == 2" (click)="sure()" [nzLoading]="http.loading">生成电子单据</button>
</div>

View File

@ -575,99 +575,116 @@ export class orderManagementVoucherViewComponent implements OnInit {
}
openlaod(value: any) {
if (value === 1) {
// 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览
let time = 10;
setInterval(function () {
time -= 1;
}, 1000);
const modal = this.modalService.success({
nzTitle: '电子装货单签署中!',
nzContent: `
请等待${time}秒后自动关闭
`
this.service.request(this.service.$api_getBillTakeGoods, {id:this.datas?.id}).subscribe(res => {
if (res) {
console.log(res);
window.open(res?.contractFilePath)
}
});
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}秒后自动关闭
`
this.service.request(this.service.$api_getBillDischargeGoods, {id:this.datas?.id}).subscribe(res => {
if (res) {
console.log(res);
window.open(res?.contractFilePath)
}
});
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); //下载完成移除元素
}
}
}
}
// 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); //下载完成移除元素
// }
// }
// }
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-03 15:31:52
* @LastEditors : Shiming
* @LastEditTime : 2022-04-19 15:16:37
* @LastEditTime : 2022-04-22 10:54:29
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -209,11 +209,14 @@ export class OrderManagementService extends ShipperBaseService {
// 查看补充协议
public $api_getSupplementaryAgreement = `/api/sdc/billShipper/getSupplementaryAgreement`;
// 获取电子提货单签章附件
public $api_getBillTakeEsignFile = `/api/sdc/billOperate/getBillTakeEsignFile`;
// 获取电子卸货单签章附件
public $api_getBillDischargeEsignFile = `/api/sdc/billOperate/getBillDischargeEsignFile`;
// 预览卸货单
public $api_getBillDischargeGoods = `/api/sdc/billOperate/getBillDischargeGoods`;
// 预览提货单
public $api_getBillTakeGoods = `/api/sdc/billOperate/getBillTakeGoods`;
// // 生成卸货单
// public $api_createBillDischargeGoods = `/api/sdc/billOperate/createBillDischargeGoods`;