|
|
@ -57,7 +57,7 @@ |
|
|
|
import { |
|
|
|
issueRecordSubmit, |
|
|
|
getWorkShopLineStation, |
|
|
|
getBalanceByFilter |
|
|
|
getTransactionByFilter |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -228,11 +228,24 @@ |
|
|
|
if (pack.parentNumber) { |
|
|
|
//子包装没有库存 |
|
|
|
if (childBalance.length == 0) { |
|
|
|
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 { |
|
|
|
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); |
|
|
@ -246,9 +259,17 @@ |
|
|
|
|
|
|
|
} else { |
|
|
|
//如果子包装没有库存,取父包装库存 |
|
|
|
//查询是不是已经出过库,在发料任务中产生了出库库存事务 |
|
|
|
let transaction = transactionRes.find(p => p.packingNumber == sub |
|
|
|
.number) |
|
|
|
if (!transaction) { |
|
|
|
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 = {}; |
|
|
|