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 }) -}) +}