feat:【BPM 工作流】增加审批人撤销的能力
parent
5a31e80c2d
commit
2c687266b2
|
|
@ -130,3 +130,8 @@ export const getChildrenTaskList = async (id: string) => {
|
||||||
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
|
`/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 } });
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ const formData: any = ref({
|
||||||
enable: false,
|
enable: false,
|
||||||
summary: [],
|
summary: [],
|
||||||
},
|
},
|
||||||
|
allowWithdrawTask: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 流程数据
|
// 流程数据
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,9 @@ function initData() {
|
||||||
if (modelData.value.taskAfterTriggerSetting) {
|
if (modelData.value.taskAfterTriggerSetting) {
|
||||||
taskAfterTriggerEnable.value = true;
|
taskAfterTriggerEnable.value = true;
|
||||||
}
|
}
|
||||||
|
if (modelData.value.allowWithdrawTask === undefined) {
|
||||||
|
modelData.value.allowWithdrawTask = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 监听表单 ID 变化,加载表单数据 */
|
/** 监听表单 ID 变化,加载表单数据 */
|
||||||
|
|
@ -267,6 +270,18 @@ defineExpose({ initData, validate });
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</FormItem>
|
</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="流程编码">
|
<FormItem v-if="modelData.processIdRule" class="mb-5" label="流程编码">
|
||||||
<Row :gutter="8" align="middle">
|
<Row :gutter="8" align="middle">
|
||||||
<Col :span="1">
|
<Col :span="1">
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ import type { BpmTaskApi } from '#/api/bpm/task';
|
||||||
|
|
||||||
import { DocAlert, Page } from '@vben/common-ui';
|
import { DocAlert, Page } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
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 { router } from '#/router';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
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: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
},
|
},
|
||||||
|
|
@ -52,7 +62,7 @@ const [Grid] = useVbenVxeGrid({
|
||||||
cellConfig: {
|
cellConfig: {
|
||||||
height: 64,
|
height: 64,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<BpmTaskApi.Task>,
|
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -75,6 +85,13 @@ const [Grid] = useVbenVxeGrid({
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
:actions="[
|
:actions="[
|
||||||
|
{
|
||||||
|
label: '撤回',
|
||||||
|
type: 'link',
|
||||||
|
icon: ACTION_ICON.EDIT,
|
||||||
|
color: 'warning',
|
||||||
|
onClick: handleWithdraw.bind(null, row),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '历史',
|
label: '历史',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue