|
|
@ -246,65 +246,6 @@ const onScanResult = (result) => { |
|
|
|
showErrorMessage(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
// getBalance(result.label, packageInfoParams, (balances) => { |
|
|
|
// packageInfo.value = packageInfoParams |
|
|
|
// // 扫描的是外包装 |
|
|
|
// const s = '' |
|
|
|
// if (!result.package.parentNumber) { |
|
|
|
// if (balances.list.length == 0) { |
|
|
|
// showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
// } else { |
|
|
|
// const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value) |
|
|
|
// if (newBalances.length == 0) { |
|
|
|
// showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
// } else if (newBalances.length == 1) { |
|
|
|
// const balance = newBalances[0] |
|
|
|
// afterGetBalance(result.label, balance, packageInfoParams) |
|
|
|
// } else { |
|
|
|
// showBalanceSelect(newBalances) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// // 扫描的是小包装 |
|
|
|
// if (balances.list.length == 0) { |
|
|
|
// showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
// } else { |
|
|
|
// // 小包装库存 |
|
|
|
// const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.number) |
|
|
|
// // 外包装库存 |
|
|
|
// const subParentPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.parentNumber && r.locationCode == fromLocationCode.value) |
|
|
|
// |
|
|
|
// // 小包装没有库存, |
|
|
|
// if (subPackitems.length == 0) { |
|
|
|
// // 外包装有库存,出库后剩余库存未转换为出库包装规格 |
|
|
|
// |
|
|
|
// if (subParentPackitems.length > 0) { |
|
|
|
// if (subParentPackitems.length == 1) { |
|
|
|
// const balance = subParentPackitems[0] |
|
|
|
// balance.qty = packageInfoParams.qty |
|
|
|
// afterGetBalance(result.label, balance, packageInfo) |
|
|
|
// } else { |
|
|
|
// showBalanceSelect(subParentPackitems) |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// showErrorMessage(`按外包装【${packageInfoParams.parentNumber}】和子包装【${packageInfoParams.number}】都未查找到库存余额`) |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// let locationCode = fromLocationCode.value |
|
|
|
// if (balances.list == 1) { |
|
|
|
// locationCode = balances.list[0].locationCode |
|
|
|
// } else { |
|
|
|
// const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value) |
|
|
|
// if (manyBlances.length > 0) { |
|
|
|
// locationCode = manyBlances[0].locationCode |
|
|
|
// } |
|
|
|
// } |
|
|
|
// showErrorMessage(`该包装【${packageInfoParams.number}】在库位【${locationCode}】已经有库存余额,请重新扫描`) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// uni.hideLoading() |
|
|
|
// }) |
|
|
|
} catch (e) { |
|
|
|
showErrorMessage(e.stack) |
|
|
|
uni.hideLoading() |
|
|
|