From e0d04c86768f86bc27b165234e5e277576b34957 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期二, 18 十一月 2025 15:38:09 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue b/north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue
index 637b8bf..7f834e7 100644
--- a/north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue
+++ b/north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue
@@ -74,19 +74,35 @@
             }
           })
           labelList = a
-          for (let i = 0; i < list.value.length; i++) {
-            let count = list.value[i].data.length
-            for (let j = 0; j < count; j++) {
-              if (detailType==0){
-                for (let k = 0; k < list.value[i].data[j].quantity; k++) {
-                  props.lastList.push(list.value[i].data[j])
+          // 閬嶅巻鍒楄〃锛堟浛鎹� i 涓烘洿璇箟鍖栫殑鍙橀噺鍚嶏級
+          for (const group of list.value) {
+            // 閬嶅巻姣忕粍涓殑鏁版嵁锛堟浛鎹� j锛�
+            for (const item of group.data) {
+              const { quantity, newList } = item;
+              // 璺宠繃 quantity 涓� 0 鎴栨棤鏁堢殑鎯呭喌
+              if (!quantity || quantity <= 0) continue;
+
+              // 澶勭悊 newList锛氱‘淇濇槸鏁扮粍锛屼笉瓒虫椂鐢ㄧ┖瀵硅薄鍏滃簳
+              const safeNewList = Array.isArray(newList) ? newList : [];
+
+              // 寰幆 quantity 娆★紝娣诲姞鏁版嵁鍒� lastList
+              for (let k = 0; k < quantity; k++) {
+                // 娣辨嫹璐� item锛岄伩鍏嶉噸澶嶅紩鐢紙鍏抽敭锛侊級
+                const newItem = JSON.parse(JSON.stringify(item));
+
+                // 鑻� newList 鏈夊搴旂储寮曟暟鎹紝濉厖瀛楁锛涘惁鍒欑疆绌�
+                const listItem = safeNewList[k];
+                if (listItem) {
+                  newItem.heat_layout_sort = listItem.glass_id || ''; // 鍏滃簳绌哄瓧绗︿覆
+                  newItem.stockPolysId = `${listItem.stock_id || ''}/${listItem.polys_id || ''}`; // 閬垮厤 undefined/
+                } else {
+                  // 鏃犲搴旀暟鎹椂锛屽瓧娈电疆绌猴紙閬垮厤淇濈暀鍘熷鍊硷級
+                  newItem.heat_layout_sort = '';
+                  newItem.stockPolysId = '';
                 }
 
-              }
-              else {
-                for (let k = 0; k < list.value[i].data[j].quantity; k++) {
-                props.lastList.push(list.value[i].data[j])
-                }
+                // 娣诲姞鍒扮洰鏍囧垪琛�
+                props.lastList.push(newItem);
               }
             }
           }

--
Gitblit v1.8.0