From 81770ee3a67550247fc70e83e90d69acae2493bd Mon Sep 17 00:00:00 2001 From: Default User Date: Tue, 27 Jan 2026 11:02:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=9D=83=E9=99=90=EF=BC=9A=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=8F=AF=E6=9F=A5=E7=9C=8B=E5=85=A8=E9=83=A8=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=EF=BC=8C=E8=B7=B3=E8=BF=87=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E4=BA=BA=E5=8C=B9=E9=85=8D=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Reject.js | 3 ++- SupplierReview.html | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Reject.js b/Reject.js index da9c1cd..469476a 100644 --- a/Reject.js +++ b/Reject.js @@ -1790,12 +1790,13 @@ app.get('/api/suppliers', async (req, res) => { params.push(`%${phoneNumber}%`); } - // 添加对接人匹配逻辑,只显示当前登录者对接的供应商 + // 添加对接人匹配逻辑,只显示当前登录者对接的供应商(非管理员) if (currentUserName || currentUserPhone) { whereClause += (status || keyword || phoneNumber) ? ' AND' : ' WHERE'; whereClause += ` (liaison LIKE ? OR liaison LIKE ?)`; params.push(`%${currentUserName}%`, `%${currentUserPhone}%`); } + // 管理员不需要对接人匹配,会显示所有供应商 // 获取总数 const [totalResult] = await connection.query( diff --git a/SupplierReview.html b/SupplierReview.html index 0f66636..84d444e 100644 --- a/SupplierReview.html +++ b/SupplierReview.html @@ -1435,6 +1435,7 @@ const parsedUserInfo = JSON.parse(userInfo); const currentUserName = parsedUserInfo.name; const currentUserPhone = parsedUserInfo.phoneNumber; + const isAdmin = parsedUserInfo.projectName === '管理员'; // 构建查询参数,添加时间戳防止缓存 let queryParams = `page=${currentPage}&pageSize=${pageSize}&status=${currentStatus}&_t=${Date.now()}`; @@ -1444,9 +1445,11 @@ if (phoneNumber) { queryParams += `&phoneNumber=${encodeURIComponent(phoneNumber)}`; } - // 添加当前登录者信息,用于对接人匹配 - queryParams += `¤tUserName=${encodeURIComponent(currentUserName)}`; - queryParams += `¤tUserPhone=${encodeURIComponent(currentUserPhone)}`; + // 添加当前登录者信息,用于对接人匹配(非管理员才需要) + if (!isAdmin) { + queryParams += `¤tUserName=${encodeURIComponent(currentUserName)}`; + queryParams += `¤tUserPhone=${encodeURIComponent(currentUserPhone)}`; + } // 使用相对路径,避免硬编码地址导致的跨电脑访问问题 const response = await fetch(`/api/suppliers?${queryParams}`);