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;