fix(xispeak): 反馈部门过滤改用流程变量中的部门信息
原先用登录用户部门(getCurrentUserDeptId)过滤,改为从流程变量 (vars.implDept/dept_id/pending_depts_id)中读取当前流程所属部门, 覆盖收集流程、反馈流程和主流程子流程三种场景。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -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<string, any>;
|
||||
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<string, any>;
|
||||
const loginInfo = (userStore.getLoginInfo || {}) as Record<string, any>;
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user