diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts index 3d6330a8..86928816 100644 --- a/src/api/bpm/processInstance/index.ts +++ b/src/api/bpm/processInstance/index.ts @@ -47,7 +47,7 @@ export type ApprovalNodeInfo = { status: number startTime?: Date endTime?: Date - candidateUserList?: User[] + candidateUsers?: User[] tasks: ApprovalTaskInfo[] } diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue index afb778c4..d201db12 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue @@ -14,7 +14,7 @@
-
+
{{ task.assigneeUser.nickname }}
@@ -57,14 +57,20 @@ > {{ task.ownerUser.nickname }}
- - +
+
+ {{ task.reason }} +
+
@@ -91,7 +97,6 @@
{{ user.nickname }}
-
diff --git a/src/views/bpm/processInstance/detail/index_new.vue b/src/views/bpm/processInstance/detail/index_new.vue index b2035a19..54880487 100644 --- a/src/views/bpm/processInstance/detail/index_new.vue +++ b/src/views/bpm/processInstance/detail/index_new.vue @@ -12,25 +12,37 @@
{{ processInstance.name }}
- +
- + + + + {{ processInstance?.startUser?.nickname.substring(0, 1) }} + {{ processInstance?.startUser?.nickname }}
{{ formatDate(processInstance.startTime) }} 提交
- +
- +
- +
+ - +
+ + + +
+ - +
+ + + +
+ - 流转评论 + +
+ 流转评论 +
+
-
+
({}) // 流程实例 +let processDefinitionId = undefined // 流程定义 Id const operationButtonRef = ref() const timelineRef = ref() const bpmnXml = ref('') // BPMN XML @@ -151,10 +171,10 @@ const detailForm = ref({ }) // 流程实例的表单详情 /** 获得详情 */ -const getDetail = () => { +const getDetail = async () => { // 1. 获得流程实例相关 getProcessInstance() - // 2. 获得流程任务列表(审批记录) + // 2. 获得流程任务列表 getTaskList() } @@ -202,9 +222,9 @@ const getProcessInstance = async () => { // 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath) } - + processDefinitionId = processDefinition.id // 加载流程图 - bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinition.id))?.bpmnXml + // bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinition.id))?.bpmnXml } finally { processInstanceLoading.value = false } @@ -273,6 +293,13 @@ const refresh = () => { /** 当前的Tab */ const activeTab = ref('form') +/** Tab 切换 加载流程图,直接加载显示不出来,不知道啥原因,所以切换以后在加载 */ +const onTabChange = async (tabName: string) => { + if (tabName === 'diagram' && processDefinitionId && !bpmnXml.value) { + //加载流程图 + bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinitionId))?.bpmnXml + } +} /** 初始化 */ const userOptions = ref([]) // 用户列表 onMounted(async () => {