From b83739552814acfd5a0ff4f9c702b38f586bff2b Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Thu, 20 Feb 2025 17:05:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4=EF=BC=9A?= =?UTF-8?q?=E8=B4=A7=E6=9E=B6=E9=80=81=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PDA/PDA/components/Card.vue | 2 +- .../productionLineCallOut.vue | 356 +++++++++++++---- .../dist/dev/app-plus/app-service.js | 367 ++++++++++++------ .../Service/MatDetailCurrentInfoService.cs | 3 - .../{CallOutRequest.cs => CallInRequest.cs} | 6 +- .../GetShelfInfoForCallOutRequest.cs | 12 + .../GetShelfInfoForCallOutResponseData.cs | 17 + ...dateMatDetailCurrentInForCallOutRequest.cs | 19 + .../PDAProductionLineCallInController.cs | 2 +- .../PDAProductionLineCallOutController.cs | 289 ++++++++------ 10 files changed, 778 insertions(+), 295 deletions(-) rename WCS.Model/ApiModel/PDAProductionLineCallOut/{CallOutRequest.cs => CallInRequest.cs} (58%) create mode 100644 WCS.Model/ApiModel/PDAProductionLineCallOut/GetShelfInfoForCallOutRequest.cs create mode 100644 WCS.Model/ApiModel/PDAProductionLineCallOut/GetShelfInfoForCallOutResponseData.cs create mode 100644 WCS.Model/ApiModel/PDAProductionLineCallOut/UpdateMatDetailCurrentInForCallOutRequest.cs diff --git a/PDA/PDA/components/Card.vue b/PDA/PDA/components/Card.vue index 5c1a550..3570c27 100644 --- a/PDA/PDA/components/Card.vue +++ b/PDA/PDA/components/Card.vue @@ -32,7 +32,7 @@ {{item.modifyUser}} - 绑定时间: + 最后更新时间: {{item.modifyTime}} diff --git a/PDA/PDA/pages/productionLineCallOut/productionLineCallOut.vue b/PDA/PDA/pages/productionLineCallOut/productionLineCallOut.vue index 03578a9..436b90e 100644 --- a/PDA/PDA/pages/productionLineCallOut/productionLineCallOut.vue +++ b/PDA/PDA/pages/productionLineCallOut/productionLineCallOut.vue @@ -36,7 +36,7 @@ - @@ -58,7 +58,7 @@ 货架码:{{shelfCode}} - 工位码:{{shelfCode}} + 工位码:{{locationCode}} @@ -66,22 +66,32 @@ - + - - + + + + + {{shelfAreaOptions[selectedShelfAreaIndex].locationAreaName}} + + - - - + + + + {{shelfTypeOptions[selectedShelfTypeIndex].text}} + + + + + @@ -110,7 +120,7 @@ getServerIPAndPort } from '@/config.js'; - import StocktakingCard from '@/components/StocktakingCard.vue'; + import Card from '@/components/Card.vue'; import { ref, onMounted, @@ -123,7 +133,7 @@ export default { components: { uniPopup, - StocktakingCard + Card }, setup() { const { @@ -142,14 +152,13 @@ const inputValue = ref(''); const showPopup = (info) => { fixedInfo.infoId = info.id; - + console.log(fixedInfo.infoId); fixedInfo.value.matName = info.matName; fixedInfo.value.matCode = info.matCode; fixedInfo.value.matSpec = info.matSpec; fixedInfo.value.matQty = info.matQty; - fixedInfo.value.stocktakingQty = info.stocktakingQty; - inputValue.value = info.stocktakingQty == -1 ? info.matQty : info.stocktakingQty; + inputValue.value = fixedInfo.value.matQty; popup.value.open(); }; @@ -159,11 +168,11 @@ }; const saveData = () => { - if (fixedInfo.value.stocktakingQty != -1 && inputValue.value == fixedInfo.value.stocktakingQty) { + if (inputValue.value == fixedInfo.value.matQty) { uni.showToast({ title: '本次修改未修改数量', icon: 'none', - duration: 1500 + duration: 2500 }); hidePopup(); return; @@ -172,19 +181,18 @@ uni.showToast({ title: '您所输入的数量应该大于等于0!', icon: 'none', - duration: 1500 + duration: 2500 }); return; } var serverIPAndPort = getServerIPAndPort(); - //调用接口进行数量的修改 uni.request({ url: 'http://' + serverIPAndPort + - '/pdaStocktaking/stockTakingById', // 请求的接口地址 + '/PDAProductionLineCallOut/updateMatDetailCurrentInfoForCallOut', // 请求的接口地址 method: 'POST', // 设置请求方式为 POST data: { - "stocktakingQty": inputValue.value, + "matQty": inputValue.value, "matDetailCurrentInfoId": fixedInfo.infoId, "userName": getConfig('userName', 'admin'), "deviceType": "PDA" @@ -197,17 +205,17 @@ if (res.statusCode === 200) { //接口返回数据为200 表示获取成功! if (res.data.code == 200) { - uni.showToast({ - title: '成功!', - icon: 'none', - duration: 1200 - }); hidePopup(); + uni.showToast({ + title: '修改成功!', + icon: 'none', + duration: 2000 + }); - proxy.refreshData(); + proxy.getCurrentMatInfo(); } else { uni.showToast({ - title: '失败:' + res.data.message, + title: '修改失败:' + res.data.message, icon: 'none', duration: 2500 }); @@ -236,6 +244,7 @@ } }); + }; return { @@ -250,14 +259,16 @@ data() { return { - locationId: null, + + locationId: 0, locationCode: '', + shelfId: 0, + shelfCode: '', + userName: '', //当前登录的用户名 recordCount: 0, - shelfId: null, - shelfCode: '', placeholderText: '请先扫描货架码', matCodeCondition: '', //物料编码搜索条件 cardData: null, @@ -267,39 +278,27 @@ touchStartY: 0, isMove: false, //滑动标识 是否滑动 + // 货架区域选项 + shelfAreaOptions: [{ + id: 1, + locationAreaName: '请先扫货架码' + }], + selectedShelfAreaIndex: 0, // 选择的货架区域索引 - selectedShelfAreaOption: '', // 初始选中值,可以是空字符串或预定义的值 - shelfAreaOptions: [ // 选项列表 - { + // 货架类型选项 + shelfTypeOptions: [{ id: 1, - value: 'type1', - text: '类型1' - }, - { - id: 2, - value: 'type2', - text: '类型2' - }, - { - id: 3, - value: 'type3', - text: '类型3' - } - ], - - shelfTypeOptions: [ // 选项列表 - { - id: 1, - value: '1', + value: 'empty', text: '空货架' }, { id: 2, - value: '2', + value: 'notEmpty', text: '非空货架' - } + }, + // ... 其他选项 ], - selectedShelfTypeOption: '', // 初始选中值,可以是空字符串或预定义的值 + selectedShelfTypeIndex: 1, // 选择的货架类型索引 } }, onShow: function() { @@ -314,25 +313,216 @@ }); }, methods: { - refreshData: function() { - this.analysisScanCode(this.shelfCode); + // 货架区域选择改变时触发 + onShelfAreaChange(e) { + this.selectedShelfAreaIndex = e.detail.value; + // 你可以在这里添加其他逻辑,比如更新状态或发送请求 + }, + + // 货架类型选择改变时触发 + onShelfTypeChange(e) { + this.selectedShelfTypeIndex = e.detail.value; + // 你可以在这里添加其他逻辑,比如更新状态或发送请求 + }, + + // 货架送回按钮点击时触发 + sendBackShelf() { + //货架码 + if (this.shelfId == 0 || this.shelfId == null) { + uni.showToast({ + title: '请先扫货架码!', + icon: 'none', + duration: 1500 + }); + return; + } + //货架送回区域是否选择 + if (shelfAreaOptions[selectedShelfAreaIndex].locationAreaName = '请先扫货架码') { + uni.showToast({ + title: '该位置未绑定货架区域,请确认!', + icon: 'none', + duration: 1500 + }); + return; + } + //请求送回货架 + var serverIPAndPort = getServerIPAndPort(); + uni.request({ + url: 'http://' + serverIPAndPort + + '/pdaProductionLineCallOut/getShelfInfoForCallOut', // 请求的接口地址 + method: 'POST', // 设置请求方式为 POST + data: { + "shelfCode": this.shelfCode, + "userName": this.userName, + "deviceType": "PDA" + }, + header: { + 'Content-Type': 'application/json', // 如果需要以JSON格式发送数据 + }, + success: (res) => { + // 请求成功的回调函数 + if (res.statusCode === 200) { + //接口返回数据为200 表示获取成功! + if (res.data.code == 200) { + //未查询到信息 + if (res.data.data == null) { + uni.showToast({ + title: '获取失败,请扫码重试!', + icon: 'none', + duration: 1500 + }); + return; + } + //绑定货架等信息 + this.shelfId = res.data.data.shelfId; + this.shelfCode = res.data.data.shelfCode; + + this.locationId = res.data.data.locationId; + this.locationCode = res.data.data.locationCode; + + this.shelfAreaOptions = res.data.data.locationAreas; + + //获取数据 + this.getCurrentMatInfo(); + return; + + } else { + uni.showToast({ + title: '获取失败:' + res.data.message, + icon: 'none', + duration: 3500 + }); + this.clear(); + } + + } else { + uni.showToast({ + title: '服务器返回错误状态码' + res.statusCode, + icon: 'none', + duration: 3000 + }); + this.clear(); + } + }, + fail: (err) => { + // 请求失败的回调函数 + uni.showToast({ + title: '请求失败' + err, + icon: 'none', + duration: 3000 + }); + + this.clear(); + }, + complete: (event) => { + // 请求完成的回调函数(无论成功或失败都会调用) + console.log('请求完成', event); + } + }); }, analysisScanCode: function(encodedString) { // 去除末尾的逗号和"..."(如果有的话) encodedString = encodedString.replace(/,\s*\.\.\.$/, ''); this.shelfCode = encodedString; - //调用接口获取当前工位信息 当前工位是否有货架 + + //获取当前货架和所在工位的信息 var serverIPAndPort = getServerIPAndPort(); uni.request({ url: 'http://' + serverIPAndPort + - '/pdaStocktaking/getStocktakingInfosByShelfCode', // 请求的接口地址 + '/pdaProductionLineCallOut/getShelfInfoForCallOut', // 请求的接口地址 method: 'POST', // 设置请求方式为 POST data: { "shelfCode": this.shelfCode, "userName": this.userName, + "deviceType": "PDA" + }, + header: { + 'Content-Type': 'application/json', // 如果需要以JSON格式发送数据 + }, + success: (res) => { + // 请求成功的回调函数 + if (res.statusCode === 200) { + //接口返回数据为200 表示获取成功! + if (res.data.code == 200) { + //未查询到信息 + if (res.data.data == null) { + uni.showToast({ + title: '获取失败,请扫码重试!', + icon: 'none', + duration: 1500 + }); + return; + } + //绑定货架等信息 + this.shelfId = res.data.data.shelfId; + this.shelfCode = res.data.data.shelfCode; + + this.locationId = res.data.data.locationId; + this.locationCode = res.data.data.locationCode; + + this.shelfAreaOptions = res.data.data.locationAreas; + + //获取数据 + this.getCurrentMatInfo(); + return; + + } else { + uni.showToast({ + title: '获取失败:' + res.data.message, + icon: 'none', + duration: 3500 + }); + this.clear(); + } + + } else { + uni.showToast({ + title: '服务器返回错误状态码' + res.statusCode, + icon: 'none', + duration: 3000 + }); + this.clear(); + } + }, + fail: (err) => { + // 请求失败的回调函数 + uni.showToast({ + title: '请求失败' + err, + icon: 'none', + duration: 3000 + }); + + this.clear(); + }, + complete: (event) => { + // 请求完成的回调函数(无论成功或失败都会调用) + console.log('请求完成', event); + } + }); + }, + + getCurrentMatInfo: function() { + if (this.shelfId == 0 || this.shelfId == null) { + uni.showToast({ + title: '获取当前货架物料失败,请扫码重试!', + icon: 'none', + duration: 1500 + }); + return; + } + //获取当前货架和所在工位的信息 + var serverIPAndPort = getServerIPAndPort(); + uni.request({ + url: 'http://' + serverIPAndPort + + '/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址 + method: 'POST', // 设置请求方式为 POST + data: { + "shelfCode": this.shelfCode, + "matCode": '', + "userName": this.userName, "deviceType": "PDA", "pageNumber": 1, - "pageSize": 1000 + "pageSize": 300, }, header: { 'Content-Type': 'application/json', // 如果需要以JSON格式发送数据 @@ -393,6 +583,7 @@ console.log('请求完成', event); } }); + }, //清空当前界面所有内容 @@ -408,6 +599,7 @@ this.touchStartX = e.touches[0].clientX; this.touchStartY = e.touches[0].clientY; }, + cardTouchMove(e) { var deltaX = e.changedTouches[0].clientX - this.touchStartX; var deltaY = e.changedTouches[0].clientY - this.touchStartY; @@ -426,6 +618,39 @@