From 53deff7a8e2e70c47d282589b65f56caecdff076 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Tue, 5 Nov 2024 15:26:54 +0800 Subject: [PATCH] =?UTF-8?q?wms=E7=99=BD=E8=83=9A=E5=8E=9F=E6=9D=90?= =?UTF-8?q?=E6=96=99=E9=87=87=E8=B4=AD=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wms/bpprocure/index.vue | 167 ++++++++++++++---------------- 1 file changed, 80 insertions(+), 87 deletions(-) diff --git a/src/views/wms/bpprocure/index.vue b/src/views/wms/bpprocure/index.vue index c2f7c10..cc629c9 100644 --- a/src/views/wms/bpprocure/index.vue +++ b/src/views/wms/bpprocure/index.vue @@ -25,90 +25,10 @@ @keyup.enter.native="handleQuery" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 搜索 重置 - + @@ -144,6 +64,9 @@ v-hasPermi="['wms:bpprocure:remove']" >删除 + + 打印 + - @@ -168,11 +90,7 @@ - - - - - + this.ids.includes(item.ID)); + if (selectedData.length === 0) { + this.$message.warning("请先选择要打印的记录"); + return; + } + + // 生成打印数据 + this.printData = { + printDate: new Date().toLocaleString(), + + workTable: selectedData.map(item => ({ + procureCode: item.procureCode, + materialCode: item.materialCode, + materialDesc: item.materialName, + unit: item.unit, + supplyName: item.supplyName, + planNumber: item.planNumber, + realityNumber: item.realityNumber|| '', + })) + }; +// 打印内容 + let printContent = ` + + 采购单 + + + + 打印日期: ${this.printData.printDate} + + + + + 采购单 + 物料编码 + 物料描述 + 供应商 + 单位 + 计划数量 + 已入库数量 + + + `; + + this.printData.workTable.forEach(item => { + printContent += ` + + ${item.procureCode} + ${item.materialCode} + ${item.materialDesc} + ${item.supplyName} + ${item.unit} + ${item.planNumber} + ${item.realityNumber} + `; + }); + + printContent += ` + + + + `; + + const printWindow = window.open('', '_blank'); + printWindow.document.write('打印'); + printWindow.document.write(printContent); + printWindow.document.write(''); + printWindow.document.close(); + printWindow.print(); + printWindow.close(); + }, + // 其他方法(handleQuery, resetQuery, etc.) + + /** 删除按钮操作 */ handleDelete(row) { const IDs = row.ID || this.ids;