From 00a7a8ce23c041e08b60a0ea7f81a951122326c4 Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: Sun, 17 Mar 2024 18:26:22 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=87=AA=E7=94=B1=E9=A9=B3=E5=9B=9E=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/task/index.ts | 11 ++++ src/components/Process/submitVerify.vue | 68 ++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index aabdd15..07b183d 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -215,3 +215,14 @@ export const getInstanceVariable = (taskId: string) => { method: 'get' }); }; + +/** + * 获取可驳回得任务节点 + * @returns + */ +export const getTaskNodeList = (processInstanceId: string) => { + return request({ + url: `/workflow/task/getTaskNodeList/${processInstanceId}`, + method: 'get' + }); +}; diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index ead353b..0d7e413 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -28,7 +28,7 @@ 加签 减签 终止 - 退回 + 退回 取消 @@ -38,6 +38,39 @@ + + + + + + + + + + + + 站内信 + 邮件 + 短信 + + + + + + + + + @@ -45,7 +78,7 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTaskById,transferTask,terminationTask } from '@/api/workflow/task'; +import { completeTask, backProcess, getTaskById,transferTask,terminationTask,getTaskNodeList } from '@/api/workflow/task'; import UserSelect from '@/components/UserSelect'; import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -74,7 +107,11 @@ const selectCopyUserList = ref([]); const selectCopyUserIds = ref(undefined); //是否多选人员 const userMultiple = ref(false); - +// 驳回是否显示 +const backVisible = ref(false); +const backLoading = ref(true); +// 可驳回得任务节点 +const taskNodeList = ref([]); //任务 const task = ref({ id: undefined, @@ -116,6 +153,13 @@ const form = ref>({ messageType: ['1'], wfCopyList: [] }); +const backForm = ref>({ + taskId: undefined, + targetActivityId: undefined, + message: undefined, + variables: {}, + messageType: ['1'] +}); const closeDialog = () => { dialog.visible = false } @@ -165,14 +209,26 @@ const handleCompleteTask = async () => { proxy?.$modal.msgSuccess('操作成功'); }; +/** 驳回弹窗打开 */ +const handleBackProcessOpen = async () => { + backForm.value = {} + backForm.value.messageType = ['1'] + backVisible.value = true + backLoading.value = true + let data = await getTaskNodeList(task.value.processInstanceId) + taskNodeList.value = data.data + backLoading.value = false + backForm.value.targetActivityId = taskNodeList.value[0].nodeId +} /** 驳回流程 */ const handleBackProcess = async () => { - form.value.taskId = taskId.value; + backForm.value.taskId = taskId.value; await proxy?.$modal.confirm('是否确认驳回到申请人?'); loading.value = true; - buttonLoading.value = true; - await backProcess(form.value).finally(() => (loading.value = false)); + backLoading.value = true; + await backProcess(backForm.value).finally(() => (loading.value = false)); dialog.visible = false; + backLoading.value = false emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); };