From 2b45cbf7bda6239783168afcda0c49036a49143f Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 21 四月 2026 10:06:26 +0800
Subject: [PATCH] Merge branch 'dev_河南_鹤壁天沐玻璃厂' of http://114.132.189.42:9002/r/product-inventory-management into dev_河南_鹤壁天沐玻璃厂
---
src/views/salesManagement/salesLedger/components/processCardPrint.js | 45 +++++++++++++++++++++++++++++++++------------
1 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/components/processCardPrint.js b/src/views/salesManagement/salesLedger/components/processCardPrint.js
index aa50b34..da7d45d 100644
--- a/src/views/salesManagement/salesLedger/components/processCardPrint.js
+++ b/src/views/salesManagement/salesLedger/components/processCardPrint.js
@@ -52,15 +52,28 @@
return columns || '<td class="route-col"></td>';
};
-const renderItems = (items, startIndex, routeNodes, totalCols) => {
+const renderItems = (
+ items,
+ startIndex,
+ routeNodes,
+ totalCols,
+ previousProductName,
+ fallbackProductName
+) => {
const list = Array.isArray(items) ? items : [];
if (list.length === 0) {
return `<tr><td colspan="${totalCols}" style="text-align:center;">鏆傛棤鏄庣粏</td></tr>`;
}
const routeEmptyCells = renderRouteEmptyCells(routeNodes);
+ let lastProductName = String(previousProductName ?? "").trim();
return list
- .map(
- (item, index) => `
+ .map((item, index) => {
+ const currentProductName =
+ String(item?.productDescription ?? "").trim() || fallbackProductName;
+ const shouldRenderProductRow = currentProductName !== lastProductName;
+ lastProductName = currentProductName;
+ return `
+ ${shouldRenderProductRow ? `<tr><td colspan="${totalCols}" class="section-title">浜у搧鍚嶇О:${escapeHtml(currentProductName)}</td></tr>` : ""}
<tr>
<td>${startIndex + index + 1}</td>
<td class="no-wrap">${escapeHtml(item?.floorCode)}</td>
@@ -70,8 +83,8 @@
<td class="no-wrap">${escapeHtml(item?.processRequirement)}</td>
${routeEmptyCells}
</tr>
- `
- )
+ `;
+ })
.join("");
};
@@ -89,8 +102,7 @@
const data = cardData ?? {};
const routeNodes = Array.isArray(data.routeNodes) ? data.routeNodes : [];
const items = Array.isArray(data.items) ? data.items : [];
- const firstItem = items[0] ?? {};
- const productName = firstItem.productDescription || "";
+ const fallbackProductName = String(data?.productName ?? "").trim();
const totalCols = 6 + Math.max(routeNodes.length, 1);
const signLabelCols = 2;
const signBlankCols = Math.max(totalCols - 5 - signLabelCols, 1);
@@ -187,9 +199,15 @@
.map((pageItems, pageIndex) => {
const isLastPage = pageIndex === totalPages - 1;
const startIndex = pageIndex * pageSize;
+ const previousProductName =
+ startIndex > 0
+ ? String(items[startIndex - 1]?.productDescription ?? "").trim() ||
+ fallbackProductName
+ : "";
return `
<div class="page">
<div class="header">
+ <div class="title">楣ゅ澶╂矏閽㈠寲鐜荤拑鍘�<br /><span class="sub-title">鐢熶骇娴佺▼鍗�(鎴愬搧)</span></div>
${
qrDataUrl
? `<div class="qr-block">
@@ -197,7 +215,6 @@
</div>`
: ""
}
- <div class="title">楣ゅ澶╂矏閽㈠寲鐜荤拑鍘�<br /><span class="sub-title">鐢熶骇娴佺▼鍗�(鎴愬搧)</span></div>
</div>
<div class="table-wrap">
<div class="page-mark">绗�${pageIndex + 1}椤碉紝鍏�${totalPages}椤�</div>
@@ -223,10 +240,14 @@
<tr>${renderRouteRow(routeNodes)}</tr>
</thead>
<tbody>
- <tr>
- <td colspan="${totalCols}" class="section-title">浜у搧鍚嶇О:${escapeHtml(productName)}</td>
- </tr>
- ${renderItems(pageItems, startIndex, routeNodes, totalCols)}
+ ${renderItems(
+ pageItems,
+ startIndex,
+ routeNodes,
+ totalCols,
+ previousProductName,
+ fallbackProductName
+ )}
${
isLastPage
? `<tr>
--
Gitblit v1.9.3