|
|
@ -57,7 +57,7 @@ |
|
|
|
import { |
|
|
|
issueRecordSubmit, |
|
|
|
getWorkShopLineStation, |
|
|
|
getBalanceByFilter |
|
|
|
getTransactionByFilter |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -228,27 +228,48 @@ |
|
|
|
if (pack.parentNumber) { |
|
|
|
//子包装没有库存 |
|
|
|
if (childBalance.length == 0) { |
|
|
|
this.setPackageData(parentBalance, pack); |
|
|
|
this.getTransactionList(pack.number, transactionRes => { |
|
|
|
if (transactionRes.length == 0) { |
|
|
|
this.setPackageData(parentBalance, pack); |
|
|
|
} else { |
|
|
|
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch + |
|
|
|
"]已经发过料") |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { //子包装有库存 |
|
|
|
this.setPackageData(childBalance[0], pack); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//扫描的是父包装,要过滤掉不在超市的库存,加上没有的库存 |
|
|
|
pack.subList.forEach(sub => { |
|
|
|
let subBalance = childBalance.find(r => r.packingNumber == sub.number); |
|
|
|
if (subBalance) { |
|
|
|
//校验父包装和子包装是否在一个库位 |
|
|
|
if (subBalance.locationCode == parentBalance.locationCode) { |
|
|
|
this.setPackageData(subBalance, sub); |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
//如果子包装没有库存,取父包装库存 |
|
|
|
this.setPackageData(parentBalance, sub); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -289,6 +310,35 @@ |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
|
|
|
|
//查询发料的业务类型 |
|
|
|
getTransactionList(packingNumbers, callback) { |
|
|
|
let params = { |
|
|
|
filters: [{ |
|
|
|
column: "businessType", |
|
|
|
action: "==", |
|
|
|
value: "发料" |
|
|
|
}, { |
|
|
|
column: "packingNumber", |
|
|
|
action: "in", |
|
|
|
value: packingNumbers |
|
|
|
}, { |
|
|
|
column: "inventoryAction", |
|
|
|
action: "==", |
|
|
|
value: "OUT" |
|
|
|
}], |
|
|
|
pageSize: 20, |
|
|
|
pageNo: 1, |
|
|
|
sort: "", |
|
|
|
by: "ASC" |
|
|
|
} |
|
|
|
|
|
|
|
getTransactionByFilter(params).then(res => { |
|
|
|
callback(res.data.list); |
|
|
|
}).catch(err => { |
|
|
|
callback([]); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createPackageDetail(balance, pack) { |
|
|
|
let newDetail = {}; |
|
|
|