|
|
@ -287,7 +287,52 @@ |
|
|
|
) |
|
|
|
return; |
|
|
|
} else { |
|
|
|
this.queryBalance(result); |
|
|
|
|
|
|
|
var params = { |
|
|
|
itemCode: result.package.itemCode, |
|
|
|
batch: result.label.batch, |
|
|
|
packingNumber: result.label.packingNumber, |
|
|
|
parentPackingNumber: result.package.parentNumber, |
|
|
|
inventoryStatus: this.jobContent.outInventoryStatuses.split(','), |
|
|
|
areaType: this.jobContent.fromAreaTypes.split(','), |
|
|
|
bussinessCode: this.jobContent.businessType |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: '查询中', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getBalanceByParams(params).then(res => { |
|
|
|
if (res.data.length == 0) { |
|
|
|
var status = getInventoryStatusDesc(params.inventoryStatus) |
|
|
|
var areaType = getListLocationAreaTypeDesc(params.areaType) |
|
|
|
var hint = |
|
|
|
"按物料号 [" + params.itemCode + "] <br>" + |
|
|
|
"包装号 [" + params.packingNumber + "] <br>" + |
|
|
|
"批次 [" + params.batch + "] <br>" + |
|
|
|
"状态 [" + status + "] <br>" + |
|
|
|
"库区 [" + areaType + "] <br>" + |
|
|
|
"未查找到库存余额" |
|
|
|
this.showErrorMessage(hint) |
|
|
|
} else if (res.data.length == 1) { |
|
|
|
result.balance = res.data[0] |
|
|
|
|
|
|
|
if (result.label.packingNumber != result.balance.packingNumber) { |
|
|
|
result.balance.handleQty = Number(result.label.qty) |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
result.balance.handleQty = Number(result.balance.qty) |
|
|
|
} |
|
|
|
this.afterGetBalance(result.label, result.balance, result.package); |
|
|
|
} else { |
|
|
|
//多条记录 |
|
|
|
this.$refs.balanceSelect.openPopup(res.data); |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
// this.getBalance(result.label, packageInfo, balances => { |
|
|
|
// this.packageInfo = packageInfo; |
|
|
@ -381,55 +426,8 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
queryBalance(result) { |
|
|
|
var params = { |
|
|
|
itemCode: result.package.itemCode, |
|
|
|
batch: result.label.batch, |
|
|
|
packingNumber: result.label.packingNumber, |
|
|
|
parentPackingNumber: result.package.parentNumber, |
|
|
|
inventoryStatus: this.jobContent.outInventoryStatuses.split(','), |
|
|
|
areaType: this.jobContent.fromAreaTypes.split(','), |
|
|
|
bussinessCode: this.jobContent.businessType |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: '查询中', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getBalanceByParams(params).then(res => { |
|
|
|
if (res.data.length == 0) { |
|
|
|
var status = getInventoryStatusDesc(params.inventoryStatus) |
|
|
|
var areaType = getListLocationAreaTypeDesc(params.areaType) |
|
|
|
var hint = |
|
|
|
"按物料号 [" + params.itemCode + "] <br>" + |
|
|
|
"包装号 [" + params.packingNumber + "] <br>" + |
|
|
|
"批次 [" + params.batch + "] <br>" + |
|
|
|
"状态 [" + status + "] <br>" + |
|
|
|
"库区 [" + areaType + "] <br>" + |
|
|
|
"未查找到库存余额" |
|
|
|
this.showErrorMessage(hint) |
|
|
|
} else if (res.data.length == 1) { |
|
|
|
|
|
|
|
result.balance = res.data[0] |
|
|
|
if (result.label.packingNumber != result.balance.packingNumber) { |
|
|
|
result.balance.lableQty = Number(result.label.qty) |
|
|
|
} |
|
|
|
this.afterGetBalance(result.label, result.balance, result.package); |
|
|
|
} else { |
|
|
|
//多条记录 |
|
|
|
this.$refs.balanceSelect.openPopup(res.data); |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getBalance(label, packageInfo, callback) { |
|
|
|
var filters = [] |
|
|
|
|
|
|
|
if (packageInfo.parentNumber) { |
|
|
|
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; |
|
|
|
filters.push({ |
|
|
@ -582,7 +580,7 @@ |
|
|
|
let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
|
if (record == undefined) { |
|
|
|
//如果有推荐箱码 |
|
|
|
if (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) |
|
|
@ -653,7 +651,7 @@ |
|
|
|
batch: data.batch, |
|
|
|
qty: 0, |
|
|
|
uom: data.uom, |
|
|
|
handleQty: Number(data.qty), |
|
|
|
handleQty: Number(balance.handleQty), |
|
|
|
Records: [] |
|
|
|
} |
|
|
|
let record = this.creatRecord(data, balance, packageInfo); |
|
|
@ -673,7 +671,8 @@ |
|
|
|
batch: label.batch, |
|
|
|
// qty: Number(balance.qty), |
|
|
|
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), |
|
|
|
qty: balance.qty ?? Number(label.qty), |
|
|
|
qty: balance.handleQty, |
|
|
|
handleQty:balance.handleQty, |
|
|
|
uom: balance.uom, |
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
balance: balance, |
|
|
@ -682,6 +681,7 @@ |
|
|
|
packUnit: packageInfo.packUnit, |
|
|
|
packQty: packageInfo.packQty |
|
|
|
} |
|
|
|
|
|
|
|
return record; |
|
|
|
}, |
|
|
|
|
|
|
|