From da5bd5596b1f0f7a27cd0791a17a7fc3b608f523 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期三, 07 五月 2025 18:10:24 +0800
Subject: [PATCH] 工具管理-仓库管理页面开发

---
 src/views/tms/WarehouseTree.vue |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/src/views/tms/WarehouseTree.vue b/src/views/tms/WarehouseTree.vue
index d17e14d..e9a92d7 100644
--- a/src/views/tms/WarehouseTree.vue
+++ b/src/views/tms/WarehouseTree.vue
@@ -170,8 +170,7 @@
       selectedKeys: [],
       expandedKeys: [],
       url: {
-        factoryTreeList: '/base/warehouse/loadTree',
-        getAllSiteList: '/base/site/getAllList',
+        warehouseTreeList: '/tms/warehouse/loadTree'
       },
       searchValue: '',
       dataList: [],
@@ -184,24 +183,9 @@
     }
   },
   created() {
-    this.getAllSiteId();
     this.queryTreeData();
-    this.closeAll();
   },
   methods: {
-    getAllSiteId() {
-      getAction(this.url.getAllSiteList).then((res) => {
-        if (res.success) {
-          let allSiteList = res.result;
-          for (let i = 0; i < allSiteList.length; i++) {
-            const site = allSiteList[i];
-            this.allSiteIds.push(site.id);
-          }
-        } else {
-          this.$message.warn(res.message);
-        }
-      })
-    },
     getCurrSelectedTitle() {
       return !this.currSelected.title ? '' : this.currSelected.title;
     },
@@ -223,12 +207,13 @@
     queryTreeData() {
       this.loading = true;
       this.cardLoading = true;
-      getAction(this.url.factoryTreeList).then((res) => {
+      getAction(this.url.warehouseTreeList).then((res) => {
         if (res.success) {
           this.dataList = [];
           this.allTreeKeys = [];
           this.treeDataSource = res.result;
           this.generateList(res.result);
+          this.expandAll()
         } else {
           this.$message.warn(res.message);
         }
@@ -302,7 +287,7 @@
       this.expandedKeys = this.allTreeKeys;
     },
     closeAll() {
-      this.expandedKeys = this.allSiteIds;
+      this.expandedKeys = []
     },
     refreshTree() {
       this.queryTreeData();
@@ -310,6 +295,11 @@
   },
   mounted() {
     this.$bus.$on('queryTreeData', this.queryTreeData);
+    this.$bus.$on('clearTreeSelection', this.onClearSelected)
+  },
+  beforeDestroy() {
+    this.$bus.$off('queryTreeData', this.queryTreeData);
+    this.$bus.$off('clearTreeSelection', this.onClearSelected)
   },
   //鐩戝惉
   watch: {

--
Gitblit v1.9.3