From 34feb4908ec7b7e5b51adf6355603978c67bd3a4 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期四, 05 六月 2025 09:53:14 +0800
Subject: [PATCH] 申请单入库

---
 src/views/tms/WarehouseTree.vue |   36 +++++++++++++++---------------------
 1 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/src/views/tms/WarehouseTree.vue b/src/views/tms/WarehouseTree.vue
index d17e14d..490df2f 100644
--- a/src/views/tms/WarehouseTree.vue
+++ b/src/views/tms/WarehouseTree.vue
@@ -2,7 +2,7 @@
   <a-card
     :loading="cardLoading"
     :bordered="false"
-    title="浠撳簱绠$悊"
+    :title="title"
     style="height: 100%;"
   >
     <a-spin :spinning="loading">
@@ -160,7 +160,13 @@
   components: {
     Tooltip,
   },
-  props: ['value'],
+  props: {
+    value: {},
+    title: {
+      type: String,
+      default: ''
+    }
+  },
   data() {
     return {
       searchInput: '',
@@ -170,8 +176,7 @@
       selectedKeys: [],
       expandedKeys: [],
       url: {
-        factoryTreeList: '/base/warehouse/loadTree',
-        getAllSiteList: '/base/site/getAllList',
+        warehouseTreeList: '/tms/warehouse/loadTree'
       },
       searchValue: '',
       dataList: [],
@@ -184,24 +189,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 +213,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 +293,7 @@
       this.expandedKeys = this.allTreeKeys;
     },
     closeAll() {
-      this.expandedKeys = this.allSiteIds;
+      this.expandedKeys = []
     },
     refreshTree() {
       this.queryTreeData();
@@ -311,6 +302,9 @@
   mounted() {
     this.$bus.$on('queryTreeData', this.queryTreeData);
   },
+  beforeDestroy() {
+    this.$bus.$off('queryTreeData', this.queryTreeData);
+  },
   //鐩戝惉
   watch: {
     currSelected(val) {//鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢

--
Gitblit v1.9.3