feat(钢卷管理): 添加真实库区选择功能并优化表单字段
- 在分卷、合卷和钢卷录入页面添加真实库区选择组件 - 将nextWarehouseId字段重命名为warehouseId以统一命名 - 添加加载状态提示提升用户体验 - 优化表单布局和字段验证规则
This commit is contained in:
@@ -176,8 +176,8 @@
|
||||
<template slot="append">吨</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="目标库区">
|
||||
<el-select v-model="targetCoil.nextWarehouseId" placeholder="请选择" style="width: 100%" clearable :disabled="readonly">
|
||||
<el-form-item label="目标库位">
|
||||
<el-select v-model="targetCoil.warehouseId" placeholder="请选择" style="width: 100%" clearable :disabled="readonly">
|
||||
<el-option
|
||||
v-for="warehouse in warehouseList"
|
||||
:key="warehouse.warehouseId"
|
||||
@@ -186,6 +186,15 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="真实库区">
|
||||
<actual-warehouse-select
|
||||
v-model="targetCoil.actualWarehouseId"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
:disabled="readonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -238,7 +247,8 @@ export default {
|
||||
itemId: null,
|
||||
grossWeight: null,
|
||||
netWeight: null,
|
||||
nextWarehouseId: null
|
||||
warehouseId: null,
|
||||
actualWarehouseId: null
|
||||
},
|
||||
loading: false,
|
||||
// 钢卷选择器可见性
|
||||
@@ -370,7 +380,8 @@ export default {
|
||||
// 自动填充目标卷信息
|
||||
this.targetCoil.itemType = data.itemType;
|
||||
this.targetCoil.itemId = data.itemId;
|
||||
this.targetCoil.nextWarehouseId = data.warehouseId;
|
||||
this.targetCoil.warehouseId = data.warehouseId;
|
||||
this.targetCoil.actualWarehouseId = data.actualWarehouseId;
|
||||
|
||||
// 加载对应的物品列表
|
||||
if (data.itemType) {
|
||||
@@ -566,7 +577,8 @@ export default {
|
||||
if (index === 0) {
|
||||
this.targetCoil.itemType = coil.itemType;
|
||||
this.targetCoil.itemId = coil.itemId;
|
||||
this.targetCoil.nextWarehouseId = coil.warehouseId;
|
||||
this.targetCoil.warehouseId = coil.warehouseId;
|
||||
this.targetCoil.actualWarehouseId = coil.actualWarehouseId;
|
||||
}
|
||||
|
||||
this.$message.success('钢卷选择成功');
|
||||
@@ -619,7 +631,8 @@ export default {
|
||||
itemId: this.targetCoil.itemId,
|
||||
grossWeight: this.targetCoil.grossWeight,
|
||||
netWeight: this.targetCoil.netWeight,
|
||||
nextWarehouseId: this.targetCoil.nextWarehouseId,
|
||||
warehouseId: this.targetCoil.warehouseId,
|
||||
actualWarehouseId: this.targetCoil.actualWarehouseId,
|
||||
hasMergeSplit: 2, // 2表示合卷
|
||||
newCoils: this.sourceCoils.map(item => ({
|
||||
coilId: item.coilId,
|
||||
@@ -629,7 +642,11 @@ export default {
|
||||
};
|
||||
|
||||
console.log('提交的合卷数据:', mergeData);
|
||||
|
||||
const loadingInstance = this.$loading({
|
||||
lock: true,
|
||||
text: '正在合卷,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
const response = await mergeMaterialCoil(mergeData);
|
||||
if (response.code === 200) {
|
||||
this.$message.success('合卷保存成功');
|
||||
@@ -649,6 +666,7 @@ export default {
|
||||
console.error(error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
loadingInstance.close();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user