This commit is contained in:
Taric Xin
2022-01-12 17:49:41 +08:00
parent 5157974d35
commit c918757a6c
2 changed files with 24 additions and 9 deletions

View File

@ -1,7 +1,10 @@
nz-select-top-control {
height: 65px !important;
}
cdk-virtual-scroll-viewport {
height: 100px !important;
app-print-order-modal{
nz-select-top-control {
height: 65px !important;
}
cdk-virtual-scroll-viewport {
height: 100px !important;
}
}

View File

@ -40,8 +40,11 @@ export class PrintOrderModalComponent implements OnInit {
sure() {
if (this.type === 1) {
this.service.request(this.service.$api_create_express, this.vatappcodes).subscribe(res => {
if (res) {
if (res?.length > 0) {
this.getPDF(res);
} else {
this.service.msgSrv.warning('请到快递信息页面打印');
this.modal.destroy(true);
}
});
} else {
@ -60,8 +63,11 @@ export class PrintOrderModalComponent implements OnInit {
delete this.data.scontactInfo.shipperId;
delete this.data.scontactInfo.id;
this.service.request(this.service.$api_get_order_summary, params).subscribe(res => {
if (res) {
if (res?.length > 0) {
this.reviewPDF(res);
} else {
this.service.msgSrv.warning('请到快递信息页面打印');
this.modal.destroy(true);
}
});
}
@ -69,15 +75,21 @@ export class PrintOrderModalComponent implements OnInit {
getPDF(ids: Array<string>) {
this.service.request(this.service.$api_get_print_pdf, ids).subscribe(res => {
if (res) {
if (res?.pdfUrl) {
this.service.msgSrv.success('操作成功');
this.modal.destroy(true);
this.reviewPDF(res);
this.reviewPDF(res.pdfUrl);
} else {
this.service.msgSrv.warning('下载失败');
this.modal.destroy(true);
}
});
}
reviewPDF(url: string) {
if (!url) {
return;
}
const uA = window.navigator.userAgent; // 判断浏览器内核
const isIE =
/msie\s|trident\/|edge\//i.test(uA) &&