From c6d13e58d85fbaaceb49d4c24401b50143050173 Mon Sep 17 00:00:00 2001
From: zhang_12370 <z2864490065@outlook.com>
Date: 星期四, 26 六月 2025 18:01:24 +0800
Subject: [PATCH] 调整 基础管理煤种生产人 更改采购数计算逻辑 处理供应商数据回显问题

---
 src/views/archiveManagement/index.vue |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/views/archiveManagement/index.vue b/src/views/archiveManagement/index.vue
index c3e56e4..7bcbed9 100644
--- a/src/views/archiveManagement/index.vue
+++ b/src/views/archiveManagement/index.vue
@@ -201,21 +201,21 @@
     ElMessage.error("鎿嶄綔澶辫触锛岃绋嶅悗閲嶈瘯");
   }
 };
-// 褰撳墠缁勪欢鐨勬暟鎹�
-const initTreeData = ref([]); // 鏍戝舰鏁版嵁
+
 const centerDialogVisible = (val) => {
   dialogVisible.value = val;
 };
 const tableSwitch = ref(false);
 // 澶勭悊鑺傜偣鐐瑰嚮
 const handleNodeClick = (data) => {
-  initTreeData.value = data || [];
+  rowClickData.value = data; // 瀛樺偍褰撳墠鐐瑰嚮鐨勮妭鐐规暟鎹�
   tableSwitch.value = true;
   // 鍒囨崲鑺傜偣鏃堕噸缃埌绗竴椤�
   queryParams.current = 1;
   queryParams.treeId = data.id;
   getArchiveListData();
 };
+const rowClickData = ref({}); // 瀛樺偍褰撳墠鐐瑰嚮鐨勮妭鐐规暟鎹�
 const archiveDialogs = ref(null); // 琛ㄦ牸缁勪欢寮曠敤
 // 鏂板褰掓。
 const add = () => {
@@ -227,7 +227,7 @@
     // 纭繚缁勪欢寮曠敤瀛樺湪鍚庡啀璋冪敤鏂规硶
     nextTick(() => {
       if (archiveDialogs.value && typeof archiveDialogs.value.initForm === 'function') {
-        archiveDialogs.value.initForm(initTreeData); // 閲嶇疆琛ㄥ崟
+        archiveDialogs.value.initForm(rowClickData.value); // 閲嶇疆琛ㄥ崟
       }
     });
   } catch (error) {
@@ -489,15 +489,16 @@
     const hasChildren = data.children;
     const nodeKey = data.id || data;
     const node = treeRef.value?.getNode(nodeKey);
-    const isExpanded = node?.expanded;
-    
-    // 濡傛灉鏈夊瓙绾т笖鏈睍寮�锛屽厛灞曞紑鑺傜偣
+    const isExpanded = node?.expanded; // 濡傛灉鏈夊瓙绾т笖鏈睍寮�锛屽厛灞曞紑鑺傜偣
     if (hasChildren && !isExpanded) {
-      if (treeRef.value && treeRef.value.store && treeRef.value.store.nodesMap[nodeKey]) {
+      if (
+          treeRef.value &&
+          treeRef.value.store &&
+          treeRef.value.store.nodesMap[nodeKey]
+      ) {
         treeRef.value.store.nodesMap[nodeKey].expanded = true;
       }
     }
-    
     const newNode = {
       name: "鏂板瓙鑺傜偣",
       isEdit: true,
@@ -508,12 +509,6 @@
     }
     data.children.push(newNode);
     newName.value = "鏂板瓙鑺傜偣";
-
-    // 纭繚鐖惰妭鐐瑰睍寮�
-    if (node) {
-      node.expanded = true;
-      expandParentNodes(node);
-    }
 
     // 鏍规嵁鏄惁闇�瑕佸睍寮�鏉ュ喅瀹氬欢杩熸椂闂�
     const delay = hasChildren && !isExpanded ? 200 : 50;

--
Gitblit v1.9.3