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