diff --git a/src/enums/workflowEnum.ts b/src/enums/workflowEnum.ts
index 8864ba3..4d743ec 100644
--- a/src/enums/workflowEnum.ts
+++ b/src/enums/workflowEnum.ts
@@ -8,5 +8,5 @@
export enum PageEnum {
TODO_TASK_PAGE = '/workflow/transaction/todo',
TASK_FORM_PAGE = '/workflow/task/taskForm',
- TASK_FORM_VIEW_PAGE = '/workflow/task/taskViewForm'
+ TASK_FORM_VIEW_PAGE = '/workflow/task/taskFormView'
}
diff --git a/src/views/workflow/task/HistoryTask.vue b/src/views/workflow/task/HistoryTask.vue
index aa0e1a6..890984c 100644
--- a/src/views/workflow/task/HistoryTask.vue
+++ b/src/views/workflow/task/HistoryTask.vue
@@ -2,17 +2,20 @@
+
+ {{ record.name }}
+ 回滚任务
+
@@ -31,27 +34,26 @@
*/
import { defineComponent } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
- import { useModal } from '/@/components/Modal';
- import { columns, searchFormSchema } from './task.data';
- import { listTodoTask, getTaskDefinition } from '/@/api/platform/workflow/controller/task';
+ import { historyColumns, searchFormSchema } from './task.data';
+ import { listHistoryTask, getTaskDefinition } from '/@/api/platform/workflow/controller/task';
import { PageEnum } from '/@/enums/workflowEnum';
import { useRouter } from 'vue-router';
- import WorkflowChartModal from './popups/WorkflowChartModal.vue';
+ import { useMessage } from '/@/hooks/web/useMessage';
+ import { undoTask } from '/@/api/platform/workflow/controller/task';
export default defineComponent({
- name: 'WorkflowTodoTask',
+ name: 'WorkflowHistoryTask',
components: {
- WorkflowChartModal,
BasicTable,
TableAction,
},
setup() {
- const [registerModal, { openModal }] = useModal();
const { push } = useRouter();
- const [registerTable] = useTable({
- api: listTodoTask,
+ const { createConfirm, createMessage } = useMessage();
+ const [registerTable, { reload }] = useTable({
+ api: listHistoryTask,
rowKey: 'id',
- columns,
+ columns: historyColumns,
formConfig: {
compact: true,
labelWidth: 100,
@@ -74,44 +76,57 @@
},
});
- async function handleTodo(record: Recordable) {
- const { taskInfo, vars } = record;
+ async function handleProcessView(record: Recordable) {
const task = await getTaskDefinition({
- taskId: taskInfo.id,
- taskName: taskInfo.name,
- taskDefKey: taskInfo.taskDefKey,
- processInsId: taskInfo.processInsId,
- processDefId: taskInfo.processDefId,
- processDefKey: taskInfo.processDefKey
+ taskDefKey: record.taskDefKey,
+ processInsId: record.processInsId,
+ processDefId: record.processDefId
});
await push({
- path: PageEnum.TASK_FORM_PAGE,
+ path: PageEnum.TASK_FORM_VIEW_PAGE,
query: {
_meta: 'y',
- title: `审批【${taskInfo.name || ''}】`,
- formTitle: `${vars.title}`,
+ taskId: record.id,
+ taskDefKey: task.taskDefKey,
+ title: `${record.processDefName}【${record.name}】`,
+ formTitle: `${record.processDefName}`,
formType: task.formType,
formKey: task.formKey,
- formReadOnly: String(task.formReadOnly),
+ processDefKey: task.processDefKey,
processInsId: task.processInsId,
processDefId: task.processDefId,
- processDefKey: task.processDefKey,
- taskId: task.taskId,
- taskDefKey: task.taskDefKey,
- businessId: task.businessId
+ businessId: task.businessId,
+ }
+ });
+ }
+
+ function handleRollBackTask(record: Recordable) {
+ createConfirm({
+ iconType: 'warning',
+ title: '警告',
+ content: '确定回滚该已办任务吗?',
+ onOk: async () => {
+ const { taskInfo } = record;
+ await undoTask({
+ processInsId: record.processInsId,
+ currentTaskId: taskInfo.id,
+ currentTaskDefKey: taskInfo.taskDefKey,
+ undoTaskId: record.id,
+ undoTaskDefKey: record.taskDefKey
+ });
+ handleRefreshTable();
}
});
}
- function handleTrace(record: Recordable) {
- openModal(true, { record: record.taskInfo });
+ function handleRefreshTable() {
+ reload();
}
return {
- handleTodo,
- handleTrace,
+ handleProcessView,
registerTable,
- registerModal,
+ handleRollBackTask,
};
}
});
diff --git a/src/views/workflow/task/index.vue b/src/views/workflow/task/index.vue
index b479758..0fb9024 100644
--- a/src/views/workflow/task/index.vue
+++ b/src/views/workflow/task/index.vue
@@ -51,7 +51,7 @@
const { push } = useRouter();
const [registerTable] = useTable({
api: listTodoTask,
- rowKey: 'id',
+ rowKey: 'taskInfo.id',
columns,
formConfig: {
compact: true,
diff --git a/src/views/workflow/task/task.data.ts b/src/views/workflow/task/task.data.ts
index d0fbc01..72be157 100644
--- a/src/views/workflow/task/task.data.ts
+++ b/src/views/workflow/task/task.data.ts
@@ -56,3 +56,39 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 8 }
}
];
+
+export const historyColumns: BasicColumn[] = [
+ {
+ title: '任务名称',
+ dataIndex: 'name',
+ width: 200,
+ },
+ {
+ title: '流程标题',
+ dataIndex: ['vars', 'title'],
+ width: 200,
+ },
+ {
+ title: '流程名称',
+ dataIndex: 'processDefName',
+ width: 200,
+ },
+ {
+ title: '办理状态',
+ dataIndex: 'mesName',
+ width: 150,
+ customRender: ({ record }) => {
+ return h(Tag, { color: 'processing' }, () => record.mesName);
+ }
+ },
+ {
+ title: '流程发起人',
+ dataIndex: ['vars', 'userName'],
+ width: 150
+ },
+ {
+ title: '完成时间',
+ dataIndex: 'endTime',
+ width: 200
+ }
+];