|
|
@ -75,7 +75,8 @@ |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
calcHandleQty, |
|
|
|
calcHandleQtyAdd |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
export default { |
|
|
@ -238,7 +239,14 @@ |
|
|
|
this.toLocationCode = code; |
|
|
|
this.toLocationInfo = location; |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
getScanResult(result,managementType) { |
|
|
|
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ |
|
|
|
this.getScanResultAfterBatch(result) |
|
|
|
}else{ |
|
|
|
this.getScanResultAfter(result) |
|
|
|
} |
|
|
|
}, |
|
|
|
getScanResultAfter(result){ |
|
|
|
var balance = result.balance; |
|
|
|
var pack = result.package; |
|
|
|
var item = this.detailSource.find(res => { |
|
|
@ -249,11 +257,11 @@ |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
|
|
|
|
|
|
|
|
if (newDetail.packingNumber == '') { |
|
|
|
newDetail.packingNumber = pack.number; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
|
} else { |
|
|
@ -273,7 +281,7 @@ |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
// newDetail.inventoryStatus = balance.inventoryStatus; |
|
|
@ -282,7 +290,7 @@ |
|
|
|
} else { |
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (newDetail.packingNumber == '') { |
|
|
|
newDetail.packingNumber = pack.number; |
|
|
|
} |
|
|
@ -297,7 +305,65 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
|
|
|
|
}, |
|
|
|
getScanResultAfterBatch(result){ |
|
|
|
var balance = result.balance; |
|
|
|
this.balanceInfo = result.balance; |
|
|
|
var pack = result.package; |
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
|
|
|
|
if (newDetail.packingNumber == '') { |
|
|
|
newDetail.packingNumber = pack.number; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
|
} else { |
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
} |
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
newDetail.fromLocationCode = result.fromLocationCode |
|
|
|
newDetail.handleQty = 0 |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.batch == pack.batch && |
|
|
|
r.fromLocationCode == balance.locationCode && |
|
|
|
r.toInventoryStatus == balance.inventoryStatus && |
|
|
|
r.scaned == true) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
// newDetail.inventoryStatus = balance.inventoryStatus; |
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
|
} else { |
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
} |
|
|
|
|
|
|
|
if (newDetail.packingNumber == '') { |
|
|
|
newDetail.packingNumber = pack.number; |
|
|
|
} |
|
|
|
newDetail.handleQty = 0 |
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
newDetail.fromLocationCode = result.fromLocationCode |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQtyAdd(this.detailSource,result.label); |
|
|
|
}, |
|
|
|
showErrorMessage(message) { |
|
|
|
if (this.$refs.scanPopup) { |
|
|
@ -407,7 +473,9 @@ |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// if(this.balanceInfo) |
|
|
|
console.log("提交" ,params) |
|
|
|
|
|
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
@ -457,6 +525,8 @@ |
|
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
|
var submitItem = deepCopyData(detail) |
|
|
|
console.log(233,submitItem) |
|
|
|
console.log(244,info) |
|
|
|
submitItem.itemCode = detail.itemCode; |
|
|
|
submitItem.itemName = detail.package.itemName; |
|
|
|
submitItem.itemDesc1 = detail.package.itemDesc1; |
|
|
@ -467,7 +537,7 @@ |
|
|
|
|
|
|
|
submitItem.fromPackingNumber = info.packingNumber; |
|
|
|
submitItem.toPackingNumber = info.packingNumber; |
|
|
|
|
|
|
|
submitItem.packingNumber = info.packingNumber; |
|
|
|
submitItem.fromContainerNumber = detail.containerNumber; |
|
|
|
submitItem.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|