diff --git a/common/record.js b/common/record.js index 5e8fe283..353842eb 100644 --- a/common/record.js +++ b/common/record.js @@ -49,6 +49,8 @@ export function getBusinessType(typeCode, callback) { businessType: '', fromlocationTypeList: '', tolocationTypeList: '', + fromInventoryStatuses:'', + toInventoryStatuses:'', message: '' }; getBusinesstypeByCode(typeCode).then(res => { @@ -56,6 +58,8 @@ export function getBusinessType(typeCode, callback) { result.businessType = res.data.list[0]; result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes) result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes) + result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses; + result.toInventoryStatuses = res.data.list[0].inInventoryStatuses; callback(result) } else { result.success = false; diff --git a/pages/deliver/coms/comScanDeliverPack.vue b/pages/deliver/coms/comScanDeliverPack.vue index e3ed35ac..8b02061f 100644 --- a/pages/deliver/coms/comScanDeliverPack.vue +++ b/pages/deliver/coms/comScanDeliverPack.vue @@ -138,7 +138,7 @@ fromLocationList: [], fromLocationCode: '', fromLocation: null, - issueRecord: [], //发货历史 + issueRecord: [], //补料历史 expand: true, scanOptions: {}, editItem: {}, @@ -212,7 +212,7 @@ let location = this.fromLocationList.find(r => r == fromlocation) if (location == undefined) { this.fromLocationCode = '' - this.showErrorMessage('发货库位【' + fromlocation + '】不存在') + this.showErrorMessage('补料库位【' + fromlocation + '】不存在') } }, onScan(result) { @@ -225,12 +225,13 @@ }); return; } + let packageInfo = result.package; let itemCode = result.label.itemCode; let packingCode = result.label.packingNumber; let lot = result.label.batch; let item = that.toLocation.Items.find(r => r.itemCode == itemCode); if (item == undefined) { - that.showErrorMessage('未查找到零件【' + itemCode + '】的发货明细', + that.showErrorMessage('未查找到零件【' + itemCode + '】的补料明细', res => { that.getfocus(); } @@ -251,7 +252,7 @@ }) } else if (balanceRes.data.list.length == 1) { let balance = balanceRes.data.list[0]; - this.afterGetBalance(result.label, balance); + this.afterGetBalance(result.label, balance,packageInfo); } else { this.label =result.label; this.showBalanceSelect(balanceRes.data.list); @@ -273,7 +274,7 @@ }, - afterGetBalance(label, balance) { + afterGetBalance(label, balance,packageInfo) { try { let that = this; let itemCode = label.itemCode; @@ -294,11 +295,11 @@ if (batch.Recommends.length > 0) { let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); if (recommend != undefined) { - that.addRecord(batch, label, balance) + that.addRecord(batch, label, balance,packageInfo) } else { //允许修改箱码 if (this.jobContent.allowModifyPackingNumber == 'TRUE') { - that.addRecord(batch, label, balance); + that.addRecord(batch, label, balance,packageInfo); } else { that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', res => { @@ -308,7 +309,7 @@ } } } else { - that.addRecord(batch, label, balance) + that.addRecord(batch, label, balance,packageInfo) } } else { that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', @@ -320,21 +321,21 @@ } else { if (this.jobContent.AllowModifyBatch == null) { this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + - '】的发货明细,是否要继续发货?', res => { + '】的补料明细,是否要继续补料?', res => { if (res) { let batch = that.createBatchInfo(label, balance); fromLocation.Batchs.unshift(batch); } }) } else { - that.showErrorMessage('未查找到批次【' + lot + '】的发货明细', + that.showErrorMessage('未查找到批次【' + lot + '】的补料明细', res => { that.getfocus(); }); } } } else { - that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发货明细', + that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的补料明细', res => { that.getfocus(); } @@ -363,12 +364,14 @@ return batch; }, - creatRecord(label, balance) { + creatRecord(label, balance,packageInfo) { + balance.stdPackQty = packageInfo.stdPackQty + balance.stdPackUnit = packageInfo.stdPackUnit let record = { itemCode: label.itemCode, packingNumber: label.packingNumber, batch: label.batch, - qty: Number(label.qty)>Number(label.balance)?Number(label.balance):Number(label.qty), + qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), uom: balance.uom, inventoryStatus: balance.inventoryStatus, balance: balance, @@ -386,8 +389,8 @@ batch.handleQty = handleQty; }, - addRecord(batch, label, balance) { - let record = this.creatRecord(label, balance); + addRecord(batch, label, balance,packageInfo) { + let record = this.creatRecord(label, balance,packageInfo); batch.Records.push(record); this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); diff --git a/pages/deliver/job/deliverDetail2.vue b/pages/deliver/job/deliverDetail2.vue deleted file mode 100644 index 153a5f4f..00000000 --- a/pages/deliver/job/deliverDetail2.vue +++ /dev/null @@ -1,533 +0,0 @@ - - - - - diff --git a/pages/issue/coms/comScanIssuePack.vue b/pages/issue/coms/comScanIssuePack.vue index fcbb192e..70f20728 100644 --- a/pages/issue/coms/comScanIssuePack.vue +++ b/pages/issue/coms/comScanIssuePack.vue @@ -85,6 +85,7 @@ + @@ -95,6 +96,7 @@ import winComScan from '@/mycomponents/scan/winComScan.vue' import balance from '@/mycomponents/balance/balance.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' + import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import { getDetailOption, @@ -114,7 +116,8 @@ comMessage, winComScan, balance, - balanceQtyEdit + balanceQtyEdit, + balanceSelect }, props: { title: { @@ -141,7 +144,8 @@ editItem: {}, positionInfo: "请选择位置", positionList: [], - defaultValueList: [] + defaultValueList: [], + fromInventoryStatuses :"", } }, created() { @@ -174,11 +178,15 @@ let that = this; that.fromLocationList = []; if (that.dataContent != null) { + that.fromInventoryStatuses =this.jobContent.outInventoryStatuses that.toLocation = that.dataContent[0]; that.toLocationCode = that.dataContent[0].toLocationCode; that.fromLocationList = that.getFromLocationList(); } }, + showBalanceSelect(items) { + this.$refs.balanceSelect.openPopup(items); + }, getFromLocationList() { let list = []; @@ -215,6 +223,7 @@ }); return; } + let packageInfo = result.package; let itemCode = result.label.itemCode; let packingCode = result.label.packingNumber; let lot = result.label.batch; @@ -232,7 +241,7 @@ title: '加载中', mask: true }) - getBalanceByManagementPrecision(result.label, that.fromLocationCode, "OK", balanceRes => { + getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, balanceRes => { if (balanceRes.success) { if (balanceRes.data.list.length == 0) { this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', @@ -241,7 +250,7 @@ }) } else if (balanceRes.data.list.length == 1) { let balance = balanceRes.data.list[0]; - this.afterGetBalance(result.label, balance); + this.afterGetBalance(result.label, balance,packageInfo); } else { this.showBalanceSelect(balanceRes.data.list); } @@ -256,8 +265,11 @@ uni.hideLoading(); } }, + selectBalanceItem(balance) { + this.afterGetBalance(this.label, balance); + }, - afterGetBalance(label, balance) { + afterGetBalance(label, balance,packageInfo) { try { let that = this; let itemCode = label.itemCode; @@ -278,11 +290,11 @@ if (batch.Recommends.length > 0) { let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); if (recommend != undefined) { - that.addRecord(batch, label, balance) + that.addRecord(batch, label, balance,packageInfo) } else { //允许修改箱码 if (this.jobContent.allowModifyPackingNumber == 'TRUE') { - that.addRecord(batch, label, balance); + that.addRecord(batch, label, balance,packageInfo); } else { that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', res => { @@ -292,7 +304,7 @@ } } } else { - that.addRecord(batch, label, balance) + that.addRecord(batch, label, balance,packageInfo) } } else { that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', @@ -347,12 +359,14 @@ return batch; }, - creatRecord(label, balance) { + creatRecord(label, balance,packageInfo) { + balance.stdPackQty = packageInfo.stdPackQty + balance.stdPackUnit = packageInfo.stdPackUnit let record = { itemCode: label.itemCode, packingNumber: label.packingNumber, batch: label.batch, - qty: Number(balance.qty), + qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), uom: balance.uom, inventoryStatus: balance.inventoryStatus, balance: balance, @@ -370,8 +384,8 @@ batch.handleQty = handleQty; }, - addRecord(batch, label, balance) { - let record = this.creatRecord(label, balance); + addRecord(batch, label, balance,packageInfo) { + let record = this.creatRecord(label, balance,packageInfo); batch.Records.push(record); this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); diff --git a/pages/issue/record/issueRecord.vue b/pages/issue/record/issueRecord.vue index 66d4730e..74807e48 100644 --- a/pages/issue/record/issueRecord.vue +++ b/pages/issue/record/issueRecord.vue @@ -30,7 +30,7 @@ - + @@ -46,12 +46,15 @@ goHome, updateTitle, getRemoveOption, - getISODateTime + getISODateTime, } from '@/common/basic.js'; import { getDataSource } from '@/pages/issue/js/issue.js'; + import { + getBusinessType, + } from '@/common/record.js'; import comBlankView from '@/mycomponents/common/comBlankView.vue' import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue' @@ -83,11 +86,13 @@ detailOptions: [], scanOptions: [], fromType: "", - workShopCode: "" + workShopCode: "", + fromInventoryStatuses: "", + toInventoryStatuses: "" } }, mounted() { - this.goScan(true) + }, onLoad(option) { this.fromType = option.fromType @@ -97,8 +102,25 @@ updateTitle("发料记录") } + var typeCode = "Issue" + getBusinessType(typeCode, res => { + if (res.success) { + this.businessType = res.businessType; + this.fromlocationTypeList = res.fromlocationTypeList; + this.tolocationTypeList = res.tolocationTypeList; + this.fromInventoryStatuses = res.fromInventoryStatuses + this.toInventoryStatuses = res.toInventoryStatuses + this.goScan(true) + } else { + this.$refs.comMessage.showBreakMessage(res.message); + } + }); + }, methods: { + closeScan(){ + this.resizeCollapse(); + }, resizeCollapse() { this.$nextTick(r => { this.$refs.comIssueDetailCard.forEach(r => { @@ -216,7 +238,11 @@ var datacontent = {} //克隆对象,深度克隆,防止双向绑定同一个变量 // Object.assign(datacontent, this.detailSource); - this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent); + var dataContent = { + allowModifyPackingNumber: "FALSE", + outInventoryStatuses: this.fromInventoryStatuses + } + this.$refs.comScanIssuePack.openScanPopup(this.detailSource, dataContent); }, closeScanPopup() { @@ -243,6 +269,7 @@ }) } // item.handleQty=itemHandleQty; + // this.closeScan(); }, setParams() { diff --git a/pages/repleinsh/coms/comRepleishDetailCard.vue b/pages/repleinsh/coms/comRepleishDetailCard.vue index afd9726b..731e0f58 100644 --- a/pages/repleinsh/coms/comRepleishDetailCard.vue +++ b/pages/repleinsh/coms/comRepleishDetailCard.vue @@ -5,7 +5,7 @@ - +