diff --git a/inventory-web/src/components/WarehouseSelector.vue b/inventory-web/src/components/WarehouseSelector.vue
new file mode 100644
index 0000000..1a1bea6
--- /dev/null
+++ b/inventory-web/src/components/WarehouseSelector.vue
@@ -0,0 +1,286 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 当前层级无库位数据
+
+
+ -
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/inventory-web/src/views/dashboard/index.vue b/inventory-web/src/views/dashboard/index.vue
index a8aa6a9..0c13d0b 100644
--- a/inventory-web/src/views/dashboard/index.vue
+++ b/inventory-web/src/views/dashboard/index.vue
@@ -214,14 +214,14 @@ const savePrinterConfig = async () => {
// ==================== 库位管理相关 ====================
// 根据层级返回"新增下级"按钮颜色
-// 第1层(顶级)=primary蓝色, 第2层=success绿色, 第3层=warning橙色, 第4层及以上=info灰色
+// el-tree中顶层节点level=1,第1层=primary蓝色,第2层=success绿色,第3层=warning橙色,第4层及以上=danger红色
const getAddBtnType = (level: number) => {
const levelTypes: Record = {
- 0: 'primary', // 第1层(顶级)
- 1: 'success', // 第2层
- 2: 'warning', // 第3层
+ 1: 'primary', // 第1层(顶级)
+ 2: 'success', // 第2层
+ 3: 'warning', // 第3层
}
- return levelTypes[level] || 'info' // 第4层及以上
+ return levelTypes[level] || 'danger' // 第4层及以上
}
const warehouseDialogVisible = ref(false)
diff --git a/inventory-web/src/views/stock/inbound/buy.vue b/inventory-web/src/views/stock/inbound/buy.vue
index cd24a42..1fd2ec4 100644
--- a/inventory-web/src/views/stock/inbound/buy.vue
+++ b/inventory-web/src/views/stock/inbound/buy.vue
@@ -327,21 +327,10 @@
-
-
- {{ data.name }}
-
-
+ :options="warehouseOptions"
+ />
@@ -660,6 +649,7 @@ import {
import {getLabelPreview, executePrint} from '@/api/common/print'
import { getWarehouseTree } from '@/api/common/warehouse'
import WebRtcCamera from '@/components/Camera/WebRtcCamera.vue'
+import WarehouseSelector from '@/components/WarehouseSelector.vue'
import { useUserStore } from '@/stores/user'
// ------------------------------------
diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue
index 807d3e7..ae00ae0 100644
--- a/inventory-web/src/views/stock/inbound/product.vue
+++ b/inventory-web/src/views/stock/inbound/product.vue
@@ -287,21 +287,10 @@
-
-
- {{ data.name }}
-
-
+ :options="warehouseOptions"
+ />
@@ -528,6 +517,7 @@ import {
} from '@/api/inbound/product'
import { uploadFile, deleteFile } from '@/api/inbound/buy'
import WebRtcCamera from '@/components/Camera/WebRtcCamera.vue'
+import WarehouseSelector from '@/components/WarehouseSelector.vue'
import { getLabelPreview, executePrint } from '@/api/common/print'
import { getWarehouseTree } from '@/api/common/warehouse'
import { useUserStore } from '@/stores/user'
diff --git a/inventory-web/src/views/stock/inbound/semi.vue b/inventory-web/src/views/stock/inbound/semi.vue
index 2a50630..be03e34 100644
--- a/inventory-web/src/views/stock/inbound/semi.vue
+++ b/inventory-web/src/views/stock/inbound/semi.vue
@@ -346,21 +346,10 @@
-
-
- {{ data.name }}
-
-
+ :options="warehouseOptions"
+ />
@@ -592,6 +581,7 @@ import {
} from '@/api/inbound/semi'
import { uploadFile, deleteFile } from '@/api/inbound/buy'
import WebRtcCamera from '@/components/Camera/WebRtcCamera.vue'
+import WarehouseSelector from '@/components/WarehouseSelector.vue'
import {getLabelPreview, executePrint} from '@/api/common/print'
import { getWarehouseTree } from '@/api/common/warehouse'
import { useUserStore } from '@/stores/user'