|
|
@ -66,7 +66,9 @@ import { |
|
|
|
getManagementPrecisions |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc' |
|
|
|
import { |
|
|
|
getDataSource, |
|
|
|
createRecordInfo, |
|
|
@ -238,10 +240,80 @@ const openDetail = (item) => { |
|
|
|
}; |
|
|
|
|
|
|
|
const openScanPopup = () => { |
|
|
|
scanPopup.value.openScanPopup(); |
|
|
|
scanPopup.value.openScanPopup(fromLocationCode.value); |
|
|
|
}; |
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
const getScanResult = (result)=> { |
|
|
|
managementType.value = result.managementType |
|
|
|
if (managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY') { |
|
|
|
setDataBatch(result) |
|
|
|
} else { |
|
|
|
setData(result) |
|
|
|
} |
|
|
|
} |
|
|
|
const setDataBatch = (result)=>{ |
|
|
|
try { |
|
|
|
const packingNumber = result.label.packingNumber; |
|
|
|
const batch = result.label.batch; |
|
|
|
const qty = result.label.qty; |
|
|
|
const itemCode = result.label.itemCode; |
|
|
|
const detail = detailSource.value.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
let itemDetail = detail.subList.find(r => { |
|
|
|
return r.batch == batch |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
showErrorMessage("批次[" + batch + "]不在列表中") |
|
|
|
} else { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
// this.showErrorMessage("批次[" + batch + "]已经扫描") |
|
|
|
itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.package.qty)) |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.package.qty) |
|
|
|
itemDetail.inventoryStatus = "OK" |
|
|
|
itemDetail.packQty = result.package.packQty |
|
|
|
itemDetail.packUnit = result.package.packUnit |
|
|
|
|
|
|
|
|
|
|
|
//合格退料时不能查库存余额,因为生产退料时新生成的批次是000000 --nxt |
|
|
|
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); |
|
|
|
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); |
|
|
|
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { |
|
|
|
// this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|
|
|
// ']不一致,是否继续上架?', res => { |
|
|
|
// if (res) { |
|
|
|
// itemDetail.scaned = true; |
|
|
|
// itemDetail.handleQty = Number(result.balance.qty) |
|
|
|
// itemDetail.balance = result.balance; |
|
|
|
// itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
// itemDetail.balance.packQty = result.package.packQty |
|
|
|
// itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
// this.calcHandleQty(); |
|
|
|
// } else { |
|
|
|
// this.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// itemDetail.scaned = true; |
|
|
|
// itemDetail.handleQty = Number(result.balance.qty) |
|
|
|
// itemDetail.balance = result.balance; |
|
|
|
// itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
// itemDetail.balance.packQty = result.package.packQty |
|
|
|
// itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
// this.calcHandleQty(); |
|
|
|
// } |
|
|
|
} |
|
|
|
calcHandleQty(); |
|
|
|
} |
|
|
|
} |
|
|
|
scanPopupGetFocus(); |
|
|
|
} catch (e) { |
|
|
|
showErrorMessage(e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
const setData = (result) => { |
|
|
|
try { |
|
|
|
const packingNumber = result.label.packingNumber; |
|
|
|
const batch = result.label.batch; |
|
|
|