|
|
@ -78,6 +78,7 @@ const type = ref('') |
|
|
|
const isCheckLocation = ref(false) |
|
|
|
const switchCode = ref('') |
|
|
|
const scanedPackingNumber = ref('') |
|
|
|
const status = ref('') |
|
|
|
const scanPopup = ref() |
|
|
|
const comScanLocation = ref() |
|
|
|
const detailInfoPopupRef = ref() |
|
|
@ -86,6 +87,7 @@ onLoad((option) => { |
|
|
|
id.value = option.id |
|
|
|
type.value = option.type |
|
|
|
scanedPackingNumber.value = option.scaned || '' |
|
|
|
status.value = option.status || '' |
|
|
|
if (type.value == 'predict') { |
|
|
|
switchCode.value = 'SemiPutawayLocationCodeValidate' |
|
|
|
updateTitle('预生产上架任务') |
|
|
@ -93,9 +95,11 @@ onLoad((option) => { |
|
|
|
switchCode.value = 'FgPutawayLocationCodeValidate' |
|
|
|
updateTitle('装配上架任务') |
|
|
|
} |
|
|
|
}) |
|
|
|
onShow(() => { |
|
|
|
if (id.value != undefined) { |
|
|
|
// 新建的任务自动接收 |
|
|
|
if (option.status == '1') { |
|
|
|
if (status.value == '1') { |
|
|
|
receive((callback) => { |
|
|
|
getDetail() |
|
|
|
}) |
|
|
@ -155,22 +159,21 @@ const getDetail = () => { |
|
|
|
fromLocationCode.value = subList.value[0].fromLocationCode |
|
|
|
jobToLocationCode.value = subList.value[0].toLocationCode |
|
|
|
detailSource.value = getDataSource(subList.value) |
|
|
|
isCheckLocation.value = getSwitchInfoByCode(that.switchCode) |
|
|
|
if (isCheckLocation.value) { |
|
|
|
toLocationCode.value = '' |
|
|
|
} else { |
|
|
|
toLocationCode.value = jobToLocationCode.value |
|
|
|
} |
|
|
|
detailSource.value.forEach((r) => { |
|
|
|
r.subList.forEach((s) => { |
|
|
|
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { |
|
|
|
s.scaned = true |
|
|
|
s.handleQty = s.qty |
|
|
|
s.cancleScanedHiht = true |
|
|
|
openScanPopupSimulate(s) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
toLocationAreaTypeList.value = getLocationTypeArray(jobContent.value.toAreaTypes) |
|
|
|
isCheckLocation.value = getSwitchInfoByCode(switchCode.value) |
|
|
|
if (isCheckLocation.value) { |
|
|
|
toLocationCode.value = '' |
|
|
|
} else { |
|
|
|
toLocationCode.value = jobToLocationCode.value |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
} else { |
|
|
|
showMessage('列表数据为0') |
|
|
|
} |
|
|
@ -198,6 +201,25 @@ const updateData = () => { |
|
|
|
const openDetail = (item) => { |
|
|
|
detailInfoPopupRef.value.openPopup(item) |
|
|
|
} |
|
|
|
const openScanPopupSimulate = (item) => { |
|
|
|
let fromlocationCode = '' |
|
|
|
const fromlocationList = [] |
|
|
|
for (let i = 0; i < detailSource.value.length; i++) { |
|
|
|
const item = detailSource.value[i] |
|
|
|
item.subList.forEach((l) => { |
|
|
|
// 重复的库位不往里面插入 |
|
|
|
const location = fromlocationList.find((res) => res == l.fromLocationCode) |
|
|
|
if (location == undefined) { |
|
|
|
fromlocationList.push(l.fromLocationCode) |
|
|
|
} |
|
|
|
// 来源库位赋默认值 |
|
|
|
if (fromlocationCode == '') { |
|
|
|
fromlocationCode = l.fromLocationCode |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item) |
|
|
|
} |
|
|
|
const openScanPopup = () => { |
|
|
|
let fromlocationCode = '' |
|
|
|
const fromlocationList = [] |
|
|
@ -241,28 +263,11 @@ const getScanResult = (result) => { |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`) |
|
|
|
} else if (itemDetail.scaned) { |
|
|
|
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { |
|
|
|
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`) |
|
|
|
} else { |
|
|
|
// addDetail(itemDetail, result) |
|
|
|
// return |
|
|
|
// 暂时先不判断状态 |
|
|
|
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) |
|
|
|
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) |
|
|
|
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { |
|
|
|
// if (jobContent.value.allowModifyInventoryStatus == 'TRUE') { |
|
|
|
showQuestionMessage(`实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续上架?`, (res) => { |
|
|
|
if (res) { |
|
|
|
addDetail(itemDetail, result) |
|
|
|
} else { |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
}) |
|
|
|
// } |
|
|
|
} |
|
|
|
// else { |
|
|
|
// addDetail(itemDetail, result) |
|
|
|
// } |
|
|
|
addDetail(itemDetail, result) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|