!63 fix(xispeak): 反馈部门过滤改用流程变量中的部门信息
Merge pull request !63 from wsm/feature/20260626_03
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