diff --git a/src/pages/inventoryMove/coms/comMoveRecord.vue b/src/pages/inventoryMove/coms/comMoveRecord.vue index 1599bdca..207753ee 100644 --- a/src/pages/inventoryMove/coms/comMoveRecord.vue +++ b/src/pages/inventoryMove/coms/comMoveRecord.vue @@ -12,7 +12,7 @@ + :allowEditStatus="allowEditStatus" > @@ -35,7 +35,7 @@ - + { if(this.showOnePop){ + this.$refs.okToHoldRecordPackRef.fromLocationCode = '' + this.$refs.okToHoldRecordPackRef.itemCode = '' + this.$refs.okToHoldRecordPackRef.batch = '' + this.$refs.okToHoldRecordPackRef.handleQty = 0 this.$refs.okToHoldRecordPackRef.showOne = true + }else{ this.$refs.scanFromLocationCode.openScanPopup(); } @@ -267,20 +268,19 @@ this.toLocationCode = code; this.toLocationInfo = location; }, - getScanResult(result,managementType) { + getScanResult(result,managementTypeParams) { + this.managementType = managementTypeParams if(this.showOnePop){ - this.itemCode= result.balance.itemCode - this.batch = result.balance.batch - this.isClearItemCode = false - debugger + this.$refs.okToHoldRecordPackRef.itemCode= result.balance.itemCode + this.$refs.okToHoldRecordPackRef.batch = result.balance.batch this.getResult = result//存储接受的结果 this.$refs.scanPopup.closeScanPopup() }else{ - if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ - this.getScanResultAfterBatch(result) + if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ + this.getScanResultAfterBatch(result,managementTypeParams) }else{ - this.getScanResultAfter(result) + this.getScanResultAfter(result,managementTypeParams) } } @@ -302,7 +302,7 @@ // this.getResult.fromLocationCode = obj.fromLocationCode this.getResult.label.batch = obj.handleQty this.getResult.label.qty = obj.handleQty - this.getScanResultAfterBatch(this.getResult) + this.getScanResultAfterBatch(this.getResult,this.managementType) }, getScanResultAfter(result){ var balance = result.balance; @@ -364,7 +364,7 @@ } calcHandleQty(this.detailSource); }, - getScanResultAfterBatch(result){ + getScanResultAfterBatch(result,managementTypeParams){ var balance = result.balance; this.balanceInfo = result.balance; var pack = result.package; @@ -387,18 +387,31 @@ newDetail.toInventoryStatus = this.toInventoryStatus; } newDetail.toLocationCode = this.toLocationCode; + newDetail.managementTypeParams = managementTypeParams; newDetail.fromLocationCode = result.fromLocationCode newDetail.handleQty = Number(result.label.qty) 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.scaned == true) { - return r; - } - }) + var detail = '' + console.log(9988,managementTypeParams) + if(managementTypeParams == 'BY_QUANTITY'){ + detail = item.subList.find(r => { + if (r.fromLocationCode == balance.locationCode && + r.scaned == true) { + return r; + } + }) + }else if(managementTypeParams == 'BY_BATCH'){ + detail = item.subList.find(r => { + if (r.batch == pack.batch && + r.fromLocationCode == balance.locationCode && + r.scaned == true) { + return r; + } + }) + } + console.log(detail) if (detail == undefined) { let newDetail = createDetailInfo(balance, pack); // newDetail.inventoryStatus = balance.inventoryStatus; @@ -412,12 +425,15 @@ newDetail.packingNumber = pack.number; } newDetail.toLocationCode = this.toLocationCode; + newDetail.managementTypeParams = managementTypeParams; newDetail.fromLocationCode = result.fromLocationCode item.subList.push(newDetail); } else { + console.log(999,detail.handleQty) detail.handleQty =calc.add(detail.handleQty, result.label.qty) } } + calcHandleQty(this.detailSource); }, getInputMsgResult(result,fromWitch){ @@ -426,17 +442,17 @@ }, // 清除来源库位 clearFromLocation(fromLocationCodeParams){ - this.fromLocationCode = fromLocationCodeParams - this.itemCode ='' - this.batch ='' - this.isClearFromLocationCode = true + this.$refs.okToHoldRecordPackRef.fromLocationCode = '' + this.$refs.okToHoldRecordPackRef.itemCode ='' + this.$refs.okToHoldRecordPackRef.batch ='' + // this.isClearFromLocationCode = true }, - // 清除零件 + // 清除批次和物料 clearItemCode(label){ - this.itemCode = label.itemCode - this.batch ='' - this.isClearItemCode = true + this.$refs.okToHoldRecordPackRef.itemCode ='' + this.$refs.okToHoldRecordPackRef.batch ='' }, + showErrorMessage(message) { if (this.$refs.scanPopup) { this.$refs.scanPopup.packLoseFocus() @@ -547,7 +563,12 @@ } // if(this.balanceInfo) console.log("提交" ,params) - + let obj = params.subList.find(item=>item.balanceQty < item.handleQty) + if(obj){ + this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']') + uni.hideLoading() + return + } inventoryMoveRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { diff --git a/src/pages/inventoryMove/coms/comMoveRecordCard.vue b/src/pages/inventoryMove/coms/comMoveRecordCard.vue index 8c0449b2..d8fc1a3b 100644 --- a/src/pages/inventoryMove/coms/comMoveRecordCard.vue +++ b/src/pages/inventoryMove/coms/comMoveRecordCard.vue @@ -16,9 +16,9 @@ - + :isShowLocation="true" :allowEditStatus='allowEditStatus' :isShowPack='item.managementTypeParams == "BY_PACKAGING"' :isShowBatch='item.managementTypeParams == "BY_PACKAGING" || item.managementTypeParams == "BY_Batch"'> diff --git a/src/pages/inventoryMove/coms/okToHoldRecordPack.vue b/src/pages/inventoryMove/coms/okToHoldRecordPack.vue index fae7571e..013b738e 100644 --- a/src/pages/inventoryMove/coms/okToHoldRecordPack.vue +++ b/src/pages/inventoryMove/coms/okToHoldRecordPack.vue @@ -10,8 +10,8 @@ 来源库位: - - + + @@ -19,7 +19,10 @@ 零件: - + + + + @@ -28,6 +31,7 @@ 批次: + @@ -65,7 +69,7 @@ components: { winScanLocation }, - emits: ["showFromLocationPopup",'itemCodeClick','confirm','getInputMsgResult'], + emits: ["showFromLocationPopup",'itemCodeClick','confirm','getInputMsgResult','clearFromLocationCode','clickBtnClearItemCode'], data() { return { handleQty:0, @@ -76,31 +80,11 @@ } }, props: { - fromLocationCodeProps:{ - type: String, - default: '' - }, // 是否显示第一层弹窗 showOnePop: { type: Boolean, default: false }, - itemCodeProps:{ - type: String, - default: '' - }, - batchProps:{ - type: String, - default: '' - }, - isClearFromLocationCode:{ - type: Boolean, - default: false - }, - isClearItemCode:{ - type: Boolean, - default: false - }, }, mounted() { }, @@ -131,12 +115,15 @@ this.$emit("confirm",obj); }, fromLocationScanMsg(){ + if (this.fromLocationCode) { console.log(111,this.fromLocationCode) this.scanMsg = this.fromLocationCode this.fromWitch = 'fromLocationScanMsg' this.handelScanMsg() + } }, itemCodeScanMsg(){ + if (this.itemCode) { if(!this.fromLocationCode){ this.$refs.comMessage.showMessage("请先扫描来源库位") return @@ -144,6 +131,7 @@ this.fromWitch = 'itemCodeScanMsg' this.scanMsg = this.itemCode this.handelScanMsg() + } }, handelScanMsg() { //点击了回车 @@ -157,7 +145,7 @@ // that.scanMsg =that.scanMsg + "\n"; // } console.log(that.scanMsg.includes('\n')) - // if (that.scanMsg.includes('\n')) { + if (that.scanMsg) { // that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; setTimeout(() => { that.losefocus(); @@ -195,7 +183,7 @@ } }); }, 200); - // } + } }, losefocus() { let that = this; @@ -203,38 +191,15 @@ that.boxfocus = false; }); }, - onClear(){ - console.log(111) - } - }, - watch: { - fromLocationCodeProps:{ - handler(newVal, oldVal) { - if(this.isClearFromLocationCode){ - this.fromLocationCode='' - }else{ - this.fromLocationCode = newVal - } - }, - // deep: true, - // immediate: true + clickBtnClearFromLocation(){ + this.$emit("clickBtnClearFromLocation"); }, - itemCodeProps: { - handler(newVal, oldVal) { - if(this.isClearItemCode){ - this.itemCode='' - }else{ - this.itemCode = newVal - } - }, - }, - batchProps(newVal) { - if(this.isClearItemCode){ - this.batch='' - }else{ - this.batch = newVal - } + clickBtnClearItemCode(){ + this.$emit("clickBtnClearItemCode"); }, + }, + watch: { + } }