From 8905bdd0a74c4bd6cabc206c36a299341488041e Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期四, 11 九月 2025 11:00:26 +0800
Subject: [PATCH] 合并设备借出与归还流程,增加借出归还列表详情功能

---
 src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue b/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue
index 59f6ec8..66e73b0 100644
--- a/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue
+++ b/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue
@@ -24,7 +24,7 @@
           <a-tree-select v-model="model.leanDepartId"
                          :disabled="disableSubmit"
                          style="width: 100%"
-                         :tree-data="treeData"
+                         :tree-data="treeDataAlias"
                          :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                          placeholder="璇烽�夋嫨鍊熷叆杞﹂棿"
                          allow-clear
@@ -67,6 +67,7 @@
         },
         confirmLoading: false,
         treeData: [],
+        treeDataAlias: [],
         validatorRules:{
           equipmentId: [
             { required: true, message: '璇烽�夋嫨璁惧锛�' }
@@ -147,12 +148,43 @@
         getAction(this.url.loadProductionOptions).then(res => {
           if (res.success) {
             this.treeData = [...res.result]
+            this.treeDataAlias = this.deepCopyAndModify(res.result)
           }else {
             that.$message.warning(res.message)
           }
         })
       },
+      deepCopyAndModify(arr) {
+        // 濡傛灉褰撳墠鍏冪礌涓嶆槸鏁扮粍鎴栧璞★紝鐩存帴杩斿洖
+        if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) {
+          return arr;
+        }
 
+        // 濡傛灉鏄暟缁勶紝鍒涘缓涓�涓柊鏁扮粍骞堕�掑綊澶勭悊姣忎釜鍏冪礌
+        if (Array.isArray(arr)) {
+          const newArray = [];
+          for (let i = 0; i < arr.length; i++) {
+            newArray.push(this.deepCopyAndModify(arr[i]));
+          }
+          return newArray;
+        }
+
+        // 濡傛灉鏄璞★紝鍒涘缓涓�涓柊瀵硅薄骞堕�掑綊澶勭悊姣忎釜灞炴��
+        const newObj = {};
+        for (const key in arr) {
+          if (arr.hasOwnProperty(key)) {
+            if(key === 'selectable') {
+              newObj[key] = true;
+            } else if(key === 'children') {
+              newObj[key] = this.deepCopyAndModify(arr[key]);
+            }else {
+              newObj[key] = arr[key];
+            }
+
+          }
+        }
+        return newObj;
+      }
     }
   }
 </script>

--
Gitblit v1.9.3