|
|
@ -325,7 +325,6 @@ const tableSelectionDelete = (selection) => { |
|
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
|
} |
|
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
|
const flag = ref() |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, submitData) => { |
|
|
@ -334,15 +333,20 @@ const submitForm = async (formType, submitData) => { |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
let flag = false |
|
|
|
data.subList.forEach(item => { |
|
|
|
item.toBatch = item.fromBatch |
|
|
|
item.fromLocationCode = data.fromLocationCode |
|
|
|
item.toLocationCode = data.toLocationCode |
|
|
|
item.toInventoryStatus = data.toInventoryStatus |
|
|
|
|
|
|
|
if(item.qty == 0){ |
|
|
|
message.error(`数量不能为0!`) |
|
|
|
flag.value = true |
|
|
|
if(item.checkQty>0&&Number(item.qty)==0){ |
|
|
|
message.error(`${item['itemCode']}数量不能为0!`) |
|
|
|
flag = true |
|
|
|
return; |
|
|
|
} |
|
|
|
if(item.checkQty>0&&item.qty<0){ |
|
|
|
message.error(`${item['itemCode']}数量不能小于0!`) |
|
|
|
flag = true |
|
|
|
return; |
|
|
|
} |
|
|
|
}) |
|
|
@ -351,7 +355,7 @@ const submitForm = async (formType, submitData) => { |
|
|
|
message.warning('从库位和到库位不能相同') |
|
|
|
return |
|
|
|
} |
|
|
|
if(flag.value){ |
|
|
|
if(flag){ |
|
|
|
formRef.value.formLoading = false |
|
|
|
return |
|
|
|
} |
|
|
@ -387,6 +391,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
newRow['fromInventoryStatus'] = item['inventoryStatus'] |
|
|
|
newRow['origin_fromLocationCode'] = item['locationCode'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
newRow['checkQty'] = item['qty'] //用于保存的时候作校验 HL-5524 |
|
|
|
newRow['qty'] = item['qty'] |
|
|
|
if(item['packingNumber']&&item['packingNumber'].length>0){ |
|
|
|
newRow['packUnit'] = item['packUnit'] |
|
|
|