From 3ec188666c645ac47ece05b88852c0503f7c8b0f Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Sat, 22 Aug 2026 11:23:50 +0800 Subject: [PATCH] feat(pl): add blank HTML renderers for inbound and delivery slips Co-authored-by: Cursor --- .../src/utils/pl-delivery-slip-template.ts | 55 +++++++++++++++---- .../src/utils/pl-inbound-slip-template.ts | 49 ++++++++++++++--- 2 files changed, 87 insertions(+), 17 deletions(-) diff --git a/web-admin/src/utils/pl-delivery-slip-template.ts b/web-admin/src/utils/pl-delivery-slip-template.ts index 17b1c07f1..67156441a 100644 --- a/web-admin/src/utils/pl-delivery-slip-template.ts +++ b/web-admin/src/utils/pl-delivery-slip-template.ts @@ -168,11 +168,31 @@ function formatDeliverySlipProductGridCellContent(content: string): string { return plain || ' ' } +/** 空白单据物料空行数(与分装单最小行数对齐) */ +export const BLANK_SLIP_PRODUCT_MIN_ROWS = 5 + +function buildBlankDeliveryProductRow(): string { + const cells = Array.from({ length: 8 }) + .map( + () => + ` ` + ) + .join('\n ') + return `\n ${cells}\n ` +} + function buildProductRows( products: PlanProduct[] = [], planNo = '', - ctx?: DeliverySlipRenderContext + ctx?: DeliverySlipRenderContext, + options?: { blank?: boolean } ): string { + if (options?.blank) { + return Array.from({ length: BLANK_SLIP_PRODUCT_MIN_ROWS }) + .map(() => buildBlankDeliveryProductRow()) + .join('') + } + if (!products.length) { return `暂无产品信息` } @@ -449,7 +469,7 @@ export const DELIVERY_SLIP_PRINT_CSS = ` min-height: 0 !important; height: auto !important; } -.delivery-slip-doc .delivery-slip-seal-block img[alt="印章"] { +.delivery-slip-doc .delivery-slip-seal-block .delivery-slip-seal-img { position: absolute !important; right: 4px !important; top: ${DELIVERY_SLIP_SEAL_TOP}px !important; @@ -571,7 +591,7 @@ export const DELIVERY_SLIP_STYLE_BLOCK = `