diff --git a/src/pages/deliver/job/deliverDetailBatch.vue b/src/pages/deliver/job/deliverDetailBatch.vue index a5a43e30..edbb6418 100644 --- a/src/pages/deliver/job/deliverDetailBatch.vue +++ b/src/pages/deliver/job/deliverDetailBatch.vue @@ -228,8 +228,36 @@ }, - getScanResult(result, managementTypeParams) { + getScanResult(result, managementTypeParams) { this.managementType = managementTypeParams + let array1 = []//记录推荐的库位 + let array2 = []//记录推荐的批次 + this.detailSource.forEach(item=>{ + item.subList.forEach(cur=>{ + array1.push(cur.fromLocationCode) + array2.push(cur.batch) + }) + }) + // 扫描的库位是否在 + const obj1 = array1.find(item=>item == result.fromLocationCode) + const obj2 = array2.find(item=>item == result.label.batch) + if(this.jobContent.allowModifyLocation == 'FALSE'){ + if(!obj1){ + this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) + return + } + } + if(this.jobContent.allowModifyBatch == 'FALSE'){ + if(!obj2){ + this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) + return + } + } + if(!obj1){ + this.recommendQty = 0 + }else{ + this.recommendQty = result.balance.qty + } if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ this.setDataBatch(result) }else{