From 2b61314ae8f045e59ca1006c874526f9e90e31e3 Mon Sep 17 00:00:00 2001 From: ye1023 <12588209+ye1023@user.noreply.gitee.com> Date: Wed, 10 Jun 2026 11:04:27 +0800 Subject: [PATCH] =?UTF-8?q?yxk-20260610-=E5=AE=A1=E6=89=B9=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E9=A1=B5=E9=9D=A2=20=E4=BC=98=E5=85=88=E8=B0=83?= =?UTF-8?q?=E7=94=A8=20/sys/sysDepart/queryAffiliatedDepts=3FuserName=3D${?= =?UTF-8?q?userInfo.username}=20=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=89=80=E5=B1=9E=E5=85=A8=E9=83=A8=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/TaskApprovalHistoryContent.vue | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) 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 }]; }