From 6febb51cdb94aaa4240f1871fdba60545b3c7aab Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 18 Dec 2023 12:34:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A5=E5=BF=97=E6=92=A4=E5=9B=9E?= =?UTF-8?q?=EF=BC=8C=E7=9B=AE=E5=89=8D=E5=8F=AA=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?7=E8=BD=A6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/wpm.js | 9 +++ src/views/wpm/mlog_dept7.vue | 111 +++++++++++++++++++--------------- src/views/wpm/mlog_drawer.vue | 46 +++++++------- 3 files changed, 94 insertions(+), 72 deletions(-) diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index eb3a09a9..dc7992b9 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -203,6 +203,15 @@ export default { `${config.API_URL}/wpm/mlog/${id}/submit/`, ); } + }, + revert:{ + name: "撤回", + req: async function(id, data){ + return await http.post( + `${config.API_URL}/wpm/mlog/${id}/revert/`, + data + ); + } } }, handover:{ diff --git a/src/views/wpm/mlog_dept7.vue b/src/views/wpm/mlog_dept7.vue index ab9c2ac8..a1a35817 100644 --- a/src/views/wpm/mlog_dept7.vue +++ b/src/views/wpm/mlog_dept7.vue @@ -45,7 +45,7 @@ @@ -110,7 +110,7 @@ @@ -136,15 +136,20 @@ @@ -266,11 +261,12 @@ import saveDialog from "./worktask_form.vue"; import showDrawer from "./mlog_drawer.vue"; export default { components: { - saveDialog,showDrawer + saveDialog, showDrawer }, data() { return { - activeName:'7车间', + mlogHandleLoading: false, + activeName: '7车间', currentDept: {}, currentMtask: {}, apiMtask: null, @@ -282,27 +278,37 @@ export default { 30: "生产中", 40: "已提交", }, - dialogSave:false, - visibleDrawer:false, + dialogSave: false, + visibleDrawer: false, apiObjHandover: null, paramsHandover: {}, apiObjWm: null, paramsWm: {}, - mlogs:[], - mlogId:'', - mtask:'', - mgroup:'', - material_out:'' + mlogs: [], + mlogId: '', + mgroup: '', + material_out: '' } }, mounted() { this.initDept() }, methods: { + mlog_revert(row) { + this.mlogHandleLoading = true; + this.$API.wpm.mlog.revert.req(row.id).then(res => { + this.$message.success("撤回成功"); + this.mtaskClick(this.currentMtask) + this.$refs.table_wm.refresh() + this.mlogHandleLoading = false; + }).catch(e => { + this.mlogHandleLoading = false; + }) + }, tomio() { this.$router.push({ name: "mainso_mio" }); }, - tomioin(){ + tomioin() { this.$router.push({ name: "halfgood_mio" }); }, //添加 @@ -319,7 +325,7 @@ export default { that.$message.warning("请选择任务"); } }, - table_edit(row){ + table_edit(row) { this.dialogSave = true; this.$nextTick(() => { this.$refs.saveDialog.open("edit").setData(row); @@ -332,9 +338,9 @@ export default { type: "warning", }).then(() => { that.$API.wpm.mlog.delete.req(row.id).then((res) => { - that.$message.success("删除成功"); - that.getMlogs(); - return res; + that.$message.success("删除成功"); + that.getMlogs(); + return res; }).catch((err) => { return err; }); @@ -369,27 +375,29 @@ export default { }) }, getMlogs() { - this.$API.wpm.mlog.list.req({ mtask: this.mtask, page: 0 }).then(res => { + this.$API.wpm.mlog.list.req({ mtask: this.currentMtask.id, page: 0 }).then(res => { this.mlogs = res }) }, + getMtask() { + this.$API.pm.mtask.item.req(this.currentMtask.id).then(res => { + this.currentMtask = res + }) + }, mtaskClick(row) { this.currentMtask = row; - this.mtask = row.id; + this.getMtask() this.getMlogs() }, - table_submit(row) { + mtask_submit(row) { this.$API.pm.mtask.submit.req(row.id).then(res => { this.$message.success('操作成功') - if (row.id == this.currentMtask.id) { - this.mtaskClick(row) - } this.$refs.table_mtask.refresh() + this.mtaskClick(this.currentMtask) }).catch(err => { - }) }, - handleSaveSuccess(){ + handleSaveSuccess() { this.getMlogs(); }, table_show(row) { @@ -399,11 +407,16 @@ export default { this.$refs.showDrawer.open(); }); }, - mlog_submit(row){ + mlog_submit(row) { + this.mlogHandleLoading = true this.$API.wpm.mlog.submit.req(row.id).then(res => { this.$message.success('操作成功') - this.$refs.table_mlog.refresh() - }).catch(err => {}) + this.mtaskClick(this.currentMtask) + this.$refs.table_wm.refresh() + this.mlogHandleLoading = false + }).catch(err => { + this.mlogHandleLoading = false + }) }, } } diff --git a/src/views/wpm/mlog_drawer.vue b/src/views/wpm/mlog_drawer.vue index 6e9ca108..b7af65a7 100644 --- a/src/views/wpm/mlog_drawer.vue +++ b/src/views/wpm/mlog_drawer.vue @@ -6,92 +6,92 @@ - -