diff --git a/.env.development b/.env.development index 2c183308..a216fad1 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,11 @@ -VITE_BASE_URL=http://172.21.32.13:81/api/admin-api -VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api +VITE_BASE_URL=http://172.21.32.14:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api # 租户配置 VITE_TENANT='[{"text":"长春1379","value":1}]' # 是否是测试环境 -VITE_isDevelopment=false +VITE_isDevelopment=true # 积木报表请求路径 -VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' +VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 9ce31bc1..0a28f250 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -35,7 +35,7 @@ --> - - + --> @@ -231,7 +231,7 @@ that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.toLocation = that.dataContent[0]; that.toLocationCode = that.dataContent[0].toLocationCode; - that.fromLocationList = that.getFromLocationList(); + // that.fromLocationList = that.getFromLocationList(); } }, @@ -239,23 +239,23 @@ this.$refs.balanceSelect.openPopup(items); }, - getFromLocationList() { - let list = []; - this.dataContent.forEach(location => { - location.Items.forEach(item => { - item.Locations.forEach(f => { - let item = list.find(l => l == f.fromLocationCode); - if (item == undefined) { - list.push(f.fromLocationCode) - } - }) - }) - }); - //去掉重复库位 - list = uniqueArray(list); - this.fromLocationCode = list[0]; - return list; - }, + // getFromLocationList() { + // let list = []; + // this.dataContent.forEach(location => { + // location.Items.forEach(item => { + // item.Locations.forEach(f => { + // let item = list.find(l => l == f.fromLocationCode); + // if (item == undefined) { + // list.push(f.fromLocationCode) + // } + // }) + // }) + // }); + // //去掉重复库位 + // list = uniqueArray(list); + // this.fromLocationCode = list[0]; + // return list; + // }, fromLocationUpdate(fromlocation) { let location = this.fromLocationList.find(r => r == fromlocation) @@ -268,12 +268,12 @@ onScanResult(result) { try { let that = this; - if (that.fromLocationCode == '') { - that.showErrorMessage('请选择来源库位', res => { - that.$refs.toLocationCombox.onFocus(); - }); - return; - } + // if (that.fromLocationCode == '') { + // that.showErrorMessage('请选择来源库位', res => { + // that.$refs.toLocationCombox.onFocus(); + // }); + // return; + // } let packageInfo = result.package; let itemCode = result.label.itemCode; let packingCode = result.label.packingNumber; @@ -287,7 +287,7 @@ ) return; } else { - + var params = { itemCode: result.package.itemCode, batch: result.label.batch, @@ -318,9 +318,7 @@ if (result.label.packingNumber != result.balance.packingNumber) { result.balance.handleQty = Number(result.label.qty) - } - else - { + } else { result.balance.handleQty = Number(result.balance.qty) } this.afterGetBalance(result.label, result.balance, result.package); @@ -502,62 +500,7 @@ } } }, - onScanResult1(result) { - try { - let that = this; - if (that.fromLocationCode == '') { - that.showErrorMessage('请选择来源库位', res => { - that.$refs.toLocationCombox.onFocus(); - }); - return; - } - - that.label = result.label; - that.packageInfo = result.package; - // 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 + '】的发料明细', - res => { - that.getfocus(); - } - ) - return; - } else { - //查找库存信息 - uni.showLoading({ - title: '加载中', - mask: true - }) - getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, - balanceRes => { - if (balanceRes.success) { - if (balanceRes.data.list.length == 0) { - this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', - res => { - this.packGetFocus(); - }) - } else if (balanceRes.data.list.length == 1) { - let balance = balanceRes.data.list[0]; - this.afterGetBalance(result.label, balance, that.packageInfo); - } else { - this.showBalanceSelect(balanceRes.data.list); - } - } else { - this.showErrorMessage(balanceRes.message.message); - } - uni.hideLoading(); - }); - } - } catch (e) { - this.showErrorMessage(e.stack) - uni.hideLoading(); - } - }, - + selectBalanceItem(balance) { this.afterGetBalance(this.label, balance, this.packageInfo); }, @@ -569,6 +512,7 @@ let packingCode = label.packingNumber; let lot = label.batch; 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) { let batch = fromLocation.Batchs.find(r => r.batch == lot); @@ -580,7 +524,7 @@ let record = batch.Records.find(r => r.packingNumber == packingCode); if (record == undefined) { //如果有推荐箱码 - if ( batch.Recommends !=undefined && batch.Recommends.length > 0) { + if (batch.Recommends != undefined && batch.Recommends.length > 0) { let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); if (recommend != undefined) { that.addRecord(batch, label, balance, packageInfo) @@ -631,11 +575,8 @@ } } } else { - that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细', - res => { - that.getfocus(); - } - ) + let locaion = that.createLocationInfo(label, balance, packageInfo); + item.Locations.push(locaion); } } catch (e) { that.showErrorMessage(e.stack, @@ -646,6 +587,22 @@ } }, + //增加实际扫描的明细 + createLocationInfo(label, balance, packageInfo) { + let location = { + fromLocationCode: balance.locationCode, + qty: balance.qty, + uom: balance.uom, + handleQty: 0, + Batchs: [] + } + let batch = this.createBatchInfo(label, balance, packageInfo); + batch.detail = balance; + location.Batchs.push(batch); + return location; + }, + + createBatchInfo(data, balance, packageInfo) { let batch = { batch: data.batch, @@ -672,7 +629,7 @@ // qty: Number(balance.qty), // qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), qty: balance.handleQty, - handleQty:balance.handleQty, + handleQty: balance.handleQty, uom: balance.uom, inventoryStatus: balance.inventoryStatus, balance: balance, @@ -681,7 +638,7 @@ packUnit: packageInfo.packUnit, packQty: packageInfo.packQty } - + return record; },