From a2b2a777892d62b4c6f61459afce5c4a85736659 Mon Sep 17 00:00:00 2001 From: yinq Date: Thu, 19 Mar 2026 09:16:34 +0800 Subject: [PATCH] =?UTF-8?q?1.0.95=20=E9=83=A8=E9=97=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/dept/index.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 0d13a4f..d909049 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -235,9 +235,11 @@ async function getDeptAllUser(deptId: any) { } /** 查询所有用户 */ -async function getAllUser() { - const res = await listUserByDeptId(100); - allUserList.value = res.data || []; +async function getAllUser(deptId: any) { + if (deptId !== null && deptId !== '' && deptId !== undefined) { + const res = await listUserByDeptId(deptId); + allUserList.value = res.data || []; + } } /** 取消按钮 */ @@ -287,7 +289,7 @@ const handleAdd = async (row?: DeptVO) => { getDeptAllUser(row.deptId); } // 加载所有用户列表,用于选择分管副总 - getAllUser(); + getAllUser(row.deptId); dialog.visible = true; dialog.title = '添加部门'; } @@ -299,7 +301,7 @@ const handleUpdate = async (row: DeptVO) => { //查询当前部门所有用户 getDeptAllUser(row.deptId); // 加载所有用户列表,用于选择分管副总 - getAllUser(); + getAllUser(row.deptId); const res = await getDept(row.deptId); form.value = res.data; const response = await listDeptExcludeChild(row.deptId);