|
@ -8,12 +8,12 @@ |
|
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
|
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="uni-flex uni-row" style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; margin-top: 8rpx; border-radius: 8rpx"> |
|
|
<!-- <view class="uni-flex uni-row" style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; margin-top: 8rpx; border-radius: 8rpx">--> |
|
|
<view class="uni-center" style="width: 25%"> 来源库位 </view> |
|
|
<!-- <view class="uni-center" style="width: 25%"> 来源库位 </view>--> |
|
|
<view class="" style="width: 75%; padding: 8rpx"> |
|
|
<!-- <view class="" style="width: 75%; padding: 8rpx">--> |
|
|
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" @confirm="fromLocationUpdate"></uni-combox> |
|
|
<!-- <uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" @confirm="fromLocationUpdate"></uni-combox>--> |
|
|
</view> |
|
|
<!-- </view>--> |
|
|
</view> |
|
|
<!-- </view>--> |
|
|
|
|
|
|
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<view class=""> |
|
@ -56,13 +56,13 @@ import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|
|
|
|
|
|
|
|
import { getDetailOption, getDetailEditRemoveOption, getDetailGiveupOption } from '@/common/array.js' |
|
|
import { getDetailOption, getDetailEditRemoveOption, getDetailGiveupOption } from '@/common/array.js' |
|
|
import { getWorkShopLineStation, getBalanceByFilter } from '@/api/request2.js' |
|
|
import { getWorkShopLineStation, getBalanceByFilter, getBalanceByParams } from '@/api/request2.js' |
|
|
|
|
|
|
|
|
import { calc } from '@/common/calc.js' |
|
|
import { calc } from '@/common/calc.js' |
|
|
import { uniqueArray } from '@/common/basic.js' |
|
|
import { uniqueArray } from '@/common/basic.js' |
|
|
|
|
|
|
|
|
import { getBalanceByManagementPrecision } from '@/common/balance.js' |
|
|
import { getBalanceByManagementPrecision } from '@/common/balance.js' |
|
|
import { getDirectoryItemArray } from '../../../common/directory.js' |
|
|
import { getDirectoryItemArray,getInventoryStatusDesc,getListLocationAreaTypeDesc } from '../../../common/directory.js' |
|
|
import { getLabelInfo } from '@/common/label.js' |
|
|
import { getLabelInfo } from '@/common/label.js' |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
@ -137,7 +137,7 @@ const initData = () => { |
|
|
fromInventoryStatuses.value = jobContent.value.outInventoryStatuses |
|
|
fromInventoryStatuses.value = jobContent.value.outInventoryStatuses |
|
|
toLocation.value = dataContent.value[0] |
|
|
toLocation.value = dataContent.value[0] |
|
|
toLocationCode.value = dataContent.value[0].toLocationCode |
|
|
toLocationCode.value = dataContent.value[0].toLocationCode |
|
|
fromLocationList.value = getFromLocationList() |
|
|
// fromLocationList.value = getFromLocationList() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -145,27 +145,27 @@ const showBalanceSelect = (items) => { |
|
|
balanceSelectRef.value.openPopup(items) |
|
|
balanceSelectRef.value.openPopup(items) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getFromLocationList = () => { |
|
|
// const getFromLocationList = () => { |
|
|
const list = [] |
|
|
// let list = [] |
|
|
const location = dataContent.value.find((r) => r.toLocationCode == toLocationCode.value) |
|
|
// const location = dataContent.value.find((r) => r.toLocationCode == toLocationCode.value) |
|
|
if (location != undefined) { |
|
|
// if (location != undefined) { |
|
|
location.Items.forEach((item) => { |
|
|
// location.Items.forEach((item) => { |
|
|
item.Locations.forEach((f) => { |
|
|
// item.Locations.forEach((f) => { |
|
|
list.push(f.fromLocationCode) |
|
|
// list.push(f.fromLocationCode) |
|
|
}) |
|
|
// }) |
|
|
}) |
|
|
// }) |
|
|
// 去掉重复库位 |
|
|
// // 去掉重复库位 |
|
|
list = uniqueArray(list) |
|
|
// list = uniqueArray(list) |
|
|
fromLocationCode.value = list[0] |
|
|
// fromLocationCode.value = list[0] |
|
|
return list |
|
|
// return list |
|
|
} |
|
|
// } |
|
|
comMessageRef.value.showErrorMessages(`需求库位【${toLocationCode.value}】不存在`, (res) => { |
|
|
// comMessageRef.value.showErrorMessages(`需求库位【${toLocationCode.value}】不存在`, (res) => { |
|
|
if (res) { |
|
|
// if (res) { |
|
|
scanMsg.value = '' |
|
|
// scanMsg.value = '' |
|
|
getfocus() |
|
|
// getfocus() |
|
|
} |
|
|
// } |
|
|
}) |
|
|
// }) |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
const fromLocationUpdate = (fromlocation) => { |
|
|
const fromLocationUpdate = (fromlocation) => { |
|
|
const location = fromLocationList.value.find((r) => r == fromlocation) |
|
|
const location = fromLocationList.value.find((r) => r == fromlocation) |
|
@ -174,15 +174,41 @@ const fromLocationUpdate = (fromlocation) => { |
|
|
showErrorMessage(`发料库位【${fromlocation}】不存在`) |
|
|
showErrorMessage(`发料库位【${fromlocation}】不存在`) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const onScan = (result)=> { |
|
|
const onScan = (result) => { |
|
|
if (!result.package) { |
|
|
try { |
|
|
this.showErrorMessage('扫描数据错误[' + result.label.code + "]", |
|
|
if (fromLocationCode.value == '') { |
|
|
res => { |
|
|
showErrorMessage('请选择来源库位', (res) => { |
|
|
getfocus(); |
|
|
toLocationCombox.value.onFocus() |
|
|
} |
|
|
}) |
|
|
) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (toLocation.value && result.package.packUnit) { |
|
|
|
|
|
let item = toLocation.value.Items.find(r => r.itemCode == result.package.itemCode); |
|
|
|
|
|
if (!item) { |
|
|
|
|
|
showErrorMessage('扫描物料代码不属于该任务'); |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (result.package.packUnit !== item.packUnit) { |
|
|
|
|
|
comMessageRef.value.showQuestionMessage( |
|
|
|
|
|
`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
onScanResult(result) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
onScanResult(result) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const onScanResult = (result) => { |
|
|
|
|
|
try { |
|
|
|
|
|
// if (fromLocationCode.value == '') { |
|
|
|
|
|
// showErrorMessage('请选择来源库位', (res) => { |
|
|
|
|
|
// toLocationCombox.value.onFocus() |
|
|
|
|
|
// }) |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
const packageInfoParams = result.package |
|
|
const packageInfoParams = result.package |
|
|
const { itemCode } = result.label |
|
|
const { itemCode } = result.label |
|
|
const packingCode = result.label.packingNumber |
|
|
const packingCode = result.label.packingNumber |
|
@ -194,129 +220,168 @@ const onScan = (result) => { |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var params = { |
|
|
|
|
|
itemCode: result.package.itemCode, |
|
|
|
|
|
batch: result.label.batch, |
|
|
|
|
|
packingNumber: result.label.packingNumber, |
|
|
|
|
|
parentPackingNumber: result.package.parentNumber, |
|
|
|
|
|
inventoryStatus: jobContent.value.outInventoryStatuses.split(','), |
|
|
|
|
|
areaType: jobContent.value.fromAreaTypes.split(','), |
|
|
|
|
|
bussinessCode: jobContent.value.businessType |
|
|
|
|
|
} |
|
|
// 查找库存信息 |
|
|
// 查找库存信息 |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中', |
|
|
title: '查询中', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
getBalanceByParams(params).then(res => { |
|
|
getBalance(result.label, packageInfoParams, (balances) => { |
|
|
if (res.data.length == 0) { |
|
|
packageInfo.value = packageInfoParams |
|
|
let status = getInventoryStatusDesc(params.inventoryStatus) |
|
|
// 扫描的是外包装 |
|
|
let areaType = getListLocationAreaTypeDesc(params.areaType) |
|
|
const s = '' |
|
|
let hint = |
|
|
if (!result.package.parentNumber) { |
|
|
"按物料号 [" + params.itemCode + "] <br>" + |
|
|
if (balances.list.length == 0) { |
|
|
"包装号 [" + params.packingNumber + "] <br>" + |
|
|
showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
"批次 [" + params.batch + "] <br>" + |
|
|
} else { |
|
|
"状态 [" + status + "] <br>" + |
|
|
const newBalances = balances.list.filter((b) => b.locationCode == that.fromLocationCode) |
|
|
"库区 [" + areaType + "] <br>" + |
|
|
if (newBalances.length == 0) { |
|
|
"未查找到库存余额" |
|
|
showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
showErrorMessage(hint) |
|
|
} else if (newBalances.length == 1) { |
|
|
} else if (res.data.length == 1) { |
|
|
const balance1 = newBalances[0] |
|
|
result.balance = res.data[0] |
|
|
afterGetBalance(result.label, balance1, packageInfoParams) |
|
|
|
|
|
} else { |
|
|
if (result.label.packingNumber != result.balance.packingNumber) { |
|
|
showBalanceSelect(newBalances) |
|
|
result.balance.handleQty = Number(result.label.qty) |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} 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, packageInfoParams) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
showBalanceSelect(subParentPackitems) |
|
|
result.balance.handleQty = Number(result.balance.qty) |
|
|
} |
|
|
} |
|
|
|
|
|
afterGetBalance(result.label, result.balance, result.package); |
|
|
} else { |
|
|
} else { |
|
|
showErrorMessage(`按外包装【${packageInfoParams.parentNumber}】和子包装【${packageInfoParams.number}】都未查找到库存余额`) |
|
|
//多条记录 |
|
|
} |
|
|
balanceSelectRef.value.openPopup(res.data); |
|
|
} 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() |
|
|
uni.hideLoading() |
|
|
}) |
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
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 == that.fromLocationCode) |
|
|
|
|
|
// if (newBalances.length == 0) { |
|
|
|
|
|
// showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
|
|
// } else if (newBalances.length == 1) { |
|
|
|
|
|
// const balance1 = newBalances[0] |
|
|
|
|
|
// afterGetBalance(result.label, balance1, 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, packageInfoParams) |
|
|
|
|
|
// } 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) { |
|
|
} catch (e) { |
|
|
showErrorMessage(e.stack) |
|
|
showErrorMessage(e.stack) |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const getBalance = (labelParams, packageInfo, callback) => { |
|
|
// const getBalance = (labelParams, packageInfo, callback) => { |
|
|
const filters = [] |
|
|
// const filters = [] |
|
|
if (packageInfo.parentNumber) { |
|
|
// if (packageInfo.parentNumber) { |
|
|
const packingNumber = `${packageInfo.parentNumber},${labelParams.packingNumber}` |
|
|
// const packingNumber = `${packageInfo.parentNumber},${labelParams.packingNumber}` |
|
|
filters.push({ |
|
|
// filters.push({ |
|
|
column: 'packingNumber', |
|
|
// column: 'packingNumber', |
|
|
action: 'in', |
|
|
// action: 'in', |
|
|
value: packingNumber |
|
|
// value: packingNumber |
|
|
}) |
|
|
// }) |
|
|
} else { |
|
|
// } else { |
|
|
filters.push({ |
|
|
// filters.push({ |
|
|
column: 'packingNumber', |
|
|
// column: 'packingNumber', |
|
|
action: '==', |
|
|
// action: '==', |
|
|
value: labelParams.packingNumber |
|
|
// value: labelParams.packingNumber |
|
|
}) |
|
|
// }) |
|
|
} |
|
|
// } |
|
|
filters.push({ |
|
|
// filters.push({ |
|
|
column: 'packingNumber', |
|
|
// column: 'packingNumber', |
|
|
action: '==', |
|
|
// action: '==', |
|
|
value: labelParams.packingNumber |
|
|
// value: labelParams.packingNumber |
|
|
}) |
|
|
// }) |
|
|
filters.push({ |
|
|
// filters.push({ |
|
|
column: 'itemCode', |
|
|
// column: 'itemCode', |
|
|
action: '==', |
|
|
// action: '==', |
|
|
value: labelParams.itemCode |
|
|
// value: labelParams.itemCode |
|
|
}) |
|
|
// }) |
|
|
filters.push({ |
|
|
// filters.push({ |
|
|
column: 'batch', |
|
|
// column: 'batch', |
|
|
action: '==', |
|
|
// action: '==', |
|
|
value: labelParams.batch |
|
|
// value: labelParams.batch |
|
|
}) |
|
|
// }) |
|
|
|
|
|
// |
|
|
if (fromInventoryStatuses.value != null && fromInventoryStatuses.value != '') { |
|
|
// if (fromInventoryStatuses.value != null && fromInventoryStatuses.value != '') { |
|
|
filters.push({ |
|
|
// filters.push({ |
|
|
column: 'inventoryStatus', |
|
|
// column: 'inventoryStatus', |
|
|
action: 'in', |
|
|
// action: 'in', |
|
|
value: fromInventoryStatuses.value |
|
|
// value: fromInventoryStatuses.value |
|
|
}) |
|
|
// }) |
|
|
} |
|
|
// } |
|
|
|
|
|
// |
|
|
const params = { |
|
|
// const params = { |
|
|
filters, |
|
|
// filters, |
|
|
pageNo: 1, |
|
|
// pageNo: 1, |
|
|
pageSize: 100 |
|
|
// pageSize: 100 |
|
|
} |
|
|
// } |
|
|
getBalanceByFilter(params) |
|
|
// getBalanceByFilter(params) |
|
|
.then((res) => { |
|
|
// .then((res) => { |
|
|
callback(res.data) |
|
|
// callback(res.data) |
|
|
}) |
|
|
// }) |
|
|
.catch((err) => { |
|
|
// .catch((err) => { |
|
|
showErrorMessage(err.message) |
|
|
// showErrorMessage(err.message) |
|
|
}) |
|
|
// }) |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
const selectBalanceItem = (balanceParams) => { |
|
|
const selectBalanceItem = (balanceParams) => { |
|
|
afterGetBalance(label.value, balanceParams, packageInfo.value) |
|
|
afterGetBalance(label.value, balanceParams, packageInfo.value) |
|
@ -328,7 +393,9 @@ const afterGetBalance = (labelParams, balanceParams, packageInfo) => { |
|
|
const packingCode = labelParams.packingNumber |
|
|
const packingCode = labelParams.packingNumber |
|
|
const lot = labelParams.batch |
|
|
const lot = labelParams.batch |
|
|
const item = toLocation.value.Items.find((r) => r.itemCode == itemCode) |
|
|
const item = toLocation.value.Items.find((r) => r.itemCode == itemCode) |
|
|
|
|
|
fromLocationCode.value = balanceParams.locationCode; |
|
|
const fromLocation = item.Locations.find((l) => l.fromLocationCode == fromLocationCode.value) |
|
|
const fromLocation = item.Locations.find((l) => l.fromLocationCode == fromLocationCode.value) |
|
|
|
|
|
//如果库存余额中的库位与任务推荐的不一致 |
|
|
if (fromLocation != undefined) { |
|
|
if (fromLocation != undefined) { |
|
|
const batch = fromLocation.Batchs.find((r) => r.batch == lot) |
|
|
const batch = fromLocation.Batchs.find((r) => r.batch == lot) |
|
|
if (batch != undefined) { |
|
|
if (batch != undefined) { |
|
@ -377,9 +444,11 @@ const afterGetBalance = (labelParams, balanceParams, packageInfo) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
showErrorMessage(`未查找到推荐库位【${fromLocationCode.value}】的发料明细`, (res) => { |
|
|
let locaion = createLocationInfo(labelParams, balanceParams, packageInfo); |
|
|
getfocus() |
|
|
item.Locations.push(locaion); |
|
|
}) |
|
|
// showErrorMessage(`未查找到推荐库位【${fromLocationCode.value}】的发料明细`, (res) => { |
|
|
|
|
|
// getfocus() |
|
|
|
|
|
// }) |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
showErrorMessage(e.stack, (res) => { |
|
|
showErrorMessage(e.stack, (res) => { |
|
@ -387,7 +456,20 @@ const afterGetBalance = (labelParams, balanceParams, packageInfo) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//增加实际扫描的明细 |
|
|
|
|
|
const createLocationInfo = (labelParams, balanceParams, packageInfo)=> { |
|
|
|
|
|
let location = { |
|
|
|
|
|
fromLocationCode: balanceParams.locationCode, |
|
|
|
|
|
qty: balanceParams.qty, |
|
|
|
|
|
uom: balanceParams.uom, |
|
|
|
|
|
handleQty: 0, |
|
|
|
|
|
Batchs: [] |
|
|
|
|
|
} |
|
|
|
|
|
let batch = createBatchInfo(labelParams, balanceParams, packageInfo); |
|
|
|
|
|
batch.detail = balanceParams; |
|
|
|
|
|
location.Batchs.push(batch); |
|
|
|
|
|
return location; |
|
|
|
|
|
} |
|
|
const createBatchInfo = (labelParams, balanceParams, packageInfo) => { |
|
|
const createBatchInfo = (labelParams, balanceParams, packageInfo) => { |
|
|
const batch = { |
|
|
const batch = { |
|
|
batch: labelParams.batch, |
|
|
batch: labelParams.batch, |
|
@ -396,11 +478,11 @@ const createBatchInfo = (labelParams, balanceParams, packageInfo) => { |
|
|
Records: [] |
|
|
Records: [] |
|
|
} |
|
|
} |
|
|
let record = {} |
|
|
let record = {} |
|
|
if (balanceParams == null) { |
|
|
if (balanceParams != null) { |
|
|
record = creatRecordByBalance(labelParams, packageInfo) |
|
|
record = creatRecordByBalance(balanceParams, packageInfo) |
|
|
batch.handleQty = Number(labelParams.qty) |
|
|
batch.handleQty = Number(labelParams.qty) |
|
|
} else { |
|
|
} else { |
|
|
record = creatRecordByLabel(balanceParams, packageInfo) |
|
|
record = creatRecordByLabel(labelParams, packageInfo) |
|
|
batch.handleQty = Number(balanceParams.qty) |
|
|
batch.handleQty = Number(balanceParams.qty) |
|
|
} |
|
|
} |
|
|
batch.Records.push(record) |
|
|
batch.Records.push(record) |
|
|