|
@ -69,7 +69,7 @@ |
|
|
<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" |
|
|
<balance :dataContent="record" :isShowFromLocation="false" :isShowStatus='true' |
|
|
:isShowStdPack="false"></balance> |
|
|
:isShowStdPack="false"></balance> |
|
|
</view> |
|
|
</view> |
|
|
</uni-swipe-action-item> |
|
|
</uni-swipe-action-item> |
|
@ -106,8 +106,8 @@ |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
calc |
|
|
calc |
|
|
} from '@/common/calc.js'; |
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getBalanceByManagementPrecision |
|
|
getBalanceByManagementPrecision |
|
@ -242,30 +242,33 @@ |
|
|
) |
|
|
) |
|
|
return; |
|
|
return; |
|
|
} else { |
|
|
} else { |
|
|
//查找库存信息 |
|
|
|
|
|
uni.showLoading({ |
|
|
this.afterGetBalance(result.label, result.label, packageInfo); |
|
|
title: '加载中', |
|
|
|
|
|
mask: true |
|
|
// //查找库存信息 |
|
|
}) |
|
|
// uni.showLoading({ |
|
|
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
// title: '加载中', |
|
|
balanceRes => { |
|
|
// mask: true |
|
|
if (balanceRes.success) { |
|
|
// }) |
|
|
if (balanceRes.data.list.length == 0) { |
|
|
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
// balanceRes => { |
|
|
res => { |
|
|
// if (balanceRes.success) { |
|
|
this.packGetFocus(); |
|
|
// if (balanceRes.data.list.length == 0) { |
|
|
}) |
|
|
// this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
} else if (balanceRes.data.list.length == 1) { |
|
|
// res => { |
|
|
let balance = balanceRes.data.list[0]; |
|
|
// this.packGetFocus(); |
|
|
this.afterGetBalance(result.label, balance, packageInfo); |
|
|
// }) |
|
|
} else { |
|
|
// } else if (balanceRes.data.list.length == 1) { |
|
|
this.showBalanceSelect(balanceRes.data.list); |
|
|
// let balance = balanceRes.data.list[0]; |
|
|
} |
|
|
// this.afterGetBalance(result.label, balance, packageInfo); |
|
|
} else { |
|
|
// } else { |
|
|
this.showErrorMessage(balanceRes.message.message); |
|
|
// this.showBalanceSelect(balanceRes.data.list); |
|
|
} |
|
|
// } |
|
|
uni.hideLoading(); |
|
|
// } else { |
|
|
}); |
|
|
// this.showErrorMessage(balanceRes.message.message); |
|
|
|
|
|
// } |
|
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
|
// }); |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
this.showErrorMessage(e.stack) |
|
|
this.showErrorMessage(e.stack) |
|
@ -297,11 +300,11 @@ |
|
|
if (batch.Recommends.length > 0) { |
|
|
if (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, balance, packageInfo) |
|
|
that.addRecord(batch, label, packageInfo) |
|
|
} else { |
|
|
} else { |
|
|
//允许修改箱码 |
|
|
//允许修改箱码 |
|
|
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
that.addRecord(batch, label, balance, packageInfo); |
|
|
that.addRecord(batch, label, packageInfo); |
|
|
} else { |
|
|
} else { |
|
|
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
res => { |
|
|
res => { |
|
@ -311,7 +314,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
that.addRecord(batch, label, packageInfo) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
|
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
@ -325,8 +328,8 @@ |
|
|
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + |
|
|
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + |
|
|
'】的发料明细,是否要继续发料?', res => { |
|
|
'】的发料明细,是否要继续发料?', res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
let batch = that.createBatchInfo(label, balance,packageInfo); |
|
|
let batch = that.createBatchInfo(label, balance, packageInfo); |
|
|
if(fromLocation.Batchs.length>0){ |
|
|
if (fromLocation.Batchs.length > 0) { |
|
|
batch.detail = fromLocation.Batchs[0].detail; |
|
|
batch.detail = fromLocation.Batchs[0].detail; |
|
|
} |
|
|
} |
|
|
fromLocation.Batchs.unshift(batch); |
|
|
fromLocation.Batchs.unshift(batch); |
|
@ -355,7 +358,7 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
createBatchInfo(data, balance,packageInfo) { |
|
|
createBatchInfo(data, balance, packageInfo) { |
|
|
let batch = { |
|
|
let batch = { |
|
|
batch: data.batch, |
|
|
batch: data.batch, |
|
|
qty: 0, |
|
|
qty: 0, |
|
@ -363,54 +366,75 @@ |
|
|
handleQty: Number(data.qty), |
|
|
handleQty: Number(data.qty), |
|
|
Records: [] |
|
|
Records: [] |
|
|
} |
|
|
} |
|
|
let record = this.creatRecord(data, balance,packageInfo); |
|
|
let record = this.creatRecord(data, packageInfo); |
|
|
batch.Records.push(record); |
|
|
batch.Records.push(record); |
|
|
this.issueRecord.unshift(record) |
|
|
this.issueRecord.unshift(record) |
|
|
return batch; |
|
|
return batch; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
creatRecord(label, balance, packageInfo) { |
|
|
creatRecord(label, packageInfo) { |
|
|
balance.packQty = packageInfo.packQty |
|
|
|
|
|
balance.packUnit = packageInfo.packUnit |
|
|
|
|
|
let record = { |
|
|
let record = { |
|
|
scaned: true, |
|
|
scaned: true, |
|
|
itemCode: label.itemCode, |
|
|
itemCode: label.itemCode, |
|
|
packingNumber: label.packingNumber, |
|
|
packingNumber: label.packingNumber, |
|
|
|
|
|
parentPackingNumber: packageInfo.parentNumber, |
|
|
batch: label.batch, |
|
|
batch: label.batch, |
|
|
qty: Number(balance.qty), |
|
|
qty: Number(label.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: label.uom, |
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
inventoryStatus: "OK", |
|
|
balance: balance, |
|
|
balance: null, |
|
|
toLocationCode: this.toLocationCode, |
|
|
toLocationCode: this.toLocationCode, |
|
|
supplierCode: label.supplierCode |
|
|
supplierCode: label.supplierCode |
|
|
} |
|
|
} |
|
|
return record; |
|
|
return record; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// creatRecord(label, balance, packageInfo) { |
|
|
|
|
|
// balance.packQty = packageInfo.packQty |
|
|
|
|
|
// balance.packUnit = packageInfo.packUnit |
|
|
|
|
|
// let record = { |
|
|
|
|
|
// scaned: true, |
|
|
|
|
|
// itemCode: label.itemCode, |
|
|
|
|
|
// packingNumber: label.packingNumber, |
|
|
|
|
|
// batch: label.batch, |
|
|
|
|
|
// qty: Number(balance.qty), |
|
|
|
|
|
// // qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), |
|
|
|
|
|
// uom: balance.uom, |
|
|
|
|
|
// inventoryStatus: balance.inventoryStatus, |
|
|
|
|
|
// balance: balance, |
|
|
|
|
|
// toLocationCode: this.toLocationCode, |
|
|
|
|
|
// supplierCode: label.supplierCode |
|
|
|
|
|
// } |
|
|
|
|
|
// return record; |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
calcBatchHandleQty(batch) { |
|
|
calcBatchHandleQty(batch) { |
|
|
let handleQty = 0; |
|
|
let handleQty = 0; |
|
|
batch.Records.forEach(res => { |
|
|
batch.Records.forEach(res => { |
|
|
handleQty = calc.add(handleQty,res.qty) |
|
|
handleQty = calc.add(handleQty, res.qty) |
|
|
}) |
|
|
}) |
|
|
batch.handleQty = handleQty; |
|
|
batch.handleQty = handleQty; |
|
|
|
|
|
|
|
|
this.dataContent.forEach(toLocationCode=>{ |
|
|
this.dataContent.forEach(toLocationCode => { |
|
|
toLocationCode.Items.forEach(item=>{ |
|
|
toLocationCode.Items.forEach(item => { |
|
|
var itemCodeHandleQty =0; |
|
|
var itemCodeHandleQty = 0; |
|
|
item.Locations.forEach(batch=>{ |
|
|
item.Locations.forEach(batch => { |
|
|
batch.Batchs.forEach(batchHandleQty=>{ |
|
|
batch.Batchs.forEach(batchHandleQty => { |
|
|
itemCodeHandleQty=calc.add(itemCodeHandleQty,batchHandleQty.handleQty) |
|
|
itemCodeHandleQty = calc.add(itemCodeHandleQty, |
|
|
|
|
|
batchHandleQty.handleQty) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
item.handleQty=itemCodeHandleQty; |
|
|
item.handleQty = itemCodeHandleQty; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
addRecord(batch, label, balance, packageInfo) { |
|
|
addRecord(batch, label, packageInfo) { |
|
|
let record = this.creatRecord(label, balance, packageInfo); |
|
|
let record = this.creatRecord(label, packageInfo); |
|
|
batch.Records.push(record); |
|
|
batch.Records.push(record); |
|
|
this.issueRecord.unshift(record) |
|
|
this.issueRecord.unshift(record) |
|
|
this.calcBatchHandleQty(batch); |
|
|
this.calcBatchHandleQty(batch); |
|
|