diff --git a/src/api/workflow/instance/index.ts b/src/api/workflow/instance/index.ts index 4f53a9a8..b98c94b9 100644 --- a/src/api/workflow/instance/index.ts +++ b/src/api/workflow/instance/index.ts @@ -32,10 +32,11 @@ export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise { +export const flowHisTaskList = (ids: { businessId?: string | number; instanceId?: string | number }) => { return request({ - url: `/workflow/instance/flowHisTaskList/${businessId}?t=${Math.random()}`, - method: 'get' + url: '/workflow/instance/flowHisTaskList', + method: 'get', + params: ids }); }; diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts index 3aad766d..48311d58 100644 --- a/src/api/workflow/workflowCommon/index.ts +++ b/src/api/workflow/workflowCommon/index.ts @@ -9,6 +9,7 @@ export default { path: routerJumpVo.formPath, query: { id: routerJumpVo.businessId, + instanceId: routerJumpVo.instanceId, type: routerJumpVo.type, taskId: routerJumpVo.taskId } diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts index 4815554a..03af14d7 100644 --- a/src/api/workflow/workflowCommon/types.ts +++ b/src/api/workflow/workflowCommon/types.ts @@ -1,5 +1,6 @@ export interface RouterJumpVo { businessId: string; + instanceId?: string | number; taskId: string | number; type: string; formCustom: string; diff --git a/src/components/Process/approvalButton.vue b/src/components/Process/approvalButton.vue index a2221c41..1768e703 100644 --- a/src/components/Process/approvalButton.vue +++ b/src/components/Process/approvalButton.vue @@ -15,7 +15,7 @@ 审批 - + 流程进度 @@ -37,6 +37,8 @@ const props = defineProps({ pageType: propTypes.string.def(''), buttonLoading: propTypes.bool.def(false), id: propTypes.string.def('') || propTypes.number.def(), + businessId: propTypes.string.def(''), + instanceId: propTypes.string.def(''), mode: propTypes.bool.def(false) }); const emits = defineEmits(['submitForm', 'approvalVerifyOpen', 'handleApprovalRecord']); diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index b420906f..e28d2c5e 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -113,12 +113,12 @@ const tabActiveName = ref('image'); const insId = ref(null); //初始化查询审批记录 -const init = async (businessId: string | number) => { +const init = async (ids: { businessId?: string | number; instanceId?: string | number }) => { visible.value = true; loading.value = true; tabActiveName.value = 'image'; historyList.value = []; - flowHisTaskList(businessId).then(resp => { + flowHisTaskList(ids).then(resp => { if (resp.data) { historyList.value = resp.data.list; insId.value = resp.data.instanceId; diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index d5505378..9db4fe8f 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -9,6 +9,8 @@ @handleApprovalRecord="handleApprovalRecord" :buttonLoading="buttonLoading" :id="form.id" + :business-id="routeParams.id" + :instance-id="routeParams.instanceId" :status="form.status" :pageType="routeParams.type" :mode="false" @@ -271,7 +273,7 @@ const handleStartWorkFlow = async (data: LeaveForm) => { }; //审批记录 const handleApprovalRecord = () => { - approvalRecordRef.value.init(form.value.id); + approvalRecordRef.value?.init({ businessId: routeParams.value.id || form.value.id, instanceId: routeParams.value.instanceId }); }; //提交回调 const submitCallback = async () => { diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index e49c0612..e3e16c28 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -491,6 +491,7 @@ const cancelPopover = async (index: number) => { const handleView = row => { const routerJumpVo = reactive({ businessId: row.businessId, + instanceId: row.id, taskId: row.id, type: 'view', formCustom: row.formCustom,