From 08dec15614aca4b9f1cf766b65d1ad608293d9fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com>
Date: Tue, 30 Jun 2026 10:02:27 +0800
Subject: [PATCH] =?UTF-8?q?feat(wms-warehouse):=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E9=92=A2=E5=8D=B7=E5=8F=B3=E9=94=AE=E9=A2=86=E6=96=99=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
新增仓库视图右键菜单触发钢卷选择弹窗,支持平面视图和3D视图右键选中钢卷,实现快速领料流程,包含领料弹窗、工序选择和接口调用逻辑
---
.../layout/components/Sidebar/SidebarItem.vue | 6 -
klp-ui/src/store/modules/permission.js | 3 -
.../wms/warehouse/components/Warehouse3D.vue | 39 ++++-
.../warehouse/components/WarehouseBird.vue | 6 +-
.../components/WarehouseInterlaced.vue | 16 +-
klp-ui/src/views/wms/warehouse/overview.vue | 156 +++++++++++++++++-
6 files changed, 209 insertions(+), 17 deletions(-)
diff --git a/klp-ui/src/layout/components/Sidebar/SidebarItem.vue b/klp-ui/src/layout/components/Sidebar/SidebarItem.vue
index 60d39e8b9..d69c49331 100644
--- a/klp-ui/src/layout/components/Sidebar/SidebarItem.vue
+++ b/klp-ui/src/layout/components/Sidebar/SidebarItem.vue
@@ -91,20 +91,14 @@ export default {
return this.findFirstLeaf(this.item, this.basePath)
},
menuStyle() {
- console.log('[SidebarItem] 完整 item 对象:', JSON.parse(JSON.stringify(this.item)))
- console.log('[SidebarItem] item.meta:', this.item.meta)
- console.log('[SidebarItem] item.meta?.style 原始值:', this.item.meta && this.item.meta.style)
if (this.item.meta && this.item.meta.style) {
try {
const parsed = JSON.parse(this.item.meta.style)
- console.log('[SidebarItem] ✅ menuStyle 解析成功:', parsed)
return parsed
} catch (e) {
- console.warn('[SidebarItem] ❌ JSON.parse 失败:', e)
return {}
}
}
- console.log('[SidebarItem] ⚠️ item.meta.style 为空,返回 {}')
return {}
}
},
diff --git a/klp-ui/src/store/modules/permission.js b/klp-ui/src/store/modules/permission.js
index 512229fbc..17129d557 100644
--- a/klp-ui/src/store/modules/permission.js
+++ b/klp-ui/src/store/modules/permission.js
@@ -49,13 +49,10 @@ const permission = {
arr.forEach(item => {
const title = (item.meta && item.meta.title) || item.name || ''
const styleVal = item.meta && item.meta.style
- console.log('[permission] depth=' + depth, title, 'meta.style=', styleVal)
if (item.children) logMetaStyle(item.children, depth + 1)
})
}
- console.log('[permission] === getRouters 原始数据 ===')
logMetaStyle(res.data)
- console.log('[permission] === getRouters 数据结束 ===')
const sdata = JSON.parse(JSON.stringify(res.data))
const rdata = JSON.parse(JSON.stringify(res.data))
const sidebarRoutes = filterAsyncRouter(sdata)
diff --git a/klp-ui/src/views/wms/warehouse/components/Warehouse3D.vue b/klp-ui/src/views/wms/warehouse/components/Warehouse3D.vue
index 79b46aa65..65dec88fc 100644
--- a/klp-ui/src/views/wms/warehouse/components/Warehouse3D.vue
+++ b/klp-ui/src/views/wms/warehouse/components/Warehouse3D.vue
@@ -92,7 +92,8 @@
+ @click="showCoilDetail(c.id)"
+ @contextmenu.prevent="handleRowRightClick(c)">
| {{ c.posKey }} L{{ c.layer }} |
{{ c.coilNo }} |
{{ c.specification }} |
@@ -306,6 +307,7 @@ export default {
const dom = this.renderer.domElement;
dom.addEventListener('click', this.onCanvasClick);
+ dom.addEventListener('contextmenu', this.onContextMenu);
dom.addEventListener('mousedown', this.onMouseDown);
dom.addEventListener('mousemove', this.onMouseMove);
dom.addEventListener('mouseup', this.onMouseUp);
@@ -608,6 +610,32 @@ export default {
this.closeDetail();
},
+ onContextMenu(e) {
+ e.preventDefault();
+ const rect = this.renderer.domElement.getBoundingClientRect();
+ this.mouseVec.x = ((e.clientX - rect.left) / rect.width) * 2 - 1;
+ this.mouseVec.y = -((e.clientY - rect.top) / rect.height) * 2 + 1;
+ this.raycaster.setFromCamera(this.mouseVec, this.camera);
+ const targets = [];
+ this.scene.traverse((o) => { if (o.userData && o.userData.coilId) targets.push(o); });
+ const hits = this.raycaster.intersectObjects(targets, true);
+ if (hits.length > 0) {
+ let obj = hits[0].object;
+ while (obj.parent && !(obj.userData && obj.userData.coilId)) obj = obj.parent;
+ if (obj.userData && obj.userData.coilId) {
+ const coil = this.coilList.find(c => c.id === obj.userData.coilId);
+ if (coil) {
+ this.$emit('coil-selected', {
+ coilId: coil.id,
+ currentCoilNo: coil.coilNo,
+ warehouseId: coil.warehouseId,
+ warehouseName: coil.warehouseName,
+ });
+ }
+ }
+ }
+ },
+
async showCoilDetail(cid) {
const coil = this.coilList.find((c) => c.id === cid);
if (!coil) return;
@@ -638,6 +666,15 @@ export default {
}
},
+ handleRowRightClick(coil) {
+ this.$emit('coil-selected', {
+ coilId: coil.id,
+ currentCoilNo: coil.coilNo,
+ warehouseId: coil.warehouseId,
+ warehouseName: coil.warehouseName,
+ });
+ },
+
closeDetail() {
this.detail = null;
this.applyHighlight();
diff --git a/klp-ui/src/views/wms/warehouse/components/WarehouseBird.vue b/klp-ui/src/views/wms/warehouse/components/WarehouseBird.vue
index 0c32f7178..bf9c578d6 100644
--- a/klp-ui/src/views/wms/warehouse/components/WarehouseBird.vue
+++ b/klp-ui/src/views/wms/warehouse/components/WarehouseBird.vue
@@ -80,7 +80,7 @@
+ @release-warehouse="handleReleaseWarehouse" @coil-selected="handleCoilSelected" />
@@ -179,6 +179,10 @@ export default {
handleReleaseWarehouse(warehouse) {
this.$emit('release-warehouse', warehouse);
},
+
+ handleCoilSelected(coil) {
+ this.$emit('coil-selected', coil);
+ },
/**
* 解析第三级库位编码
* 新规则:
diff --git a/klp-ui/src/views/wms/warehouse/components/WarehouseInterlaced.vue b/klp-ui/src/views/wms/warehouse/components/WarehouseInterlaced.vue
index 0755ecb0d..b26010291 100644
--- a/klp-ui/src/views/wms/warehouse/components/WarehouseInterlaced.vue
+++ b/klp-ui/src/views/wms/warehouse/components/WarehouseInterlaced.vue
@@ -41,7 +41,8 @@
}">
+ :class="{ disabled: warehouse.isEnabled === 0, error: warehouse.isEnabled === 0 && warehouse.currentCoilNo == null }" @click.stop="handleCellClick(warehouse)"
+ @contextmenu.prevent.stop="handleCellContextMenu(warehouse)">
{{ warehouse.actualWarehouseName || '-' }}
{{ warehouse.currentCoilNo || '-' }}
@@ -61,7 +62,8 @@
:class="{ disabled: warehouse.isEnabled === 0, error: warehouse.isEnabled === 0 && warehouse.currentCoilNo == null }" :style="{
transform: `translateY(var(--offset-value))`,
position: 'relative'
- }" @click.stop="handleCellClick(warehouse)">
+ }" @click.stop="handleCellClick(warehouse)"
+ @contextmenu.prevent.stop="handleCellContextMenu(warehouse)">
{{ warehouse.actualWarehouseName || '-' }}
{{ warehouse.currentCoilNo || '-' }}
@@ -433,6 +435,16 @@ export default {
this.currentWarehouse = { ...warehouse };
this.dialogOpen = true;
},
+
+ handleCellContextMenu(warehouse) {
+ if (!warehouse.coilId) return;
+ this.$emit('coil-selected', {
+ coilId: warehouse.coilId,
+ currentCoilNo: warehouse.currentCoilNo,
+ warehouseId: warehouse.actualWarehouseId,
+ warehouseName: warehouse.actualWarehouseName || warehouse.actualWarehouseCode,
+ });
+ },
handleSplitWarehouse(payload) {
this.$emit('split-warehouse', payload);
},
diff --git a/klp-ui/src/views/wms/warehouse/overview.vue b/klp-ui/src/views/wms/warehouse/overview.vue
index f0f1f9592..09d305a43 100644
--- a/klp-ui/src/views/wms/warehouse/overview.vue
+++ b/klp-ui/src/views/wms/warehouse/overview.vue
@@ -13,7 +13,7 @@
-
+
-
+
@@ -36,6 +38,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认领料
+
+
+
@@ -71,6 +96,9 @@