diff --git a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less index d08fba0d..a9a87774 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less +++ b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less @@ -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; + } } \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts index 52fc3af5..5fe2cddd 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts @@ -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) { 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) &&