
--- client/resources/api/user.js
+++ client/resources/api/user.js
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 |
} |
16 | 16 |
|
17 | 17 |
// 스크랩 자료 수정 (PUT 메서드 사용) |
18 |
-export const updateUsersProc = (userId, formData) => { |
|
18 |
+export const updateUsersProc = (userId, formData) => { |
|
19 | 19 |
return fileClient.put(`/user/${userId}/users.file`, formData); |
20 | 20 |
} |
21 | 21 |
|
... | ... | @@ -23,3 +23,8 @@ |
23 | 23 |
export const updatePassword = (userId, updateUserPasswordDTO) => { |
24 | 24 |
return apiClient.put(`/user/${userId}/updatePassword.json`, updateUserPasswordDTO); |
25 | 25 |
} |
26 |
+ |
|
27 |
+// 조회 - 목록 (모달용) |
|
28 |
+export const findUsersForModalProc = data => { |
|
29 |
+ return apiClient.get('/user/usersForModal.json', { params: data }); |
|
30 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- client/views/component/Popup/HrPopup.vue
+++ client/views/component/Popup/HrPopup.vue
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 |
import { SearchOutlined, CloseCircleFilled } from '@ant-design/icons-vue'; |
52 | 52 |
import Pagination from '../Pagination.vue'; |
53 | 53 |
// API |
54 |
-import { findUsersProc } from '../../../resources/api/user'; |
|
54 |
+import { findUsersForModalProc } from '../../../resources/api/user'; |
|
55 | 55 |
|
56 | 56 |
export default { |
57 | 57 |
name: 'EmployeeSelectionModal', |
... | ... | @@ -72,7 +72,13 @@ |
72 | 72 |
// 사용자 목록 내 유저아이디 key(혹은 column) 값 |
73 | 73 |
idField: { |
74 | 74 |
type: String, |
75 |
- default: 'userId' |
|
75 |
+ default: 'userId', |
|
76 |
+ }, |
|
77 |
+ |
|
78 |
+ // 필터링용 날짜 정보 |
|
79 |
+ dateInfo: { |
|
80 |
+ type: Object, |
|
81 |
+ default: () => ({}), |
|
76 | 82 |
} |
77 | 83 |
}, |
78 | 84 |
|
... | ... | @@ -85,8 +91,11 @@ |
85 | 91 |
searchParams: { |
86 | 92 |
searchType: 'nm', // 검색조건 (사용자 이름으로 고정) |
87 | 93 |
searchText: null, // 검색어 |
88 |
- searchSttus: 1, // 회원상태 (승인 고정) |
|
89 |
- searchUseAt: 'Y', // 사용여부 (사용으로 고정) |
|
94 |
+ |
|
95 |
+ bgnde: null, // 시작 일 (YYYY-MM-DD) |
|
96 |
+ beginHour: null, // 시작 시 |
|
97 |
+ endde: null, // 종료 일 (YYYY-MM-DD) |
|
98 |
+ endHour: null, // 종료 시 |
|
90 | 99 |
}, |
91 | 100 |
} |
92 | 101 |
}, |
... | ... | @@ -97,21 +106,41 @@ |
97 | 106 |
} |
98 | 107 |
}, |
99 | 108 |
|
109 |
+ watch: { |
|
110 |
+ dateInfo: { |
|
111 |
+ handler(newDateInfo) { |
|
112 |
+ this.applyDateInfo(); // dateInfo 검색 조건에 적용 |
|
113 |
+ }, |
|
114 |
+ deep: true, |
|
115 |
+ immediate: true |
|
116 |
+ } |
|
117 |
+ }, |
|
118 |
+ |
|
100 | 119 |
mounted() { |
101 | 120 |
this.fetchEmployeeList(); |
102 | 121 |
}, |
103 | 122 |
|
104 | 123 |
methods: { |
124 |
+ // dateInfo 검색 조건에 적용 |
|
125 |
+ applyDateInfo() { |
|
126 |
+ if (this.dateInfo && Object.keys(this.dateInfo).length > 0) { |
|
127 |
+ this.searchParams.bgnde = this.dateInfo.bgnde || null; |
|
128 |
+ this.searchParams.beginHour = this.dateInfo.beginHour || null; |
|
129 |
+ this.searchParams.endde = this.dateInfo.endde || null; |
|
130 |
+ this.searchParams.endHour = this.dateInfo.endHour || null; |
|
131 |
+ } |
|
132 |
+ }, |
|
133 |
+ |
|
105 | 134 |
// 직원 목록 조회 |
106 | 135 |
async fetchEmployeeList() { |
107 | 136 |
try { |
108 |
- const response = await findUsersProc(this.searchParams); |
|
137 |
+ const response = await findUsersForModalProc(this.searchParams); |
|
109 | 138 |
const result = response.data.data; |
110 | 139 |
|
111 | 140 |
this.employeeList = result.users; |
112 | 141 |
this.searchParams = result.search; |
113 | 142 |
} catch (error) { |
114 |
- const message = error.response.data.message; |
|
143 |
+ const message = error.response?.data?.message || '데이터 조회에 실패했습니다.'; |
|
115 | 144 |
alert(message); |
116 | 145 |
console.error(error); |
117 | 146 |
} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?