From ddda8743d1f1aa8bbed045514fcac9f95fa5d324 Mon Sep 17 00:00:00 2001 From: liangzhou <594755172@qq.com> Date: Tue, 9 Jul 2024 17:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/config.js | 37 +++--- src/api/task.js | 46 ++----- src/http/request.js | 4 +- src/layout/goodsIn.vue | 6 +- src/layout/goodsOut.vue | 279 ++++++++++++++++++++++++++++++++-------- src/layout/stock.vue | 5 +- src/views/HomeView.vue | 50 ++++++- 7 files changed, 305 insertions(+), 122 deletions(-) diff --git a/src/api/config.js b/src/api/config.js index c7c823a..01dae2d 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -8,32 +8,27 @@ const updateConfig = (params) => { return request.post('/config/updateConfig', params) } -const queryBoxConfig = (params) => { - return request.post('/config/queryBoxConfig', params) +const restartSystem = (params) => { + return request({ + url: '/system/restartSystem', + method: 'post', + data: params, + timeout: 5000 + }) } -const queryBoxConfigByPage = (params) => { - return request.post('/config/queryBoxConfigByPage', params) -} - -const updateBoxConfig = (params) => { - return request.post('/config/updateBoxConfig', params) -} - -const addBoxConfig = (params) => { - return request.post('/config/addBoxConfig', params) -} - -const deleteBoxConfig = (params) => { - return request.post('/config/deleteBoxConfig', params) +const reloadConfig = (params) => { + return request({ + url: '/system/reloadConfig', + method: 'post', + data: params, + timeout: 5000 + }) } export { getConfigs, updateConfig, - queryBoxConfig, - queryBoxConfigByPage, - updateBoxConfig, - addBoxConfig, - deleteBoxConfig + restartSystem, + reloadConfig } \ No newline at end of file diff --git a/src/api/task.js b/src/api/task.js index d5fd31e..3ed6d27 100644 --- a/src/api/task.js +++ b/src/api/task.js @@ -16,10 +16,11 @@ const sendGoodsOutTask = (params) => { }) } -const getAllTasks = () => { +const getTasks = () => { return request({ - url: '/task/getAllTasks', - method: 'get' + url: '/task/getTasks', + method: 'post', + data: params }) } @@ -39,25 +40,17 @@ const finishInventoryTask = (params) => { }) } -const getTasks = (params) => { +const getTasksByPage = (params) => { return request({ - url: '/task/getTasks', + url: '/task/getTasksByPage', method: 'post', data: params }) } -const finishPicking = (params) => { +const finishPickingAndBack = (params) => { return request({ - url: '/task/finishPicking', - method: 'post', - data: params - }) -} - -const getTaskByTask = (params) => { - return request({ - url: '/task/getTaskByTask', + url: '/task/finishPickingAndBack', method: 'post', data: params }) @@ -71,32 +64,13 @@ const changeTaskStatus = (params) => { }) } -const queryNotConfirmScanInfo = (params) => { - return request({ - url: '/task/queryNotConfirmScanInfo', - method: 'post', - data: params - }) -} - -const solveScanDifference = (params) => { - return request({ - url: '/task/solveScanDifference', - method: 'post', - data: params - }) -} - export { sendGoodsInTask, sendGoodsOutTask, - getAllTasks, + getTasksByPage, sendInventoryTask, finishInventoryTask, getTasks, - finishPicking, - getTaskByTask, + finishPickingAndBack, changeTaskStatus, - queryNotConfirmScanInfo, - solveScanDifference } \ No newline at end of file diff --git a/src/http/request.js b/src/http/request.js index 3c6e942..b969fc4 100644 --- a/src/http/request.js +++ b/src/http/request.js @@ -1,11 +1,11 @@ import axios from 'axios' const request = axios.create({ - baseURL: 'http://localhost:12315/wms', + baseURL: 'http://192.168.3.254:12315/wms', timeout: 5000 }) -// axios.defaults.baseURL = 'http://10.18.61.7:12315/wms' +// axios.defaults.baseURL = 'http://192.168.3.254:12315/wms' // axios.defaults.baseURL = 'http://localhost:12315/wms' // axios.defaults.baseURL = 'http://10.30.9.89:12315/wms' diff --git a/src/layout/goodsIn.vue b/src/layout/goodsIn.vue index 01b4225..ede7458 100644 --- a/src/layout/goodsIn.vue +++ b/src/layout/goodsIn.vue @@ -137,7 +137,7 @@ export default { disabledEmpty: false, taskInRequestEntity: reactive({ vehicleId: '', - originPoint: 'R1', + originPoint: 'RC1', goodsId: '', goodsName: '', singleWeight: 0, @@ -159,8 +159,8 @@ export default { }), standOptions: [ { - value: "R1", - label: '入库站台1' + value: "RC1", + label: '入库口' } ], stockTypeOptions: [ diff --git a/src/layout/goodsOut.vue b/src/layout/goodsOut.vue index f701a63..6189a0d 100644 --- a/src/layout/goodsOut.vue +++ b/src/layout/goodsOut.vue @@ -9,14 +9,13 @@ - - - - - - + + + + + - - + + - - + + - - + - - + + + + + + + + + + + + + + @@ -70,6 +84,46 @@ +
+ 拣选确认信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 确认完回库 + + + + +
@@ -77,23 +131,16 @@ @@ -112,12 +159,42 @@ export default { loading: false, labelPosition: 'top', taskOutRequestEntity: { - goodsType: '', - specification: '', - quantity: 0, - taskId: '', + vehicleId: '', + goodsId: '', + goodsNum: 0, + originPoint: '', + isPicking: 0, + destinationPoint: '', userName: store.getters.getUserName, - } + }, + pickConfirmEntity: { + taskId: '', + vehicleId: '', + goodsId: '', + opNum: 0, + originNum: 0, + userName: store.getters.getUserName, + }, + destinationPointOptions: [ + { + value: "RC1", + label: '入库口' + }, + { + value: "P1", + label: '拣选台' + } + ], + pickOptions: [ + { + value: 0, + label: '非拣选任务' + }, + { + value: 1, + label: '拣选任务' + } + ], } }, mounted() { @@ -130,22 +207,18 @@ export default { }, methods: { getAllTasks() { - this.pageInfo.pageNum = this.currentPage - this.pageInfo.pageSize = this.pageSize - const tableRequest = { - page: this.pageInfo, - param: { - taskType: 2, - userName: store.getters.getUserName - } + const request = { + pageNo: this.currentPage, + pageSize: this.pageSize, + taskType: 2 } - getTasks(tableRequest).then(res => { + getTasksByPage(request).then(res => { const tableResponse = res.data if (tableResponse.code != 0) { ElMessage.error(tableResponse.message) } - this.tasks = tableResponse.rows - this.total = tableResponse.total + this.tasks = tableResponse.returnData.lists + this.total = tableResponse.returnData.total }).catch(err => { console.log(err) ElMessage.error('查询任务错误') @@ -173,23 +246,43 @@ export default { }) return } - if (formData.quantity <= 0) { + if (formData.vehicleId == '' || formData.goodsId == '' || formData.originPoint == '') { + ElMessage({ + message: '载具号、物料号、起始库位号必须至少输入一个', + type: 'error', + }) + return + } + if (formData.goodsNum <= 0) { ElMessage({ message: '数量必须要大于0的数字', type: 'error', }) return } + if ((formData.isPicking == 1 && formData.destinationPoint != 'P1')) { + ElMessage({ + message: '拣选任务必须选拣选站台', + type: 'error', + }) + return + } + if (formData.isPicking == 0 && formData.destinationPoint == 'P1') { + ElMessage({ + message: '非拣选任务不得选拣选站台', + type: 'error', + }) + return + } const outParams = { - taskId: formData.taskId == '' ? genTaskId('') : formData.taskId, - taskType: 2, - detailTaskInfoList: [ - { - goodsType: formData.goodsType, - specification: formData.specification, - quantity: formData.quantity - } - ] + goodsId: formData.goodsId, + goodsNum: formData.goodsNum, + vehicleId: formData.vehicleId, + originPoint: formData.originPoint, + destinationPoint: formData.destinationPoint, + userName: store.getters.getUserName, + isPicking: formData.isPicking, + pickStand: formData.destinationPoint } sendGoodsOutTask(outParams).then(res => { if (res.data.code == 0) { @@ -206,6 +299,77 @@ export default { ElMessage.error('创建出库任务错误!') }) }) + }, + getPickTaskDetails() { + const request = { + taskType: 2, + isPicking: 1, + taskStatus: 8 + } + getTasks(request).then(res1 => { + if (res1.data.code == 0) { + if (res1.data.returnData.length > 0) { + const currentFinishTask = res1.data.returnData[0]; + if (currentFinishTask.taskId == this.pickConfirmEntity.taskId) {// 信息没更新 + return + } + this.pickConfirmEntity.taskId = currentFinishTask.taskId + this.pickConfirmEntity.goodsId = currentFinishTask.goodsRelated.goodsId + this.pickConfirmEntity.vehicleId = currentFinishTask.vehicleId + this.pickConfirmEntity.opNum = currentFinishTask.goodsRelated.opNum + this.pickConfirmEntity.originNum = currentFinishTask.goodsRelated.originNum + + } else { + this.pickConfirmEntity.taskId = '' + this.pickConfirmEntity.goodsId = '' + this.pickConfirmEntity.vehicleId = '' + this.pickConfirmEntity.opNum = 0 + this.pickConfirmEntity.originNum = 0 + } + } + }).catch(err => { + ElMessage.error('查询任务错误') + }) + }, + confirmTask(formEl, formData) { + if (!formEl) return + formEl.validate((valid) => { + if (!valid) { + ElMessage({ + message: '确认信息验证失败', + type: 'warning', + }) + return + } + if (formData.taskId = '' || formData.vehicleId == '' || formData.goodsId == '') { + ElMessage({ + message: '载具号、物料号、任务号不可缺少', + type: 'error', + }) + return + } + const confirmParams = { + taskId: formData.taskId, + vehicleId: formData.vehicleId, + goodsId: formData.goodsId, + opNum: formData.opNum, + originNum: formData.originNum, + userName: formData.userName + } + finishPickingAndBack(confirmParams).then(res => { + if (res.data.code == 0) { + ElMessage({ + message: '确认成功!', + type: 'success', + }) + formEl.resetFields() + } else { + ElMessage.error(res.data.message) + } + }).catch(err => { + ElMessage.error('创建出库任务错误!') + }) + }) } } } @@ -256,7 +420,16 @@ export default { .input-area-up { margin: auto; max-width: inherit; - height: 632px; + height: 300px; + border: solid 1px; + border-radius: 10px; + box-shadow: 0px 15px 10px -15px #000; +} + +.input-area-down { + margin: auto; + max-width: inherit; + height: 300px; border: solid 1px; border-radius: 10px; box-shadow: 0px 15px 10px -15px #000; diff --git a/src/layout/stock.vue b/src/layout/stock.vue index 59a68c2..68b2a18 100644 --- a/src/layout/stock.vue +++ b/src/layout/stock.vue @@ -288,11 +288,10 @@ export default { getAllStocks(request).then(res => { const tableResponse = res.data if (tableResponse.code != 0) { - console.log(tableResponse.code + ':' + tableResponse.message) ElMessage.error(tableResponse.message) } - this.displayStocks = tableResponse.lists - this.total = tableResponse.total + this.displayStocks = tableResponse.returnData.lists + this.total = tableResponse.returnData.total }).catch(err => { console.log(err) ElMessage.error('查询库存错误') diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 0ffc511..946c9b8 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -5,9 +5,21 @@
- WMS仓库管理系统 + WMS仓库管理系统 +
+
+ + + {{ userName }} + + +
-
{{ userName }}
@@ -36,7 +48,7 @@ - © 1970-2024 江苏菲达宝开电气股份有限公司 + © 1970- 江苏菲达宝开电气股份有限公司 @@ -46,6 +58,9 @@ // @ is an alias to /src import sideMenu from '@/components/sideMenu.vue' import appTag from '@/components/appTag.vue' +import store from '@/store' +import { ElMessage } from 'element-plus' +import { restartSystem, reloadConfig } from '@/api/config.js' const icon_img_url = require('@/assets/fdbk_log.png') @@ -58,7 +73,7 @@ export default { }, computed: { userName() { - return this.$store.state.user.userName + return store.getters.getUserName } }, methods: { @@ -69,6 +84,33 @@ export default { path: '/location' }) this.$router.push('/location') + }, + handleCommand: (command) => { + const param = store.getters.getUser + if (command == 1) { + restartSystem(param).then(res => { + if (res.data.code != 0) { + ElMessage.error(res.data.message) + } + }).catch(err => { + console.log(err) + ElMessage.error('发生错误') + }) + } else if (command == 2) { + reloadConfig(param).then(res => { + if (res.data.code == 0) { + ElMessage({ + message: '重载配置成功', + type: 'success', + }) + } else { + ElMessage.error(res.data.message) + } + }).catch(err => { + console.log(err) + ElMessage.error('发生错误') + }) + } } } }