diff --git a/klp-ui/src/views/wms/coil/panels/base.vue b/klp-ui/src/views/wms/coil/panels/base.vue index e5c49d1d..c2c86195 100644 --- a/klp-ui/src/views/wms/coil/panels/base.vue +++ b/klp-ui/src/views/wms/coil/panels/base.vue @@ -103,7 +103,7 @@ 搜索 重置 导出 - 批量移出发货单 diff --git a/klp-ui/src/views/wms/delivery/components/DugeWayBill1.vue b/klp-ui/src/views/wms/delivery/components/DugeWayBill1.vue index 3c97c812..ba9217ad 100644 --- a/klp-ui/src/views/wms/delivery/components/DugeWayBill1.vue +++ b/klp-ui/src/views/wms/delivery/components/DugeWayBill1.vue @@ -477,16 +477,13 @@ export default { const blob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); - const win = window.open(url, '_blank'); - if (!win) { - this.$message.error('打印失败,请检查浏览器设置'); - // const a = document.createElement('a'); - // a.href = url; - // a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || new Date().getTime()}.pdf`; - // document.body.appendChild(a); - // a.click(); - // document.body.removeChild(a); - } + const a = document.createElement('a'); + a.href = url; + a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || Date.now()}.pdf`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); }, async exportExcel() { try { diff --git a/klp-ui/src/views/wms/delivery/components/DugeWayBill2.vue b/klp-ui/src/views/wms/delivery/components/DugeWayBill2.vue index 12281830..ecded388 100644 --- a/klp-ui/src/views/wms/delivery/components/DugeWayBill2.vue +++ b/klp-ui/src/views/wms/delivery/components/DugeWayBill2.vue @@ -475,16 +475,13 @@ export default { const blob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); - const win = window.open(url, '_blank'); - if (!win) { - this.$message.error('打印失败,请检查浏览器设置'); - // const a = document.createElement('a'); - // a.href = url; - // a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || new Date().getTime()}.pdf`; - // document.body.appendChild(a); - // a.click(); - // document.body.removeChild(a); - } + const a = document.createElement('a'); + a.href = url; + a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || Date.now()}.pdf`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); }, async exportExcel() { try { diff --git a/klp-ui/src/views/wms/delivery/components/ZincWayBill1.vue b/klp-ui/src/views/wms/delivery/components/ZincWayBill1.vue index a29d9d7d..c40e9d26 100644 --- a/klp-ui/src/views/wms/delivery/components/ZincWayBill1.vue +++ b/klp-ui/src/views/wms/delivery/components/ZincWayBill1.vue @@ -477,16 +477,13 @@ export default { const blob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); - const win = window.open(url, '_blank'); - if (!win) { - this.$message.error('打印失败,请检查浏览器设置'); - // const a = document.createElement('a'); - // a.href = url; - // a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || new Date().getTime()}.pdf`; - // document.body.appendChild(a); - // a.click(); - // document.body.removeChild(a); - } + const a = document.createElement('a'); + a.href = url; + a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || Date.now()}.pdf`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); }, async exportExcel() { try { diff --git a/klp-ui/src/views/wms/delivery/components/wayBill.vue b/klp-ui/src/views/wms/delivery/components/wayBill.vue index 4d61c7ea..80445ca5 100644 --- a/klp-ui/src/views/wms/delivery/components/wayBill.vue +++ b/klp-ui/src/views/wms/delivery/components/wayBill.vue @@ -476,16 +476,13 @@ export default { const blob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); - const win = window.open(url, '_blank'); - if (!win) { - this.$message.error('打印失败,请检查浏览器设置'); - // const a = document.createElement('a'); - // a.href = url; - // a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || new Date().getTime()}.pdf`; - // document.body.appendChild(a); - // a.click(); - // document.body.removeChild(a); - } + const a = document.createElement('a'); + a.href = url; + a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || Date.now()}.pdf`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); }, async exportExcelByXLSX() { try { diff --git a/klp-ui/src/views/wms/delivery/components/wayBill2.vue b/klp-ui/src/views/wms/delivery/components/wayBill2.vue index d6ba5d21..40d256cd 100644 --- a/klp-ui/src/views/wms/delivery/components/wayBill2.vue +++ b/klp-ui/src/views/wms/delivery/components/wayBill2.vue @@ -475,16 +475,13 @@ export default { const blob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); - const win = window.open(url, '_blank'); - if (!win) { - this.$message.error('打印失败,请检查浏览器设置'); - // const a = document.createElement('a'); - // a.href = url; - // a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || new Date().getTime()}.pdf`; - // document.body.appendChild(a); - // a.click(); - // document.body.removeChild(a); - } + const a = document.createElement('a'); + a.href = url; + a.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || Date.now()}.pdf`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); }, async exportExcelByXLSX() { try {