From bd6a1dcc645ecd9464152eb6acd9c3bf67a1bef1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 24 Jan 2023 11:34:31 +0800 Subject: [PATCH] =?UTF-8?q?bpm=EF=BC=9A=E6=B5=81=E7=A8=8B=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=9A=84=E5=AE=A1=E6=89=B9=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/bpm/processInstance/detail.vue | 37 +++++++++++++++++-- .../src/views/bpm/processInstance/detail2.vue | 25 +------------ 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue index 047d3dc56..484e1ed23 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue @@ -12,7 +12,7 @@ {{ processInstance.startUser.nickname }} - {{ processInstance.startUser.deptName }} + {{ processInstance.startUser.deptName }} { + // 1.1 获得对应表单 + const index = runningTasks.value.indexOf(task) + // const auditFormRef = ref([]).value.get(index) + // 1.2 校验表单 + // const elForm = unref(auditFormRef) + // if (!elForm) return + // const valid = await auditFormRef.validate() + // if (!valid) return + + // 2.1 提交审批 + const data = { + id: task.id, + reason: auditForms.value[index].reason + } + if (pass) { + await TaskApi.approveTask(data) + message.success('审批通过成功') + } else { + await TaskApi.rejectTask(data) + message.success('审批不通过成功') + } + // 2.2 加载最新数据 + getDetail() +} + // ========== 申请信息 ========== import { setConfAndFields2 } from '@/utils/formCreate' import { ApiAttrs } from '@form-create/element-ui/types/config' @@ -187,6 +214,10 @@ const getTimelineItemType = (item) => { // ========== 初始化 ========== onMounted(() => { + getDetail() +}) + +const getDetail = () => { // 1. 获得流程实例相关 processInstanceLoading.value = true ProcessInstanceApi.getProcessInstanceApi(id) @@ -269,7 +300,7 @@ onMounted(() => { .finally(() => { tasksLoad.value = false }) -}) +}