|
@ -75,7 +75,8 @@ |
|
|
getBusinessType, |
|
|
getBusinessType, |
|
|
createItemInfo, |
|
|
createItemInfo, |
|
|
createDetailInfo, |
|
|
createDetailInfo, |
|
|
calcHandleQty |
|
|
calcHandleQty, |
|
|
|
|
|
calcHandleQtyAdd |
|
|
} from '@/common/record.js'; |
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
@ -238,7 +239,14 @@ |
|
|
this.toLocationCode = code; |
|
|
this.toLocationCode = code; |
|
|
this.toLocationInfo = location; |
|
|
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 balance = result.balance; |
|
|
var pack = result.package; |
|
|
var pack = result.package; |
|
|
var item = this.detailSource.find(res => { |
|
|
var item = this.detailSource.find(res => { |
|
@ -297,7 +305,65 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
calcHandleQty(this.detailSource); |
|
|
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) { |
|
|
showErrorMessage(message) { |
|
|
if (this.$refs.scanPopup) { |
|
|
if (this.$refs.scanPopup) { |
|
@ -407,7 +473,9 @@ |
|
|
}); |
|
|
}); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
// if(this.balanceInfo) |
|
|
|
|
|
console.log("提交" ,params) |
|
|
|
|
|
|
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
@ -457,6 +525,8 @@ |
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
var submitItem = deepCopyData(detail) |
|
|
var submitItem = deepCopyData(detail) |
|
|
|
|
|
console.log(233,submitItem) |
|
|
|
|
|
console.log(244,info) |
|
|
submitItem.itemCode = detail.itemCode; |
|
|
submitItem.itemCode = detail.itemCode; |
|
|
submitItem.itemName = detail.package.itemName; |
|
|
submitItem.itemName = detail.package.itemName; |
|
|
submitItem.itemDesc1 = detail.package.itemDesc1; |
|
|
submitItem.itemDesc1 = detail.package.itemDesc1; |
|
@ -467,7 +537,7 @@ |
|
|
|
|
|
|
|
|
submitItem.fromPackingNumber = info.packingNumber; |
|
|
submitItem.fromPackingNumber = info.packingNumber; |
|
|
submitItem.toPackingNumber = info.packingNumber; |
|
|
submitItem.toPackingNumber = info.packingNumber; |
|
|
|
|
|
submitItem.packingNumber = info.packingNumber; |
|
|
submitItem.fromContainerNumber = detail.containerNumber; |
|
|
submitItem.fromContainerNumber = detail.containerNumber; |
|
|
submitItem.toContainerNumber = detail.containerNumber |
|
|
submitItem.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|
|