Bläddra i källkod

feat(考勤): 添加根据条件查询用户列表功能

新增selectUserListByCondition接口用于按条件查询用户列表
修改班组变更处理逻辑,使用新接口获取班组成员
huoyi 1 månad sedan
förälder
incheckning
b0bc7ea18b
2 ändrade filer med 19 tillägg och 5 borttagningar
  1. 10 0
      src/api/attendance/postRecord.js
  2. 9 5
      src/views/attendance/postRecord/index.vue

+ 10 - 0
src/api/attendance/postRecord.js

@@ -60,3 +60,13 @@ export function teamList(data) {
60
     data: data
60
     data: data
61
   })
61
   })
62
 }
62
 }
63
+
64
+
65
+//查询用户列表
66
+export function selectUserListByCondition(data) {
67
+  return request({
68
+    url: '/system/user/selectUserListByCondition',
69
+    method: 'post',
70
+    data: data
71
+  })
72
+}

+ 9 - 5
src/views/attendance/postRecord/index.vue

@@ -181,8 +181,8 @@
181
 </template>
181
 </template>
182
 
182
 
183
 <script setup name="PostRecord">
183
 <script setup name="PostRecord">
184
-import { listPostRecord, getPostRecord, delPostRecord, addPostRecord, updatePostRecord, positionList, teamList } from "@/api/attendance/postRecord"
185
-import { listRecord } from "@/api/attendance/record"
184
+import { listPostRecord, getPostRecord, delPostRecord, addPostRecord, updatePostRecord, positionList, teamList, selectUserListByCondition } from "@/api/attendance/postRecord"
185
+
186
 import UserSelect from "@/components/UserSelect"
186
 import UserSelect from "@/components/UserSelect"
187
 
187
 
188
 const { proxy } = getCurrentInstance()
188
 const { proxy } = getCurrentInstance()
@@ -328,13 +328,17 @@ const { queryParams, form, rules } = toRefs(data)
328
 
328
 
329
 
329
 
330
 const handleTeamChange = async (newTeamId) => {
330
 const handleTeamChange = async (newTeamId) => {
331
-  
331
+
332
   if (newTeamId) {
332
   if (newTeamId) {
333
     // 当班组ID变化时,获取该班组的成员
333
     // 当班组ID变化时,获取该班组的成员
334
     try {
334
     try {
335
-      const response = await listRecord({ attendanceTeamId: newTeamId,pageSize: 1000 })
335
+      const response = await selectUserListByCondition({
336
+        deptId: newTeamId, roleKeyList: [
337
+          "SecurityCheck"
338
+        ],
339
+      })
336
       // 获取团队成员的用户ID列表
340
       // 获取团队成员的用户ID列表
337
-      const teamUserIds = response.rows.map(item => item.userId)
341
+      const teamUserIds = response.data.map(item => item.userId)
338
       // 将团队成员的用户ID赋值给form.userId
342
       // 将团队成员的用户ID赋值给form.userId
339
       form.value.userIdList = teamUserIds
343
       form.value.userIdList = teamUserIds
340
     } catch (error) {
344
     } catch (error) {