diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index e0853fe..0aac90a 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -275,3 +275,15 @@ export const taskOperation = (data: TaskOperationBo, operation: string) => { data: data }); }; + +/** + * 获取当前任务办理人 + * @param taskId 任务id + * @returns + */ +export const getUserListTaskId = (taskId: string) => { + return request({ + url: `/workflow/task/getUserListTaskId/${taskId}`, + method: 'get' + }); +}; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 3e57ca4..612cddb 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -26,6 +26,7 @@ export interface FlowTaskVO { flowCode: string; flowStatus: string; nodeType: number; + nodeRatio: string | number; wfNodeConfigVo?: NodeConfigVO; wfDefinitionConfigVo?: DefinitionConfigVO; } diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 8cc8803..4f05f75 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -26,15 +26,15 @@ 提交 委托 转办 - - 加签 - + 加签 + + 减签 终止 @@ -49,7 +49,7 @@ - + @@ -78,6 +78,19 @@ +
+ + + + + + + +
+
@@ -85,18 +98,15 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTaskById, taskOperation, terminationTask, getBackTaskNode } from '@/api/workflow/task'; +import { completeTask, backProcess, getTaskById, taskOperation, terminationTask, getBackTaskNode, getUserListTaskId } 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 { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types'; const userSelectCopyRef = ref>(); const transferTaskRef = ref>(); const delegateTaskRef = ref>(); - -//加签组件 -const multiInstanceUserRef = ref>(); +const multiInstanceUserRef = ref>(); const props = defineProps({ taskVariables: { @@ -114,7 +124,9 @@ const taskId = ref(''); const selectCopyUserList = ref([]); //抄送人id const selectCopyUserIds = ref(undefined); -// 驳回是否显示 +//可减签的人员 +const deleteUserList = ref([]); +//驳回是否显示 const backVisible = ref(false); const backLoading = ref(true); const backButtonDisabled = ref(true); @@ -135,16 +147,16 @@ const task = ref({ flowCode: undefined, flowStatus: undefined, nodeType: undefined, + nodeRatio: undefined, wfNodeConfigVo: undefined, wfDefinitionConfigVo: undefined }); -//加签 减签标题 -const title = ref(''); const dialog = reactive({ visible: false, title: '提示' }); - +//减签弹窗 +const deleteSignatureVisible = ref(false); const form = ref>({ taskId: undefined, message: undefined, @@ -269,18 +281,46 @@ const handleCopyCloseTag = (user: UserVO) => { selectCopyUserIds.value = selectCopyUserList.value.map((item) => item.userId).join(','); }; //加签 -const addMultiInstanceUser = () => { - if (multiInstanceUserRef.value) { - title.value = '加签人员'; - multiInstanceUserRef.value.getAddMultiInstanceList(taskId.value, []); +const openMultiInstanceUser = async () => { + multiInstanceUserRef.value.open(); +}; +//加签 +const addMultiInstanceUser = async (data) => { + if (data && data.length > 0) { + const taskOperationBo = reactive({ + userIds: data.map((e) => e.userId), + taskId: taskId.value, + message: form.value.message + }); + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonDisabled.value = true; + await taskOperation(taskOperationBo, 'addSignature').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + } else { + proxy?.$modal.msgWarning('请选择用户!'); } }; //减签 -const deleteMultiInstanceUser = () => { - if (multiInstanceUserRef.value) { - title.value = '减签人员'; - multiInstanceUserRef.value.getDeleteMultiInstanceList(taskId.value); - } +const deleteMultiInstanceUser = async (row) => { + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonDisabled.value = true; + const taskOperationBo = reactive({ + userIds: [row.userId], + taskId: taskId.value, + message: form.value.message + }); + await taskOperation(taskOperationBo, 'reductionSignature').finally(() => { + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + }); }; //打开转办 const openTransferTask = () => { @@ -336,7 +376,7 @@ const handleDelegateTask = async (data) => { } }; //终止任务 -const handleTerminationTask = async (data) => { +const handleTerminationTask = async () => { let params = { taskId: taskId.value, comment: form.value.message @@ -352,6 +392,16 @@ const handleTerminationTask = async (data) => { emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); }; +const handleTaskUser = async () => { + let data = await getUserListTaskId(taskId.value); + deleteUserList.value = data.data; + if (deleteUserList.value && deleteUserList.value.length > 0) { + deleteUserList.value.forEach((e) => { + e.nodeName = task.value.nodeName; + }); + } + deleteSignatureVisible.value = true; +}; /** * 对外暴露子组件方法