From a660db06773007b1be690e0674829c00a57aeb7b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 16:21:23 +0800
Subject: [PATCH] 订单首页流程卡新增楼层编号显示

---
 north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue |   94 +++++++++++++++++-----------------------------
 1 files changed, 35 insertions(+), 59 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 0467bcf..badc31c 100644
--- a/north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
+++ b/north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
@@ -55,19 +55,7 @@
 
 let name=company.companyName
 let replenishQRCode=company.replenishQRCode
-//鍘婚櫎閲嶅瀵硅薄
-// let uniqueObjects = {};
-// // 閬嶅巻鍘熷鏁版嵁鏁扮粍
-// data.value.printList.forEach(obj => {
-//   // 鏋勫缓涓�涓敮涓�閿紝渚嬪 'NG24071502A001_1'
-//   let key = `${obj.process_id}_${obj.technology_number}_${obj.order_number}`;
-//
-//   // 濡傛灉璇ラ敭涓嶅瓨鍦ㄤ簬 uniqueObjects 涓紝鍒欏皢璇ュ璞℃坊鍔犲埌 uniqueObjects 涓�
-//   if (!uniqueObjects[key]) {
-//     uniqueObjects[key] = obj;
-//   }
-// });
-// data.value.printList = Object.values(uniqueObjects);
+
 let flowCardCount = null
 onMounted(() => {
   request.post(`/processCard/getSelectPrintingRefund/${merge}/${like}/${mergeTechnologyNumber}`, data.value).then((res) => {
@@ -95,43 +83,13 @@
             });
             produceList.value[j].detail[0].weight = sumWeight
           }
-          //澶勭悊鍚堝苟鎵撳嵃
-          // if (printMerge !== null && printMerge !== undefined && printMerge !== "") {
-          //
-          //   produceList.value.forEach(item => {
-          //     item.detail[0].technologyNumber = printMerge;
-          //   });
-          //
-          //   //鍚堝苟鎵撳嵃宸ヨ壓娴佺▼澶勭悊
-          //   if (like == null) {
-          //     let process = produceList.value[0].detail[0].process
-          //     console.log(process)
-          //     let indexOfJiaJiao = process.indexOf('澶硅兌');
-          //     if (indexOfJiaJiao !== -1) {
-          //       // 浣跨敤 substring 鎴彇 "澶硅兌" 鍚庨潰鐨勯儴鍒嗭紝鍖呮嫭 "澶硅兌" 鏈韩
-          //       let afterJiaJiao = process.substring(indexOfJiaJiao).trim();
-          //       produceList.value.forEach(item => {
-          //         item.detail[0].process = afterJiaJiao
-          //       })
-          //     }
-          //
-          //     let indexOfProceList = produceList.value[0].processList
-          //     let getProceList = indexOfProceList.findIndex(item => item.process === '澶硅兌');
-          //
-          //     if (getProceList !== -1) {
-          //       // 浣跨敤 filter 鏂规硶杩囨护鍑� "澶硅兌" 鍙婂叾涔嬪悗鐨勫璞�
-          //       produceList.value[0].processList = indexOfProceList.filter((item, index) => index >= getProceList);
-          //     }
-          //   }
-          // }
-
 
           produceList.value.forEach(item => {
             let technologyNumberMerge = printMerge.split('').join(',');
             item.detail[0].technologyNumberMerge = technologyNumberMerge
           })
           //澶勭悊缂栧彿鍒�
-          //瀹氫箟瀛樻斁缂栧彿鏁扮粍
+          //瀹氫箟瀛樻斁缂栧彿鏁扮粍 澶╂触
           const s01Values = [];
           for (let i = 0; i < produceList.value.length; i++) {
             const s01Values = [];
@@ -152,28 +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
+          }, {})
 
           // 灏嗗悎骞跺悗鐨勫璞¤浆鎹㈠洖鏁扮粍
-          produceList.value = Object.values(mergedData);
-
+          //if (company.printReplenishMerge){
+            produceList.value = Object.values(mergedData);
+          //}
            flowCardCount=produceList.value.length
 
           handleSummary()
@@ -191,12 +162,15 @@
     }
 )
 
+const techNumberLength = ref()
+const qrcodeLength =ref()
 const handleGetQRCode = async () => {
   for (let i = 0; i < produceList.value.length; i++) {
     const detailItem = produceList.value[i].detail[0];
     const detailList = produceList.value[i].detailList;
 
     const mergeTechNumber = detailItem.mergeTechnologyNumber.toString();
+
     const processId = detailItem.process_id;
 
     detailItem.qrcodeList = [];
@@ -292,7 +266,7 @@
               <span v-if="name=='澶╂触鍖楃幓鐜荤拑宸ヤ笟鎶�鏈湁闄愬叕鍙革紙TJBB-QR7.1-01锛�'" style="font-size: 10px">{{itemFlow.otherRemarks}}</span>
               娴佺▼鍗″彿锛� {{
                 itemFlow.process_id
-              }}/{{ itemFlow.technologyNumber }} 鍏� {{ item.count }} 鏋�
+              }}/{{ itemFlow.technologyNumber }}
             </div>
           </div>
         </td>
@@ -310,9 +284,11 @@
         <td class="tdNowrap">纾ㄨ竟绫诲瀷锛�</td>
         <td colspan="3">{{ itemTr.edging_type }}</td>
         <td class="tdNowrap">鍗曠墖鍚嶇О锛�</td>
-        <td colspan="8">{{ itemTr.glass_child }}</td>
+        <td v-if="itemTr.qrcodeList.length*1>1" colspan="8">澶氬眰鍚堝苟锛岃鎯呰浜у搧鍚嶇О</td>
+        <td v-else colspan="8">{{ itemTr.glass_child }}</td>
         <td class="tdNowrap">浜у搧鍚嶇О锛�</td>
-        <td :colspan="2+item.processList.length*2">{{ itemTr.product_name }}</td>
+        <td v-if="!company.processFontSize" :colspan="2+item.processList.length*2">{{ itemTr.product_name }}</td>
+        <td v-else :colspan="2+item.processList.length*2" style="font-size: 18px;">{{ itemTr.product_name }}</td>
       </tr>
       <tr>
         <td rowspan='2'>搴忓彿</td>

--
Gitblit v1.8.0