|
|
@ -72,10 +72,6 @@ |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
} from '@/common/record.js'; |
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
@ -85,7 +81,6 @@ |
|
|
|
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'; |
|
|
@ -154,21 +149,7 @@ |
|
|
|
|
|
|
|
methods: { |
|
|
|
getScanResult(result) { |
|
|
|
console.log(result) |
|
|
|
//获取管理模式,封装参数 |
|
|
|
getManagementPrecisions([result.label.itemCode], result.balance.locationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
this.managementType = this.managementList.some(item => item.ManagementPrecision == |
|
|
|
'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
this.managementType = 'BY_BATCH' |
|
|
|
if(this.managementType == 'BY_BATCH'){ |
|
|
|
this.setDataBatch(result) |
|
|
|
}else{ |
|
|
|
this.setData(result); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
setData(result) { |
|
|
@ -290,126 +271,6 @@ |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
setDataBatch(result) { |
|
|
|
debugger |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
|
|
|
|
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 (checkData) { |
|
|
|
//提示已经扫描 |
|
|
|
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch + |
|
|
|
"]的父包装已经扫描") |
|
|
|
console.log("父包装已经扫描") |
|
|
|
} else { |
|
|
|
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); |
|
|
|
} |
|
|
|
} 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); |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("扫描的是父包装,是否移除子包装") |
|
|
|
} else { |
|
|
|
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.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
|
|
|
|
getRecommendLocation(balance) { |
|
|
|
uni.showLoading({ |
|
|
|