feat(annealPlan): 添加钢卷绑定信息更新功能并优化界面

- 新增updateAnnealPlanCoil API用于更新钢卷绑定信息
- 移除加入计划按钮的状态限制
- 将实际库位改为钢卷去向选择器并添加钢卷层级输入
- 实现钢卷信息变更自动保存功能
- 按层级排序钢卷列表
- 完善完成处理时的库位校验逻辑
This commit is contained in:
砂糖
2026-03-17 09:48:17 +08:00
parent 0aee6cecaa
commit 347ec849ae
2 changed files with 35 additions and 10 deletions

View File

@@ -96,3 +96,14 @@ export function unbindAnnealPlanCoil(data) {
data: data
})
}
/**
* 更新钢卷绑定信息
*/
export function updateAnnealPlanCoil(data) {
return request({
url: '/wms/furnacePlanCoil',
method: 'put',
data: data
})
}

View File

@@ -112,7 +112,7 @@
<div class="material-sub">入场{{ item.enterCoilNo || '-' }}</div>
</div>
<el-button type="primary" size="mini" @click="handleAddToPlan(item)"
:disabled="!currentPlan.planId || currentPlan.status !== 0">加入计划</el-button>
:disabled="!currentPlan.planId">加入计划</el-button>
</div>
<div class="material-body">
<div class="material-row">厂家{{ item.supplierCoilNo || '-' }}</div>
@@ -154,14 +154,20 @@
</div>
<el-table :data="coilList" v-loading="coilLoading" class="light-table">
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo" />
<el-table-column label="创建时间" align="center" prop="createTime">
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}
<el-date-picker style="width: 185px" v-model="scope.row.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择创建时间" @change="handlePLanCoilChange(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="实际库位" align="center" width="220">
<el-table-column label="钢卷去向" align="center" width="220">
<template slot-scope="scope">
<span>{{ scope.row.actualWarehouseName || '-' }}</span>
<WarehouseSelect v-model="scope.row.logicWarehouseId" @change="handlePLanCoilChange(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="钢卷层级" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.furnaceLevel" placeholder="请输入钢卷层级" @change="handlePLanCoilChange(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
@@ -244,7 +250,7 @@
</template>
<script>
import { listAnnealPlan, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
import { listAnnealPlan, updateAnnealPlanCoil, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
import { listMaterialCoil } from "@/api/wms/coil";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
@@ -328,6 +334,13 @@ export default {
this.currentPlan = row;
this.loadPlanCoils();
},
handlePLanCoilChange(row) {
updateAnnealPlanCoil(row).then(() => {
this.$message.success('已更新');
}).finally(() => {
this.loadPlanCoils();
});
},
getMaterialCoils() {
this.materialLoading = true;
listMaterialCoil(this.materialQueryParams).then(response => {
@@ -361,7 +374,7 @@ export default {
this.completeCoils = (response.data || []).map(item => ({
coilId: item.coilId,
enterCoilNo: item.enterCoilNo,
actualWarehouseId: item.actualWarehouseId || null
warehouseId: item.logicWarehouseId || null
}));
this.completeLoading = false;
}).catch(() => {
@@ -395,7 +408,8 @@ export default {
}
this.coilLoading = true;
listAnnealPlanCoils(this.currentPlan.planId).then(response => {
this.coilList = response.data || [];
// 按照层级排序,数字大的考前
this.coilList = response.data.sort((a, b) => b.furnaceLevel - a.furnaceLevel) || [];
this.coilLoading = false;
});
},
@@ -526,9 +540,9 @@ export default {
submitComplete() {
const locations = (this.completeCoils || []).map(item => ({
coilId: item.coilId,
actualWarehouseId: item.actualWarehouseId
warehouseId: item.warehouseId
}));
const missing = locations.filter(item => !item.actualWarehouseId);
const missing = locations.filter(item => !item.warehouseId);
if (missing.length > 0) {
this.$message.warning('请先为所有钢卷分配实际库位');
return;