diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts index 96b440bb..e9256407 100644 --- a/src/api/bpm/processInstance/index.ts +++ b/src/api/bpm/processInstance/index.ts @@ -87,14 +87,8 @@ export const getProcessInstanceCopyPage = async (params: any) => { } // 获取审批详情 -export const getApprovalDetail = async ( - processInstanceId?: string, - processDefinitionId?: string -) => { - const param = processInstanceId - ? '?processInstanceId=' + processInstanceId - : '?processDefinitionId=' + processDefinitionId - return await request.get({ url: 'bpm/process-instance/get-approval-detail' + param }) +export const getApprovalDetail = async (params: any) => { + return await request.get({ url: 'bpm/process-instance/get-approval-detail' , params }) } // 获取表单字段权限 diff --git a/src/utils/formCreate.ts b/src/utils/formCreate.ts index 850df8cb..a93d9cdd 100644 --- a/src/utils/formCreate.ts +++ b/src/utils/formCreate.ts @@ -44,6 +44,7 @@ export const setConfAndFields2 = ( value?: object ) => { if (isRef(detailPreview)) { + // @ts-ignore detailPreview = detailPreview.value } // @ts-ignore diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue index 188ac9dc..9518465c 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue @@ -657,7 +657,6 @@ const openChildrenTask = () => { /** 重新加载数据 */ const reload = () => { - getMyTodoTask() emit('success') } @@ -691,26 +690,23 @@ const getButtonDisplayName = (btnType: OperationButtonType) => { return displayName } -/** 获取我的待办任务 */ -const getMyTodoTask = async () => { +const loadTodoTask = (task: any) => { genericForm.value = {} approveForm.value = {} approveFormFApi.value = {} - const data = await TaskApi.myTodoTask(props.processInstanceId) - runningTask.value = data + runningTask.value = task // 处理 approve 表单. - if (data && data.formId && data.formConf) { + if (task && task.formId && task.formConf) { const tempApproveForm = {} - setConfAndFields2(tempApproveForm, data.formConf, data.formFields, data.formVariables) + setConfAndFields2(tempApproveForm, task.formConf, task.formFields, task.formVariables) approveForm.value = tempApproveForm } else { approveForm.value = {} // 占位,避免为空 } } -onMounted(async () => { - await getMyTodoTask() -}) +defineExpose({ loadTodoTask }) +