|
|
@ -2,17 +2,20 @@ |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<BasicTable @register="registerTable"> |
|
|
|
<BasicTable @register="registerTable"> |
|
|
|
<template #bodyCell="{ column, record }"> |
|
|
|
<template #bodyCell="{ column, record }"> |
|
|
|
|
|
|
|
<template v-if="column.key === 'name'"> |
|
|
|
|
|
|
|
{{ record.name }} |
|
|
|
|
|
|
|
<a-button v-if="record.rollBack" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
danger |
|
|
|
|
|
|
|
@click="handleRollBackTask(record)" |
|
|
|
|
|
|
|
>回滚任务</a-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
<TableAction :actions="[ |
|
|
|
<TableAction :actions="[ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '办理', |
|
|
|
label: '历史', |
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
icon: 'fa6-solid:clock-rotate-left', |
|
|
|
onClick: handleTodo.bind(null, record) |
|
|
|
onClick: handleProcessView.bind(null, record) |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '进度', |
|
|
|
|
|
|
|
icon: 'fa6-solid:bars-progress', |
|
|
|
|
|
|
|
onClick: handleTrace.bind(null, record) |
|
|
|
|
|
|
|
}]" |
|
|
|
}]" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -31,27 +34,26 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import { defineComponent } from 'vue'; |
|
|
|
import { defineComponent } from 'vue'; |
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import { historyColumns, searchFormSchema } from './task.data'; |
|
|
|
import { columns, searchFormSchema } from './task.data'; |
|
|
|
import { listHistoryTask, getTaskDefinition } from '/@/api/platform/workflow/controller/task'; |
|
|
|
import { listTodoTask, getTaskDefinition } from '/@/api/platform/workflow/controller/task'; |
|
|
|
|
|
|
|
import { PageEnum } from '/@/enums/workflowEnum'; |
|
|
|
import { PageEnum } from '/@/enums/workflowEnum'; |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
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({ |
|
|
|
export default defineComponent({ |
|
|
|
name: 'WorkflowTodoTask', |
|
|
|
name: 'WorkflowHistoryTask', |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
WorkflowChartModal, |
|
|
|
|
|
|
|
BasicTable, |
|
|
|
BasicTable, |
|
|
|
TableAction, |
|
|
|
TableAction, |
|
|
|
}, |
|
|
|
}, |
|
|
|
setup() { |
|
|
|
setup() { |
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
|
|
|
|
const { push } = useRouter(); |
|
|
|
const { push } = useRouter(); |
|
|
|
const [registerTable] = useTable({ |
|
|
|
const { createConfirm, createMessage } = useMessage(); |
|
|
|
api: listTodoTask, |
|
|
|
const [registerTable, { reload }] = useTable({ |
|
|
|
|
|
|
|
api: listHistoryTask, |
|
|
|
rowKey: 'id', |
|
|
|
rowKey: 'id', |
|
|
|
columns, |
|
|
|
columns: historyColumns, |
|
|
|
formConfig: { |
|
|
|
formConfig: { |
|
|
|
compact: true, |
|
|
|
compact: true, |
|
|
|
labelWidth: 100, |
|
|
|
labelWidth: 100, |
|
|
@ -74,44 +76,57 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
async function handleTodo(record: Recordable) { |
|
|
|
async function handleProcessView(record: Recordable) { |
|
|
|
const { taskInfo, vars } = record; |
|
|
|
|
|
|
|
const task = await getTaskDefinition({ |
|
|
|
const task = await getTaskDefinition({ |
|
|
|
taskId: taskInfo.id, |
|
|
|
taskDefKey: record.taskDefKey, |
|
|
|
taskName: taskInfo.name, |
|
|
|
processInsId: record.processInsId, |
|
|
|
taskDefKey: taskInfo.taskDefKey, |
|
|
|
processDefId: record.processDefId |
|
|
|
processInsId: taskInfo.processInsId, |
|
|
|
|
|
|
|
processDefId: taskInfo.processDefId, |
|
|
|
|
|
|
|
processDefKey: taskInfo.processDefKey |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
await push({ |
|
|
|
await push({ |
|
|
|
path: PageEnum.TASK_FORM_PAGE, |
|
|
|
path: PageEnum.TASK_FORM_VIEW_PAGE, |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
_meta: 'y', |
|
|
|
_meta: 'y', |
|
|
|
title: `审批【${taskInfo.name || ''}】`, |
|
|
|
taskId: record.id, |
|
|
|
formTitle: `${vars.title}`, |
|
|
|
taskDefKey: task.taskDefKey, |
|
|
|
|
|
|
|
title: `${record.processDefName}【${record.name}】`, |
|
|
|
|
|
|
|
formTitle: `${record.processDefName}`, |
|
|
|
formType: task.formType, |
|
|
|
formType: task.formType, |
|
|
|
formKey: task.formKey, |
|
|
|
formKey: task.formKey, |
|
|
|
formReadOnly: String(task.formReadOnly), |
|
|
|
processDefKey: task.processDefKey, |
|
|
|
processInsId: task.processInsId, |
|
|
|
processInsId: task.processInsId, |
|
|
|
processDefId: task.processDefId, |
|
|
|
processDefId: task.processDefId, |
|
|
|
processDefKey: task.processDefKey, |
|
|
|
businessId: task.businessId, |
|
|
|
taskId: task.taskId, |
|
|
|
} |
|
|
|
taskDefKey: task.taskDefKey, |
|
|
|
}); |
|
|
|
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) { |
|
|
|
function handleRefreshTable() { |
|
|
|
openModal(true, { record: record.taskInfo }); |
|
|
|
reload(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
handleTodo, |
|
|
|
handleProcessView, |
|
|
|
handleTrace, |
|
|
|
|
|
|
|
registerTable, |
|
|
|
registerTable, |
|
|
|
registerModal, |
|
|
|
handleRollBackTask, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|