diff --git a/src/api/workflow/instance/types.ts b/src/api/workflow/instance/types.ts index a12dab3..7cb7f97 100644 --- a/src/api/workflow/instance/types.ts +++ b/src/api/workflow/instance/types.ts @@ -23,4 +23,6 @@ export interface FlowInstanceVO extends BaseEntity { flowStatus: string; flowStatusName: string; flowTaskList: FlowTaskVO[]; + businessCode: string; + businessTitle: string; } diff --git a/src/api/workflow/leave/types.ts b/src/api/workflow/leave/types.ts index a44d35d..c8e58a7 100644 --- a/src/api/workflow/leave/types.ts +++ b/src/api/workflow/leave/types.ts @@ -1,5 +1,6 @@ export interface LeaveVO { id: string | number; + applyCode?: string; leaveType: string; startDate: string; endDate: string; @@ -10,6 +11,7 @@ export interface LeaveVO { export interface LeaveForm extends BaseEntity { id?: string | number; + applyCode?: string; leaveType?: string; startDate?: string; endDate?: string; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 8698eff..f331975 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -31,6 +31,8 @@ export interface FlowTaskVO { version?: string; applyNode?: boolean; buttonList?: buttonList[]; + businessCode: string; + businessTitle: string; } export interface buttonList { diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts index 3e7a71d..8ab5a67 100644 --- a/src/api/workflow/workflowCommon/types.ts +++ b/src/api/workflow/workflowCommon/types.ts @@ -10,4 +10,5 @@ export interface StartProcessBo { businessId: string | number; flowCode: string; variables: any; + flowInstanceBizExtBo: any; } diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index eb438cf..bcc1726 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -11,7 +11,7 @@ :id="form.id" :status="form.status" :pageType="routeParams.type" - :mode="false" + :mode="true" /> @@ -126,9 +126,11 @@ const leaveFormRef = ref(); const submitFormData = ref({ businessId: '', flowCode: '', - variables: {} + variables: {}, + flowInstanceBizExtBo: {} }); const taskVariables = ref>({}); +const flowInstanceBizExtBo = ref>({}); const initFormData: LeaveForm = { id: undefined, @@ -199,13 +201,13 @@ const submitForm = (status: string, mode: boolean) => { buttonLoading.value = true; // 设置后端发起和不等于草稿状态 直接走流程发起 if (mode && status != 'draft') { - let res = await submitAndFlowStart(form.value).finally(() => (buttonLoading.value = false)); + const res = await submitAndFlowStart(form.value).finally(() => (buttonLoading.value = false)); form.value = res.data; buttonLoading.value = false; proxy?.$modal.msgSuccess('操作成功'); proxy.$tab.closePage(proxy.$route); proxy.$router.go(-1); - } else{ + } else { let res; if (form.value.id) { res = await updateLeave(form.value).finally(() => (buttonLoading.value = false)); @@ -241,7 +243,13 @@ const handleStartWorkFlow = async (data: LeaveForm) => { // leave4/5 使用的流程变量 userList: ['1', '3', '4'] }; + //流程实例业务扩展字段 + flowInstanceBizExtBo.value = { + businessTitle: '请假申请', + businessCode: data.applyCode + }; submitFormData.value.variables = taskVariables.value; + submitFormData.value.flowInstanceBizExtBo = flowInstanceBizExtBo.value; const resp = await startWorkFlow(submitFormData.value); if (submitVerifyRef.value) { buttonLoading.value = false; diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 0bfc9d8..d4b4f3f 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -61,15 +61,17 @@ - + + + - - + - + + @@ -79,14 +81,14 @@ 挂起 - + - +