|
|
@ -57,6 +57,7 @@ |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
@clearInput="clearInput" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -124,23 +125,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
newRow['fromAreaCode'] = item['areaCode'] |
|
|
|
newRow['toAreaCode'] = item['areaCode'] |
|
|
|
newRow['inventoryStatus'] = item['inventoryStatus'] |
|
|
|
newRow['fromPackUnit'] = item['packUnit'] |
|
|
|
// newRow['fromPackUnit'] = item['packUnit'] |
|
|
|
newRow['fromPackQty'] = item['packQty'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
|
|
|
|
} else if (formField == 'toPackUnit') { |
|
|
|
row['toPackUnit'] = val[0]['packUnit'] |
|
|
|
row['toPackQty'] = val[0]['packQty'] |
|
|
|
row['fromPackUnit'] = val[0]['packUnit'] |
|
|
|
row['toPackQty'] = 0 |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if (formField == 'fromWarehouseCode') { |
|
|
|
setV['fromWarehouseCode'] = val[0]['code'] |
|
|
|
setV['toWarehouseCode'] = val[0]['code'] |
|
|
|
if (formField == 'fromLocationCode') { |
|
|
|
setV['toLocationCode'] = val[0]['code'] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
@ -403,13 +404,17 @@ const submitForm = async (formType, submitData) => { |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
if(tableData.value.find(item => (item.toPackUnit == item.fromPackUnit))) { |
|
|
|
message.warning('从包装规格与到包装规格不能相同') |
|
|
|
return |
|
|
|
} |
|
|
|
// if(tableData.value.find(item => (item.toPackUnit == item.fromPackUnit))) { |
|
|
|
// message.warning('从包装规格与到包装规格不能相同') |
|
|
|
// return |
|
|
|
// } |
|
|
|
if(tableData.value.find(item => (item.qty <= 0))) { |
|
|
|
message.warning('数量必须大于0') |
|
|
|
return |
|
|
|
} |
|
|
|
if(tableData.value.find(item => (item.toPackQty <= 0))) { |
|
|
|
message.warning('到标包数量必须大于0') |
|
|
|
return |
|
|
|
} |
|
|
|
formRef.value.formLoading = true |
|
|
|
try { |
|
|
@ -477,7 +482,11 @@ const searchFormClick = (searchData) => { |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
const clearInput = (field, row, index) => { |
|
|
|
if (field == 'toPackUnit') { |
|
|
|
row.fromPackUnit = '' |
|
|
|
} |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|