diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 67204f8a..50dff7a6 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -10,6 +10,7 @@ + @@ -178,7 +179,7 @@ fontSize: "100rpx" }, bussinessCode: 'Issue', - toLocationAreaTypeList:[] + toLocationAreaTypeList: [] } }, created() { @@ -234,7 +235,7 @@ that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.toLocation = that.dataContent[0]; that.toLocationCode = that.dataContent[0].toLocationCode; - that.toLocationAreaTypeList=getDirectoryItemArray(this.jobContent.toAreaTypes) + that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes) // that.fromLocationList = that.getFromLocationList(); } }, @@ -317,9 +318,9 @@ "库区 [" + areaType + "] \n" + "未查找到库存余额" this.showErrorMessage(hint, - res => { - that.getfocus(); - }) + res => { + that.getfocus(); + }) } else if (res.data.length == 1) { result.balance = res.data[0] @@ -337,15 +338,15 @@ }).catch(error => { uni.hideLoading() this.showErrorMessage(error, - res => { - that.getfocus(); - }) + res => { + that.getfocus(); + }) }) } } catch (e) { - this.showErrorMessage(e.stack,res => { - that.getfocus(); - }) + this.showErrorMessage(e.stack, res => { + that.getfocus(); + }) uni.hideLoading(); } }, @@ -427,7 +428,7 @@ } } }, - + //查询到目标库位的库存余额 getToLocationBalance(result) { uni.showLoading({ @@ -449,7 +450,7 @@ value: result.package.number }) } - + filters.push({ column: "itemCode", action: "==", @@ -460,14 +461,14 @@ action: "==", value: result.package.batch }) - + filters.push({ column: "areaType", action: "in", value: this.toLocationAreaTypeList.join(',') }) - - + + var params = { filters: filters, pageNo: 1, @@ -486,7 +487,7 @@ this.showErrorMessage(err.message); }) }, - + selectBalanceItem(balance) { this.afterGetBalance(this.label, balance, this.packageInfo); }, @@ -500,7 +501,7 @@ let item = that.toLocation.Items.find(r => r.itemCode == itemCode); that.fromLocationCode = balance.locationCode; let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); - if (fromLocation != undefined) { + if (fromLocation &&!fromLocation.isNewAdd) { let batch = fromLocation.Batchs.find(r => r.batch == lot); if (batch != undefined) { if (batch.Records == undefined) { @@ -530,7 +531,7 @@ } else { that.addRecord(batch, label, balance, packageInfo) } - that.$emit("afterScan"); + } else { that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', res => { @@ -550,6 +551,7 @@ batch.detail = fromLocation.Batchs[0].detail; } fromLocation.Batchs.unshift(batch); + this.getfocus(); that.$emit("afterScan"); } }) @@ -561,8 +563,22 @@ } } } else { - let locaion = that.createLocationInfo(label, balance, packageInfo); - item.Locations.push(locaion); + + if (this.jobContent.allowModifyLocation == "FALSE") { + this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + + "】与推荐的库位不一致,是否要继续发料?", res => { + if (res) { + let locaion = that.createLocationInfo(label, balance, packageInfo); + item.Locations.push(locaion); + this.getfocus(); + that.$emit("afterScan"); + } + }) + + } else { + this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + + "】与推荐的库位不一致,不允许继续发料?") + } } } catch (e) { that.showErrorMessage(e.stack, @@ -573,18 +589,19 @@ } }, - //增加实际扫描的明细 + //增加不是任务中的库位,实际扫描的明细 createLocationInfo(label, balance, packageInfo) { let location = { fromLocationCode: balance.locationCode, qty: balance.qty, uom: balance.uom, handleQty: 0, + isNewAdd:true, Batchs: [] } let batch = this.createBatchInfo(label, balance, packageInfo); batch.detail = balance; - batch.detail.fromLocationCode=balance.locationCode; + batch.detail.fromLocationCode = balance.locationCode; location.Batchs.push(batch); return location; }, @@ -615,8 +632,8 @@ batch: label.batch, // qty: Number(balance.qty), // qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), - qty: Number(balance.qty), - handleQty: Number(balance.qty), + qty: Number(balance.qty), + handleQty: Number(balance.qty), uom: balance.uom, inventoryStatus: balance.inventoryStatus, balance: balance, @@ -644,6 +661,7 @@ this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); this.getfocus(); + this.$emit("afterScan"); }, getfocus() { @@ -691,7 +709,6 @@ this.issueRecord.splice(index, 1) let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); - if (item != undefined) { item.Locations.forEach(l => {