
--- client/views/layout/Menu.jsx
+++ client/views/layout/Menu.jsx
... | ... | @@ -56,7 +56,9 @@ |
56 | 56 |
</ul> |
57 | 57 |
</div> |
58 | 58 |
<div className="bottom-section flex-center" style={{width: '100%'}}> |
59 |
- {state.loginUser['authority'] == 'ROLE_ADMIN' ? |
|
59 |
+ {state.loginUser['authority'] == 'ROLE_ADMIN' |
|
60 |
+ || state.loginUser['authority'] == 'ROLE_GOVERNMENT' |
|
61 |
+ || state.loginUser['authority'] == 'ROLE_AGENCY' ? |
|
60 | 62 |
<div className="info-id" > |
61 | 63 |
<span onClick={() => { |
62 | 64 |
navigate("/Join"); |
--- client/views/pages/AppRoute.jsx
+++ client/views/pages/AppRoute.jsx
... | ... | @@ -33,7 +33,8 @@ |
33 | 33 |
import VisitInsert from "./visit/visit/VisitInsert.jsx"; |
34 | 34 |
import VisitSelectOne from "./visit/visit/VisitSelectOne.jsx"; |
35 | 35 |
import EquipmentRentalInsert from "./equipment/EquipmentRentalInsert.jsx"; |
36 |
-import EquipmentManagementSelect from "./equipment/EquipmentManagementSelect.jsx"; |
|
36 |
+import EquipmentSelect from "./equipment/EquipmentSelect.jsx"; |
|
37 |
+import GovernmentEquipmentSelect from "./equipment/GovernmentEquipmentSelect.jsx"; |
|
37 | 38 |
import EquipmentManagementSelectOne from "./equipment/EquipmentManagementSelectOne.jsx"; |
38 | 39 |
import UserSelect from "./user_management/UserSelect.jsx"; |
39 | 40 |
import AgencySeniorSelect from "./user_management/AgencySeniorSelect.jsx"; |
... | ... | @@ -86,7 +87,7 @@ |
86 | 87 |
}, |
87 | 88 |
{ |
88 | 89 |
title: "장비 관리", |
89 |
- path: "/EquipmentManagementSelect", |
|
90 |
+ path: "/EquipmentSelect", |
|
90 | 91 |
icon: ( |
91 | 92 |
<SpeakerPhoneIcon |
92 | 93 |
sx={{ fontSize: 20, marginRight: 1 }} |
... | ... | @@ -132,7 +133,7 @@ |
132 | 133 |
<Route path="/Main" element={<Main />}></Route> |
133 | 134 |
<Route path="/EquipmentRentalInsert" element={<EquipmentRentalInsert />}></Route> |
134 | 135 |
<Route path="/EquipmentManagementInsert" element={<EquipmentManagementInsert />}></Route> |
135 |
- <Route path="/EquipmentManagementSelect" element={<EquipmentManagementSelect />}></Route> |
|
136 |
+ <Route path="/EquipmentSelect" element={<EquipmentSelect />}></Route> |
|
136 | 137 |
<Route path="/EquipmentManagementSelectOne" element={<EquipmentManagementSelectOne />}></Route> |
137 | 138 |
<Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
138 | 139 |
<Route path="/TemperatureManagementSelectOne" element={<TemperatureManagementSelectOne />}></Route> |
... | ... | @@ -180,14 +181,15 @@ |
180 | 181 |
], |
181 | 182 |
}, |
182 | 183 |
{ |
183 |
- title: "문의 현황 관리", |
|
184 |
+ title: "장비 관리", |
|
185 |
+ path: "/GovernmentEquipmentSelect", |
|
184 | 186 |
icon: ( |
185 |
- <ContactSupportIcon |
|
187 |
+ <SpeakerPhoneIcon |
|
186 | 188 |
sx={{ fontSize: 20, marginRight: 1 }} |
187 | 189 |
/> |
188 | 190 |
), |
189 | 191 |
}, |
190 |
- { |
|
192 |
+ /* { |
|
191 | 193 |
title: "대상자 관리", |
192 | 194 |
icon: ( |
193 | 195 |
<Diversity1Icon |
... | ... | @@ -204,8 +206,8 @@ |
204 | 206 |
path:"/Medicalcare", |
205 | 207 |
}, |
206 | 208 |
], |
207 |
- }, |
|
208 |
- { |
|
209 |
+ }, */ |
|
210 |
+ /* { |
|
209 | 211 |
title: "설정 관리", |
210 | 212 |
icon: ( |
211 | 213 |
<SettingsIcon sx={{ fontSize: 20, marginRight: 1 }} /> |
... | ... | @@ -215,12 +217,27 @@ |
215 | 217 |
title: "위험 기준 관리", |
216 | 218 |
path: "/RiskSet", |
217 | 219 |
}, |
218 |
- /* { |
|
220 |
+ { |
|
219 | 221 |
title: "사용자 권한 관리", |
220 | 222 |
path: "/AuthorityManagement", |
221 |
- }, */ |
|
223 |
+ }, |
|
222 | 224 |
], |
225 |
+ }, */ |
|
226 |
+ { |
|
227 |
+ title: "위험 기준 관리", |
|
228 |
+ icon: ( |
|
229 |
+ <SettingsIcon sx={{ fontSize: 20, marginRight: 1 }} /> |
|
230 |
+ ), |
|
231 |
+ path: "/RiskSet" |
|
223 | 232 |
}, |
233 |
+ { |
|
234 |
+ title: "문의 현황 관리", |
|
235 |
+ icon: ( |
|
236 |
+ <ContactSupportIcon |
|
237 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
238 |
+ /> |
|
239 |
+ ), |
|
240 |
+ } |
|
224 | 241 |
]; |
225 | 242 |
function GovernmentAppRoute() { |
226 | 243 |
return ( |
... | ... | @@ -250,6 +267,7 @@ |
250 | 267 |
<Route path="/UserEdit" element={<UserEdit />}></Route> |
251 | 268 |
<Route path="/AgentSelectOne" element={<AgentSelectOne />}></Route> |
252 | 269 |
<Route path="/OrgSelect" element={<OrgSelect />}></Route> |
270 |
+ <Route path="/GovernmentEquipmentSelect" element={<GovernmentEquipmentSelect />}></Route> |
|
253 | 271 |
</Routes> |
254 | 272 |
); |
255 | 273 |
} |
... | ... | @@ -267,6 +285,13 @@ |
267 | 285 |
), |
268 | 286 |
}, |
269 | 287 |
{ |
288 |
+ title: "장비 사용 현황", |
|
289 |
+ path: "/GovernmentEquipmentSelect", |
|
290 |
+ icon: ( |
|
291 |
+ <SpeakerPhoneIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
292 |
+ ), |
|
293 |
+ }, |
|
294 |
+ { |
|
270 | 295 |
title: "건강 관리", |
271 | 296 |
path:"/Healthcare", |
272 | 297 |
icon: ( |
... | ... | @@ -278,13 +303,6 @@ |
278 | 303 |
path:"/Medicalcare", |
279 | 304 |
icon: ( |
280 | 305 |
<LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
281 |
- ), |
|
282 |
- }, |
|
283 |
- { |
|
284 |
- title: "장비 관리", |
|
285 |
- path: "/EquipmentManagementSelect", |
|
286 |
- icon: ( |
|
287 |
- <SpeakerPhoneIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
288 | 306 |
), |
289 | 307 |
}, |
290 | 308 |
{ |
... | ... | @@ -327,12 +345,8 @@ |
327 | 345 |
element={<EquipmentRentalInsert />} |
328 | 346 |
></Route> |
329 | 347 |
<Route |
330 |
- path="/EquipmentManagementSelect" |
|
331 |
- element={<EquipmentManagementSelect />} |
|
332 |
- ></Route> |
|
333 |
- <Route |
|
334 |
- path="/EquipmentManagementSelectOne" |
|
335 |
- element={<EquipmentManagementSelectOne />} |
|
348 |
+ path="/GovernmentEquipmentSelect" |
|
349 |
+ element={<GovernmentEquipmentSelect />} |
|
336 | 350 |
></Route> |
337 | 351 |
<Route |
338 | 352 |
path="/QandASelect" |
--- client/views/pages/equipment/EquipmentManagementSelect.jsx
+++ client/views/pages/equipment/EquipmentSelect.jsx
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
|
12 | 12 |
import CommonUtil from "../../../resources/js/CommonUtil.js"; |
13 | 13 |
|
14 |
-export default function EquipmentManagementSelect() { |
|
14 |
+export default function EquipmentSelect() { |
|
15 | 15 |
|
16 | 16 |
const navigate = useNavigate(); |
17 | 17 |
|
... | ... | @@ -358,8 +358,8 @@ |
358 | 358 |
}).then((response) => response.json()).then((data) => { |
359 | 359 |
console.log("장비 납품 결과(건수) : ", data); |
360 | 360 |
if (data > 0) { |
361 |
- modalDeliveryClose() |
|
362 | 361 |
alert("납품완료"); |
362 |
+ modalDeliveryClose() |
|
363 | 363 |
equipmentSearching(); |
364 | 364 |
setIsEquipmentDelivery(false); |
365 | 365 |
setTabIndex(1); |
... | ... | @@ -417,13 +417,11 @@ |
417 | 417 |
stockEquipmentSearch[key] = equipmentSearch[key]; |
418 | 418 |
deliveryEquipmentSearch[key] = equipmentSearch[key]; |
419 | 419 |
} |
420 |
+ setStockEquipmentSearch({...stockEquipmentSearch}); |
|
421 |
+ setDeliveryEquipmentSearch({...deliveryEquipmentSearch}); |
|
422 |
+ |
|
420 | 423 |
stockEquipmentSelectList(1); |
421 | 424 |
deliveryEquipmentSelectList(1); |
422 |
- |
|
423 |
- const newStockEquipmentSearch = {...stockEquipmentSearch}; |
|
424 |
- setStockEquipmentSearch(newStockEquipmentSearch); |
|
425 |
- const newDeliveryEquipmentSearch = {...deliveryEquipmentSearch}; |
|
426 |
- setDeliveryEquipmentSearch(newDeliveryEquipmentSearch); |
|
427 | 425 |
} |
428 | 426 |
const equipmentSearchingEnter = (key) => { |
429 | 427 |
if (key == 'Enter') { |
+++ client/views/pages/equipment/GovernmentEquipmentSelect.jsx
... | ... | @@ -0,0 +1,452 @@ |
1 | +import React from "react"; | |
2 | +import { useNavigate } from "react-router"; | |
3 | +import { useSelector } from "react-redux"; | |
4 | +import DetailTitle from "../../component/DetailTitle.jsx"; | |
5 | +import SubTitle from "../../component/SubTitle.jsx"; | |
6 | +import Modal from "../../component/Modal.jsx"; | |
7 | + | |
8 | +import House from "../../../resources/files/icon/house.png"; | |
9 | +import Arrow from "../../../resources/files/icon/arrow.png"; | |
10 | +import Pagination from "../../component/Pagination.jsx"; | |
11 | + | |
12 | +import CommonUtil from "../../../resources/js/CommonUtil.js"; | |
13 | + | |
14 | +export default function GovernmentEquipmentSelect() { | |
15 | + | |
16 | + const navigate = useNavigate(); | |
17 | + | |
18 | + //전역 변수 저장 객체 | |
19 | + const state = useSelector((state) => {return state}); | |
20 | + const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; | |
21 | + const defaultAgencyId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id']; | |
22 | + | |
23 | + | |
24 | + //기관 계층 구조 목록 | |
25 | + const [orgListOfHierarchy, setOrgListOfHierarchy] = React.useState([]); | |
26 | + //기관(관리, 시행) 계층 구조 목록 조회 | |
27 | + const orgSelectListOfHierarchy = () => { | |
28 | + fetch("/org/orgSelectListOfHierarchy.json", { | |
29 | + method: "POST", | |
30 | + headers: { | |
31 | + 'Content-Type': 'application/json; charset=UTF-8' | |
32 | + }, | |
33 | + body: JSON.stringify({ | |
34 | + 'government_id': defaultGovernmentId, | |
35 | + 'agency_id': defaultAgencyId | |
36 | + }), | |
37 | + }).then((response) => response.json()).then((data) => { | |
38 | + console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); | |
39 | + setOrgListOfHierarchy(data); | |
40 | + }).catch((error) => { | |
41 | + console.log('orgSelectListOfHierarchy() /org/orgSelectListOfHierarchy.json error : ', error); | |
42 | + }); | |
43 | + }; | |
44 | + //검색 변수 (초기화값) | |
45 | + const [org, setOrg] = React.useState({ | |
46 | + 'government_id': defaultGovernmentId, | |
47 | + 'agency_id': defaultAgencyId, | |
48 | + }); | |
49 | + //올잇메디 선택 | |
50 | + const adminChange = () => { | |
51 | + org['government_id'] = null; | |
52 | + org['agency_id'] = null; | |
53 | + setOrg({...org}); | |
54 | + } | |
55 | + //관리 기관 선택 | |
56 | + const governmentChange = (government_id) => { | |
57 | + org['government_id'] = government_id; | |
58 | + org['agency_id'] = null; | |
59 | + setOrg({...org}); | |
60 | + rentalEquipmentSelectList(1); | |
61 | + } | |
62 | + //시행 기관 선택 | |
63 | + const agencyChange = (government_id, agency_id) => { | |
64 | + org['government_id'] = government_id; | |
65 | + org['agency_id'] = agency_id; | |
66 | + setOrg({...org}); | |
67 | + rentalEquipmentSelectList(1); | |
68 | + } | |
69 | + | |
70 | + | |
71 | + | |
72 | + // 시스템 코드 - 장비 상태 | |
73 | + const [equipmentStates, setEquipmentStates] = React.useState({}); | |
74 | + // 시스템 코드 - 장비 상태 조회 | |
75 | + const equipmentStatesSelect = () => { | |
76 | + console.log('equipmentStatesSelect Function Run'); | |
77 | + | |
78 | + //fetch post | |
79 | + fetch("/common/systemCode/equipmentStatesSelect.json", { | |
80 | + method: "POST", | |
81 | + headers: { | |
82 | + 'Content-Type': 'application/json; charset=UTF-8' | |
83 | + }, | |
84 | + body: JSON.stringify({}) | |
85 | + }).then((response) => response.json()).then((data) => { | |
86 | + console.log('equipmentStatesSelect response : ', data); | |
87 | + setEquipmentStates(data); | |
88 | + }).catch((error) => { | |
89 | + console.log('equipmentStatesSelect error : ', error); | |
90 | + }); | |
91 | + } | |
92 | + | |
93 | + | |
94 | + | |
95 | + | |
96 | + //공통 검색 정보 | |
97 | + const [equipmentSearch, setEquipmentSearch] = React.useState({ | |
98 | + 'equipment_state': null, | |
99 | + | |
100 | + 'searchType': null, | |
101 | + 'searchText': null, | |
102 | + }); | |
103 | + //장비 정보 변경 | |
104 | + const equipmentSearchChange = (targetKey, value) => { | |
105 | + equipmentSearch[targetKey] = value; | |
106 | + setEquipmentSearch({...equipmentSearch}); | |
107 | + } | |
108 | + //장비 검색 | |
109 | + const equipmentSearching = () => { | |
110 | + for (const key in equipmentSearch) { | |
111 | + deliveryEquipmentSearch[key] = equipmentSearch[key]; | |
112 | + rentalEquipmentSearch[key] = equipmentSearch[key]; | |
113 | + } | |
114 | + setDeliveryEquipmentSearch({...deliveryEquipmentSearch}); | |
115 | + setRentalEquipmentSearch({...rentalEquipmentSearch}); | |
116 | + | |
117 | + deliveryEquipmentSelectList(1); | |
118 | + rentalEquipmentSelectList(1); | |
119 | + } | |
120 | + const equipmentSearchingEnter = (key) => { | |
121 | + if (key == 'Enter') { | |
122 | + equipmentSearching(); | |
123 | + } else { | |
124 | + return; | |
125 | + } | |
126 | + } | |
127 | + | |
128 | + //입고 및 미대여 장비 검색 정보 | |
129 | + const [deliveryEquipmentSearch, setDeliveryEquipmentSearch] = React.useState({ | |
130 | + 'government_id': defaultGovernmentId, | |
131 | + 'senior_id': 'IS_NULL', | |
132 | + 'currentPage': 1, | |
133 | + 'perPage': 10, | |
134 | + }); | |
135 | + //입고 및 미대여 목록 | |
136 | + const [deliveryEquipment, setDeliveryEquipment] = React.useState({equipmentList: [], equipmentListCount: 0}); | |
137 | + //입고 및 미대여 목록 조회 | |
138 | + const deliveryEquipmentSelectList = (currentPage) => { | |
139 | + deliveryEquipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
140 | + setDeliveryEquipmentSearch({...deliveryEquipmentSearch}); | |
141 | + | |
142 | + fetch("/equipment/equipmentSelectList.json", { | |
143 | + method: "POST", | |
144 | + headers: { | |
145 | + 'Content-Type': 'application/json; charset=UTF-8' | |
146 | + }, | |
147 | + body: JSON.stringify(deliveryEquipmentSearch) | |
148 | + }).then((response) => response.json()).then((data) => { | |
149 | + console.log('deliveryEquipmentSelectList response : ', data); | |
150 | + setDeliveryEquipment(data); | |
151 | + }).catch((error) => { | |
152 | + console.log('deliveryEquipmentSelectList error : ', error); | |
153 | + }); | |
154 | + } | |
155 | + | |
156 | + | |
157 | + //입고 및 미대여 장비 검색 정보 | |
158 | + const [rentalEquipmentSearch, setRentalEquipmentSearch] = React.useState({ | |
159 | + 'government_id': defaultGovernmentId, | |
160 | + 'agency_id': org['agency_id'], | |
161 | + 'senior_id': 'IS_NOT_NULL', | |
162 | + 'currentPage': 1, | |
163 | + 'perPage': 10, | |
164 | + }); | |
165 | + //입고 및 미대여 목록 | |
166 | + const [rentalEquipment, setRentalEquipment] = React.useState({equipmentList: [], equipmentListCount: 0}); | |
167 | + //입고 및 미대여 목록 조회 | |
168 | + const rentalEquipmentSelectList = (currentPage) => { | |
169 | + rentalEquipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
170 | + rentalEquipmentSearch['agency_id'] = org['agency_id']; | |
171 | + setRentalEquipmentSearch({...rentalEquipmentSearch}); | |
172 | + | |
173 | + fetch("/equipment/equipmentSelectList.json", { | |
174 | + method: "POST", | |
175 | + headers: { | |
176 | + 'Content-Type': 'application/json; charset=UTF-8' | |
177 | + }, | |
178 | + body: JSON.stringify(rentalEquipmentSearch) | |
179 | + }).then((response) => response.json()).then((data) => { | |
180 | + console.log('rentalEquipmentSelectList response : ', data); | |
181 | + setRentalEquipment(data); | |
182 | + }).catch((error) => { | |
183 | + console.log('rentalEquipmentSelectList error : ', error); | |
184 | + }); | |
185 | + } | |
186 | + | |
187 | + | |
188 | + //Mounted | |
189 | + React.useEffect(() => { | |
190 | + orgSelectListOfHierarchy(); | |
191 | + equipmentStatesSelect(); | |
192 | + equipmentSearching(); | |
193 | + }, []); | |
194 | + | |
195 | + | |
196 | + //대여(사용) 중 장비 목록 내용 | |
197 | + const rentalContent = ( | |
198 | + <> | |
199 | + <table class="caregiver-user protector-user"> | |
200 | + <thead> | |
201 | + <tr> | |
202 | + <th>No </th> | |
203 | + <th>모델명</th> | |
204 | + <th>시리얼넘버</th> | |
205 | + <th>입고일자</th> | |
206 | + <th>장비상태</th> | |
207 | + <th>기관</th> | |
208 | + <th>대여시행자</th> | |
209 | + <th>대여일</th> | |
210 | + <th>장비사용대상자</th> | |
211 | + </tr> | |
212 | + </thead> | |
213 | + <tbody> | |
214 | + {rentalEquipment.equipmentList.map((item, idx) => { return ( | |
215 | + <tr> | |
216 | + <td data-label="No">{rentalEquipment.equipmentListCount - idx - (rentalEquipmentSearch.currentPage - 1) * rentalEquipmentSearch.perPage}</td> | |
217 | + <td data-label="모델명">{item['equipment_name']}</td> | |
218 | + <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> | |
219 | + <td data-label="입고일자">{item['equipment_stock_date']}</td> | |
220 | + <td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td> | |
221 | + <td>{item['agency_name']}</td> | |
222 | + <td data-label="대여시행자"> | |
223 | + {item['rental_detail_insert_user_name']} | |
224 | + ({item['rental_detail_insert_user_id']}) | |
225 | + </td> | |
226 | + <td data-label="대여일">{item['rental_start_date']}</td> | |
227 | + <td data-label="장비사용대상자">{item['user_name']}</td> | |
228 | + </tr> | |
229 | + )})} | |
230 | + {CommonUtil.isEmpty(rentalEquipment.equipmentList) ? | |
231 | + <tr> | |
232 | + <td colSpan={9}>조회된 데이터가 없습니다</td> | |
233 | + </tr> | |
234 | + : null} | |
235 | + </tbody> | |
236 | + </table> | |
237 | + <Pagination | |
238 | + currentPage={rentalEquipmentSearch.currentPage} | |
239 | + perPage={rentalEquipmentSearch.perPage} | |
240 | + totalCount={rentalEquipment.equipmentListCount} | |
241 | + maxRange={5} | |
242 | + click={rentalEquipmentSelectList} | |
243 | + /> | |
244 | + </> | |
245 | + ); | |
246 | + //현재 탭 Index | |
247 | + const [tabIndex, setTabIndex] = React.useState(0); | |
248 | + //탭 초기화 | |
249 | + const tab = [{ | |
250 | + title: `사용가능 장비 (${deliveryEquipment.equipmentListCount})`, | |
251 | + content: ( | |
252 | + <div> | |
253 | + <div className="flex equip-tab"> | |
254 | + <SubTitle explanation={"현재 기관에 입고된 장비 중 돌봄 대상자에게 대여하지 않은 장비 목록입니다."} /> | |
255 | + <div className="btn-wrap flex-end margin-bottom "> | |
256 | + <button className={"btn-small gray-btn"} | |
257 | + onClick={() => navigate("/UserSelect", {state: { | |
258 | + 'government_id': defaultGovernmentId, | |
259 | + 'agency_id': null, | |
260 | + 'tabActiveByRoleType': 'ROLE_SENIOR', | |
261 | + }})}>대상자에게 장비대여</button> | |
262 | + </div> | |
263 | + </div> | |
264 | + <table class="caregiver-user protector-user"> | |
265 | + <thead> | |
266 | + <tr> | |
267 | + <th>No </th> | |
268 | + <th>모델명</th> | |
269 | + <th>시리얼넘버</th> | |
270 | + <th>입고일자</th> | |
271 | + <th>장비상태</th> | |
272 | + </tr> | |
273 | + </thead> | |
274 | + <tbody> | |
275 | + {deliveryEquipment.equipmentList.map((item, idx) => { return ( | |
276 | + <tr> | |
277 | + <td data-label="No">{deliveryEquipment.equipmentListCount - idx - (deliveryEquipmentSearch.currentPage - 1) * deliveryEquipmentSearch.perPage}</td> | |
278 | + <td data-label="모델명">{item['equipment_name']}</td> | |
279 | + <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> | |
280 | + <td data-label="입고일자">{item['equipment_stock_date']}</td> | |
281 | + <td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td> | |
282 | + </tr> | |
283 | + )})} | |
284 | + {CommonUtil.isEmpty(deliveryEquipment.equipmentList) ? | |
285 | + <tr> | |
286 | + <td colSpan={5}>조회된 데이터가 없습니다</td> | |
287 | + </tr> | |
288 | + : null} | |
289 | + </tbody> | |
290 | + </table> | |
291 | + <Pagination | |
292 | + currentPage={deliveryEquipmentSearch.currentPage} | |
293 | + perPage={deliveryEquipmentSearch.perPage} | |
294 | + totalCount={deliveryEquipment.equipmentListCount} | |
295 | + maxRange={5} | |
296 | + click={deliveryEquipmentSelectList} | |
297 | + /> | |
298 | + </div> | |
299 | + ) | |
300 | + }, { | |
301 | + title: `사용중인 장비 (${rentalEquipment.equipmentListCount})`, | |
302 | + content: ( | |
303 | + <div> | |
304 | + | |
305 | + <div className="flex-align-start userauthoriylist gap5"> | |
306 | + <div className="left"> | |
307 | + <SubTitle explanation={"기관 리스트"}/> | |
308 | + <div style={{fontSize: '16px', marginTop: '0px'}} className="category"> | |
309 | + {/* {state.loginUser['authority'] == 'ROLE_ADMIN' ? | |
310 | + <a onClick={adminChange} | |
311 | + className={org['government_id'] == null && org['agency_id'] == null ? "active" : ""}> | |
312 | + 올잇메디 | |
313 | + </a> | |
314 | + : null} */} | |
315 | + <ul style={{marginLeft: '15px'}}> | |
316 | + {orgListOfHierarchy.map((item, idx) => { return ( | |
317 | + <li style={{margin: '10px 0px'}} key={idx}> | |
318 | + <span style={{marginRight: '5px'}}><img src={House} alt="" /></span> | |
319 | + <a onClick={() => {governmentChange(item['government_id'])}} | |
320 | + className={item['government_id'] == org['government_id'] ? "active" : ""}> | |
321 | + {item['government_name']} | |
322 | + </a> | |
323 | + {item['agencyList'] != undefined && item['agencyList'] != null ? | |
324 | + <ul style={{marginLeft: '15px'}}> | |
325 | + {item['agencyList'].map((item2, idx2) => { return ( | |
326 | + <li style={{margin: '10px 0px'}} key={idx2}> | |
327 | + <span style={{marginRight: '5px'}}><img src={Arrow} alt="" /></span> | |
328 | + <a onClick={() => {agencyChange(item['government_id'], item2['agency_id'])}} | |
329 | + className={item2['agency_id'] == org['agency_id'] ? "active" : ""}> | |
330 | + {item2['agency_name']} | |
331 | + </a> | |
332 | + </li> | |
333 | + )})} | |
334 | + </ul> | |
335 | + : null | |
336 | + } | |
337 | + </li> | |
338 | + )})} | |
339 | + </ul> | |
340 | + </div> | |
341 | + </div> | |
342 | + <div className="right"> | |
343 | + <div className="flex equip-tab"> | |
344 | + <SubTitle explanation={"선택한 기관의 돌봄 대상자가 사용중인 장비 목록입니다."} /> | |
345 | + <div className="btn-wrap flex-end margin-bottom "> | |
346 | + {/* <button className={"btn-small gray-btn"} onClick={() => {modalEquipmentOpen()}}>등록</button> */} | |
347 | + </div> | |
348 | + </div> | |
349 | + {rentalContent} | |
350 | + </div> | |
351 | + </div> | |
352 | + </div> | |
353 | + ) | |
354 | + }]; | |
355 | + | |
356 | + | |
357 | + return ( | |
358 | + <main> | |
359 | + | |
360 | + {/* <Modal open={modalDeliveryIsOpen} close={modalDeliveryClose} header="납품 기관 선택"> | |
361 | + <div className="board-wrap"> | |
362 | + <div> | |
363 | + <div style={{textAlign:'left', fontSize: '16px',margin:'2rem 0'}} className="category"> | |
364 | + <div className="search-management flex-end margin-bottom2 margin-top"> | |
365 | + <div style={{width: '90px', fontWeight: '600'}}>납품일자</div> | |
366 | + <input type="date" | |
367 | + value={equipmentDelivery['delivery_date']} | |
368 | + onChange={(e) => { | |
369 | + equipmentDelivery['delivery_date'] = e.target.value; | |
370 | + setEquipmentDelivery({...equipmentDelivery})} | |
371 | + }/> | |
372 | + </div> | |
373 | + <ul style={{marginLeft: '15px'}}> | |
374 | + {orgListOfHierarchy.map((item, idx) => { return ( | |
375 | + <li style={{margin: '10px 0px'}} key={idx}> | |
376 | + <span style={{marginRight: '5px'}}><img src={House} alt="" /></span> | |
377 | + <a>{item['government_name']}</a> | |
378 | + <button onClick={() => { | |
379 | + if (confirm(`'${item['government_name']}'에 장비를 납품하시겠습니까?`)) { | |
380 | + equipmentDeliveryInsert(item['government_id']) | |
381 | + } else { | |
382 | + return; | |
383 | + } | |
384 | + }}>선택</button> | |
385 | + </li> | |
386 | + )})} | |
387 | + </ul> | |
388 | + </div> | |
389 | + </div> | |
390 | + </div> | |
391 | + </Modal> */} | |
392 | + | |
393 | + | |
394 | + <div className="search-management flex-end margin-bottom2 margin-top gap"> | |
395 | + <select style={{maxWidth: '150px'}} | |
396 | + onChange={(e) => equipmentSearchChange('equipment_state', e.target.value)}> | |
397 | + <option value="">상태</option> | |
398 | + {Object.keys(equipmentStates).map((key, idx) => { return ( | |
399 | + <option key={key} value={key}> | |
400 | + {equipmentStates[key]} | |
401 | + </option> | |
402 | + )})} | |
403 | + </select> | |
404 | + <select style={{maxWidth: '150px'}} | |
405 | + onChange={(e) => equipmentSearchChange('searchType', e.target.value)}> | |
406 | + <option value="">전체</option> | |
407 | + <option value="equipment_name">모델명</option> | |
408 | + <option value="equipment_serial_number">시리얼넘버</option> | |
409 | + </select> | |
410 | + <input type="text" | |
411 | + value={equipmentSearch.searchText} | |
412 | + onChange={(e) => equipmentSearchChange('searchText', e.target.value)} | |
413 | + onKeyUp={(e) => equipmentSearchingEnter(e.key)} | |
414 | + /> | |
415 | + <button className={"btn-small gray-btn"} style={{maxWidth: '150px'}} onClick={equipmentSearching}>검색</button> | |
416 | + </div> | |
417 | + | |
418 | + {CommonUtil.isEmpty(state.loginUser) == false && (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') | |
419 | + ? ( | |
420 | + <div className="tab-container"> | |
421 | + <ul className="tab-menu flex-start"> | |
422 | + {tab.map((item, idx) => { return ( | |
423 | + <li onClick={() => setTabIndex(idx)} className={idx == tabIndex ? 'active' : null}> | |
424 | + {item.title} | |
425 | + </li> | |
426 | + )})} | |
427 | + </ul> | |
428 | + <div className="content-wrap"> | |
429 | + <ul className="tab-content"> | |
430 | + <li> | |
431 | + {tab[tabIndex].content} | |
432 | + </li> | |
433 | + </ul> | |
434 | + </div> | |
435 | + </div> | |
436 | + ) : ( | |
437 | + <div className="content-wrap"> | |
438 | + <DetailTitle contentTitle={"장비 사용 현황"} /> | |
439 | + <div className="board-wrap" style={{ marginTop: "3rem" }} > | |
440 | + <div className="btn-wrap margin-bottom"> | |
441 | + <div className="btn-wrap flex-end margin-bottom "> | |
442 | + <button className={"btn-small gray-btn"} onClick={() => navigate("/AgencySeniorSelect")}>대상자 관리</button> | |
443 | + </div> | |
444 | + {rentalContent} | |
445 | + </div> | |
446 | + </div> | |
447 | + </div> | |
448 | + ) | |
449 | + } | |
450 | + </main> | |
451 | + ); | |
452 | +} |
--- client/views/pages/join/Join.jsx
+++ client/views/pages/join/Join.jsx
... | ... | @@ -8,20 +8,30 @@ |
8 | 8 |
export default function Join() { |
9 | 9 |
const navigate = useNavigate(); |
10 | 10 |
const location = useLocation(); |
11 |
- let defaultAuthority = CommonUtil.isEmpty(location.state) ? null : location.state['authority']; |
|
12 |
- let defaultAgencyId = CommonUtil.isEmpty(location.state) ? null : location.state['agency_id']; |
|
13 |
- let defaultGovernmentId = CommonUtil.isEmpty(location.state) ? null :location.state['government_id']; |
|
11 |
+ const state = useSelector((state) => {return state}); |
|
12 |
+ |
|
13 |
+ let defaultAuthority = null; |
|
14 |
+ let defaultAgencyId = null; |
|
15 |
+ let defaultGovernmentId = null; |
|
16 |
+ console.log('location.state : ', location.state); |
|
17 |
+ console.log('state.loginUser : ', state.loginUser); |
|
18 |
+ if (CommonUtil.isEmpty(location.state) == false) { |
|
19 |
+ defaultAuthority = location.state['authority']; |
|
20 |
+ defaultAgencyId = location.state['agency_id']; |
|
21 |
+ defaultGovernmentId = location.state['government_id']; |
|
22 |
+ } else if (CommonUtil.isEmpty(state.loginUser) == false) { |
|
23 |
+ defaultAuthority = state.loginUser['authority']; |
|
24 |
+ defaultAgencyId = state.loginUser['agency_id']; |
|
25 |
+ defaultGovernmentId = state.loginUser['government_id']; |
|
26 |
+ } else { |
|
27 |
+ defaultAuthority = null; |
|
28 |
+ defaultAgencyId = null; |
|
29 |
+ defaultGovernmentId = null; |
|
30 |
+ } |
|
14 | 31 |
|
15 | 32 |
|
16 | 33 |
|
17 | 34 |
/**** 기본 조회 데이터 (시작) ****/ |
18 |
- //전역 변수 저장 객체 |
|
19 |
- const state = useSelector((state) => {return state}); |
|
20 |
- defaultAuthority = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['authority']; |
|
21 |
- defaultAgencyId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id']; |
|
22 |
- defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null :state.loginUser['government_id']; |
|
23 |
- |
|
24 |
- |
|
25 | 35 |
//권한 타입 종류 |
26 | 36 |
const [authorities, setAuthorities] = React.useState([]); |
27 | 37 |
//권한 타입 종류 목록 조회 |
... | ... | @@ -43,12 +53,20 @@ |
43 | 53 |
const [orgListOfHierarchy, setOrgListOfHierarchy] = React.useState([]); |
44 | 54 |
//기관(관리, 시행) 계층 구조 목록 조회 |
45 | 55 |
const orgSelectListOfHierarchy = () => { |
56 |
+ const param = { |
|
57 |
+ 'government_id': defaultGovernmentId, |
|
58 |
+ 'agency_id': defaultAgencyId |
|
59 |
+ }; |
|
60 |
+ if (CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_ADMIN') { |
|
61 |
+ param['government_id'] = null; |
|
62 |
+ param['agency_id'] = null; |
|
63 |
+ } |
|
46 | 64 |
fetch("/org/orgSelectListOfHierarchy.json", { |
47 | 65 |
method: "POST", |
48 | 66 |
headers: { |
49 | 67 |
'Content-Type': 'application/json; charset=UTF-8' |
50 | 68 |
}, |
51 |
- body: JSON.stringify({'government_id': defaultGovernmentId}), |
|
69 |
+ body: JSON.stringify(param), |
|
52 | 70 |
}).then((response) => response.json()).then((data) => { |
53 | 71 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
54 | 72 |
setOrgListOfHierarchy(data); |
... | ... | @@ -275,11 +293,17 @@ |
275 | 293 |
<div> |
276 | 294 |
<div className="flex-start margin-bottom2"> |
277 | 295 |
<label className="flex25"><span style={{color : "red"}}>*</span>사용자구분</label> |
278 |
- <select name="division" id="section" onChange={(e) => {userAuthorityChange(e.target.value)}}> |
|
279 |
- {CommonUtil.isEmpty(defaultAuthority) == true || defaultAuthority == 'ROLE_ADMIN' ? |
|
296 |
+ <select name="division" id="section" |
|
297 |
+ disabled={ |
|
298 |
+ CommonUtil.isEmpty(state.loginUser) == false |
|
299 |
+ && state.loginUser['authority'] != 'ROLE_ADMIN' |
|
300 |
+ && state.loginUser['authority'] != 'ROLE_GOVERNMENT' |
|
301 |
+ } |
|
302 |
+ onChange={(e) => {userAuthorityChange(e.target.value)}}> |
|
303 |
+ {CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_ADMIN' ? |
|
280 | 304 |
<option value="ROLE_ADMIN" selected={user['authority'] == "ROLE_ADMIN"}>시스템 관리자</option> |
281 | 305 |
: null} |
282 |
- {CommonUtil.isEmpty(defaultAuthority) == true || defaultAuthority == 'ROLE_ADMIN' || defaultAuthority == 'ROLE_GOVERNMENT' ? |
|
306 |
+ {CommonUtil.isEmpty(state.loginUser) == false && (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') ? |
|
283 | 307 |
<option value="ROLE_GOVERNMENT" selected={user['authority'] == "ROLE_GOVERNMENT"}>기관 관리자</option> |
284 | 308 |
: null} |
285 | 309 |
<option value="ROLE_AGENCY" selected={user['authority'] == "ROLE_AGENCY"}>보호사</option> |
... | ... | @@ -291,7 +315,14 @@ |
291 | 315 |
<div> |
292 | 316 |
<div className="flex-start margin-bottom2"> |
293 | 317 |
<label className="flex25" htmlFor="name"><span style={{color : "red"}}>*</span>관리기관</label> |
294 |
- <select onChange={(e) => {userGovernmentIdChange(e.target.value)}} ref={el => userRef.current['government_id'] = el}> |
|
318 |
+ <select |
|
319 |
+ disabled={ |
|
320 |
+ CommonUtil.isEmpty(state.loginUser) == false |
|
321 |
+ && state.loginUser['authority'] != 'ROLE_ADMIN' |
|
322 |
+ && state.loginUser['authority'] != 'ROLE_GOVERNMENT' |
|
323 |
+ } |
|
324 |
+ onChange={(e) => {userGovernmentIdChange(e.target.value)}} |
|
325 |
+ ref={el => userRef.current['government_id'] = el}> |
|
295 | 326 |
<option value={''} selected={user['government_id'] == null}>관리기관선택</option> |
296 | 327 |
{orgListOfHierarchy.map((item, idx) => { return ( |
297 | 328 |
<option key={idx} value={item['government_id']} selected={user['government_id'] == item['government_id']}> |
... | ... | @@ -307,7 +338,14 @@ |
307 | 338 |
<div> |
308 | 339 |
<div className="flex-start margin-bottom2"> |
309 | 340 |
<label className="flex25" htmlFor="name"><span style={{color : "red"}}>*</span>시행기관</label> |
310 |
- <select onChange={(e) => {userAgencyIdChange(e.target.value)}} ref={el => userRef.current['agency_id'] = el}> |
|
341 |
+ <select |
|
342 |
+ disabled={ |
|
343 |
+ CommonUtil.isEmpty(state.loginUser['authority']) == false |
|
344 |
+ && state.loginUser['authority'] != 'ROLE_ADMIN' |
|
345 |
+ && state.loginUser['authority'] != 'ROLE_GOVERNMENT' |
|
346 |
+ } |
|
347 |
+ onChange={(e) => {userAgencyIdChange(e.target.value)}} |
|
348 |
+ ref={el => userRef.current['agency_id'] = el}> |
|
311 | 349 |
<option value={''} selected={user['agency_id'] == null}>시행기관선택</option> |
312 | 350 |
{getAgencyList().map((item, idx) => { return ( |
313 | 351 |
<option key={idx} value={item['agency_id']} selected={user['agency_id'] == item['agency_id']}> |
--- client/views/pages/main/Main_agency.jsx
+++ client/views/pages/main/Main_agency.jsx
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 |
<li className="flex-start"> |
50 | 50 |
<img src={box} alt="" /> |
51 | 51 |
<div className="text"> |
52 |
- <p>나의 관리 대상자</p> |
|
52 |
+ <p>나의 돌봄 대상자</p> |
|
53 | 53 |
<p className="peoplecount">40</p> |
54 | 54 |
</div> |
55 | 55 |
</li> |
--- client/views/pages/org/OrgSelect.jsx
+++ client/views/pages/org/OrgSelect.jsx
... | ... | @@ -403,7 +403,7 @@ |
403 | 403 |
|
404 | 404 |
//사용자 관리 페이지 이동 |
405 | 405 |
const userManagementPage = (governmentId, agencyId, auth) => { |
406 |
- navigate("/UserAuthoriySelect", {state: { |
|
406 |
+ navigate("/UserSelect", {state: { |
|
407 | 407 |
'government_id': governmentId, |
408 | 408 |
'agency_id': agencyId, |
409 | 409 |
'tabActiveByRoleType': auth, |
... | ... | @@ -580,7 +580,7 @@ |
580 | 580 |
<th>관리장비개수</th> |
581 | 581 |
<th>관리자(명)</th> |
582 | 582 |
<th>보호사(명)</th> |
583 |
- <th>관리대상자(명)</th> |
|
583 |
+ <th>돌봄 대상자(명)</th> |
|
584 | 584 |
<th>주소</th> |
585 | 585 |
<th>대표연락처</th> |
586 | 586 |
{state.loginUser['authority'] == 'ROLE_ADMIN' ? |
... | ... | @@ -600,7 +600,7 @@ |
600 | 600 |
<td data-label="관리 장비 개수">{item['equipment_count']}</td> |
601 | 601 |
<td data-label="관리자(명)">{item['government_user_count']}</td> |
602 | 602 |
<td data-label="보호사(명)">{item['agent_user_count']}</td> |
603 |
- <td data-label="관리 대상자(명)">{item['senior_user_count']}</td> |
|
603 |
+ <td data-label="돌봄 대상자(명)">{item['senior_user_count']}</td> |
|
604 | 604 |
<td data-label="주소">{item['government_address']}</td> |
605 | 605 |
<td data-label="대표 연락처">{item['government_phonenumber']}</td> |
606 | 606 |
{state.loginUser['authority'] == 'ROLE_ADMIN' ? |
... | ... | @@ -687,7 +687,7 @@ |
687 | 687 |
<th>관리기관명</th> |
688 | 688 |
<th>기관명</th> |
689 | 689 |
<th>보호사(명)</th> |
690 |
- <th>관리대상자(명)</th> |
|
690 |
+ <th>돌봄 대상자(명)</th> |
|
691 | 691 |
<th>주소</th> |
692 | 692 |
<th>대표연락처</th> |
693 | 693 |
{/* <th>장비관리</th> */} |
... | ... | @@ -703,7 +703,7 @@ |
703 | 703 |
<td data-label="관리기관명">{item['government_name']}</td> |
704 | 704 |
<td data-label="기관명">{item['agency_name']}</td> |
705 | 705 |
<td data-label="보호사(명)">{item['agent_user_count']}</td> |
706 |
- <td data-label="관리 대상자(명)">{item['senior_user_count']}</td> |
|
706 |
+ <td data-label="돌봄 대상자(명)">{item['senior_user_count']}</td> |
|
707 | 707 |
<td data-label="주소">{item['agency_address']}</td> |
708 | 708 |
<td data-label="대표 연락처">{item['agency_phonenumber']}</td> |
709 | 709 |
{/* <td> |
--- client/views/pages/senior_management/SeniorSelectOne.jsx
+++ client/views/pages/senior_management/SeniorSelectOne.jsx
... | ... | @@ -1,8 +1,12 @@ |
1 | 1 |
import React from "react"; |
2 | 2 |
import { useNavigate, useLocation } from "react-router"; |
3 | 3 |
|
4 |
+import Modal from "../../component/Modal.jsx"; |
|
4 | 5 |
import SubTitle from "../../component/SubTitle.jsx"; |
5 | 6 |
import Modal_Guardian from "../../component/Modal_Guardian.jsx"; |
7 |
+import Pagination from "../../component/Pagination.jsx"; |
|
8 |
+ |
|
9 |
+import CommonUtil from "../../../resources/js/CommonUtil.js"; |
|
6 | 10 |
|
7 | 11 |
|
8 | 12 |
export default function SeniorSelectOne() { |
... | ... | @@ -39,6 +43,114 @@ |
39 | 43 |
} |
40 | 44 |
|
41 | 45 |
|
46 |
+ //장비 대여 모달 여부 |
|
47 |
+ const [modalRentalIsOpen, setModalRentalIsOpen] = React.useState(false); |
|
48 |
+ //장비 대여 오픈 |
|
49 |
+ const modalRentalOpen = () => { |
|
50 |
+ setModalRentalIsOpen(true); |
|
51 |
+ }; |
|
52 |
+ //장비 대여 닫기 |
|
53 |
+ const modalRentalClose = () => { |
|
54 |
+ setModalRentalIsOpen(false); |
|
55 |
+ }; |
|
56 |
+ |
|
57 |
+ // 시스템 코드 - 장비 상태 |
|
58 |
+ const [equipmentStates, setEquipmentStates] = React.useState({}); |
|
59 |
+ // 시스템 코드 - 장비 상태 조회 |
|
60 |
+ const equipmentStatesSelect = () => { |
|
61 |
+ console.log('equipmentStatesSelect Function Run'); |
|
62 |
+ |
|
63 |
+ //fetch post |
|
64 |
+ fetch("/common/systemCode/equipmentStatesSelect.json", { |
|
65 |
+ method: "POST", |
|
66 |
+ headers: { |
|
67 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
68 |
+ }, |
|
69 |
+ body: JSON.stringify({}) |
|
70 |
+ }).then((response) => response.json()).then((data) => { |
|
71 |
+ console.log('equipmentStatesSelect response : ', data); |
|
72 |
+ setEquipmentStates(data); |
|
73 |
+ }).catch((error) => { |
|
74 |
+ console.log('equipmentStatesSelect error : ', error); |
|
75 |
+ }); |
|
76 |
+ } |
|
77 |
+ |
|
78 |
+ //입고 및 미대여 장비 검색 정보 |
|
79 |
+ const [deliveryEquipmentSearch, setDeliveryEquipmentSearch] = React.useState({ |
|
80 |
+ 'government_id': location.state['government_id'], |
|
81 |
+ 'senior_id': 'IS_NULL', |
|
82 |
+ 'currentPage': 1, |
|
83 |
+ 'perPage': 10, |
|
84 |
+ }); |
|
85 |
+ //입고 및 미대여 목록 |
|
86 |
+ const [deliveryEquipment, setDeliveryEquipment] = React.useState({equipmentList: [], equipmentListCount: 0}); |
|
87 |
+ //입고 및 미대여 목록 조회 |
|
88 |
+ const deliveryEquipmentSelectList = (currentPage) => { |
|
89 |
+ deliveryEquipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; |
|
90 |
+ setDeliveryEquipmentSearch({...deliveryEquipmentSearch}); |
|
91 |
+ |
|
92 |
+ fetch("/equipment/equipmentSelectList.json", { |
|
93 |
+ method: "POST", |
|
94 |
+ headers: { |
|
95 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
96 |
+ }, |
|
97 |
+ body: JSON.stringify(deliveryEquipmentSearch) |
|
98 |
+ }).then((response) => response.json()).then((data) => { |
|
99 |
+ console.log('deliveryEquipmentSelectList response : ', data); |
|
100 |
+ setDeliveryEquipment(data); |
|
101 |
+ }).catch((error) => { |
|
102 |
+ console.log('deliveryEquipmentSelectList error : ', error); |
|
103 |
+ }); |
|
104 |
+ } |
|
105 |
+ |
|
106 |
+ |
|
107 |
+ //장비 대여 등록 정보 |
|
108 |
+ const [equipmentRental, setEquipmentRental] = React.useState({ |
|
109 |
+ 'senior_id': location.state['senior_id'], |
|
110 |
+ 'rental_idx': 0, |
|
111 |
+ 'rental_start_date': CommonUtil.getDate(), |
|
112 |
+ 'rental_end_date': null, |
|
113 |
+ 'rental_return_date': null |
|
114 |
+ }); |
|
115 |
+ |
|
116 |
+ //장비 대여 등록 |
|
117 |
+ const equipmentRentalInsert = (equipment) => { |
|
118 |
+ if (CommonUtil.isEmpty(equipmentRental['rental_start_date'])) { |
|
119 |
+ alert("대여 시작일을 선택해 주세요."); |
|
120 |
+ return; |
|
121 |
+ } |
|
122 |
+ if (confirm('해당 장비를 추가하시겠습니까?') == false) { |
|
123 |
+ return; |
|
124 |
+ } |
|
125 |
+ |
|
126 |
+ equipment['senior_id'] = location.state['senior_id']; |
|
127 |
+ equipment['rental_start_date'] = equipmentRental['rental_start_date']; |
|
128 |
+ |
|
129 |
+ fetch("/equipment/equipmentRentalInsert.json", { |
|
130 |
+ method: "POST", |
|
131 |
+ headers: { |
|
132 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
133 |
+ }, |
|
134 |
+ body: JSON.stringify(equipment), |
|
135 |
+ }).then((response) => response.json()).then((data) => { |
|
136 |
+ console.log("장비 대여 등록 결과(건수) : ", data); |
|
137 |
+ if (data > 0) { |
|
138 |
+ alert("추가완료"); |
|
139 |
+ modalRentalClose(); |
|
140 |
+ equipmentSelectListBySenior(); |
|
141 |
+ deliveryEquipmentSelectList(1); |
|
142 |
+ } else { |
|
143 |
+ alert("장비추가에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
144 |
+ } |
|
145 |
+ }).catch((error) => { |
|
146 |
+ console.log('seniorSelectOne() /user/seniorSelectOne.json error : ', error); |
|
147 |
+ }); |
|
148 |
+ }; |
|
149 |
+ |
|
150 |
+ |
|
151 |
+ |
|
152 |
+ |
|
153 |
+ |
|
42 | 154 |
//시니어 정보 |
43 | 155 |
const [senior, setSenior] = React.useState({ |
44 | 156 |
'user_id': location.state['senior_id'], |
... | ... | @@ -50,8 +162,8 @@ |
50 | 162 |
'user_address': null, |
51 | 163 |
'user_email': null, |
52 | 164 |
'authority': 'ROLE_SENIOR', |
53 |
- 'agency_id': null, |
|
54 |
- 'government_id': null, |
|
165 |
+ 'agency_id': location.state['agency_id'], |
|
166 |
+ 'government_id': location.state['government_id'], |
|
55 | 167 |
|
56 | 168 |
'senior_id': location.state['senior_id'], |
57 | 169 |
'care_grade': null, |
... | ... | @@ -76,6 +188,8 @@ |
76 | 188 |
console.log('seniorSelectOne() /user/seniorSelectOne.json error : ', error); |
77 | 189 |
}); |
78 | 190 |
}; |
191 |
+ |
|
192 |
+ |
|
79 | 193 |
|
80 | 194 |
//대상자의 보호자 목록 |
81 | 195 |
const [guardianListBySenior, setGuardianListBySenior] = React.useState([]); |
... | ... | @@ -123,6 +237,25 @@ |
123 | 237 |
} |
124 | 238 |
|
125 | 239 |
|
240 |
+ //대상자 장비 목록 |
|
241 |
+ const [equipmentBySenior, setEquipmentBySenior] = React.useState({equipmentList: [], equipmentListCount: 0}); |
|
242 |
+ //대상자 장비 목록 조회 |
|
243 |
+ const equipmentSelectListBySenior = () => { |
|
244 |
+ fetch("/equipment/equipmentSelectList.json", { |
|
245 |
+ method: "POST", |
|
246 |
+ headers: { |
|
247 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
248 |
+ }, |
|
249 |
+ body: JSON.stringify(senior) |
|
250 |
+ }).then((response) => response.json()).then((data) => { |
|
251 |
+ console.log('equipmentSelectListBySenior response : ', data); |
|
252 |
+ setEquipmentBySenior(data); |
|
253 |
+ }).catch((error) => { |
|
254 |
+ console.log('equipmentSelectListBySenior error : ', error); |
|
255 |
+ }); |
|
256 |
+ } |
|
257 |
+ |
|
258 |
+ |
|
126 | 259 |
|
127 | 260 |
//가입승인 |
128 | 261 |
const userUpdate = (user, callback) => { |
... | ... | @@ -149,17 +282,80 @@ |
149 | 282 |
|
150 | 283 |
React.useEffect(() => { |
151 | 284 |
medicationTimeCodeSelectList(); |
285 |
+ equipmentStatesSelect(); |
|
286 |
+ deliveryEquipmentSelectList(); |
|
287 |
+ |
|
152 | 288 |
seniorSelectOne(); |
153 | 289 |
guardianSelectListBySenior(); |
154 | 290 |
agentSelectListBySenior(); |
291 |
+ equipmentSelectListBySenior(); |
|
155 | 292 |
}, []) |
156 | 293 |
|
157 | 294 |
|
158 | 295 |
return ( |
159 |
- <main> |
|
296 |
+ <main> |
|
160 | 297 |
<Modal_Guardian open={modalGuardianIsOpen} close={modalGuardianClose} seniorId={location.state['senior_id']} |
161 | 298 |
guardianBySenior={guardianBySenior} |
162 | 299 |
guardianManagementCallback={() => {guardianSelectListBySenior(); modalGuardianClose(); setGuardianBySenior({})}}/> |
300 |
+ |
|
301 |
+ |
|
302 |
+ <Modal open={modalRentalIsOpen} close={modalRentalClose} header="사용가능 장비 선택"> |
|
303 |
+ <div className="board-wrap"> |
|
304 |
+ <div> |
|
305 |
+ <div className="search-management flex-end margin-bottom2 margin-top"> |
|
306 |
+ <div style={{width: '120px', fontWeight: '600', fontSize: '16px'}}>대여 시작일</div> |
|
307 |
+ <input type="date" |
|
308 |
+ value={equipmentRental['rental_start_date']} |
|
309 |
+ onChange={(e) => { |
|
310 |
+ equipmentRental['rental_start_date'] = e.target.value; |
|
311 |
+ setEquipmentRental({...equipmentRental})} |
|
312 |
+ }/> |
|
313 |
+ </div> |
|
314 |
+ |
|
315 |
+ <table class="caregiver-user protector-user"> |
|
316 |
+ <thead> |
|
317 |
+ <tr> |
|
318 |
+ <th>No </th> |
|
319 |
+ <th>모델명</th> |
|
320 |
+ <th>시리얼넘버</th> |
|
321 |
+ <th>입고일자</th> |
|
322 |
+ <th>장비상태</th> |
|
323 |
+ <th>장비선택</th> |
|
324 |
+ </tr> |
|
325 |
+ </thead> |
|
326 |
+ <tbody> |
|
327 |
+ {deliveryEquipment.equipmentList.map((item, idx) => { return ( |
|
328 |
+ <tr> |
|
329 |
+ <td data-label="No">{deliveryEquipment.equipmentListCount - idx - (deliveryEquipmentSearch.currentPage - 1) * deliveryEquipmentSearch.perPage}</td> |
|
330 |
+ <td data-label="모델명">{item['equipment_name']}</td> |
|
331 |
+ <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> |
|
332 |
+ <td data-label="입고일자">{item['equipment_stock_date']}</td> |
|
333 |
+ <td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td> |
|
334 |
+ <td data-label="장비선택"> |
|
335 |
+ <button className={"btn-small gray-btn"} onClick={() => {equipmentRentalInsert(item)}}>추가</button> |
|
336 |
+ </td> |
|
337 |
+ |
|
338 |
+ </tr> |
|
339 |
+ )})} |
|
340 |
+ {CommonUtil.isEmpty(deliveryEquipment.equipmentList) ? |
|
341 |
+ <tr> |
|
342 |
+ <td colSpan={6}>조회된 데이터가 없습니다</td> |
|
343 |
+ </tr> |
|
344 |
+ : null} |
|
345 |
+ </tbody> |
|
346 |
+ </table> |
|
347 |
+ <Pagination |
|
348 |
+ currentPage={deliveryEquipmentSearch.currentPage} |
|
349 |
+ perPage={deliveryEquipmentSearch.perPage} |
|
350 |
+ totalCount={deliveryEquipment.equipmentListCount} |
|
351 |
+ maxRange={5} |
|
352 |
+ click={deliveryEquipmentSelectList} |
|
353 |
+ /> |
|
354 |
+ </div> |
|
355 |
+ </div> |
|
356 |
+ </Modal> |
|
357 |
+ |
|
358 |
+ |
|
163 | 359 |
<div className="content-wrap row"> |
164 | 360 |
<SubTitle explanation={"대상자 상세 프로필"} className="margin-bottom" /> |
165 | 361 |
<div className="margin-bottom5"> |
... | ... | @@ -279,9 +475,9 @@ |
279 | 475 |
</td> |
280 | 476 |
</tr> |
281 | 477 |
)})} |
282 |
- {guardianListBySenior == null || guardianListBySenior.length == 0 ? |
|
478 |
+ {CommonUtil.isEmpty(guardianListBySenior) ? |
|
283 | 479 |
<tr> |
284 |
- <td colSpan={7}>조회된 데이터가 없습니다</td> |
|
480 |
+ <td colSpan={8}>조회된 데이터가 없습니다</td> |
|
285 | 481 |
</tr> |
286 | 482 |
: null} |
287 | 483 |
</tbody> |
... | ... | @@ -323,7 +519,7 @@ |
323 | 519 |
</td> |
324 | 520 |
</tr> |
325 | 521 |
)})} |
326 |
- {agent.agentListBySenior == null || agent.agentListBySenior.length == 0 ? |
|
522 |
+ {CommonUtil.isEmpty(agent.agentListBySenior) ? |
|
327 | 523 |
<tr> |
328 | 524 |
<td colSpan={10}>조회된 데이터가 없습니다</td> |
329 | 525 |
</tr> |
... | ... | @@ -332,6 +528,43 @@ |
332 | 528 |
</table> |
333 | 529 |
</div> |
334 | 530 |
|
531 |
+ |
|
532 |
+ |
|
533 |
+ <SubTitle explanation={"대상자의 장비"} className="margin-bottom display-inline-block" /> |
|
534 |
+ <button className={"btn-small gray-btn display-inline-block float-right"} onClick={modalRentalOpen}>장비 추가</button> |
|
535 |
+ <div className="margin-bottom5"> |
|
536 |
+ <table className={"senior-user protector-user"}> |
|
537 |
+ <thead> |
|
538 |
+ <tr> |
|
539 |
+ <th>No </th> |
|
540 |
+ <th>모델명</th> |
|
541 |
+ <th>시리얼넘버</th> |
|
542 |
+ <th>장비상태</th> |
|
543 |
+ <th>관리</th> |
|
544 |
+ </tr> |
|
545 |
+ </thead> |
|
546 |
+ <tbody> |
|
547 |
+ {equipmentBySenior.equipmentList.map((item, idx) => { return ( |
|
548 |
+ <tr key={idx}> |
|
549 |
+ <td data-label="No">{idx + 1}</td> |
|
550 |
+ <td data-label="모델명">{item['equipment_name']}</td> |
|
551 |
+ <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> |
|
552 |
+ <td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td> |
|
553 |
+ <td data-label="관리"> |
|
554 |
+ <button className={"btn-small lightgray-btn"} onClick={() => guardianBySeniorManagement(item)}>정보 수정</button> |
|
555 |
+ </td> |
|
556 |
+ </tr> |
|
557 |
+ )})} |
|
558 |
+ {CommonUtil.isEmpty(equipmentBySenior.equipmentList) ? |
|
559 |
+ <tr> |
|
560 |
+ <td colSpan={5}>조회된 데이터가 없습니다</td> |
|
561 |
+ </tr> |
|
562 |
+ : null} |
|
563 |
+ </tbody> |
|
564 |
+ </table> |
|
565 |
+ </div> |
|
566 |
+ |
|
567 |
+ |
|
335 | 568 |
<div className="btn-wrap flex-center"> |
336 | 569 |
<button className={"btn-large gray-btn"} onClick={() => navigate(-1)}>이전</button> |
337 | 570 |
</div> |
--- client/views/pages/user_management/AgencySelect.jsx
+++ client/views/pages/user_management/AgencySelect.jsx
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 |
"기관명", |
26 | 26 |
"담당 부서 연락처(담당자)", |
27 | 27 |
"관리 장비 개수", |
28 |
- "관리 대상자 인원", |
|
28 |
+ "돌봄 대상자 인원", |
|
29 | 29 |
"주소", |
30 | 30 |
"사용자관리", |
31 | 31 |
"기관통계보기", |
--- client/views/pages/user_management/AgencySeniorSelect.jsx
+++ client/views/pages/user_management/AgencySeniorSelect.jsx
... | ... | @@ -87,9 +87,9 @@ |
87 | 87 |
} |
88 | 88 |
|
89 | 89 |
|
90 |
- //보호사(간호사)의 관리 대상자(시니어) |
|
90 |
+ //보호사(간호사)의 돌봄 대상자(시니어) |
|
91 | 91 |
const [mySenior, setMySenior] = React.useState({seniorList: [], seniorListCount: 0, search: JSON.parse(JSON.stringify(search))}); |
92 |
- //보호사(간호사)의 관리 대상자(시니어) 목록 조회 |
|
92 |
+ //보호사(간호사)의 돌봄 대상자(시니어) 목록 조회 |
|
93 | 93 |
const mySeniorSelectList = (currentPage) => { |
94 | 94 |
mySenior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; |
95 | 95 |
|
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 |
body: JSON.stringify(mySenior.search), |
102 | 102 |
}).then((response) => response.json()).then((data) => { |
103 | 103 |
data.search = mySenior.search; |
104 |
- console.log("보호사(간호사)의 관리 대상자(시니어) 목록 조회 : ", data); |
|
104 |
+ console.log("보호사(간호사)의 돌봄 대상자(시니어) 목록 조회 : ", data); |
|
105 | 105 |
setMySenior(data); |
106 | 106 |
}).catch((error) => { |
107 | 107 |
console.log('seniorSelectList() /user/seniorSelectList.json error : ', error); |
... | ... | @@ -131,10 +131,49 @@ |
131 | 131 |
}); |
132 | 132 |
} |
133 | 133 |
//보호사 선택 -> 시행기관의 대상자(시니어) 목록 조회 |
134 |
- const agentChange = (agentId) => { |
|
135 |
- agencySenior.search['agent_id'] = agentId; |
|
134 |
+ const agentChange = (userId) => { |
|
135 |
+ agencySenior.search['agent_id'] = userId; |
|
136 | 136 |
setAgencySenior({...agencySenior}); |
137 | 137 |
agencySeniorSelectList(1); |
138 |
+ } |
|
139 |
+ //선택한 보호사의 이름 |
|
140 |
+ const getSearchAgentName = () => { |
|
141 |
+ for (let i = 0; i < agent.userList.length; i++) { |
|
142 |
+ if (agent.userList[i]['user_id'] == agencySenior.search['agent_id']) { |
|
143 |
+ return agent.userList[i]['user_name']; |
|
144 |
+ } |
|
145 |
+ } |
|
146 |
+ return '보호사'; |
|
147 |
+ } |
|
148 |
+ |
|
149 |
+ |
|
150 |
+ |
|
151 |
+ //보호사의 대상자 등록 |
|
152 |
+ const agentSeniorInsert = (senior, agentId) => { |
|
153 |
+ if (confirm(`${senior['user_name']}님을 돌봄 대상자로 추가하시겠습니까?`) == false) { |
|
154 |
+ return; |
|
155 |
+ } else { |
|
156 |
+ senior['agent_id'] = state.loginUser['user_id']; |
|
157 |
+ } |
|
158 |
+ fetch("/user/agentSeniorInsert.json", { |
|
159 |
+ method: "POST", |
|
160 |
+ headers: { |
|
161 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
162 |
+ }, |
|
163 |
+ body: JSON.stringify(senior), |
|
164 |
+ }).then((response) => response.json()).then((data) => { |
|
165 |
+ if (data > 0) { |
|
166 |
+ setTabIndex(0); |
|
167 |
+ search.searchText = ''; |
|
168 |
+ search.searchType = ''; |
|
169 |
+ searching(); |
|
170 |
+ alert("추가완료"); |
|
171 |
+ } else { |
|
172 |
+ alert("추가에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
173 |
+ } |
|
174 |
+ }).catch((error) => { |
|
175 |
+ console.log('agencySeniorSelectList() /user/seniorSelectList.json error : ', error); |
|
176 |
+ }); |
|
138 | 177 |
} |
139 | 178 |
|
140 | 179 |
|
... | ... | @@ -148,11 +187,11 @@ |
148 | 187 |
const [tabIndex, setTabIndex] = React.useState(0); |
149 | 188 |
//탭 초기화 |
150 | 189 |
const tab = [{ |
151 |
- title: `내 관리 대상자 (${mySenior.seniorListCount})`, |
|
190 |
+ title: `내 돌봄 대상자 (${mySenior.seniorListCount})`, |
|
152 | 191 |
content: ( |
153 | 192 |
<div> |
154 | 193 |
<div className="flex equip-tab"> |
155 |
- <SubTitle explanation={"접속하신 보호사(간호사)분의 관리 대상자 목록입니다."} /> |
|
194 |
+ <SubTitle explanation={"접속하신 보호사(간호사)분의 돌봄 대상자 목록입니다."} /> |
|
156 | 195 |
<div className="btn-wrap flex-end margin-bottom "> |
157 | 196 |
<button className={"btn-small gray-btn"} onClick={modalSeniorInsertOpen}>신규등록</button> |
158 | 197 |
</div> |
... | ... | @@ -166,21 +205,34 @@ |
166 | 205 |
<th>생년월일</th> |
167 | 206 |
<th>성별</th> |
168 | 207 |
<th>연락처</th> |
169 |
- <th>주소</th> |
|
170 | 208 |
<th>보호자</th> |
209 |
+ <th>대상자관리</th> |
|
171 | 210 |
</tr> |
172 | 211 |
</thead> |
173 | 212 |
<tbody> |
174 | 213 |
{mySenior.seniorList.map((item, idx) => { return ( |
175 |
- <tr key={idx} onClick={() => {navigate("/SeniorSelectOne", {state: {'senior_id': item['senior_id']}})}}> |
|
214 |
+ <tr key={idx}> |
|
176 | 215 |
<td data-label="No">{mySenior.seniorListCount - idx - (mySenior.search.currentPage - 1) * mySenior.search.perPage}</td> |
177 | 216 |
<td data-label="소속기관명">{item['agency_name']}</td> |
178 | 217 |
<td data-label="이름">{item['user_name']}</td> |
179 | 218 |
<td data-label="생년월일">{item['user_birth']}</td> |
180 | 219 |
<td data-label="성별">{item['user_gender']}</td> |
181 | 220 |
<td data-label="연락처">{item['user_phonenumber']}</td> |
182 |
- <td data-label="주소">{item['user_address']}</td> |
|
183 |
- <td data-label="보호자">{item['guardian_user_names']}</td> |
|
221 |
+ <td data-label="보호자"> |
|
222 |
+ {CommonUtil.isEmpty(item['guardian_user_names']) |
|
223 |
+ ? '없음' |
|
224 |
+ : item['guardian_user_names'] |
|
225 |
+ } |
|
226 |
+ </td> |
|
227 |
+ <td data-label="대상자관리"> |
|
228 |
+ <button className="btn-small gray-btn" onClick={() => { |
|
229 |
+ navigate("/SeniorSelectOne", {state: { |
|
230 |
+ 'senior_id': item['senior_id'], |
|
231 |
+ 'agency_id': item['agency_id'], |
|
232 |
+ 'government_id': item['government_id'] |
|
233 |
+ }}) |
|
234 |
+ }}>대상자관리</button> |
|
235 |
+ </td> |
|
184 | 236 |
</tr> |
185 | 237 |
)})} |
186 | 238 |
{CommonUtil.isEmpty(mySenior.seniorList) ? |
... | ... | @@ -200,18 +252,22 @@ |
200 | 252 |
</div> |
201 | 253 |
) |
202 | 254 |
}, { |
203 |
- title: `우리기관 관리 대상자 (${agencySenior.seniorListCount})`, |
|
255 |
+ title: `우리기관 돌봄 대상자 (${agencySenior.seniorListCount})`, |
|
204 | 256 |
content: ( |
205 | 257 |
<div> |
206 | 258 |
<div className="flex-align-start userauthoriylist gap5"> |
207 | 259 |
<div className="left"> |
208 | 260 |
<SubTitle explanation={"우리기관 보호사"}/> |
209 | 261 |
<div style={{fontSize: '16px', marginTop: '0px'}} className="category"> |
210 |
- <a className="active">{state.loginUser['government_name']}</a> |
|
262 |
+ <a className="active" onClick={() => {agentChange(null)}}> |
|
263 |
+ {state.loginUser['government_name']} |
|
264 |
+ </a> |
|
211 | 265 |
<ul style={{marginLeft: '15px'}}> |
212 | 266 |
<li style={{margin: '10px 0px'}}> |
213 | 267 |
<span style={{marginRight: '5px'}}><img src={House} alt="" /></span> |
214 |
- <a className="active">{state.loginUser['agency_name']}</a> |
|
268 |
+ <a className="active" onClick={() => {agentChange(null)}}> |
|
269 |
+ {state.loginUser['agency_name']} |
|
270 |
+ </a> |
|
215 | 271 |
<ul style={{marginLeft: '15px'}}> |
216 | 272 |
{agent.userList.map((user, idx) => { return ( |
217 | 273 |
<li style={{margin: '10px 0px'}} key={idx}> |
... | ... | @@ -219,6 +275,10 @@ |
219 | 275 |
<a className={user['user_id'] == agencySenior.search['agent_id'] ? "active" : ""} |
220 | 276 |
onClick={() => {agentChange(user['user_id'])}}> |
221 | 277 |
{user['user_name']} |
278 |
+ {state.loginUser['user_id'] == user['user_id'] |
|
279 |
+ ? '(나)' |
|
280 |
+ : `(${user['user_id']})` |
|
281 |
+ } |
|
222 | 282 |
</a> |
223 | 283 |
</li> |
224 | 284 |
)})} |
... | ... | @@ -226,7 +286,7 @@ |
226 | 286 |
<span style={{marginRight: '5px'}}><img src={Arrow} alt="" /></span> |
227 | 287 |
<a className={'IS_NULL' == agencySenior.search['agent_id'] ? "active" : ""} |
228 | 288 |
onClick={() => {agentChange('IS_NULL')}}> |
229 |
- 미지정 |
|
289 |
+ 미배정 |
|
230 | 290 |
</a> |
231 | 291 |
</li> |
232 | 292 |
</ul> |
... | ... | @@ -236,7 +296,13 @@ |
236 | 296 |
</div> |
237 | 297 |
<div className="right"> |
238 | 298 |
<div className="flex equip-tab"> |
239 |
- <SubTitle explanation={"현재 기관에서 관리중인 대상자 목록입니다."} /> |
|
299 |
+ <SubTitle explanation={CommonUtil.isEmpty(agencySenior.search['agent_id']) |
|
300 |
+ ? '현재 기관에서 관리중인 돌봄 대상자 목록입니다.' |
|
301 |
+ : (agencySenior.search['agent_id'] == 'IS_NULL' |
|
302 |
+ ? '담당자가 배정되지 않은 돌봄 대상자 목록입니다.' |
|
303 |
+ : `${getSearchAgentName()}님의 돌봄 대상자 목록입니다.` |
|
304 |
+ ) |
|
305 |
+ } /> |
|
240 | 306 |
<div className="btn-wrap flex-end margin-bottom "> |
241 | 307 |
{/* <button className={"btn-small gray-btn"} onClick={() => {modalEquipmentOpen()}}>등록</button> */} |
242 | 308 |
</div> |
... | ... | @@ -250,23 +316,41 @@ |
250 | 316 |
<th>생년월일</th> |
251 | 317 |
<th>성별</th> |
252 | 318 |
<th>연락처</th> |
253 |
- <th>주소</th> |
|
254 | 319 |
<th>보호자</th> |
255 | 320 |
<th>보호사</th> |
321 |
+ <th>대상자관리</th> |
|
256 | 322 |
</tr> |
257 | 323 |
</thead> |
258 | 324 |
<tbody> |
259 | 325 |
{agencySenior.seniorList.map((item, idx) => { return ( |
260 |
- <tr key={idx} onClick={() => {navigate("/SeniorSelectOne", {state: {'senior_id': item['senior_id']}})}}> |
|
326 |
+ <tr key={idx}> |
|
261 | 327 |
<td data-label="No">{agencySenior.seniorListCount - idx - (agencySenior.search.currentPage - 1) * agencySenior.search.perPage}</td> |
262 | 328 |
<td data-label="소속기관명">{item['agency_name']}</td> |
263 | 329 |
<td data-label="이름">{item['user_name']}</td> |
264 | 330 |
<td data-label="생년월일">{item['user_birth']}</td> |
265 | 331 |
<td data-label="성별">{item['user_gender']}</td> |
266 | 332 |
<td data-label="연락처">{item['user_phonenumber']}</td> |
267 |
- <td data-label="주소">{item['user_address']}</td> |
|
268 |
- <td data-label="보호자">{item['guardian_user_names']}</td> |
|
269 |
- <td data-label="보호사">{item['agent_user_names']}</td> |
|
333 |
+ <td data-label="보호자"> |
|
334 |
+ {CommonUtil.isEmpty(item['guardian_user_names']) |
|
335 |
+ ? '없음' |
|
336 |
+ : item['guardian_user_names'] |
|
337 |
+ } |
|
338 |
+ </td> |
|
339 |
+ <td data-label="보호사"> |
|
340 |
+ {CommonUtil.isEmpty(item['agent_user_names']) |
|
341 |
+ ? <button className="btn-small gray-btn" onClick={() => agentSeniorInsert(item)}>내 돌봄 대상자로 추가</button> |
|
342 |
+ : item['agent_user_names'] |
|
343 |
+ } |
|
344 |
+ </td> |
|
345 |
+ <td data-label="대상자관리"> |
|
346 |
+ <button className="btn-small gray-btn" onClick={() => { |
|
347 |
+ navigate("/SeniorSelectOne", {state: { |
|
348 |
+ 'senior_id': item['senior_id'], |
|
349 |
+ 'agency_id': item['agency_id'], |
|
350 |
+ 'government_id': item['government_id'] |
|
351 |
+ }}) |
|
352 |
+ }}>대상자관리</button> |
|
353 |
+ </td> |
|
270 | 354 |
</tr> |
271 | 355 |
)})} |
272 | 356 |
{CommonUtil.isEmpty(agencySenior.seniorList) ? |
... | ... | @@ -296,11 +380,12 @@ |
296 | 380 |
open={modalSeniorInsertIsOpen} |
297 | 381 |
close={modalSeniorInsertClose} |
298 | 382 |
seniorInsertCallback={() => { |
299 |
- agencySenior.searchText = ''; |
|
300 |
- agencySenior.searchType = ''; |
|
301 |
- mySeniorSelectList(); |
|
383 |
+ search.searchText = ''; |
|
384 |
+ search.searchType = ''; |
|
385 |
+ searching(); |
|
302 | 386 |
modalSeniorInsertClose(); |
303 | 387 |
}} |
388 |
+ defaultAgentId={state.loginUser['user_id']} |
|
304 | 389 |
defaultAgencyId={state.loginUser['agency_id']} |
305 | 390 |
defaultGovernmentId={state.loginUser['government_id']} |
306 | 391 |
/> |
--- client/views/pages/user_management/UserSelect.jsx
+++ client/views/pages/user_management/UserSelect.jsx
... | ... | @@ -294,8 +294,8 @@ |
294 | 294 |
}).then((response) => response.json()).then((data) => { |
295 | 295 |
console.log("시니어 등록 결과(건수) : ", data); |
296 | 296 |
if (data > 0) { |
297 |
- alert("승인완료"); |
|
298 | 297 |
callback(); |
298 |
+ alert("승인완료"); |
|
299 | 299 |
} else { |
300 | 300 |
alert("승인에 실패하였습니다. 관리자에게 문의바랍니다."); |
301 | 301 |
} |
... | ... | @@ -445,7 +445,13 @@ |
445 | 445 |
</thead> |
446 | 446 |
<tbody> |
447 | 447 |
{senior.userList.map((item, idx) => { return ( |
448 |
- <tr key={idx} onClick={() => {navigate("/SeniorSelectOne", {state: {'senior_id': item['user_id']}})}}> |
|
448 |
+ <tr key={idx} onClick={() => {navigate("/SeniorSelectOne", { |
|
449 |
+ state: { |
|
450 |
+ 'senior_id': item['user_id'], |
|
451 |
+ 'agency_id': item['agency_id'], |
|
452 |
+ 'government_id': item['government_id'] |
|
453 |
+ } |
|
454 |
+ })}}> |
|
449 | 455 |
<td data-label="No">{senior.userListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> |
450 | 456 |
<td data-label="No">{item['agency_name']}</td> |
451 | 457 |
<td data-label="소속기관명">{item['user_name']}</td> |
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?