|
@ -69,8 +69,8 @@ |
|
|
<uni-swipe-action-item @click="swipeClick($event,record,index)" |
|
|
<uni-swipe-action-item @click="swipeClick($event,record,index)" |
|
|
:right-options="scanOptions"> |
|
|
:right-options="scanOptions"> |
|
|
<view style="padding: 0px 10px"> |
|
|
<view style="padding: 0px 10px"> |
|
|
<balance :dataContent="record" :isShowFromLocation="false" :isShowStatus='true' |
|
|
<balance :dataContent="record" :isShowFromLocation="false" |
|
|
:isShowStdPack="false"></balance> |
|
|
:isShowStatus='true' :isShowStdPack="false"></balance> |
|
|
</view> |
|
|
</view> |
|
|
</uni-swipe-action-item> |
|
|
</uni-swipe-action-item> |
|
|
</uni-swipe-action> |
|
|
</uni-swipe-action> |
|
@ -102,7 +102,8 @@ |
|
|
getDetailEditRemoveOption |
|
|
getDetailEditRemoveOption |
|
|
} from '@/common/array.js'; |
|
|
} from '@/common/array.js'; |
|
|
import { |
|
|
import { |
|
|
getWorkShopLineStation |
|
|
getWorkShopLineStation, |
|
|
|
|
|
getBalanceByFilter |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -222,7 +223,6 @@ |
|
|
onScan(result) { |
|
|
onScan(result) { |
|
|
try { |
|
|
try { |
|
|
let that = this; |
|
|
let that = this; |
|
|
|
|
|
|
|
|
if (that.fromLocationCode == '') { |
|
|
if (that.fromLocationCode == '') { |
|
|
that.showErrorMessage('请选择来源库位', res => { |
|
|
that.showErrorMessage('请选择来源库位', res => { |
|
|
that.$refs.toLocationCombox.onFocus(); |
|
|
that.$refs.toLocationCombox.onFocus(); |
|
@ -242,22 +242,48 @@ |
|
|
) |
|
|
) |
|
|
return; |
|
|
return; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
//查找库存信息 |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '加载中', |
|
|
|
|
|
mask: true |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.getBalance(result.label, balances => { |
|
|
|
|
|
//扫描的是外包装 |
|
|
|
|
|
let s = ''; |
|
|
|
|
|
if (result.package.parentNumber == null || 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.afterGetBalance(result.label, null, packageInfo); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode + |
|
|
|
|
|
'】已经有库存余额,请重新扫描') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.afterGetBalance(result.label, result.label, packageInfo); |
|
|
|
|
|
|
|
|
|
|
|
// //查找库存信息 |
|
|
|
|
|
// uni.showLoading({ |
|
|
|
|
|
// title: '加载中', |
|
|
|
|
|
// mask: true |
|
|
|
|
|
// }) |
|
|
|
|
|
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
// balanceRes => { |
|
|
// balanceRes => { |
|
|
// if (balanceRes.success) { |
|
|
// if (balanceRes.success) { |
|
|
|
|
|
// let s = ''; |
|
|
// if (balanceRes.data.list.length == 0) { |
|
|
// if (balanceRes.data.list.length == 0) { |
|
|
// this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
// this.afterGetBalance(result.label, null, packageInfo); |
|
|
// res => { |
|
|
|
|
|
// this.packGetFocus(); |
|
|
|
|
|
// }) |
|
|
|
|
|
// } else if (balanceRes.data.list.length == 1) { |
|
|
// } else if (balanceRes.data.list.length == 1) { |
|
|
// let balance = balanceRes.data.list[0]; |
|
|
// let balance = balanceRes.data.list[0]; |
|
|
// this.afterGetBalance(result.label, balance, packageInfo); |
|
|
// this.afterGetBalance(result.label, balance, packageInfo); |
|
@ -275,6 +301,45 @@ |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getBalance(label, callback) { |
|
|
|
|
|
var filters = [] |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
column: "packingNumber", |
|
|
|
|
|
action: "==", |
|
|
|
|
|
value: label.packingNumber |
|
|
|
|
|
}) |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
column: "itemCode", |
|
|
|
|
|
action: "==", |
|
|
|
|
|
value: label.itemCode |
|
|
|
|
|
}) |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
column: "batch", |
|
|
|
|
|
action: "==", |
|
|
|
|
|
value: label.batch |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") { |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
column: "inventoryStatus", |
|
|
|
|
|
action: "in", |
|
|
|
|
|
value: this.fromInventoryStatuses |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var params = { |
|
|
|
|
|
filters: filters, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
pageSize: 100, |
|
|
|
|
|
} |
|
|
|
|
|
getBalanceByFilter(params).then(res => { |
|
|
|
|
|
callback(res.data) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.showErrorMessage(err.message); |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
selectBalanceItem(balance) { |
|
|
selectBalanceItem(balance) { |
|
|
this.afterGetBalance(this.label, balance); |
|
|
this.afterGetBalance(this.label, balance); |
|
|
}, |
|
|
}, |
|
@ -297,14 +362,14 @@ |
|
|
let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
if (record == undefined) { |
|
|
if (record == undefined) { |
|
|
//如果有推荐箱码 |
|
|
//如果有推荐箱码 |
|
|
if (batch.Recommends!=undefined && batch.Recommends.length > 0) { |
|
|
if (batch.Recommends != undefined && batch.Recommends.length > 0) { |
|
|
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); |
|
|
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); |
|
|
if (recommend != undefined) { |
|
|
if (recommend != undefined) { |
|
|
that.addRecord(batch, label, packageInfo) |
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
} else { |
|
|
} else { |
|
|
//允许修改箱码 |
|
|
//允许修改箱码 |
|
|
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
that.addRecord(batch, label, packageInfo); |
|
|
that.addRecord(batch, label, balance, packageInfo); |
|
|
} else { |
|
|
} else { |
|
|
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
res => { |
|
|
res => { |
|
@ -314,7 +379,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
that.addRecord(batch, label, packageInfo) |
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
|
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
@ -325,7 +390,6 @@ |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (this.jobContent.allowModifyBatch == "TRUE") { |
|
|
if (this.jobContent.allowModifyBatch == "TRUE") { |
|
|
|
|
|
|
|
|
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,批次【' + lot + |
|
|
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,批次【' + lot + |
|
|
'】不是推荐批次,是否要继续发料?', res => { |
|
|
'】不是推荐批次,是否要继续发料?', res => { |
|
|
if (res) { |
|
|
if (res) { |
|
@ -351,29 +415,37 @@ |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
that.showErrorMessage(e.stack, |
|
|
this.showErrorMessage(e.stack, |
|
|
res => { |
|
|
res => { |
|
|
that.getfocus(); |
|
|
this.getfocus(); |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
createBatchInfo(data, balance, packageInfo) { |
|
|
createBatchInfo(label, balance, packageInfo) { |
|
|
let batch = { |
|
|
let batch = { |
|
|
batch: data.batch, |
|
|
batch: label.batch, |
|
|
qty: 0, |
|
|
qty: 0, |
|
|
uom: data.uom, |
|
|
uom: label.uom, |
|
|
handleQty: Number(data.qty), |
|
|
|
|
|
Records: [] |
|
|
Records: [] |
|
|
} |
|
|
} |
|
|
let record = this.creatRecord(data, packageInfo); |
|
|
let record = {} |
|
|
|
|
|
if (balance == null) { |
|
|
|
|
|
record = this.creatRecordByBalance(label, packageInfo); |
|
|
|
|
|
batch.handleQty = Number(label.qty) |
|
|
|
|
|
} else { |
|
|
|
|
|
record = this.creatRecordByLabel(balance, packageInfo); |
|
|
|
|
|
batch.handleQty = Number(balance.qty) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
batch.Records.push(record); |
|
|
batch.Records.push(record); |
|
|
this.issueRecord.unshift(record) |
|
|
this.issueRecord.unshift(record) |
|
|
return batch; |
|
|
return batch; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
creatRecord(label, packageInfo) { |
|
|
creatRecordByLabel(label, packageInfo) { |
|
|
let record = { |
|
|
let record = { |
|
|
scaned: true, |
|
|
scaned: true, |
|
|
itemCode: label.itemCode, |
|
|
itemCode: label.itemCode, |
|
@ -387,32 +459,30 @@ |
|
|
balance: null, |
|
|
balance: null, |
|
|
toLocationCode: this.toLocationCode, |
|
|
toLocationCode: this.toLocationCode, |
|
|
supplierCode: label.supplierCode, |
|
|
supplierCode: label.supplierCode, |
|
|
packUnit:packageInfo.packUnit, |
|
|
packUnit: packageInfo.packUnit, |
|
|
packQty:packageInfo.packQty |
|
|
packQty: packageInfo.packQty |
|
|
} |
|
|
} |
|
|
return record; |
|
|
return record; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
creatRecordByBalance(balance, packageInfo) { |
|
|
|
|
|
balance.packQty = packageInfo.packQty |
|
|
// creatRecord(label, balance, packageInfo) { |
|
|
balance.packUnit = packageInfo.packUnit |
|
|
// balance.packQty = packageInfo.packQty |
|
|
let record = { |
|
|
// balance.packUnit = packageInfo.packUnit |
|
|
scaned: true, |
|
|
// let record = { |
|
|
itemCode: balance.itemCode, |
|
|
// scaned: true, |
|
|
packingNumber: balance.packingNumber, |
|
|
// itemCode: label.itemCode, |
|
|
batch: balance.batch, |
|
|
// packingNumber: label.packingNumber, |
|
|
qty: Number(balance.qty), |
|
|
// batch: label.batch, |
|
|
// qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), |
|
|
// qty: Number(balance.qty), |
|
|
uom: balance.uom, |
|
|
// // qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), |
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
// uom: balance.uom, |
|
|
balance: balance, |
|
|
// inventoryStatus: balance.inventoryStatus, |
|
|
toLocationCode: this.toLocationCode, |
|
|
// balance: balance, |
|
|
supplierCode: balance.supplierCode |
|
|
// toLocationCode: this.toLocationCode, |
|
|
} |
|
|
// supplierCode: label.supplierCode |
|
|
return record; |
|
|
// } |
|
|
}, |
|
|
// return record; |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
calcBatchHandleQty(batch) { |
|
|
calcBatchHandleQty(batch) { |
|
|
let handleQty = 0; |
|
|
let handleQty = 0; |
|
@ -436,8 +506,13 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
addRecord(batch, label, packageInfo) { |
|
|
addRecord(batch, label, balance, packageInfo) { |
|
|
let record = this.creatRecord(label, packageInfo); |
|
|
let record = {}; |
|
|
|
|
|
if (balance == null) { |
|
|
|
|
|
record = this.creatRecordByLabel(label, packageInfo); |
|
|
|
|
|
} else { |
|
|
|
|
|
record = this.creatRecordByBalance(balance, packageInfo); |
|
|
|
|
|
} |
|
|
batch.Records.push(record); |
|
|
batch.Records.push(record); |
|
|
this.issueRecord.unshift(record) |
|
|
this.issueRecord.unshift(record) |
|
|
this.calcBatchHandleQty(batch); |
|
|
this.calcBatchHandleQty(batch); |
|
|