feat(wms): 新增钢卷合同号自动填充功能

1. 在钢卷合并、分卷、打钢印、计划拆分、退火计划页面添加合同号自动拉取逻辑
2. 优化合同选择组件,补全不存在于列表的已选合同
3. 移除split.vue中冗余的注释代码
This commit is contained in:
2026-06-21 11:32:02 +08:00
parent b4fba79838
commit 274671f309
6 changed files with 88 additions and 15 deletions

View File

@@ -366,9 +366,10 @@
<script>
import { getMaterialCoil, splitMaterialCoil, getFirstHeatCoilMaterial } from '@/api/wms/coil';
import { listCoilContractRel } from '@/api/wms/coilContractRel';
import { listCoilAbnormal } from '@/api/wms/coilAbnormal';
import { listWarehouse } from '@/api/wms/warehouse';
import { completeAction, getPendingAction } from '@/api/wms/pendingAction';
import { getPendingAction } from '@/api/wms/pendingAction';
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
import ProductSelect from "@/components/KLPService/ProductSelect";
@@ -478,6 +479,7 @@ export default {
inheritButtonLoading: false,
parentCoils: [],
currentInheritSubCoilIndex: -1,
defaultContractId: '',
};
},
computed: {
@@ -502,8 +504,7 @@ export default {
// 先加载库区列表
await this.loadWarehouses();
// 不再一次性加载所有数据,改为实时搜索
// await this.loadAllItems();
// 加载母卷信息
// 从路由参数获取coilId、actionId和readonly
const coilId = this.$route.query.coilId;
@@ -643,6 +644,19 @@ export default {
// console.error('获取最早的热轧卷板材质失败', error);
}
// 获取母卷绑定的合同号作为子卷默认值
listCoilContractRel({ coilId }).then(res => {
const rows = res.rows || []
if (rows.length > 0 && rows[0].contractId) {
this.defaultContractId = rows[0].contractId
for (const item of this.splitList) {
if (!item.contractId) {
this.$set(item, 'contractId', this.defaultContractId)
}
}
}
})
}
} catch (error) {
this.$message.error('加载母卷信息失败');
@@ -683,6 +697,7 @@ export default {
trimmingRequirement: '',
temperGrade: '',
coatingType: '',
contractId: this.defaultContractId || '',
actualLength: undefined,
actualWidth: undefined,
productionStartTime: this.currentAction.createTime,