diff --git a/src/views/super/bpm/process/personalOffice/myHandleTask/content/TaskApprovalHistoryContent.vue b/src/views/super/bpm/process/personalOffice/myHandleTask/content/TaskApprovalHistoryContent.vue index 0ecdb44..3fb3505 100644 --- a/src/views/super/bpm/process/personalOffice/myHandleTask/content/TaskApprovalHistoryContent.vue +++ b/src/views/super/bpm/process/personalOffice/myHandleTask/content/TaskApprovalHistoryContent.vue @@ -119,16 +119,6 @@ return typeof value === 'string' ? value.trim() : ''; } - function splitValue(value: unknown): string[] { - if (Array.isArray(value)) { - return value.map((item) => normalizeText(item)).filter(Boolean); - } - return normalizeText(value) - .split(',') - .map((item) => item.trim()) - .filter(Boolean); - } - function resolveRecords(res: any): ApprovalHistoryRecord[] { if (Array.isArray(res)) { return res; @@ -237,13 +227,13 @@ async function doLoadCurrentUserDeptList() { const userInfo = (userStore.getUserInfo || {}) as Record; const loginInfo = (userStore.getLoginInfo || {}) as Record; - const departIds = splitValue(userInfo.departIds); const fallbackDeptList = getFallbackCurrentUserDeptList(userInfo, loginInfo); + const username = normalizeText(userInfo.username); - // 本部门按用户全部部门处理,优先用部门ID批量补齐编码和名称,避免只按当前登录部门筛选。 - if (departIds.length > 0) { + // 本部门按用户所属全部部门处理;departIds 是管理部门,不适合作为审批意见筛选口径。 + if (username) { try { - const res = await defHttp.get({ url: '/sys/sysDepart/listAll', params: { id: departIds.join(',') } }); + const res = await defHttp.get({ url: '/sys/sysDepart/queryAffiliatedDepts', params: { userName: username } }); const deptList = resolveDeptList(res); setCurrentUserDeptList(deptList.length > 0 ? deptList : fallbackDeptList); } catch (e) { @@ -262,7 +252,7 @@ } const orgCode = normalizeText(userInfo.orgCode); - const departName = normalizeText(userInfo.orgCodeTxt || userInfo.departIds_dictText); + const departName = normalizeText(userInfo.orgCodeTxt); if (orgCode || departName) { return [{ orgCode, departName }]; }