|
@ -113,7 +113,9 @@ |
|
|
import { |
|
|
import { |
|
|
getBalanceByManagementPrecision |
|
|
getBalanceByManagementPrecision |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
import { |
|
|
|
|
|
getDirectoryItemArray |
|
|
|
|
|
} from '../../../common/directory.js'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'winScanPack', |
|
|
name: 'winScanPack', |
|
@ -185,7 +187,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
let that = this; |
|
|
let that = this; |
|
|
that.fromLocationList = []; |
|
|
that.fromLocationList = []; |
|
|
if (that.dataContent != null) { |
|
|
if (that.dataContent != null) { |
|
|
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses |
|
|
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses |
|
|
that.toLocation = that.dataContent[0]; |
|
|
that.toLocation = that.dataContent[0]; |
|
|
that.toLocationCode = that.dataContent[0].toLocationCode; |
|
|
that.toLocationCode = that.dataContent[0].toLocationCode; |
|
|
that.fromLocationList = that.getFromLocationList(); |
|
|
that.fromLocationList = that.getFromLocationList(); |
|
@ -249,15 +251,16 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.getBalance(result.label,packageInfo, balances => { |
|
|
this.getBalance(result.label, packageInfo, balances => { |
|
|
|
|
|
|
|
|
//扫描的是外包装 |
|
|
//扫描的是外包装 |
|
|
let s = ''; |
|
|
let s = ''; |
|
|
if (result.package.parentNumber == null || result.package.parentNumber == '') { |
|
|
if (!result.package.parentNumber) { |
|
|
if (balances.list.length == 0) { |
|
|
if (balances.list.length == 0) { |
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
} else { |
|
|
} else { |
|
|
let newBalances = balances.list.filter(b => b.locationCode ==that.fromLocationCode); |
|
|
let newBalances = balances.list.filter(b => b.locationCode == that |
|
|
|
|
|
.fromLocationCode); |
|
|
if (newBalances.length == 0) { |
|
|
if (newBalances.length == 0) { |
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
} else if (newBalances.length == 1) { |
|
|
} else if (newBalances.length == 1) { |
|
@ -270,10 +273,52 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
} else { |
|
|
} else { |
|
|
//扫描的是小包装 |
|
|
//扫描的是小包装 |
|
|
if (balances.list.length == 0) { |
|
|
if (balances.list.length == 0) { |
|
|
this.afterGetBalance(result.label, null, packageInfo); |
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode + |
|
|
//小包装库存 |
|
|
'】已经有库存余额,请重新扫描') |
|
|
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo |
|
|
|
|
|
.number) |
|
|
|
|
|
//外包装库存 |
|
|
|
|
|
let subParentPackitems = balances.list.filter(r => r.packingNumber == |
|
|
|
|
|
packageInfo |
|
|
|
|
|
.parentNumber) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//小包装没有库存, |
|
|
|
|
|
if (subPackitems.length == 0) { |
|
|
|
|
|
//外包装有库存,出库后剩余库存未转换为出库包装规格 |
|
|
|
|
|
|
|
|
|
|
|
if (subParentPackitems.length > 0) { |
|
|
|
|
|
if(subParentPackitems.length==1){ |
|
|
|
|
|
let balance = subParentPackitems[0]; |
|
|
|
|
|
this.afterGetBalance(result.label, balance, packageInfo); |
|
|
|
|
|
}else { |
|
|
|
|
|
this.showBalanceSelect(subParentPackitems); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' + |
|
|
|
|
|
packageInfo.number + '】都未查找到库存余额') |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + balances |
|
|
|
|
|
.list[0].locationCode + |
|
|
|
|
|
'】已经有库存余额,请重新扫描') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //小包装没有库存,外包装有库存 |
|
|
|
|
|
// if (subitems.length == 0 && subParentPackitems.length > 0) { |
|
|
|
|
|
// this.afterGetBalance(result.label, null, packageInfo); |
|
|
|
|
|
// } else if (subitems.length > 0 && subParentPackitems.length == 0) { |
|
|
|
|
|
// //小包装没有库存,外包装没有有库存 |
|
|
|
|
|
// this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode + |
|
|
|
|
|
// '】已经有库存余额,请重新扫描') |
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -304,24 +349,24 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getBalance(label, packageInfo,callback) { |
|
|
getBalance(label, packageInfo, callback) { |
|
|
var filters = [] |
|
|
var filters = [] |
|
|
|
|
|
|
|
|
if (packageInfo.parentNumber) { |
|
|
if (packageInfo.parentNumber) { |
|
|
var packingNumber = packageInfo.parentNumber + "," + packageInfo.packingNumber; |
|
|
var packingNumber = packageInfo.parentNumber + "," + label.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: packageInfo.packingNumber |
|
|
value: label.packingNumber |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "itemCode", |
|
|
column: "itemCode", |
|
|
action: "==", |
|
|
action: "==", |
|
@ -484,8 +529,9 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
let record = { |
|
|
let record = { |
|
|
scaned: true, |
|
|
scaned: true, |
|
|
itemCode: balance.itemCode, |
|
|
itemCode: balance.itemCode, |
|
|
packingNumber: balance.packingNumber, |
|
|
packingNumber: packageInfo.number, |
|
|
batch: balance.batch, |
|
|
parentPackingNumber: packageInfo.parentNumber, |
|
|
|
|
|
batch: packageInfo.batch, |
|
|
qty: Number(balance.qty), |
|
|
qty: Number(balance.qty), |
|
|
// qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), |
|
|
// qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), |
|
|
uom: balance.uom, |
|
|
uom: balance.uom, |
|
@ -579,10 +625,11 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
if (item != undefined) { |
|
|
if (item != undefined) { |
|
|
item.Locations.forEach(l => { |
|
|
item.Locations.forEach(l => { |
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || |
|
|
|
|
|
b |
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
|
|
record.batch); |
|
|
record.batch); |
|
|
|
|
|
|
|
|
let rIndex = batch.Records.findIndex(r => r.packingNumber == record |
|
|
let rIndex = batch.Records.findIndex(r => r.packingNumber == record |
|
|
.packingNumber && r |
|
|
.packingNumber && r |
|
|
.batch == record.batch); |
|
|
.batch == record.batch); |
|
|