fix(wms): 修复合同ID为空时添加合同关系的错误

在合并、分条和批量分条操作中,当合同ID为空时不再尝试添加合同关系
同时优化批量分条时的合同关系添加逻辑,先过滤掉空合同ID
This commit is contained in:
2026-04-20 11:04:14 +08:00
parent af002b84d3
commit 4fefc68bbc
4 changed files with 22 additions and 15 deletions

View File

@@ -684,12 +684,15 @@ export default {
// 拿到多个子卷的coilId
const newCoilIds = response.msg.split(',');
// 先构建所有的请求体,并移除合同为空为空的项
const requests = newCoilIds.map((coilId, index) => ({
coilId,
contractId: this.splitList[index].contractId
}))
.filter(req => req.contractId);
// 为每个子卷添加合同关联
Promise.all(newCoilIds.map(async (coilId, index) => {
addCoilContractRel({
coilId,
contractId: this.splitList[index].contractId
});
Promise.all(requests.map(async (req, index) => {
addCoilContractRel(req);
}));
// 如果是从待操作列表进来的,标记操作为完成