diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index 2c5e539..7b496c0 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -179,3 +179,17 @@ export const updateAssignee = (taskIds: Array,userId: string) => { method: 'put' }); }; + +/** + * 转办任务 + * @param taskIds + * @param userId + * @returns + */ +export const transferTask = (data: object) => { + return request({ + url: `/workflow/task/transferTask`, + method: 'post', + data: data + }); +}; diff --git a/src/components/Process/multiInstanceUser.vue b/src/components/Process/multiInstanceUser.vue index 3cda3fd..d79bac9 100644 --- a/src/components/Process/multiInstanceUser.vue +++ b/src/components/Process/multiInstanceUser.vue @@ -75,7 +75,7 @@ diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 9e2a7be..54e6678 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -24,15 +24,19 @@ - + + + + - + @@ -40,13 +44,14 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTaskById } from '@/api/workflow/task'; +import { completeTask, backProcess, getTaskById,transferTask } from '@/api/workflow/task'; import UserSelect from '@/components/UserSelect'; import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; import { UserVO } from '@/api/system/user/types'; import { TaskVO } from '@/api/workflow/task/types'; const userSelectCopyRef = ref>(); +const transferTaskRef = ref>(); //加签组件 const multiInstanceUserRef = ref>(); @@ -66,6 +71,9 @@ const taskId = ref(''); const selectCopyUserList = ref([]); //抄送人id const selectCopyUserIds = ref(undefined); +//是否多选人员 +const userMultiple = ref(false); + //任务 const task = ref({ id: undefined, @@ -107,6 +115,9 @@ const form = ref>({ messageType: ['1'], wfCopyList: [] }); +const closeDialog = () => { + dialog.visible = false +} //打开弹窗 const openDialog = (id?: string) => { selectCopyUserIds.value = undefined @@ -172,6 +183,7 @@ const cancel = async () => { }; //打开抄送人员 const openUserSelectCopy = () => { + userMultiple.value = true userSelectCopyRef.value.open(); }; //确认抄送人员 @@ -203,6 +215,31 @@ const deleteMultiInstanceUser = () => { multiInstanceUserRef.value.getDeleteMultiInstanceList(taskId.value); } }; +//打开转办 +const openTransferTask = () => { + userMultiple.value = false + transferTaskRef.value.open(); +}; +//转办 +const handleTransferTask = async (data) => { + if(data && data.length > 0){ + let params = { + taskId: taskId.value, + userId: data[0].userId, + comment: form.value.message + } + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonLoading.value = true; + await transferTask(params).finally(() => (loading.value = false)); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + }else{ + proxy?.$modal.msgWarning('请选择用户!'); + } +} + /** * 对外暴露子组件方法 */ diff --git a/src/components/UserSelect/index.vue b/src/components/UserSelect/index.vue index 0599a17..e97b553 100644 --- a/src/components/UserSelect/index.vue +++ b/src/components/UserSelect/index.vue @@ -138,6 +138,7 @@ const deptTreeRef = ref(); const queryFormRef = ref(); const tableRef = ref>(); + const userDialog = useDialog({ title: '用户选择' });