|
|
@ -36,7 +36,10 @@ |
|
|
|
|
|
|
|
<win-scan-button v-if="detailSource.length>0" @goScan='openScanPopup'></win-scan-button> |
|
|
|
|
|
|
|
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> |
|
|
|
|
|
|
|
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> |
|
|
|
</winComScanBalance> |
|
|
|
|
|
|
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode' |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
@ -77,7 +80,7 @@ |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
|
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
|
import { |
|
|
|
updateTitle |
|
|
|
} from '@/common/basic.js'; |
|
|
@ -90,7 +93,8 @@ |
|
|
|
comBlankView, |
|
|
|
recordComDetailCard, |
|
|
|
winScanPackage, |
|
|
|
winScanLocation |
|
|
|
winScanLocation, |
|
|
|
winComScanBalance |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -106,7 +110,7 @@ |
|
|
|
toLocationAreaTypeList: [], |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态:"", |
|
|
|
bussinessCode: "ProductPutaway", |
|
|
|
businessTypeCode: "ProductPutaway", |
|
|
|
businessType: {}, |
|
|
|
managementList: [], |
|
|
|
type: '', |
|
|
@ -131,12 +135,11 @@ |
|
|
|
onPullDownRefresh() {}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
getBusinessType(this.bussinessCode, res => { |
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
|
|
|
this.toLocationAreaTypeList = res.toLocationAreaTypeList; |
|
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
|
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); |
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList |
|
|
|
this.openScanPopup(); |
|
|
|
} else { |
|
|
|
this.showErrorMessage(res.message) |
|
|
@ -146,55 +149,126 @@ |
|
|
|
|
|
|
|
methods: { |
|
|
|
getScanResult(result) { |
|
|
|
this.setData(result); |
|
|
|
}, |
|
|
|
|
|
|
|
setData(result) { |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
let errorHint="" |
|
|
|
result.balance.forEach( |
|
|
|
balance => { |
|
|
|
let item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode && res.containerNumber == balance |
|
|
|
.parentPackingNumber) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
itemp.containerNumber = balance.parentPackingNumber |
|
|
|
//查询推荐的目标库位 |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
this.calcHandleQty(); |
|
|
|
this.getRecommendLocation(balance) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
// itemp.containerNumber="" |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.fromLocationCode=balance.locationCode |
|
|
|
|
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
if (balance.lableQty) { |
|
|
|
newDetail.handleQty = balance.lableQty |
|
|
|
} |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
this.itemCode = balance.itemCode; |
|
|
|
this.fromLocationCode = balance.locationCode |
|
|
|
this.getRecommendLocation(balance) |
|
|
|
this.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == pack.number && |
|
|
|
r.batch == balance.batch && |
|
|
|
r.fromLocationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
//如果最开始扫父,在扫子,提示已经扫描父包装 |
|
|
|
//如果扫子在扫父,提示扫描的是父包装,是否移除子包装,是移除子包装,显示父包装 |
|
|
|
//扫描的是子包装, |
|
|
|
if (pack.parentNumber) { |
|
|
|
var checkData = item.subList.find(r => { |
|
|
|
if (r.packingNumber == pack.parentNumber && |
|
|
|
r.batch == balance.batch&& |
|
|
|
r.fromLocationCode == balance.locationCode) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
if (checkData) { |
|
|
|
//提示已经扫描 |
|
|
|
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch + |
|
|
|
"]的父包装已经扫描") |
|
|
|
console.log("父包装已经扫描") |
|
|
|
} else { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
newDetail.fromLocationCode=balance.locationCode |
|
|
|
if (balance.lableQty) { |
|
|
|
newDetail.handleQty = balance.lableQty |
|
|
|
} |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//扫描的是父包装 |
|
|
|
var checkData = item.subList.find(r => { |
|
|
|
if (r.parentNumber == pack.number && |
|
|
|
r.batch == balance.batch&& |
|
|
|
r.fromLocationCode == balance.locationCode) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (checkData) { |
|
|
|
//是否移除 |
|
|
|
this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance |
|
|
|
.batch + "]是父包装,是否移除子包装", res => { |
|
|
|
if (res) { |
|
|
|
item.subList = []; |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
newDetail.fromLocationCode=balance.locationCode |
|
|
|
if (balance.lableQty) { |
|
|
|
newDetail.handleQty = balance.lableQty |
|
|
|
} |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("扫描的是父包装,是否移除子包装") |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
errorHint+="箱码[" + balance.packingNumber + "批次[" + balance.batch + |
|
|
|
"]重复扫描\n" |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.fromLocationCode=balance.locationCode |
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
if (balance.lableQty) { |
|
|
|
newDetail.handleQty = balance.lableQty |
|
|
|
} |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
this.calcHandleQty(); |
|
|
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
if(errorHint){ |
|
|
|
this.showErrorMessage(errorHint) |
|
|
|
}else { |
|
|
|
this.scanPopupGetFocus() |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
|
|
|
|
getRecommendLocation(balance) { |
|
|
@ -214,7 +288,7 @@ |
|
|
|
uni.hideLoading(); |
|
|
|
let item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode && res.containerNumber == balance |
|
|
|
.parentPackingNumber) { |
|
|
|
.packingNumber) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
@ -274,9 +348,11 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|
setTimeout(r => { |
|
|
|
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType); |
|
|
|
}) |
|
|
|
if (this.businessType) { |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
} else { |
|
|
|
this.getBusinessType() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
@ -313,12 +389,6 @@ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
// this.managementList = []; |
|
|
|
// var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
|
|
|
|
// getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
|
// if (res.success) { |
|
|
|
// this.managementList = res.list; |
|
|
|
|
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
@ -383,27 +453,16 @@ |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
var submitItem = deepCopyData(detail) |
|
|
|
// var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
|
// detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
|
submitItem.itemCode = detail.itemCode; |
|
|
|
submitItem.itemName = detail.package.itemName; |
|
|
|
submitItem.itemDesc1 = detail.package.itemDesc1; |
|
|
|
submitItem.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
submitItem.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
// submitItem.fromPackingNumber = info.packingNumber; |
|
|
|
// submitItem.toPackingNumber = info.packingNumber; |
|
|
|
|
|
|
|
submitItem.fromPackingNumber = detail.packingNumber; |
|
|
|
submitItem.toPackingNumber = detail.packingNumber; |
|
|
|
|
|
|
|
//submitItem.fromContainerNumber = detail.containerNumber; |
|
|
|
//submitItem.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|
//submitItem.fromBatch = info.batch; |
|
|
|
//submitItem.toBatch = info.batch; |
|
|
|
|
|
|
|
|
|
|
|
submitItem.fromParentPackingNumber = detail.parentNumber; |
|
|
|
submitItem.fromBatch = detail.package.batch; |
|
|
|
submitItem.toBatch = detail.package.batch; |
|
|
|
|
|
|
|