|
@ -186,26 +186,26 @@ |
|
|
that.fromLocationList = that.getFromLocationList(); |
|
|
that.fromLocationList = that.getFromLocationList(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showBalanceSelect(items) { |
|
|
showBalanceSelect(items) { |
|
|
this.$refs.balanceSelect.openPopup(items); |
|
|
this.$refs.balanceSelect.openPopup(items); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getFromLocationList() { |
|
|
getFromLocationList() { |
|
|
let list = []; |
|
|
let list = []; |
|
|
let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode); |
|
|
this.dataContent.forEach(location => { |
|
|
if (location != undefined) { |
|
|
|
|
|
location.Items.forEach(item => { |
|
|
location.Items.forEach(item => { |
|
|
item.Locations.forEach(f => { |
|
|
item.Locations.forEach(f => { |
|
|
|
|
|
let item = list.find(l => l == f.fromLocationCode); |
|
|
|
|
|
if (item == undefined) { |
|
|
list.push(f.fromLocationCode) |
|
|
list.push(f.fromLocationCode) |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.fromLocationCode = list[0]; |
|
|
this.fromLocationCode = list[0]; |
|
|
return list; |
|
|
return list; |
|
|
} else { |
|
|
|
|
|
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => { |
|
|
|
|
|
this.toLocationCode = ''; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
fromLocationUpdate(fromlocation) { |
|
|
fromLocationUpdate(fromlocation) { |
|
@ -215,10 +215,78 @@ |
|
|
this.showErrorMessage('发料库位【' + fromlocation + '】不存在') |
|
|
this.showErrorMessage('发料库位【' + fromlocation + '】不存在') |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onScan(result) { |
|
|
onScan1(result) { |
|
|
try { |
|
|
try { |
|
|
let that = this; |
|
|
let that = this; |
|
|
|
|
|
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; |
|
|
|
|
|
let lot = result.label.batch; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
that.dataContent.forEach(l => { |
|
|
|
|
|
let item = l.Items.find(r => r.itemCode == itemCode); |
|
|
|
|
|
if (item == undefined) { |
|
|
|
|
|
continue; |
|
|
|
|
|
// 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, packageInfo); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showBalanceSelect(balanceRes.data.list); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage(balanceRes.message.message); |
|
|
|
|
|
} |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
this.showErrorMessage(e.stack) |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onScan(result) { |
|
|
|
|
|
try { |
|
|
|
|
|
let that = this; |
|
|
if (that.fromLocationCode == '') { |
|
|
if (that.fromLocationCode == '') { |
|
|
that.showErrorMessage('请选择来源库位', res => { |
|
|
that.showErrorMessage('请选择来源库位', res => { |
|
|
that.$refs.toLocationCombox.onFocus(); |
|
|
that.$refs.toLocationCombox.onFocus(); |
|
@ -243,7 +311,8 @@ |
|
|
title: '加载中', |
|
|
title: '加载中', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, balanceRes => { |
|
|
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
|
|
|
balanceRes => { |
|
|
if (balanceRes.success) { |
|
|
if (balanceRes.success) { |
|
|
if (balanceRes.data.list.length == 0) { |
|
|
if (balanceRes.data.list.length == 0) { |
|
|
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
@ -267,6 +336,7 @@ |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
selectBalanceItem(balance) { |
|
|
selectBalanceItem(balance) { |
|
|
this.afterGetBalance(this.label, balance); |
|
|
this.afterGetBalance(this.label, balance); |
|
|
}, |
|
|
}, |
|
@ -384,6 +454,7 @@ |
|
|
handleQty += Number(res.qty) |
|
|
handleQty += Number(res.qty) |
|
|
}) |
|
|
}) |
|
|
batch.handleQty = handleQty; |
|
|
batch.handleQty = handleQty; |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
addRecord(batch, label, balance, packageInfo) { |
|
|
addRecord(batch, label, balance, packageInfo) { |
|
|