refactor(仓库管理): 优化复合架功能并移除无用代码

- 将CoilSelector默认标签页改为'my'
- 为WarehouseBird和WarehouseInterlaced组件添加id属性传递
- 实现复合架功能的条件渲染和权限控制
- 移除废弃的category相关代码和视图
- 在coil/merge.vue中使用WarehouseSelect组件替代原下拉框
This commit is contained in:
砂糖
2025-12-24 10:00:26 +08:00
parent dabc6657e0
commit 9d686b23dc
8 changed files with 44 additions and 333 deletions

View File

@@ -48,7 +48,11 @@
<div class="empty-text">该分类下暂无库位数据</div>
<el-button type="primary" icon="el-icon-plus" @click="openInitDialog">初始化库位</el-button>
</div>
<warehouse-interlaced v-else="warehouseList.length" :columns="columns" @split-warehouse="handleSplitWarehouse" @merge-warehouse="handleMergeWarehouse" />
<warehouse-interlaced
v-else="warehouseList.length"
:id="id" :columns="columns"
@split-warehouse="handleSplitWarehouse"
@merge-warehouse="handleMergeWarehouse" />
</div>
</div>
</template>
@@ -64,6 +68,10 @@ export default {
warehouseList: {
type: Array,
default: () => []
},
id: {
type: String,
default: ''
}
},
data() {

View File

@@ -1,5 +1,6 @@
<template>
<div class="multi-layer-grid" ref="gridContainer">
<el-alert v-if="!isComposite" type="warning" title="当前库区不支持复合架" show-icon></el-alert>
<!-- 列标尺区域 - 添加切换按钮 -->
<div class="col-ruler" :style="{ '--cell-width': `${cellWidth}px` }">
<div class="ruler-empty"></div>
@@ -8,6 +9,7 @@
<span class="column-number">{{ col }}</span>
<!-- 拆分/合并切换按钮 -->
<button class="split-merge-toggle"
v-if="isComposite"
:class="{ 'is-split': getColumnLevel(col) === 4, 'is-merge': getColumnLevel(col) === 3 }"
@click.stop="handleColumnToggle(col)" :title="getColumnLevel(col) === 3 ? '点击切换为小卷状态' : '点击切换为大卷状态'">
<i class="el-icon-s-tools"></i>
@@ -107,10 +109,23 @@ export default {
type: Object,
required: true,
default: () => ({})
},
id: {
type: String,
default: ''
}
},
data() {
return {
// id转换位复合架规则如果不包含在内则不可使用复合架
compositeRules: {
// 测试库区
'2002207449418686465': {
big: 19 * 5,
small: 29 * 5,
rows: [1, 2, 3, 4, 5]
},
},
dialogOpen: false,
currentWarehouse: null,
containerWidth: 0,
@@ -122,6 +137,11 @@ export default {
};
},
computed: {
// 当前的库区是否支持复合架
isComposite() {
// 如果存在id则支持不存在
return this.compositeRules[this.id];
},
sortedColumnKeys() {
return Object.keys(this.columns)
.map(key => Number(key))
@@ -212,6 +232,11 @@ export default {
},
// 处理列拆分/合并状态切换
handleColumnToggle(column) {
// 检查当前ID是否被包含在复合架规则中
if (!this.compositeRules[this.id]) {
this.$message.error('当前库位不支持复合架操作');
return;
}
const currentLevel = this.getColumnLevel(column);
// 切换level3↔4
const newLevel = currentLevel === 3 ? 4 : 3;

View File

@@ -16,6 +16,7 @@
<!-- 导出所有二维码 -->
<!-- <button buttonLoading type="primary" @click="exportAllQrcodes">导出二维码</button> -->
<WarehouseBird
:id="selectedNodeId"
:warehouse-list="warehouseList"
@open-init-dialog="openInitDialog"
@split-warehouse="handleSplitWarehouse"