feat(仓库管理): 添加库位释放功能并优化组件交互
新增库位释放功能,允许用户释放被占用的库位。主要变更包括: 1. 在 WarehouseBird 和 WarehouseInterlaced 组件中添加 canRelease 和 canToggle 属性控制功能可见性 2. 实现库位释放逻辑,包括确认弹窗和 API 调用 3. 新增 release.vue 页面专门处理库位释放操作 4. 删除不再使用的 WarehouseGrid 组件 5. 优化组件间事件传递和状态管理 同时调整了相关组件的交互逻辑,提升用户体验
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<span class="column-number">{{ col }}</span>
|
||||
<!-- 拆分/合并切换按钮 -->
|
||||
<button class="split-merge-toggle"
|
||||
v-if="isComposite && splitColumns.includes(Number(col))"
|
||||
v-if="canToggle && isComposite && splitColumns.includes(Number(col))"
|
||||
: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>
|
||||
@@ -89,6 +89,7 @@
|
||||
<el-tag :type="currentWarehouse.isEnabled === 1 ? 'success' : 'danger'">
|
||||
{{ currentWarehouse.isEnabled === 1 ? '未占用' : currentWarehouse.currentCoilNo }}
|
||||
</el-tag>
|
||||
<el-button v-if="canRelease && currentWarehouse.isEnabled === 0" @click="handleReleaseWarehouse(currentWarehouse)">释放库位</el-button>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="库位码">
|
||||
<QRCode :content="currentWarehouse.actualWarehouseId" :size="60" />
|
||||
@@ -116,6 +117,14 @@ export default {
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
canToggle: {
|
||||
default: true,
|
||||
type: Boolean
|
||||
},
|
||||
canRelease: {
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -277,6 +286,25 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleReleaseWarehouse(warehouse) {
|
||||
if (!this.canRelease) {
|
||||
this.$message.error('当前库位不支持释放操作');
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm(`确认释放库位 ${warehouse.actualWarehouseCode}?` ,{
|
||||
title: '确认释放库位',
|
||||
message: `确认释放库位 ${warehouse.actualWarehouseCode}?`,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 向父组件发送释放事件,由父组件更新columns数据
|
||||
this.dialogOpen = false;
|
||||
this.$emit('release-warehouse', warehouse);
|
||||
}).catch(() => {
|
||||
// 用户取消操作
|
||||
});
|
||||
},
|
||||
// 4. 同步滚动方法(确保列标尺和网格滚动位置一致)
|
||||
syncScroll(e) {
|
||||
const target = e.target;
|
||||
|
||||
Reference in New Issue
Block a user