feat:【BPM 工作流】增加审批人撤销的能力

pull/188/MERGE
YunaiV 2025-08-02 16:25:06 +08:00
parent 5a31e80c2d
commit 2c687266b2
4 changed files with 41 additions and 3 deletions

View File

@ -130,3 +130,8 @@ export const getChildrenTaskList = async (id: string) => {
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
);
};
// 撤回任务
export const withdrawTask = async (taskId: string) => {
return await requestClient.put('/bpm/task/withdraw', null, { params: { taskId } });
};

View File

@ -123,6 +123,7 @@ const formData: any = ref({
enable: false,
summary: [],
},
allowWithdrawTask: false,
});
//

View File

@ -217,6 +217,9 @@ function initData() {
if (modelData.value.taskAfterTriggerSetting) {
taskAfterTriggerEnable.value = true;
}
if (modelData.value.allowWithdrawTask === undefined) {
modelData.value.allowWithdrawTask = false;
}
}
/** 监听表单 ID 变化,加载表单数据 */
@ -267,6 +270,18 @@ defineExpose({ initData, validate });
</div>
</div>
</FormItem>
<FormItem class="mb-5" label="审批人权限">
<div class="mt-1 flex flex-col">
<Checkbox v-model:checked="modelData.allowWithdrawTask">
允许审批人撤回任务
</Checkbox>
<div class="ml-6">
<TypographyText type="secondary">
审批人可撤回正在审批节点的前一节点
</TypographyText>
</div>
</div>
</FormItem>
<FormItem v-if="modelData.processIdRule" class="mb-5" label="流程编码">
<Row :gutter="8" align="middle">
<Col :span="1">

View File

@ -4,8 +4,10 @@ import type { BpmTaskApi } from '#/api/bpm/task';
import { DocAlert, Page } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getTaskDonePage } from '#/api/bpm/task';
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
import { router } from '#/router';
import { useGridColumns, useGridFormSchema } from './data';
@ -23,7 +25,15 @@ function handleHistory(row: BpmTaskApi.TaskManager) {
});
}
const [Grid] = useVbenVxeGrid({
/** 撤回任务 */
async function handleWithdraw(row: BpmTaskApi.TaskManager) {
await withdrawTask(row.id);
message.success('撤回成功');
//
await gridApi.query();
}
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
},
@ -52,7 +62,7 @@ const [Grid] = useVbenVxeGrid({
cellConfig: {
height: 64,
},
} as VxeTableGridOptions<BpmTaskApi.Task>,
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
});
</script>
@ -75,6 +85,13 @@ const [Grid] = useVbenVxeGrid({
<template #actions="{ row }">
<TableAction
:actions="[
{
label: '撤回',
type: 'link',
icon: ACTION_ICON.EDIT,
color: 'warning',
onClick: handleWithdraw.bind(null, row),
},
{
label: '历史',
type: 'link',