From 689255f057fd019330102b56634f18826af7d88f Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Fri, 22 Dec 2023 10:04:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=92=8C=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/basic.js | 18 ++++++++++-------- mycomponents/scan/winScanPackAndLocation.vue | 5 +++-- pages/putaway/record/putawayRecord.vue | 15 +++++++++------ static/config.json | 2 +- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/common/basic.js b/common/basic.js index 84ab342c..53648ae5 100644 --- a/common/basic.js +++ b/common/basic.js @@ -595,13 +595,12 @@ export function getInspectReasonList(value) { // else return 'Other' // } -export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber,locationCode, batch) { +export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber, locationCode, batch) { var itemInfo = { packingNumber: "", batch: "" } - - var manageType = queryManageModelByList(managementList, itemCode,locationCode) + var manageType = queryManageModelByList(managementList, itemCode, locationCode) if (manageType == "BY_QUANTITY") { itemInfo.packingNumber = "" itemInfo.batch = "" @@ -614,19 +613,22 @@ export function getPackingNumberAndBatchByList(managementList, itemCode, packing } else if (manageType == "BY_UNIQUE_ID") { itemInfo.packingNumber = packingNumber itemInfo.batch = batch + } else if (manageType == "") { + itemInfo.packingNumber = packingNumber + itemInfo.batch = batch } return itemInfo; } -export function queryManageModelByList(managementList, itemCode,locationCode) { - var result = managementList.filter(res => { - if (res.itemCode == itemCode&&res.locationCode==locationCode) { +export function queryManageModelByList(managementList, itemCode, locationCode) { + var result = managementList.find(res => { + if (res.itemCode == itemCode && res.locationCode == locationCode) { return res.ManagementPrecision } }) if (result != undefined) { - return result[0].ManagementPrecision + return result.ManagementPrecision } else { return "" } @@ -806,7 +808,7 @@ export function getBatch() { var year = date.getFullYear(); //年 var month = date.getMonth() + 1; //月 var day = date.getDate(); //日 - var batch =year.toString()+month.toString()+day.toString() + var batch = year.toString() + month.toString() + day.toString() return batch; } diff --git a/mycomponents/scan/winScanPackAndLocation.vue b/mycomponents/scan/winScanPackAndLocation.vue index 98d9f6f0..366e749f 100644 --- a/mycomponents/scan/winScanPackAndLocation.vue +++ b/mycomponents/scan/winScanPackAndLocation.vue @@ -21,13 +21,14 @@ 来源库位 - + + + @confirm="scanLocation" style='height: 30px;border:1px solid #fff ;'> diff --git a/pages/putaway/record/putawayRecord.vue b/pages/putaway/record/putawayRecord.vue index 45136c28..1098c737 100644 --- a/pages/putaway/record/putawayRecord.vue +++ b/pages/putaway/record/putawayRecord.vue @@ -163,8 +163,11 @@ } }) if (detail == undefined) { - let newDetail = createDetailInfo(balance, pack); - item.subList.push(newDetail); + this.getRecommendLocation(balance, pack, toLocationCode => { + let newDetail = createDetailInfo(balance, pack); + newDetail.toLocationCode = toLocationCode; + item.subList.push(newDetail); + }); } else { if (detail.scaned == true) { this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") @@ -276,10 +279,10 @@ //记录有目标库位,需要查询管理模式 let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); //2:获取管理模式,封装参数 - getPrecisionStrategyList(precisionStrategyParams, this.toLocationCode, res => { + getPrecisionStrategyList(precisionStrategyParams, res => { if (res.success) { this.managementList = res.list; - var params = this.setRecordParams(true) + var params = this.setRecordParams() console.log("提交参数", JSON.stringify(params)); putawayRecordSubmit(params).then(res => { @@ -333,14 +336,14 @@ return itemList; }, - setRecordParams(queryModel) { + setRecordParams() { var subList = [] var creator = this.$store.state.user.id this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, - detail.packingNumber, detail.batch); + detail.packingNumber, detail.toLocationCode, detail.batch); detail.toPackingNumber = info.packingNumber;; detail.toContainerNumber = detail.containerNumber detail.toBatch = info.batch; diff --git a/static/config.json b/static/config.json index f1ce854b..7426682e 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.180:12080/admin-api", + "value": "http://dev.ccwin-in.com:25100/api/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api", From 41bc8fd0d4853c03ce401744653db9bf5a107c06 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Fri, 22 Dec 2023 10:46:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/putaway/record/putawayRecord.vue | 60 ++++++++++++++++---------- static/config.json | 2 +- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/pages/putaway/record/putawayRecord.vue b/pages/putaway/record/putawayRecord.vue index 1098c737..8286d84b 100644 --- a/pages/putaway/record/putawayRecord.vue +++ b/pages/putaway/record/putawayRecord.vue @@ -97,14 +97,14 @@ detailSource: [], //绑定在页面上的数据源 fromLocationInfo: {}, fromLocationCode: "", - toLocationCode: "", fromlocationTypeList: [], tolocationTypeList: [], inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 businessType: {}, showToLoaction: true, - recommendLocationList: [] //推荐库位列表 + recommendLocationList: [], //推荐库位列表 + fromWarehouseCode: '' //来源仓库 }; }, onLoad(option) { @@ -143,12 +143,16 @@ return res } }) + if (this.fromWarehouseCode == '') { + this.fromWarehouseCode = balance.warehouseCode; + } if (item == undefined) { // 获取推荐库位 - this.getRecommendLocation(balance, pack, toLocationCode => { + this.getRecommendLocation(balance, pack, toLocation => { var itemp = createItemInfo(balance, pack); let newDetail = createDetailInfo(balance, pack); // - newDetail.toLocationCode = toLocationCode; + newDetail.toLocationCode = toLocation.code; + newDetail.toWarehouseCode = toLocation.warehouseCode; itemp.subList.push(newDetail); this.detailSource.push(itemp) }) @@ -163,9 +167,10 @@ } }) if (detail == undefined) { - this.getRecommendLocation(balance, pack, toLocationCode => { + this.getRecommendLocation(balance, pack, toLocation => { let newDetail = createDetailInfo(balance, pack); - newDetail.toLocationCode = toLocationCode; + newDetail.toLocationCode = toLocation.code; + newDetail.toWarehouseCode = toLocation.warehouseCode; item.subList.push(newDetail); }); } else { @@ -193,14 +198,14 @@ itemCode: balance.itemCode, locationCode: res.data.code }) - callback(res.data.code); + callback(res.data); }).catch(error => { uni.hideLoading() this.showErrorMessage(error) }) } else { - callback(recommend.locationCode); + callback(recommend); } }, @@ -262,19 +267,17 @@ this.$refs.scanPopup.getfocus(); }, - scanLocationCode(location, code) { - this.toLocationCode = code - this.toLocationCode = location; + // scanLocationCode(location, code) { + // this.toLocationCode = code + // this.toLocationCode = location; - }, + // }, commit() { - //查询库位零件关系 - - // uni.showLoading({ - // title: "提交中....", - // mask: true - // }); + uni.showLoading({ + title: "提交中....", + mask: true + }); //记录有目标库位,需要查询管理模式 let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); @@ -301,7 +304,6 @@ this.showErrorMessage(res.message); } }); - }, @@ -337,8 +339,10 @@ }, setRecordParams() { - var subList = [] + this.dataContent.creator = creator; + this.dataContent.fromWarehouseCode = this.fromWarehouseCode; var creator = this.$store.state.user.id + var subList = [] this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { @@ -354,8 +358,11 @@ } }) }) + if (subList.length > 0) { + this.dataContent.toWarehouseCode = subList[0].toWarehouseCode; + } this.dataContent.subList = subList - this.dataContent.creator = creator; + debugger; return this.dataContent; }, @@ -404,8 +411,7 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { - this.fromLocationCode = ''; - + this.clear(); }) }, @@ -417,6 +423,14 @@ this.detailSource.splice(i, 1) } } + }, + + clear() { + this.fromLocationInfo = {}; + this.fromLocationCode = ''; + this.fromWarehouseCode = ''; + this.toWarehouseCode = ''; + this.detailSource = []; } } } diff --git a/static/config.json b/static/config.json index 7426682e..27efe8bc 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://dev.ccwin-in.com:25100/api/admin-api", + "value": "http://192.168.0.230:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",