|
|
@ -35,7 +35,7 @@ |
|
|
|
</view> --> |
|
|
|
<!-- <u-line class='line_color'></u-line> --> |
|
|
|
|
|
|
|
<view class="uni-flex uni-row" style="align-items: center; |
|
|
|
<!-- <view class="uni-flex uni-row" style="align-items: center; |
|
|
|
background-color: #fff; |
|
|
|
margin-left: 20rpx; |
|
|
|
margin-right: 20rpx; |
|
|
@ -49,7 +49,7 @@ |
|
|
|
placeholder="请选择库位" @confirm="fromLocationUpdate" |
|
|
|
:inputStyle="inputStyleObject"></uni-combox> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<view class=""> |
|
|
|
<view class=""> |
|
|
@ -231,7 +231,7 @@ |
|
|
|
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses |
|
|
|
that.toLocation = that.dataContent[0]; |
|
|
|
that.toLocationCode = that.dataContent[0].toLocationCode; |
|
|
|
that.fromLocationList = that.getFromLocationList(); |
|
|
|
// that.fromLocationList = that.getFromLocationList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -239,23 +239,23 @@ |
|
|
|
this.$refs.balanceSelect.openPopup(items); |
|
|
|
}, |
|
|
|
|
|
|
|
getFromLocationList() { |
|
|
|
let list = []; |
|
|
|
this.dataContent.forEach(location => { |
|
|
|
location.Items.forEach(item => { |
|
|
|
item.Locations.forEach(f => { |
|
|
|
let item = list.find(l => l == f.fromLocationCode); |
|
|
|
if (item == undefined) { |
|
|
|
list.push(f.fromLocationCode) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
//去掉重复库位 |
|
|
|
list = uniqueArray(list); |
|
|
|
this.fromLocationCode = list[0]; |
|
|
|
return list; |
|
|
|
}, |
|
|
|
// getFromLocationList() { |
|
|
|
// let list = []; |
|
|
|
// this.dataContent.forEach(location => { |
|
|
|
// location.Items.forEach(item => { |
|
|
|
// item.Locations.forEach(f => { |
|
|
|
// let item = list.find(l => l == f.fromLocationCode); |
|
|
|
// if (item == undefined) { |
|
|
|
// list.push(f.fromLocationCode) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// }); |
|
|
|
// //去掉重复库位 |
|
|
|
// list = uniqueArray(list); |
|
|
|
// this.fromLocationCode = list[0]; |
|
|
|
// return list; |
|
|
|
// }, |
|
|
|
|
|
|
|
fromLocationUpdate(fromlocation) { |
|
|
|
let location = this.fromLocationList.find(r => r == fromlocation) |
|
|
@ -268,12 +268,12 @@ |
|
|
|
onScanResult(result) { |
|
|
|
try { |
|
|
|
let that = this; |
|
|
|
if (that.fromLocationCode == '') { |
|
|
|
that.showErrorMessage('请选择来源库位', res => { |
|
|
|
that.$refs.toLocationCombox.onFocus(); |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
// if (that.fromLocationCode == '') { |
|
|
|
// that.showErrorMessage('请选择来源库位', res => { |
|
|
|
// that.$refs.toLocationCombox.onFocus(); |
|
|
|
// }); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
let packageInfo = result.package; |
|
|
|
let itemCode = result.label.itemCode; |
|
|
|
let packingCode = result.label.packingNumber; |
|
|
@ -287,7 +287,7 @@ |
|
|
|
) |
|
|
|
return; |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
var params = { |
|
|
|
itemCode: result.package.itemCode, |
|
|
|
batch: result.label.batch, |
|
|
@ -318,9 +318,7 @@ |
|
|
|
|
|
|
|
if (result.label.packingNumber != result.balance.packingNumber) { |
|
|
|
result.balance.handleQty = Number(result.label.qty) |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
result.balance.handleQty = Number(result.balance.qty) |
|
|
|
} |
|
|
|
this.afterGetBalance(result.label, result.balance, result.package); |
|
|
@ -502,62 +500,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onScanResult1(result) { |
|
|
|
try { |
|
|
|
let that = this; |
|
|
|
if (that.fromLocationCode == '') { |
|
|
|
that.showErrorMessage('请选择来源库位', res => { |
|
|
|
that.$refs.toLocationCombox.onFocus(); |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
that.label = result.label; |
|
|
|
that.packageInfo = result.package; |
|
|
|
// let packageInfo = result.package; |
|
|
|
let itemCode = result.label.itemCode; |
|
|
|
let packingCode = result.label.packingNumber; |
|
|
|
let lot = result.label.batch; |
|
|
|
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); |
|
|
|
if (item == undefined) { |
|
|
|
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细', |
|
|
|
res => { |
|
|
|
that.getfocus(); |
|
|
|
} |
|
|
|
) |
|
|
|
return; |
|
|
|
} else { |
|
|
|
//查找库存信息 |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
|
balanceRes => { |
|
|
|
if (balanceRes.success) { |
|
|
|
if (balanceRes.data.list.length == 0) { |
|
|
|
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
|
res => { |
|
|
|
this.packGetFocus(); |
|
|
|
}) |
|
|
|
} else if (balanceRes.data.list.length == 1) { |
|
|
|
let balance = balanceRes.data.list[0]; |
|
|
|
this.afterGetBalance(result.label, balance, that.packageInfo); |
|
|
|
} else { |
|
|
|
this.showBalanceSelect(balanceRes.data.list); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showErrorMessage(balanceRes.message.message); |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.stack) |
|
|
|
uni.hideLoading(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectBalanceItem(balance) { |
|
|
|
this.afterGetBalance(this.label, balance, this.packageInfo); |
|
|
|
}, |
|
|
@ -569,6 +512,7 @@ |
|
|
|
let packingCode = label.packingNumber; |
|
|
|
let lot = label.batch; |
|
|
|
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); |
|
|
|
that.fromLocationCode = balance.locationCode; |
|
|
|
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); |
|
|
|
if (fromLocation != undefined) { |
|
|
|
let batch = fromLocation.Batchs.find(r => r.batch == lot); |
|
|
@ -580,7 +524,7 @@ |
|
|
|
let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
|
if (record == undefined) { |
|
|
|
//如果有推荐箱码 |
|
|
|
if ( batch.Recommends !=undefined && batch.Recommends.length > 0) { |
|
|
|
if (batch.Recommends != undefined && batch.Recommends.length > 0) { |
|
|
|
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); |
|
|
|
if (recommend != undefined) { |
|
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
@ -631,11 +575,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细', |
|
|
|
res => { |
|
|
|
that.getfocus(); |
|
|
|
} |
|
|
|
) |
|
|
|
let locaion = that.createLocationInfo(label, balance, packageInfo); |
|
|
|
item.Locations.push(locaion); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
that.showErrorMessage(e.stack, |
|
|
@ -646,6 +587,22 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//增加实际扫描的明细 |
|
|
|
createLocationInfo(label, balance, packageInfo) { |
|
|
|
let location = { |
|
|
|
fromLocationCode: balance.locationCode, |
|
|
|
qty: balance.qty, |
|
|
|
uom: balance.uom, |
|
|
|
handleQty: 0, |
|
|
|
Batchs: [] |
|
|
|
} |
|
|
|
let batch = this.createBatchInfo(label, balance, packageInfo); |
|
|
|
batch.detail = balance; |
|
|
|
location.Batchs.push(batch); |
|
|
|
return location; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createBatchInfo(data, balance, packageInfo) { |
|
|
|
let batch = { |
|
|
|
batch: data.batch, |
|
|
@ -672,7 +629,7 @@ |
|
|
|
// qty: Number(balance.qty), |
|
|
|
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), |
|
|
|
qty: balance.handleQty, |
|
|
|
handleQty:balance.handleQty, |
|
|
|
handleQty: balance.handleQty, |
|
|
|
uom: balance.uom, |
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
balance: balance, |
|
|
@ -681,7 +638,7 @@ |
|
|
|
packUnit: packageInfo.packUnit, |
|
|
|
packQty: packageInfo.packQty |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return record; |
|
|
|
}, |
|
|
|
|
|
|
|