|
|
@ -351,33 +351,21 @@ const showMessageHint = (hint, callback) => { |
|
|
|
const submitJob = () => { |
|
|
|
proxy.$modal.loading('提交中....') |
|
|
|
const itemCodes = [] |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
|
|
|
|
getManagementPrecisions(itemCodes, toLocationCode.value, (res) => { |
|
|
|
if (res.success) { |
|
|
|
managementList.value = res.list |
|
|
|
const params = setParams() |
|
|
|
|
|
|
|
productionReceiptJobSubmit(params) |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
showCommitSuccessMessage(`提交成功<br>生成发料接收记录<br>${res.data}`) |
|
|
|
} else { |
|
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
uni.hideLoading() |
|
|
|
showErrorMessage(error) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
const params = setParams() |
|
|
|
console.log('提交参数', JSON.stringify(params)) |
|
|
|
productionReceiptJobSubmit(params) |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
showErrorMessage(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (res.data) { |
|
|
|
showCommitSuccessMessage(`提交成功<br>生成发料接收记录<br>${res.data}`) |
|
|
|
} else { |
|
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
uni.hideLoading() |
|
|
|
showErrorMessage(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
const setParams = () => { |
|
|
|
const subList = [] |
|
|
@ -386,9 +374,9 @@ const setParams = () => { |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach((detail) => { |
|
|
|
if (detail.scaned) { |
|
|
|
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch) |
|
|
|
detail.toPackingNumber = info.packingNumber |
|
|
|
detail.toBatch = info.batch |
|
|
|
// const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch) |
|
|
|
detail.toPackingNumber = detail.packingNumber |
|
|
|
detail.toBatch = detail.batch |
|
|
|
detail.toContainerNumber = '' |
|
|
|
detail.toLocationCode = toLocationCode.value |
|
|
|
subList.push(detail) |
|
|
|