diff --git a/src/api/system/user/types.ts b/src/api/system/user/types.ts index 0787372..cb7fc41 100644 --- a/src/api/system/user/types.ts +++ b/src/api/system/user/types.ts @@ -19,6 +19,7 @@ export interface UserQuery extends PageQuery { status?: string; deptId?: string | number; roleId?: string | number; + userIds?: string; } /** diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index 55ede45..6d515ec 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -178,3 +178,16 @@ export const currentTaskAllUser = (taskId: string | number) => { method: 'get' }); }; + +/** + * 获取下一节点写 + * @param data参数 + * @returns + */ +export const getNextNodeList = (data: any): any => { + return request({ + url: '/workflow/task/getNextNodeList', + method: 'post', + data: data + }); +}; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 902d84d..8698eff 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -29,6 +29,7 @@ export interface FlowTaskVO { nodeType: number; nodeRatio: string | number; version?: string; + applyNode?: boolean; buttonList?: buttonList[]; } diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 6e0f548..bd1755a 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -17,6 +17,21 @@ {{ user.nickName }} + +
+
+ 【{{ item.nodeName }}】: + +
+
+ + + +
+
+
@@ -68,6 +83,8 @@ + + @@ -123,7 +140,16 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTask, taskOperation, terminationTask, getBackTaskNode, currentTaskAllUser } from '@/api/workflow/task'; +import { + completeTask, + backProcess, + getTask, + taskOperation, + terminationTask, + getBackTaskNode, + currentTaskAllUser, + getNextNodeList +} from '@/api/workflow/task'; import UserSelect from '@/components/UserSelect'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -134,6 +160,7 @@ const userSelectCopyRef = ref>(); const transferTaskRef = ref>(); const delegateTaskRef = ref>(); const multiInstanceUserRef = ref>(); +const porUserRef = ref>(); const props = defineProps({ taskVariables: { @@ -153,6 +180,8 @@ const selectCopyUserList = ref([]); const selectCopyUserIds = ref(undefined); //可减签的人员 const deleteUserList = ref([]); +//弹窗可选择的人员id +const popUserIds = ref([]); //驳回是否显示 const backVisible = ref(false); const backLoading = ref(true); @@ -163,6 +192,8 @@ const buttonObj = ref({ code: undefined, show: false }); +//下一节点列表 +const nestNodeList = ref([]); //任务 const task = ref({ id: undefined, @@ -181,6 +212,7 @@ const task = ref({ formPath: undefined, nodeType: undefined, nodeRatio: undefined, + applyNode: false, buttonList: [] }); const dialog = reactive({ @@ -205,7 +237,7 @@ const backForm = ref>({ }); //打开弹窗 -const openDialog = (id?: string) => { +const openDialog = async (id?: string) => { selectCopyUserIds.value = undefined; selectCopyUserList.value = []; form.value.fileId = undefined; @@ -214,17 +246,21 @@ const openDialog = (id?: string) => { dialog.visible = true; loading.value = true; buttonDisabled.value = true; - nextTick(() => { - getTask(taskId.value).then((response) => { - task.value = response.data; - buttonObj.value = []; - task.value.buttonList.forEach((e) => { - buttonObj.value[e.code] = e.show; - }); - loading.value = false; - buttonDisabled.value = false; - }); + const response = await getTask(taskId.value); + task.value = response.data; + buttonObj.value = []; + task.value.buttonList.forEach((e) => { + buttonObj.value[e.code] = e.show; }); + buttonObj.value.applyNode = task.value.applyNode; + loading.value = false; + buttonDisabled.value = false; + const data = { + taskId: taskId.value, + variables: props.taskVariables + }; + const nextData = await getNextNodeList(data); + nestNodeList.value = nextData.data; }; onMounted(() => {}); @@ -438,6 +474,15 @@ const handleTaskUser = async () => { } deleteSignatureVisible.value = true; }; +// 选择人员 +const choosePeople = async (data) => { + if (!data.permissionFlag) { + proxy?.$modal.msgError('没有可选择的人员,请联系管理员!'); + } + popUserIds.value = data.permissionFlag; + porUserRef.value.open(); +}; +const handlePopUser = async () => {}; /** * 对外暴露子组件方法 diff --git a/src/components/UserSelect/index.vue b/src/components/UserSelect/index.vue index 937a395..4f738db 100644 --- a/src/components/UserSelect/index.vue +++ b/src/components/UserSelect/index.vue @@ -108,11 +108,13 @@ interface PropType { modelValue?: UserVO[] | UserVO | undefined; multiple?: boolean; data?: string | number | (string | number)[] | undefined; + userIds?: string; } const prop = withDefaults(defineProps(), { multiple: true, modelValue: undefined, - data: undefined + data: undefined, + userIds: undefined }); const emit = defineEmits(['update:modelValue', 'confirmCallBack']); @@ -143,7 +145,8 @@ const queryParams = ref({ phonenumber: '', status: '', deptId: '', - roleId: '' + roleId: '', + userIds: '' }); const defaultSelectUserIds = computed(() => computedIds(prop.data)); @@ -166,7 +169,7 @@ const confirm = () => { const computedIds = (data) => { if (data instanceof Array) { - return data.map(item => String(item)); + return data.map((item) => String(item)); } else if (typeof data === 'string') { return data.split(','); } else if (typeof data === 'number') { @@ -192,6 +195,7 @@ const getTreeSelect = async () => { /** 查询用户列表 */ const getList = async () => { loading.value = true; + queryParams.value.userIds = prop.userIds; const res = await api.listUser(proxy?.addDateRange(queryParams.value, dateRange.value)); loading.value = false; userList.value = res.rows;