|
|
@ -200,7 +200,6 @@ |
|
|
|
let pack = result.package; |
|
|
|
let childBalance = result.balance.childBalance; |
|
|
|
let parentBalance = result.balance.parentBalance[0]; |
|
|
|
|
|
|
|
//1.先判断是否重复扫描 |
|
|
|
if (this.itemCode) { |
|
|
|
var item = this.detailSource.find(res => res.itemCode == pack.itemCode) |
|
|
@ -240,35 +239,46 @@ |
|
|
|
this.setPackageData(childBalance[0], pack); |
|
|
|
} |
|
|
|
} else { |
|
|
|
let packparams = ''; |
|
|
|
pack.subList.forEach(pack => { |
|
|
|
packparams = packparams + pack.number + ',' |
|
|
|
}) |
|
|
|
packparams = packparams.trimEnd(','); |
|
|
|
this.getTransactionList(packparams, transactionRes => { |
|
|
|
//扫描的是父包装,要过滤掉不在超市的库存,加上没有的库存 |
|
|
|
pack.subList.forEach(sub => { |
|
|
|
let subBalance = childBalance.find(r => r.packingNumber == sub.number); |
|
|
|
if (subBalance) { |
|
|
|
//校验父包装和子包装是否在一个库位 |
|
|
|
if (subBalance.locationCode == parentBalance.locationCode) { |
|
|
|
this.setPackageData(subBalance, sub); |
|
|
|
} else { |
|
|
|
//不在一个库位暂时先不加 |
|
|
|
} |
|
|
|
|
|
|
|
//扫描的是没有父包装的,自己就是子包装 |
|
|
|
if(pack.subList.length==0){ |
|
|
|
this.getTransactionList(pack.number, transactionRes => { |
|
|
|
if (transactionRes.length == 0) { |
|
|
|
this.setPackageData(childBalance[0], pack); |
|
|
|
} else { |
|
|
|
//如果子包装没有库存,取父包装库存 |
|
|
|
//查询是不是已经出过库,在发料任务中产生了出库库存事务 |
|
|
|
let transaction = transactionRes.find(p => p.packingNumber == sub |
|
|
|
.number) |
|
|
|
if (!transaction) { |
|
|
|
this.setPackageData(parentBalance, sub); |
|
|
|
} |
|
|
|
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch + |
|
|
|
"]已经发过料") |
|
|
|
} |
|
|
|
}); |
|
|
|
}else { |
|
|
|
let packparams = ''; |
|
|
|
pack.subList.forEach(pack => { |
|
|
|
packparams = packparams + pack.number + ',' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
packparams = packparams.trimEnd(','); |
|
|
|
this.getTransactionList(packparams, transactionRes => { |
|
|
|
//扫描的是父包装,要过滤掉不在超市的库存,加上没有的库存 |
|
|
|
pack.subList.forEach(sub => { |
|
|
|
let subBalance = childBalance.find(r => r.packingNumber == sub.number); |
|
|
|
if (subBalance) { |
|
|
|
//校验父包装和子包装是否在一个库位 |
|
|
|
if (subBalance.locationCode == parentBalance.locationCode) { |
|
|
|
this.setPackageData(subBalance, sub); |
|
|
|
} else { |
|
|
|
//不在一个库位暂时先不加 |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
//如果子包装没有库存,取父包装库存 |
|
|
|
//查询是不是已经出过库,在发料任务中产生了出库库存事务 |
|
|
|
let transaction = transactionRes.find(p => p.packingNumber == sub |
|
|
|
.number) |
|
|
|
if (!transaction) { |
|
|
|
this.setPackageData(parentBalance, sub); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|