diff --git a/src/api/workflow/instance/types.ts b/src/api/workflow/instance/types.ts index 57b1161..278be8e 100644 --- a/src/api/workflow/instance/types.ts +++ b/src/api/workflow/instance/types.ts @@ -5,7 +5,7 @@ export interface FlowInstanceQuery extends PageQuery { nodeName?: string; flowCode?: string; flowName?: string; - nickName?: string; + createByIds?: string[] | number[]; businessId?: string; } diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index ec9d707..671817a 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -4,7 +4,7 @@ export interface TaskQuery extends PageQuery { nodeName?: string; flowCode?: string; flowName?: string; - nickName?: string; + createByIds?: string[] | number[]; } export interface ParticipantVo { diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 16d27d6..9c99564 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -20,20 +20,22 @@ - +
- - + + + 选择申请人 + @@ -62,72 +64,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -166,6 +168,9 @@ + + +
@@ -178,12 +183,16 @@ import workflowCommon from '@/api/workflow/workflowCommon'; import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; import VueJsonPretty from 'vue-json-pretty'; import 'vue-json-pretty/lib/styles.css'; +import UserSelect from '@/components/UserSelect/index.vue'; //审批记录组件 const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { wf_business_status } = toRefs(proxy?.useDict('wf_business_status')); const queryFormRef = ref(); const categoryTreeRef = ref(); +import { ref } from 'vue'; +import { UserVO } from '@/api/system/user/types'; +const userSelectRef = ref>(); // 遮罩层 const loading = ref(true); // 选中数组 @@ -225,6 +234,11 @@ type CategoryOption = { const tab = ref('running'); // 作废原因 const deleteReason = ref(''); + +//申请人id +const selectUserIds = ref>([]); +//申请人选择数量 +const userSelectCount = ref(0); // 查询参数 const queryParams = ref({ pageNum: 1, @@ -232,7 +246,7 @@ const queryParams = ref({ nodeName: undefined, flowName: undefined, flowCode: undefined, - nickName: undefined, + createByIds: [], categoryCode: undefined }); @@ -282,6 +296,8 @@ const resetQuery = () => { queryParams.value.categoryCode = ''; queryParams.value.pageNum = 1; queryParams.value.pageSize = 10; + queryParams.value.createByIds = []; + userSelectCount.value = 0; handleQuery(); }; // 多选框选中数据 @@ -384,6 +400,19 @@ function formatToJsonObject(data: string) { } } +//打开申请人选择 +const openUserSelect = () => { + userSelectRef.value.open(); +}; +//确认选择申请人 +const userSelectCallBack = (data: UserVO[]) => { + userSelectCount.value = 0; + if (data && data.length > 0) { + userSelectCount.value = data.length; + selectUserIds.value = data.map((item) => item.userId); + queryParams.value.createByIds = selectUserIds.value; + } +}; onMounted(() => { getProcessInstanceRunningList(); getTreeselect(); diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue index 076d483..7b24b32 100644 --- a/src/views/workflow/task/allTaskWaiting.vue +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -12,8 +12,10 @@
- - + + + 选择申请人 + @@ -53,7 +55,7 @@ - + @@ -78,8 +82,14 @@ import { pageByTaskWait } from '@/api/workflow/task'; import { TaskQuery, FlowTaskVO } from '@/api/workflow/task/types'; import workflowCommon from '@/api/workflow/workflowCommon'; import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; + const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { wf_business_status } = toRefs(proxy?.useDict('wf_business_status')); +import UserSelect from '@/components/UserSelect'; +import { ref } from 'vue'; +import { UserVO } from '@/api/system/user/types'; + +const userSelectRef = ref>(); //提交组件 const queryFormRef = ref(); // 遮罩层 @@ -96,6 +106,11 @@ const showSearch = ref(true); const total = ref(0); // 模型定义表格数据 const taskList = ref([]); + +//申请人id +const selectUserIds = ref>([]); +//申请人选择数量 +const userSelectCount = ref(0); // 查询参数 const queryParams = ref({ pageNum: 1, @@ -103,7 +118,7 @@ const queryParams = ref({ nodeName: undefined, flowName: undefined, flowCode: undefined, - nickName: undefined + createByIds: [] }); onMounted(() => { getWaitingList(); @@ -117,6 +132,8 @@ const resetQuery = () => { queryFormRef.value?.resetFields(); queryParams.value.pageNum = 1; queryParams.value.pageSize = 10; + queryParams.value.createByIds = []; + userSelectCount.value = 0; handleQuery(); }; // 多选框选中数据 @@ -145,4 +162,17 @@ const handleOpen = async (row: FlowTaskVO) => { }); workflowCommon.routerJump(routerJumpVo, proxy); }; +//打开申请人选择 +const openUserSelect = () => { + userSelectRef.value.open(); +}; +//确认选择申请人 +const userSelectCallBack = (data: UserVO[]) => { + userSelectCount.value = 0; + if (data && data.length > 0) { + userSelectCount.value = data.length; + selectUserIds.value = data.map((item) => item.userId); + queryParams.value.createByIds = selectUserIds.value; + } +};