From 08511191f73b59edc88963dc810c03e934c2dcd8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 17 May 2026 23:15:16 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88wms=EF=BC=89=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20print=20=E9=A1=B6=E9=83=A8=E7=99=BD=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=AF=B9=E9=BD=90=20vue3?= =?UTF-8?q?=20+=20ep=20=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/wms/order/receipt/modules/print.vue | 237 +++++++++--------- 1 file changed, 125 insertions(+), 112 deletions(-) diff --git a/apps/web-antd/src/views/wms/order/receipt/modules/print.vue b/apps/web-antd/src/views/wms/order/receipt/modules/print.vue index a0b98775d..4bb43a4a1 100644 --- a/apps/web-antd/src/views/wms/order/receipt/modules/print.vue +++ b/apps/web-antd/src/views/wms/order/receipt/modules/print.vue @@ -37,6 +37,7 @@ const printRows = computed(() => })), ); +/** 等待条码和打印 DOM 完成绘制,避免浏览器打印到旧内容 */ function waitForPaint() { return new Promise((resolve) => { requestAnimationFrame(() => { @@ -45,10 +46,12 @@ function waitForPaint() { }); } +/** 退出打印模式,恢复当前页面显示 */ function removePrintMode() { document.body.classList.remove('wms-receipt-order-printing'); } +/** 获取打印用字典文案,空值统一显示为横杠 */ function getPrintDictLabel(dictType: string, value?: number) { if (value === undefined || value === null) { return '-'; @@ -56,6 +59,7 @@ function getPrintDictLabel(dictType: string, value?: number) { return getDictLabel(dictType, value) || '-'; } +/** 打印入库单:加载数据后只展示打印区域,再调用浏览器打印 */ async function print(id: number) { const order = await getReceiptOrder(id); const details = order.details || (await getReceiptOrderDetailListByOrderId(id)); @@ -71,126 +75,134 @@ defineExpose({ print });