diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index 07b183d..8260e69 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -226,3 +226,15 @@ export const getTaskNodeList = (processInstanceId: string) => { method: 'get' }); }; + +/** + * 委托任务 + * @returns + */ +export const delegateTask = (data: any) => { + return request({ + url: `/workflow/task/delegateTask`, + method: 'post', + data: data + }); +}; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 2e39d06..0425a1a 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -32,15 +32,15 @@ export interface TaskVO extends BaseEntity { parentTaskId?: any; tenantId: string; claimTime?: string; - businessStatus: string; - businessStatusName: string; - processDefinitionName: string; - processDefinitionKey: string; - participantVo: ParticipantVo; - multiInstance: boolean; - businessKey: string; - wfNodeConfigVo: NodeConfigVO; - wfDefinitionConfigVo: DefinitionConfigVO; + businessStatus?: string; + businessStatusName?: string; + processDefinitionName?: string; + processDefinitionKey?: string; + participantVo?: ParticipantVo; + multiInstance?: boolean; + businessKey?: string; + wfNodeConfigVo?: NodeConfigVO; + wfDefinitionConfigVo?: DefinitionConfigVO; } export interface VariableVo { diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 0d7e413..b0e4c11 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -24,6 +24,7 @@ - + - + + + @@ -78,7 +81,7 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTaskById,transferTask,terminationTask,getTaskNodeList } from '@/api/workflow/task'; +import { completeTask, backProcess, getTaskById,transferTask,terminationTask,getTaskNodeList,delegateTask } from '@/api/workflow/task'; import UserSelect from '@/components/UserSelect'; import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -86,6 +89,8 @@ import { UserVO } from '@/api/system/user/types'; import { TaskVO } from '@/api/workflow/task/types'; const userSelectCopyRef = ref>(); const transferTaskRef = ref>(); +const delegateTaskRef = ref>(); + //加签组件 const multiInstanceUserRef = ref>(); @@ -105,8 +110,6 @@ const taskId = ref(''); const selectCopyUserList = ref([]); //抄送人id const selectCopyUserIds = ref(undefined); -//是否多选人员 -const userMultiple = ref(false); // 驳回是否显示 const backVisible = ref(false); const backLoading = ref(true); @@ -137,7 +140,10 @@ const task = ref({ processDefinitionName: undefined, processDefinitionKey: undefined, participantVo: undefined, - multiInstance: undefined + multiInstance: undefined, + businessKey: undefined, + wfNodeConfigVo: undefined, + wfDefinitionConfigVo: undefined }); //加签 减签标题 const title = ref(''); @@ -240,7 +246,6 @@ const cancel = async () => { }; //打开抄送人员 const openUserSelectCopy = () => { - userMultiple.value = true userSelectCopyRef.value.open(); }; //确认抄送人员 @@ -274,7 +279,6 @@ const deleteMultiInstanceUser = () => { }; //打开转办 const openTransferTask = () => { - userMultiple.value = false transferTaskRef.value.open(); }; //转办 @@ -297,6 +301,29 @@ const handleTransferTask = async (data) => { } } +//打开委托 +const openDelegateTask = () => { + delegateTaskRef.value.open(); +}; +//委托 +const handleDelegateTask = async (data) => { + if(data && data.length > 0){ + let params = { + taskId: taskId.value, + userId: data[0].userId, + nickName: data[0].nickName + } + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonLoading.value = true; + await delegateTask(params).finally(() => (loading.value = false)); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + }else{ + proxy?.$modal.msgWarning('请选择用户!'); + } +} //终止任务 const handleTerminationTask = async (data) => { let params = {