diff --git a/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue b/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue index 662be6a..c207cc5 100644 --- a/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue +++ b/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue @@ -577,6 +577,17 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi } } + function getProcessVarDeptIds(): string[] { + const vars = (props.formData?.vars ?? {}) as Record; + const value = vars.implDept ?? vars.impl_dept_id ?? vars.pending_depts_id ?? vars.dept_id ?? vars.deptid; + if (!value) return []; + if (Array.isArray(value)) return value.map((v: any) => String(v).trim()).filter(Boolean); + return String(value) + .split(',') + .map((s: string) => s.trim()) + .filter(Boolean); + } + function getCurrentUserDeptId() { const userInfo = (userStore.getUserInfo || {}) as Record; const loginInfo = (userStore.getLoginInfo || {}) as Record; @@ -603,13 +614,13 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi const res = await apiFn({ mainId: mainForm.id, bpmProcessId, pageNo: 1, pageSize: 999 }); let list = res?.records || res?.result?.records || []; if (list.length && showDeptFeedback.value) { - const deptId = getCurrentUserDeptId(); - if (deptId) { + const deptIds = getProcessVarDeptIds(); + if (deptIds.length) { list = list.filter((item: any) => { - const deptIds = String(item.responDeptid || '') + const responDeptIds = String(item.responDeptid || '') .split(',') .map((s: string) => s.trim()); - return deptIds.includes(String(deptId)); + return deptIds.some((id) => responDeptIds.includes(id)); }); } }