From 748e47eb02e874e521500b24f5444d6dbaeda3b8 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期四, 25 十二月 2025 11:46:04 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue b/north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
index c8474ee..badc31c 100644
--- a/north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
+++ b/north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
@@ -110,30 +110,41 @@
 
           }
 
-          // 浣跨敤涓�涓璞℃潵瀛樺偍鍚堝苟鍚庣殑缁撴灉
           const mergedData = produceList.value.reduce((acc, item) => {
-            const processId = item.detail[0].process_id;
+            // detail 涓虹┖鐩存帴璺宠繃
+            const firstDetail = item?.detail?.[0]
+            if (!firstDetail) return acc
 
-            // 濡傛灉璇� process_id 灏氭湭鍦� acc 涓紝鍒濆鍖栧叾鏁扮粍
-            if (!acc[processId]) {
-              acc[processId] = {
+            const processId = firstDetail.process_id
+            const technologyNumber = firstDetail.technologyNumber
+
+            const key = company.printReplenishMerge
+                ? processId
+                : `${processId}_${technologyNumber}`
+
+            // 鍒濆鍖栧垎缁�
+            if (!acc[key]) {
+              acc[key] = {
+                processId,
+                technologyNumber,
                 processList: item.processList,
                 detailList: [],
                 detail: item.detail
-              };
+              }
             }
 
-            // 鍚堝苟 detailList
-            acc[processId].detailList = acc[processId].detailList.concat(item.detailList);
+            //  鍚堝苟 detailList
+            if (Array.isArray(item.detailList) && item.detailList.length) {
+              acc[key].detailList.push(...item.detailList)
+            }
 
-            return acc;
-          }, {});
+            return acc
+          }, {})
 
           // 灏嗗悎骞跺悗鐨勫璞¤浆鎹㈠洖鏁扮粍
-
-          if (company.printReplenishMerge){
+          //if (company.printReplenishMerge){
             produceList.value = Object.values(mergedData);
-          }
+          //}
            flowCardCount=produceList.value.length
 
           handleSummary()

--
Gitblit v1.8.0