diff --git a/.env.development b/.env.development index a216fad1..8fd8b72c 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,11 @@ -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_BASE_URL=http://172.22.32.9:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api # 租户配置 -VITE_TENANT='[{"text":"长春1379","value":1}]' +VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' # 是否是测试环境 VITE_isDevelopment=true # 积木报表请求路径 -VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' +VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' diff --git a/src/mycomponents/scan/winComScanBalance.vue b/src/mycomponents/scan/winComScanBalance.vue index 61a6e5e2..d2822de0 100644 --- a/src/mycomponents/scan/winComScanBalance.vue +++ b/src/mycomponents/scan/winComScanBalance.vue @@ -34,7 +34,8 @@ import { getBalanceByParams, - getBasicItemByCode + getBasicItemByCode, + getBalanceByFilter } from '@/api/request2.js'; import { @@ -91,6 +92,8 @@ fromLocation: '', fromLocationList: [], fromLocationAreaTypeList: [], + + toLocationAreaTypeList: [], locationOnFocus: false, businessType: {}, inventoryStatus: [], @@ -109,9 +112,9 @@ this.businessType = businessType this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses) this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes) + this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes) this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) this.$refs.popup.open('bottom') - }, getScanResult(result) { @@ -121,7 +124,68 @@ return; } this.getItemCodeType(result.package.itemCode, callBack => { - this.queryBalance(this.resultData) + + this.getToLocationBalance(this.resultData) + + //this.queryBalance(this.resultData) + }) + }, + + //查询到目标库位的库存余额 + getToLocationBalance(result) { + uni.showLoading({ + title: '查询中', + mask: true + }) + var filters = [] + if (result.package.parentNumber) { + var packingNumber = result.package.parentNumber + "," + result.package.number; + filters.push({ + column: "packingNumber", + action: "in", + value: packingNumber + }) + } else { + filters.push({ + column: "packingNumber", + action: "==", + value: result.package.packingNumber + }) + } + + filters.push({ + column: "itemCode", + action: "==", + value: result.package.itemCode + }) + filters.push({ + column: "batch", + action: "==", + value: result.package.batch + }) + + filters.push({ + column: "areaType", + action: "in", + value: this.toLocationAreaTypeList.join(',') + }) + + + var params = { + filters: filters, + pageNo: 1, + pageSize: 100, + } + getBalanceByFilter(params).then(res => { + uni.hideLoading() + if (res.data.list.length > 0) { + this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); + } else { + this.queryBalance(this.resultData); + } + // callback(res.data) + }).catch(err => { + this.showErrorMessage(err.message); }) }, @@ -170,7 +234,7 @@ this.showErrorMessage(error) }) }, - + getItemCodeType(itemCode, callBack) { uni.showLoading({ title: "加载中", @@ -186,9 +250,7 @@ if (this.verifyCategory) { if (result.category == 'LCJ' || result.category == 'BJ') { callBack() - } - else - { + } else { this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】") } } else { @@ -213,6 +275,7 @@ this.showErrorMessage(error) }) }, + showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { if (res) { @@ -222,6 +285,7 @@ } }); }, + selectBalanceItem(item) { this.resultData.balance = item this.$emit("getBalance", this.resultData) diff --git a/src/pages.json b/src/pages.json index 119d76ad..265152ee 100644 --- a/src/pages.json +++ b/src/pages.json @@ -686,7 +686,7 @@ { "path": "pages/repleinsh/record/repleinshRecord", "style": { - "navigationBarTitleText": "补料记录", + "navigationBarTitleText": "超市先进先出补料", "enablePullDownRefresh": false, "titleNView": { "autoBackButton": "true" diff --git a/src/pages/issue/record/directIssue.vue b/src/pages/issue/record/directIssue.vue index da841f90..c5451866 100644 --- a/src/pages/issue/record/directIssue.vue +++ b/src/pages/issue/record/directIssue.vue @@ -135,7 +135,7 @@ }, onLoad(option) { uni.setNavigationBarTitle({ - title: option.title + title: option.title }) this.clearData(); getBusinessType(this.businessTypeCode, res => { @@ -229,7 +229,6 @@ this.resultData = result; let packageInfo = result.package; this.getBalance(result.label, packageInfo, balances => { - //扫描的是外包装 let s = ''; if (!result.package.parentNumber) { @@ -260,8 +259,6 @@ let subParentPackitems = balances.list.filter(r => r.packingNumber == packageInfo .parentNumber && r.locationCode == this.fromLocationCode) - - //小包装没有库存, if (subPackitems.length == 0) { //外包装有库存,出库后剩余库存未转换为出库包装规格 @@ -289,32 +286,34 @@ .fromLocationCode) if (manyBlances.length > 0) { locationCode = manyBlances[0].locationCode; + this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + + locationCode + + '】已经有库存余额,请重新扫描') + } else { + this.afterGetBalance(result); } } - this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + - locationCode + - '】已经有库存余额,请重新扫描') } } } }) }, - + showBalanceSelect(items) { this.$refs.balanceSelect.openPopup(items); }, - + selectBalanceItem(balance) { - this.resultData.balance =balance; + this.resultData.balance = balance; this.afterGetBalance(this.resultData); }, - - afterGetBalance(result){ + + afterGetBalance(result) { let balance = result.balance; let label = result.label; let pack = result.package; let packUnit = pack.packUnit; - let packQty =pack.packQty + let packQty = pack.packQty var item = this.detailSource.find(res => { if (res.itemCode == balance.itemCode) { return res @@ -324,17 +323,17 @@ this.fromWarehouseCode = balance.warehouseCode; } if (item == undefined) { - + var itemp = createItemInfo(balance, pack); let newDetail = createDetailInfo(balance, pack); // - newDetail.parentNumber =pack.parentNumber; - newDetail.packingNumber =pack.number - newDetail.packUnit =packUnit; - newDetail.packQty=packQty; + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = packUnit; + newDetail.packQty = packQty; itemp.subList.push(newDetail); this.detailSource.push(itemp) calcHandleQty(this.detailSource); - + } else { var detail = item.subList.find(r => { if (r.packingNumber == pack.number && @@ -345,13 +344,13 @@ } }) if (detail == undefined) { - let newDetail = createDetailInfo(balance, pack); - newDetail.parentNumber =pack.parentNumber; - newDetail.packingNumber =pack.number - newDetail.packUnit =packUnit; - newDetail.packQty=packQty; - item.subList.push(newDetail); - calcHandleQty(this.detailSource); + let newDetail = createDetailInfo(balance, pack); + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = packUnit; + newDetail.packQty = packQty; + item.subList.push(newDetail); + calcHandleQty(this.detailSource); } else { if (detail.scaned == true) { this.showErrorMessage("箱码[" + detail.packingNumber + "]批次[" + balance.batch + "]已经在列表中") @@ -710,7 +709,7 @@ this.fromWarehouseCode = ''; this.toWarehouseCode = ''; this.detailSource = []; - this.positionInfo= "请选择生产线"; + this.positionInfo = "请选择生产线"; } } } diff --git a/src/pages/repleinsh/record/directRepleinshRecord.vue b/src/pages/repleinsh/record/directRepleinshRecord.vue index 3da22e23..1110729e 100644 --- a/src/pages/repleinsh/record/directRepleinshRecord.vue +++ b/src/pages/repleinsh/record/directRepleinshRecord.vue @@ -6,10 +6,11 @@ - - 来源库位 : {{fromLocationCode}} + + + 来源库位 : {{fromLocationCode}} + - @@ -17,11 +18,9 @@ + :isShowToLocation="false" @updateData="updateData" @removePack="removePack"> - @@ -31,7 +30,8 @@ style="background-color:ghostwhite; width: 100%; "> + @getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList"> + @@ -119,9 +119,9 @@ recommendLocationList: [], //推荐库位列表 fromWarehouseCode: '', //来源仓库 businessTypeCode: "Repleinment", - toLocationCode:"", - resultData:{}, - itemCode:"" + toLocationCode: "", + resultData: {}, + itemCode: "" }; }, onLoad(option) { @@ -145,10 +145,10 @@ mounted() {}, methods: { - getBusinessType(){ + getBusinessType() { getBusinessType(this.businessTypeCode, res => { if (res.success) { - this.businessType=res.businessType; + this.businessType = res.businessType; this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.openScanPopup(); @@ -159,7 +159,7 @@ }, getBalance(label, packageInfo, callback) { var filters = [] - + if (packageInfo.parentNumber) { var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; filters.push({ @@ -174,7 +174,7 @@ value: label.packingNumber }) } - + filters.push({ column: "itemCode", action: "==", @@ -185,7 +185,7 @@ action: "==", value: label.batch }) - + if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") { filters.push({ column: "inventoryStatus", @@ -193,7 +193,7 @@ value: this.fromInventoryStatuses }) } - + var params = { filters: filters, pageNo: 1, @@ -205,20 +205,23 @@ this.showErrorMessage(err.message); }) }, - + getScanResult(result) { this.setData(result); }, - + setData(result) { let balance = result.balance; let label = result.label; let pack = result.package; - if(this.fromLocationCode&&this.fromLocationCode!=balance.locationCode){ - this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位["+this.fromLocationCode+"]没有库存余额") + + + if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) { + this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this + .fromLocationCode + "]没有库存余额") return; } - + var item = this.detailSource.find(res => { if (res.itemCode == balance.itemCode) { return res @@ -234,17 +237,17 @@ } var itemp = createItemInfo(balance, pack); let newDetail = createDetailInfo(balance, pack); // - newDetail.parentNumber =pack.parentNumber; - newDetail.packingNumber =pack.number - newDetail.packUnit =pack.packUnit; - newDetail.packQty=pack.packQty; - if(balance.lableQty){ - newDetail.handleQty =balance.lableQty + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit; + newDetail.packQty = pack.packQty; + if (balance.lableQty) { + newDetail.handleQty = balance.lableQty } itemp.subList.push(newDetail); this.detailSource.push(itemp) this.itemCode = balance.itemCode; - this.fromLocationCode =balance.locationCode + this.fromLocationCode = balance.locationCode this.scanPopupGetFocus() } else { var detail = item.subList.find(r => { @@ -257,12 +260,12 @@ }) if (detail == undefined) { let newDetail = createDetailInfo(balance, pack); - newDetail.parentNumber =pack.parentNumber; - newDetail.packingNumber =pack.number - newDetail.packUnit =pack.packUnit; - newDetail.packQty=pack.packQty; - if(balance.lableQty){ - newDetail.handleQty =balance.lableQty + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit; + newDetail.packQty = pack.packQty; + if (balance.lableQty) { + newDetail.handleQty = balance.lableQty } item.subList.push(newDetail); this.scanPopupGetFocus() @@ -274,8 +277,8 @@ } calcHandleQty(this.detailSource); }, - - + + showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { @@ -295,7 +298,7 @@ } } this.$forceUpdate(); - + }, removeItem(index, item) { @@ -314,9 +317,9 @@ }, openScanPopup() { - if(this.businessType){ + if (this.businessType) { this.$refs.scanPopup.openScanPopup(this.businessType); - }else { + } else { this.getBusinessType() } }, @@ -339,18 +342,18 @@ }, commit() { - if(this.toLocationCode==""){ + if (this.toLocationCode == "") { this.showMessage("请输入目标库位") return; } - - this.detailSource.forEach(item=>{ - item.subList.forEach(detail=>{ - detail.toLocationCode=this.toLocationCode - detail.fromLocation =this.fromLocationCode + + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + detail.toLocationCode = this.toLocationCode + detail.fromLocation = this.fromLocationCode }) }) - + uni.showLoading({ title: "提交中....", mask: true @@ -408,25 +411,23 @@ // detail.toLocationCode = detail.toLocationCode submitItem.qty = detail.handleQty; submitItem.package = ""; - submitItem.recordList=[ - { - toInventoryStatus:detail.inventoryStatus, - fromPackingNumber:info.packingNumber, - fromParentPackingNumber: detail.parentNumber, - fromBatch:info.batch, - - toPackingNumber:info.packingNumber, - - toBatch:info.batch, - fromLocationCode:detail.locationCode, - toLocationCode:detail.toLocationCode, - handleQty:detail.handleQty, - fromPackUnit:detail.packUnit, - toPackUnit:detail.packUnit, - fromPackQty:detail.packQty, - toPackQty:detail.packQty - } - ] + submitItem.recordList = [{ + toInventoryStatus: detail.inventoryStatus, + fromPackingNumber: info.packingNumber, + fromParentPackingNumber: detail.parentNumber, + fromBatch: info.batch, + + toPackingNumber: info.packingNumber, + + toBatch: info.batch, + fromLocationCode: detail.locationCode, + toLocationCode: detail.toLocationCode, + handleQty: detail.handleQty, + fromPackUnit: detail.packUnit, + toPackUnit: detail.packUnit, + fromPackQty: detail.packQty, + toPackQty: detail.packQty + }] subList.push(submitItem) } }) @@ -480,7 +481,7 @@ this.toWarehouseCode = ''; this.detailSource = []; this.toLocationCode = ""; - this.itemCode="" + this.itemCode = "" } } }