From 8819121a611c36046798583b60a6893c7cb18d1f Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 29 Jul 2024 14:50:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E6=96=99=E4=BB=BB=E5=8A=A1=E3=80=81?= =?UTF-8?q?=E5=8F=91=E6=96=99=E4=BB=BB=E5=8A=A1=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=97=AD=E4=BB=BB=E5=8A=A1=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=BE=85=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=9A=84=E4=BB=BB=E5=8A=A1=E5=8F=AF=E4=BB=A5=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 24 +++++++++++ src/common/array.js | 20 +++++++++- src/pages/issue/job/issueJob.vue | 51 +++++++++++++++++++----- src/pages/repleinsh/job/repleinshJob.vue | 38 ++++++++++++++++-- 4 files changed, 119 insertions(+), 14 deletions(-) diff --git a/src/api/request2.js b/src/api/request2.js index 163e023e..1ab89ad3 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -1418,6 +1418,18 @@ export function cancleTakeIssueJob(id) { data: {}, }); } +/** + * 发料 关闭任务 + * @param {*} id + * + */ +export function closeTakeIssueJob(id) { + return request({ + url: baseApi + "/wms/issue-job-main/close?id=" + id, + method: "put", + data: {}, + }); +} /** * 发料任务 提交 @@ -3861,6 +3873,18 @@ export function cancleTakeRepleinshJob(id) { }); } +/** + * 补料任务 关闭任务 + * @param {*} id + * + */ +export function closeTakeRepleinshJob(id) { + return request({ + url: baseApi + "/wms/repleinsh-job-main/close?id=" + id, + method: "put", + data: {}, + }); +} /** * 补料任务 提交 * @param {*} params diff --git a/src/common/array.js b/src/common/array.js index e87d780f..ed1cf95d 100644 --- a/src/common/array.js +++ b/src/common/array.js @@ -223,7 +223,7 @@ export function getDetailEditRemoveOption() { } -//详情编辑放弃 +//详情编辑关闭 export function getDetailGiveupOption() { let option_detail_giveup = [{ text: '详情', @@ -241,7 +241,23 @@ export function getDetailGiveupOption() { return option_detail_giveup; } - +//详情放弃 +export function getDetailCloseOption() { + let option_detail_giveup = [{ + text: '详情', + style: { + backgroundColor: '#3C9CFF' + } + }, + { + text: '关闭', + style: { + backgroundColor: '#F56C6C' + } + } + ]; + return option_detail_giveup; +} //详情编辑移除 export function getEditRemoveOption() { diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index 16a826ee..89c241e3 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -9,7 +9,8 @@ - @@ -34,7 +35,8 @@ import { cancleTakeIssueJob, getIssueJobList, - getIssueJobByProductionline + getIssueJobByProductionline, + closeTakeIssueJob } from '@/api/request2.js'; import { goHome, @@ -43,7 +45,8 @@ import { getDetailOption, - getDetailGiveupOption + getDetailGiveupOption, + getDetailCloseOption } from '@/common/array.js'; import comEmptyView from '@/mycomponents/common/comEmptyView.vue' @@ -80,7 +83,8 @@ status: '1,2', //待处理 、进行中 detailOptions: [], detailGiveupOptions: [], - productionlineList: [], + productionlineList: [], + detailCloseOptions: [], title:'', productionLine:"", fromLocation:"" @@ -97,6 +101,7 @@ onReady() { this.detailOptions = getDetailOption(); this.detailGiveupOptions = getDetailGiveupOption(); + this.detailCloseOptions = getDetailCloseOption(); }, onReachBottom() { //避免多次触发 @@ -289,11 +294,18 @@ this.openjobInfoPopup(dataContent); } else if (e.content.text == "放弃") { this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", - res => { - if (res) { - this.cancleJob(dataContent.masterId); - } - }); + res => { + if (res) { + this.cancleJob(dataContent.masterId); + } + }); + }else if (e.content.text == "关闭") { + this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?", + res => { + if (res) { + this.closeJob(dataContent.masterId); + } + }); } }, @@ -315,6 +327,27 @@ this.showMessage(error) }) }, + closeJob(id) { + uni.showLoading({ + title: "加载中....", + mask: true + }); + + closeTakeIssueJob(id).then(res => { + uni.hideLoading() + if(res.data){ + this.getList("refresh") + uni.showToast({ + title:"关闭任务成功" + }) + }else { + this.showMessage("关闭任务失败") + } + }).catch(error => { + uni.hideLoading() + this.showMessage(error) + }) + }, switchChangeToday(state, creationTime) { this.checkedToday = state; diff --git a/src/pages/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue index db5cd0b9..8b17f8f2 100644 --- a/src/pages/repleinsh/job/repleinshJob.vue +++ b/src/pages/repleinsh/job/repleinshJob.vue @@ -9,7 +9,7 @@ @@ -31,7 +31,8 @@ import { getRepleinshJobList, - cancleTakeRepleinshJob + cancleTakeRepleinshJob, + closeTakeRepleinshJob } from '@/api/request2.js'; import { @@ -41,7 +42,8 @@ import { getDetailOption, - getDetailGiveupOption + getDetailGiveupOption, + getDetailCloseOption } from '@/common/array.js'; import comEmptyView from '@/mycomponents/common/comEmptyView.vue' @@ -77,6 +79,7 @@ status: '1,2', //待处理 、进行中 detailOptions: [], detailGiveupOptions: [], + detailCloseOptions: [], title:'', scanMessage:"" }; @@ -92,6 +95,7 @@ onReady() { this.detailOptions = getDetailOption(); this.detailGiveupOptions = getDetailGiveupOption(); + this.detailCloseOptions = getDetailCloseOption(); }, //后退按钮 @@ -231,6 +235,13 @@ this.cancleJob(dataContent.masterId); } }); + }else if (e.content.text == "关闭") { + this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?", + res => { + if (res) { + this.closeJob(dataContent.masterId); + } + }); } }, @@ -252,6 +263,27 @@ this.showMessage(error) }) }, + closeJob(id) { + uni.showLoading({ + title: "加载中....", + mask: true + }); + + closeTakeRepleinshJob(id).then(res => { + uni.hideLoading() + if(res.data){ + this.getList("refresh") + uni.showToast({ + title:"关闭任务成功" + }) + }else { + this.showMessage("关闭任务失败") + } + }).catch(error => { + uni.hideLoading() + this.showMessage(error) + }) + }, switchChangeToday(state, creationTime) { this.checkedToday = state;