|
|
@ -45,8 +45,8 @@ |
|
|
|
|
|
|
|
<view class=""> |
|
|
|
<view class=""> |
|
|
|
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" :headerType="headerType" |
|
|
|
:isShowHistory="false"> |
|
|
|
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" |
|
|
|
:headerType="headerType" :isShowHistory="false"> |
|
|
|
</win-com-scan> |
|
|
|
|
|
|
|
<view style="width: 100%;"> |
|
|
@ -102,6 +102,11 @@ |
|
|
|
getDetailOption, |
|
|
|
getDetailEditRemoveOption |
|
|
|
} from '@/common/array.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
import { |
|
|
|
getWorkShopLineStation |
|
|
|
} from '@/api/request2.js'; |
|
|
@ -128,7 +133,7 @@ |
|
|
|
type: String, |
|
|
|
default: "HPQ,HMQ" |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
data() { |
|
|
@ -150,9 +155,9 @@ |
|
|
|
positionInfo: "请选择位置", |
|
|
|
positionList: [], |
|
|
|
defaultValueList: [], |
|
|
|
label:{}, |
|
|
|
fromInventoryStatuses :"", |
|
|
|
packageInfo:{} |
|
|
|
label: {}, |
|
|
|
fromInventoryStatuses: "", |
|
|
|
packageInfo: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -185,14 +190,14 @@ |
|
|
|
let that = this; |
|
|
|
that.fromLocationList = []; |
|
|
|
if (that.dataContent != null) { |
|
|
|
that.fromInventoryStatuses =this.jobContent.outInventoryStatuses |
|
|
|
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses |
|
|
|
that.toLocation = that.dataContent[0]; |
|
|
|
that.toLocationCode = that.dataContent[0].toLocationCode; |
|
|
|
that.fromLocationList = that.getFromLocationList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
showBalanceSelect(items,packageInfo) { |
|
|
|
|
|
|
|
showBalanceSelect(items, packageInfo) { |
|
|
|
this.packageInfo = packageInfo; |
|
|
|
this.$refs.balanceSelect.openPopup(items); |
|
|
|
}, |
|
|
@ -250,38 +255,39 @@ |
|
|
|
title: '加载中', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, balanceRes => { |
|
|
|
if (balanceRes.success) { |
|
|
|
if (balanceRes.data.list.length == 0) { |
|
|
|
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
|
res => { |
|
|
|
this.packGetFocus(); |
|
|
|
}) |
|
|
|
} else if (balanceRes.data.list.length == 1) { |
|
|
|
let balance = balanceRes.data.list[0]; |
|
|
|
this.afterGetBalance(result.label, balance,packageInfo); |
|
|
|
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
|
balanceRes => { |
|
|
|
if (balanceRes.success) { |
|
|
|
if (balanceRes.data.list.length == 0) { |
|
|
|
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', |
|
|
|
res => { |
|
|
|
this.packGetFocus(); |
|
|
|
}) |
|
|
|
} else if (balanceRes.data.list.length == 1) { |
|
|
|
let balance = balanceRes.data.list[0]; |
|
|
|
this.afterGetBalance(result.label, balance, packageInfo); |
|
|
|
} else { |
|
|
|
this.label = result.label; |
|
|
|
this.showBalanceSelect(balanceRes.data.list, packageInfo); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.label =result.label; |
|
|
|
this.showBalanceSelect(balanceRes.data.list,packageInfo); |
|
|
|
this.showErrorMessage(balanceRes.message.message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showErrorMessage(balanceRes.message.message); |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.stack) |
|
|
|
uni.hideLoading(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectBalanceItem(balance) { |
|
|
|
this.afterGetBalance(this.label, balance,this.packageInfo); |
|
|
|
this.afterGetBalance(this.label, balance, this.packageInfo); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
afterGetBalance(label, balance,packageInfo) { |
|
|
|
|
|
|
|
afterGetBalance(label, balance, packageInfo) { |
|
|
|
try { |
|
|
|
let that = this; |
|
|
|
let itemCode = label.itemCode; |
|
|
@ -302,11 +308,11 @@ |
|
|
|
if (batch.Recommends.length > 0) { |
|
|
|
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); |
|
|
|
if (recommend != undefined) { |
|
|
|
that.addRecord(batch, label, balance,packageInfo) |
|
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
|
} else { |
|
|
|
//允许修改箱码 |
|
|
|
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
|
that.addRecord(batch, label, balance,packageInfo); |
|
|
|
that.addRecord(batch, label, balance, packageInfo); |
|
|
|
} else { |
|
|
|
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
|
res => { |
|
|
@ -316,7 +322,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.addRecord(batch, label, balance,packageInfo) |
|
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
|
@ -371,14 +377,14 @@ |
|
|
|
return batch; |
|
|
|
}, |
|
|
|
|
|
|
|
creatRecord(label, balance,packageInfo) { |
|
|
|
creatRecord(label, balance, packageInfo) { |
|
|
|
balance.stdPackQty = packageInfo.stdPackQty |
|
|
|
balance.stdPackUnit = packageInfo.stdPackUnit |
|
|
|
let record = { |
|
|
|
itemCode: label.itemCode, |
|
|
|
packingNumber: label.packingNumber, |
|
|
|
batch: label.batch, |
|
|
|
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, |
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
balance: balance, |
|
|
@ -391,13 +397,13 @@ |
|
|
|
calcBatchHandleQty(batch) { |
|
|
|
let handleQty = 0; |
|
|
|
batch.Records.forEach(res => { |
|
|
|
handleQty += Number(res.qty) |
|
|
|
handleQty = calc.add(handleQty,res.qty) |
|
|
|
}) |
|
|
|
batch.handleQty = handleQty; |
|
|
|
}, |
|
|
|
|
|
|
|
addRecord(batch, label, balance,packageInfo) { |
|
|
|
let record = this.creatRecord(label, balance,packageInfo); |
|
|
|
addRecord(batch, label, balance, packageInfo) { |
|
|
|
let record = this.creatRecord(label, balance, packageInfo); |
|
|
|
batch.Records.push(record); |
|
|
|
this.issueRecord.unshift(record) |
|
|
|
this.calcBatchHandleQty(batch); |
|
|
|