|
|
@ -388,14 +388,16 @@ |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = [] |
|
|
|
for (let item of tableData.value) { |
|
|
|
await PurchaseDetailApi.getPurchaseDetailPage({ |
|
|
|
await PurchaseDetailApi.getPurchaseDetailPageCheckData({ |
|
|
|
number: item.poNumber, |
|
|
|
lineNumber: item.poLine, |
|
|
|
}).then(res => { |
|
|
|
console.log("【要货计划】-每条数据结果",item) |
|
|
|
if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) { |
|
|
|
message.error('要货计划数量不得大于订单数量-已计划数量') |
|
|
|
return |
|
|
|
if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 |
|
|
|
if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) { |
|
|
|
message.error('要货计划数量不得大于订单数量-已计划数量') |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
data.subList.push(item) // 拼接子表数据参数 |
|
|
|
}) |
|
|
@ -422,14 +424,18 @@ |
|
|
|
// 子表新增/编辑校验 |
|
|
|
const detailValidate = async (data) => { |
|
|
|
let tag = false |
|
|
|
await PurchaseDetailApi.getPurchaseDetailPage({ |
|
|
|
await PurchaseDetailApi.getPurchaseDetailPageCheckData({ |
|
|
|
number: data.poNumber, |
|
|
|
lineNumber: data.poLine |
|
|
|
}).then(res => { |
|
|
|
if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { |
|
|
|
message.error('要货计划数量不得大于订单数量-已计划数量') |
|
|
|
tag = false |
|
|
|
} else { |
|
|
|
if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 |
|
|
|
if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { |
|
|
|
message.error('要货计划数量不得大于订单数量-已计划数量') |
|
|
|
tag = false |
|
|
|
} else { |
|
|
|
tag = true |
|
|
|
} |
|
|
|
}else{ |
|
|
|
tag = true |
|
|
|
} |
|
|
|
}).catch(err =>{ |
|
|
|