|
|
@ -39,8 +39,8 @@ |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'> |
|
|
|
</win-scan-pack> |
|
|
|
<win-scan-package ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'> |
|
|
|
</win-scan-package> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> --> |
|
|
@ -85,7 +85,7 @@ |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' |
|
|
|
// import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
@ -94,7 +94,7 @@ |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
winScanButton, |
|
|
|
winScanPack, |
|
|
|
winScanPackage, |
|
|
|
// requiredLocation, |
|
|
|
comBlankView, |
|
|
|
winScanLocation, |
|
|
@ -115,7 +115,7 @@ |
|
|
|
showToLoaction: true, |
|
|
|
recommendLocationList: [], //推荐库位列表 |
|
|
|
fromWarehouseCode: '', //来源仓库 |
|
|
|
businessTypeCode: "PurchasePutaway" |
|
|
|
businessTypeCode: "Relegate" |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -152,101 +152,10 @@ |
|
|
|
let poLine =label.poLine; |
|
|
|
let poNumber =label.poNumber; |
|
|
|
let supplierCode=label.supplierCode; |
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (this.fromWarehouseCode == '') { |
|
|
|
this.fromWarehouseCode = balance.warehouseCode; |
|
|
|
} |
|
|
|
if (item == undefined) { |
|
|
|
// 获取推荐库位 |
|
|
|
this.getRecommendLocation(balance, pack, toLocation => { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.toLocationCode = toLocation.locationCode; |
|
|
|
newDetail.toWarehouseCode = toLocation.toWarehouseCode; |
|
|
|
newDetail.poLine=poLine; |
|
|
|
newDetail.poNumber=poNumber; |
|
|
|
newDetail.supplierCode=supplierCode; |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
|
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
this.getRecommendLocation(balance, pack, toLocation => { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.toLocationCode = toLocation.locationCode; |
|
|
|
newDetail.toWarehouseCode = toLocation.toWarehouseCode; |
|
|
|
newDetail.poLine=poLine; |
|
|
|
newDetail.poNumber=poNumber; |
|
|
|
newDetail.supplierCode=supplierCode; |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//获取推荐库位 |
|
|
|
getRecommendLocation(balance, pack, callback) { |
|
|
|
uni.showLoading({ |
|
|
|
title: '扫描中...', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode); |
|
|
|
if (recommend == undefined) { |
|
|
|
let param = { |
|
|
|
itemCode: balance.itemCode, |
|
|
|
batch: balance.batch, |
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
supplierCode: pack.supplierCode, |
|
|
|
businessCode: this.businessTypeCode |
|
|
|
}; |
|
|
|
console.log(JSON.stringify(param)) |
|
|
|
getPutawayRecommendLocation(param).then(res => { |
|
|
|
this.recommendLocationList.push({ |
|
|
|
itemCode: balance.itemCode, |
|
|
|
locationCode: res.data.code, |
|
|
|
toWarehouseCode:res.data.toWarehouseCode |
|
|
|
}) |
|
|
|
|
|
|
|
var result = { |
|
|
|
locationCode: res.data.code, |
|
|
|
toWarehouseCode:res.data.toWarehouseCode |
|
|
|
} |
|
|
|
callback(result); |
|
|
|
uni.hideLoading(); |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error); |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
callback(recommend); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) {} |
|
|
@ -270,19 +179,10 @@ |
|
|
|
this.detailSource.splice(index, 1) |
|
|
|
this.updateData(); |
|
|
|
}, |
|
|
|
|
|
|
|
removePack() { |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
var item = this.detailSource[i]; |
|
|
|
if (item.subList.length == 0) { |
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
this.updateData(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType); |
|
|
|
}, |
|
|
|
|
|
|
|
showFromLocationPopup() { |
|
|
@ -342,38 +242,7 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getItemAndLocationRelations() { |
|
|
|
var itemList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
detail.toLocationCode = this.toLocationCode; |
|
|
|
var filterResult = itemList.filter(res => { |
|
|
|
if (res.itemCode == item.itemCode && |
|
|
|
res.locationCode == detail.toLocationCode && |
|
|
|
res.batch == detail.batch && |
|
|
|
res.inventoryStatus == detail.inventoryStatus) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
//去掉重复元素 |
|
|
|
if (filterResult.length == 0) { |
|
|
|
var result = { |
|
|
|
itemCode: item.itemCode, |
|
|
|
locationCode: detail.toLocationCode, |
|
|
|
batch: detail.batch, |
|
|
|
inventoryStatus: detail.inventoryStatus, |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
return itemList; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setRecordParams() { |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
@ -431,22 +300,7 @@ |
|
|
|
getLocation(location, code) { |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocationInfo = location; |
|
|
|
this.fromLocationCode = code; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getToLocationCode(location, code) { |
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
uni.showToast({ |
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.toLocationCode = code; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.clear(); |
|
|
|