From 5d8b77987d71c6f33c05d902953e0f4077e32eae Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Mon, 24 Jun 2024 18:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/manage/group-task.vue | 29 ++++++++++ pages/manage/inst-manage.vue | 95 ++++++++++--------------------- pages/manage/task-manage.vue | 94 +++++++++---------------------- utils/getData2.js | 16 ++---- utils/mork2.js | 105 +++++++++++++++++++++++++++++------ 5 files changed, 176 insertions(+), 163 deletions(-) diff --git a/pages/manage/group-task.vue b/pages/manage/group-task.vue index 941c959..3b008c4 100644 --- a/pages/manage/group-task.vue +++ b/pages/manage/group-task.vue @@ -14,6 +14,32 @@ + + + + 重量 + + + + + + + + 数量 + + + + + + + + 牌号 + + + + + + @@ -35,6 +61,7 @@ return { title: '', val1: '', + obj: {}, disabled: false }; }, @@ -46,6 +73,7 @@ methods: { clearUp () { this.val1 = '' + this.obj = {} }, async _zpxxTask () { this.disabled = true @@ -60,6 +88,7 @@ title: res.message, icon: 'none' }) + this.obj = res } catch (e) { this.disabled = false } diff --git a/pages/manage/inst-manage.vue b/pages/manage/inst-manage.vue index b90d6c0..1d4028b 100644 --- a/pages/manage/inst-manage.vue +++ b/pages/manage/inst-manage.vue @@ -1,6 +1,6 @@ @@ -105,13 +67,9 @@ }, data() { return { - show: false, - state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}, {id:'2', text: '完成'}, {id:'3', text: '取消'}], + state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}], tab: '-1', title: '', - val1: '', - val2: '', - val3: '', data: [], dataList: [], pkId: '', @@ -130,15 +88,21 @@ this.tab = '-1' }, async _handInsts () { - this.show = false try { let res = await handInsts(this.val1, this.val2, this.val3) - this.data = [...res.data] - this.dataList = [...this.data] + if (res.code === '1') { + this.data = [...res.result] + this.dataList = [...this.data] + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } } catch (e) { uni.showToast({ - title: res.message, + title: res.desc, icon: 'none' }) } @@ -160,24 +124,21 @@ } try { let res = await handInst(type, this.pkId) - this.disabled = false - this.tab = '-1' - this._handInsts() - uni.showToast({ - title: res.message, - icon: 'none' - }) + if (res.code === '1') { + this.disabled = false + this.tab = '-1' + this._handInsts() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled = false + } } catch (e) { this.disabled = false } }, - clearUp () { - this.val1 = '' - this.val2 = '' - this.val3 = '' - this.pkId = '' - this.disabled = false - }, toCheck (e) { this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid } @@ -185,5 +146,7 @@ } - diff --git a/pages/manage/task-manage.vue b/pages/manage/task-manage.vue index dc2d47d..2ed12d6 100644 --- a/pages/manage/task-manage.vue +++ b/pages/manage/task-manage.vue @@ -1,6 +1,6 @@ @@ -96,13 +58,9 @@ }, data() { return { - show: false, - state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}, {id:'2', text: '完成'}], + state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}], tab: '-1', title: '', - val1: '', - val2: '', - val3: '', data: [], dataList: [], pkId: '', @@ -116,20 +74,21 @@ this._handTasks() }, methods: { - toSearch () { - this.show = true - this.tab = '-1' - }, async _handTasks () { - this.show = false try { - let res = await handTasks(this.val1, this.val2, this.val3) - this.data = [...res.data] - this.dataList = [...this.data] - + let res = await handTasks() + if (res.code === '1') { + this.data = [...res.result] + this.dataList = [...this.data] + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } } catch (e) { uni.showToast({ - title: res.message, + title: res.desc, icon: 'none' }) } @@ -151,24 +110,21 @@ } try { let res = await handTaskoperation(type, this.pkId) - this.disabled = false - this.tab = '-1' - this._handTasks() - uni.showToast({ - title: res.message, - icon: 'none' - }) + if (res.code === '1') { + this.disabled = false + this.tab = '-1' + this._handTasks() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled = false + } } catch (e) { this.disabled = false } }, - clearUp () { - this.val1 = '' - this.val2 = '' - this.val3 = '' - this.pkId = '' - this.disabled = false - }, toCheck (e) { this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid } diff --git a/utils/getData2.js b/utils/getData2.js index db95691..2ef3a07 100644 --- a/utils/getData2.js +++ b/utils/getData2.js @@ -126,14 +126,10 @@ export const rgfjskTask = (code) => request({ * 任务管理 */ // 1.1 1.1 查询无指令的任务(任务号为-开头) -export const handTasks = (key, scode, ncode) => request({ +export const handTasks = () => request({ url:'api/hand/tasks', acsurl: true, - data: { - keyword: key, - start_devicecode: scode, - next_devicecode: ncode - } + data: {} }) // 1.2 任务操作 export const handTaskoperation = (type, id) => request({ @@ -149,14 +145,10 @@ export const handTaskoperation = (type, id) => request({ * 指令管理 */ // 1.1 查询未完成指令(生成任务号为-开头) -export const handInsts = (key, scode, ncode) => request({ +export const handInsts = () => request({ url:'api/hand/insts', acsurl: true, - data: { - keyword: key, - start_devicecode: scode, - next_devicecode: ncode - } + data: {} }) // 1.2 指令操作 export const handInst = (type, id) => request({ diff --git a/utils/mork2.js b/utils/mork2.js index 3debe6a..194d1e0 100644 --- a/utils/mork2.js +++ b/utils/mork2.js @@ -502,22 +502,95 @@ export const rgfjskTask = (code) => { } // 任务管理 export const handTasks = (key, scode, ncode) => { - let res = { - "data": [ - { - "task_no": "-087", - "task_status": "2", - "create_time": "2024-03-28 10:54:39", - "carrier": '001', - "task_uuid": "012bc5e653ce48949020f1147333aa7f", - "inst_step": "7", - "next_devicecode": "L1", - "start_devicecode": "RKSSX2", - "instruction_code": "163", - "priority": "1" - } - ], - "message": "操作成功" + let res = { + "result": [ + { + "material_type": "", + "task_status": "1", + "carrier": "0033", + "task_no": "1800358896351711233", + "create_time": "2024-06-11 10:47:33", + "task_status_name": "执行中", + "next_devicecode": "HCHJ01", + "start_devicecode": "CYHCX39", + "material_type_name": "", + "task_uuid": "718e14a17b744a81bc51a51945355daa", + "task_type": "1", + "priority": "1" + }, + { + "material_type": "", + "task_status": "1", + "carrier": "3010", + "task_no": "1800768187059539969", + "create_time": "2024-06-12 13:56:04", + "task_status_name": "执行中", + "next_devicecode": "HNJ03DJW", + "start_devicecode": "KLHW19", + "material_type_name": "", + "task_uuid": "f8e5ab3341f64bee887f4acaf403a4be", + "task_type": "1", + "priority": "1" + }, + { + "material_type": "", + "task_status": "1", + "carrier": "3011", + "task_no": "1800771496990347265", + "create_time": "2024-06-12 14:06:44", + "task_status_name": "执行中", + "next_devicecode": "KLHW36", + "start_devicecode": "HNJ03DJW", + "material_type_name": "", + "task_uuid": "177eb5d976d245efbe3d5d56c8e93e22", + "task_type": "1", + "priority": "1" + }, + { + "material_type": "", + "task_status": "1", + "carrier": "4011", + "task_no": "1800773119993057281", + "create_time": "2024-06-12 14:15:54", + "task_status_name": "执行中", + "next_devicecode": "HNJ04DJW", + "start_devicecode": "KLHW23", + "material_type_name": "", + "task_uuid": "29053a22a18b489eb0af483d897c0468", + "task_type": "1", + "priority": "1" + }, + { + "material_type": "", + "task_status": "1", + "carrier": "0030", + "task_no": "1800819807675879425", + "create_time": "2024-06-12 17:18:44", + "task_status_name": "执行中", + "next_devicecode": "RYHCX01", + "start_devicecode": "YJ02XLW02", + "material_type_name": "", + "task_uuid": "6f8642c70ee14bfc8d2699477fa977c7", + "task_type": "1", + "priority": "1" + }, + { + "material_type": "", + "task_status": "0", + "carrier": "", + "task_no": "1800820183942696961", + "create_time": "2024-06-12 17:20:14", + "task_status_name": "就绪", + "next_devicecode": "YJ02XLW02", + "start_devicecode": "CPJCK", + "material_type_name": "", + "task_uuid": "f41e5bfb7b32472fa940a8085c1e6d5e", + "task_type": "1", + "priority": "1" + } + ], + "code": "1", + "desc": "查询成功" } return res }