diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index f6c8f562..852a5f19 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -132,7 +132,7 @@ storage.clearStorage() if (process.env.NODE_ENV === 'development') { this.username = "admin" - this.password = "win123456"; + this.password = "CD_win09"; } uni.setNavigationBarColor({ frontColor: '#ffffff', diff --git a/src/pages/productPutaway/record/productPutawayRecord.vue b/src/pages/productPutaway/record/productPutawayRecord.vue index 9d78225b..28c0a642 100644 --- a/src/pages/productPutaway/record/productPutawayRecord.vue +++ b/src/pages/productPutaway/record/productPutawayRecord.vue @@ -8,10 +8,17 @@ + + + @updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation" + v-else> @@ -42,6 +49,12 @@ + + + + + @@ -72,7 +85,8 @@ getBusinessType, createItemInfo, createDetailInfo, - calcHandleQty + calcHandleQty, + calcHandleQtyAdd } from '@/common/record.js'; import { @@ -87,6 +101,8 @@ import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' + import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" + import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' import { updateTitle } from '@/common/basic.js'; @@ -100,7 +116,9 @@ recordComDetailCard, winScanPackage, winScanLocation, - winComScanBalance + winComScanBalance, + winScanPackAndLocation, + recordComDetailCardBatch }, data() { return { @@ -120,7 +138,8 @@ businessType: {}, managementList: [], type: '', - editItem: null + editItem: null, + managementType:'' }; }, // 装配收货:type = 'assemble' @@ -154,8 +173,140 @@ }, methods: { - getScanResult(result) { - this.setData(result); + getScanResult(result,managementTypeParams) { + this.managementType = managementTypeParams + if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ + this.setDataBatch(result) + }else{ + this.setData(result) + } + }, + async setDataBatch(result) { + 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 + } + newDetail.handleQty =0; + newDetail.balanceQty =result.balance.qty; + itemp.subList.push(newDetail); + this.detailSource.push(itemp) + this.itemCode = balance.itemCode; + this.fromLocationCode = balance.locationCode + await this.getRecommendLocation(balance,result) + await this.scanPopupGetFocus() + } else { + var detail = item.subList.find(r => { + if (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 + } + newDetail.handleQty =0; + newDetail.balanceQty =result.balance.qty; + 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 + } + newDetail.handleQty =0; + newDetail.balanceQty =result.balance.qty; + item.subList.push(newDetail); + calcHandleQtyAdd(this.detailSource,result.label); + } + }) + 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 + } + newDetail.handleQty =0; + newDetail.balanceQty =result.balance.qty; + item.subList.push(newDetail); + } + } + + this.scanPopupGetFocus() + } else { + if (detail.scaned == true) { + // detail.handleQty = calc.add(detail.handleQty,result.label.qty) + // this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") + } + } + } + calcHandleQtyAdd(this.detailSource,result.label); }, async setData(result) { @@ -421,7 +572,8 @@ openScanPopup() { if (this.businessType) { this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes) - this.$refs.scanPopup.openScanPopup(this.businessType); + // this.$refs.scanPopup.openScanPopup(this.businessType); + this.openFromLocationScanPopup() } else { this.getBusinessType() } @@ -444,7 +596,18 @@ this.$refs.scanPopup.losefocus(); } }, - + openFromLocationScanPopup() { + if (this.fromLocationCode == "") { + this.showFromLocationPopup(); + return + } + this.$refs.winScanPackAndLocationRef.openScanPopupForType(this.fromLocationCode, this.businessType); + }, + showFromLocationPopup() { + this.$nextTick(() => { + this.$refs.winScanFromLocation.openScanPopup(); + }) + }, scanLocationCode(location, code) { this.toLocationCode = code this.detailSource.forEach(item => { @@ -463,7 +626,15 @@ }); var params = this.setParams() + console.log("提交" + JSON.stringify(params)) + const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) + if(isHaveItem){ + this.showErrorMessage(`物料号${isHaveItem.itemCode}`) + this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') + uni.hideLoading() + return + } productPutawayRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -574,7 +745,14 @@ getToLocationCode(location, code) { this.editItem.toLocationCode = code; }, - + getLocation(location, code) { + this.getFromLocationCode(location, code) + }, + getFromLocationCode(location, code) { + this.fromLocationInfo = location; + this.fromLocationCode = code; + this.openScanPopup(); + }, showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { this.clearData(); diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue index 69841f91..1ea5eab1 100644 --- a/src/pages/putaway/record/putawayRecord.vue +++ b/src/pages/putaway/record/putawayRecord.vue @@ -173,13 +173,13 @@ getScanResult(result,managementType) { this.managementType = managementTypeParams if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ - this. getScanResultAfterBatch(result) + this.setDataBatch(result) }else{ - this. getScanResultAfter(result) + this.setData(result) } }, - getScanResultAfterBatch(result){ + setDataBatch(result){ let balance = result.balance; let label = result.label; let pack = result.package; @@ -251,7 +251,7 @@ } }, - getScanResultAfter(result){ + setData(result){ let balance = result.balance; let label = result.label; let pack = result.package;