
--- client/resources/css/main.css
+++ client/resources/css/main.css
... | ... | @@ -1108,7 +1108,7 @@ |
1108 | 1108 |
width: 50%; |
1109 | 1109 |
} |
1110 | 1110 |
|
1111 |
-/* 방문관리 */ |
|
1111 |
+/* 방문/전화 관리 */ |
|
1112 | 1112 |
.visit-content { |
1113 | 1113 |
height: 45%; |
1114 | 1114 |
} |
--- client/resources/css/responsive.css
+++ client/resources/css/responsive.css
... | ... | @@ -456,7 +456,7 @@ |
456 | 456 |
.search-management button { |
457 | 457 |
width: -webkit-fill-available; |
458 | 458 |
} |
459 |
- /* 건강관리 */ |
|
459 |
+ /* 생활 복지 관리 */ |
|
460 | 460 |
.searchselect { |
461 | 461 |
width: 48%; |
462 | 462 |
} |
... | ... | @@ -1018,7 +1018,7 @@ |
1018 | 1018 |
|
1019 | 1019 |
/* 방문 조회 */ |
1020 | 1020 |
|
1021 |
- /* 방문 관리 상세 페이지 */ |
|
1021 |
+ /* 방문/전화 관리 상세 페이지 */ |
|
1022 | 1022 |
.senior-detail tr:nth-of-type(6) td { |
1023 | 1023 |
display: flex; |
1024 | 1024 |
justify-content: center; |
--- client/views/layout/Header.jsx
+++ client/views/layout/Header.jsx
... | ... | @@ -21,6 +21,8 @@ |
21 | 21 |
setTitle('올잇메디'); |
22 | 22 |
} else if (state.loginUser['authority'] == 'ROLE_GOVERNMENT') { |
23 | 23 |
setTitle(state.loginUser['government_name']); |
24 |
+ } else if (state.loginUser['authority'] == 'ROLE_AGENCYADMIN') { |
|
25 |
+ setTitle(state.loginUser['agency_name']); |
|
24 | 26 |
} else if (state.loginUser['authority'] == 'ROLE_AGENCY') { |
25 | 27 |
setTitle(state.loginUser['agency_name']); |
26 | 28 |
} else if (state.loginUser['authority'] == 'ROLE_GUARDIAN') { |
--- client/views/layout/Menu.jsx
+++ client/views/layout/Menu.jsx
... | ... | @@ -58,6 +58,7 @@ |
58 | 58 |
<div className="bottom-section flex-center" style={{width: '100%'}}> |
59 | 59 |
{state.loginUser['authority'] == 'ROLE_ADMIN' |
60 | 60 |
|| state.loginUser['authority'] == 'ROLE_GOVERNMENT' |
61 |
+ || state.loginUser['authority'] == 'ROLE_AGENCYADMIN' |
|
61 | 62 |
|| state.loginUser['authority'] == 'ROLE_AGENCY' ? |
62 | 63 |
<div className="info-id" > |
63 | 64 |
<span onClick={() => { |
--- client/views/pages/230215_backup_AppRoute.jsx
+++ client/views/pages/230215_backup_AppRoute.jsx
... | ... | @@ -113,7 +113,7 @@ |
113 | 113 |
], |
114 | 114 |
}, |
115 | 115 |
{ |
116 |
- title: "건강 관리", |
|
116 |
+ title: "생활 복지 관리", |
|
117 | 117 |
prefix: "/Medicine", |
118 | 118 |
icon: ( |
119 | 119 |
<Diversity1Icon sx={{ fontSize: 20, color: "#ffffff", marginRight: 1 }} /> |
... | ... | @@ -135,14 +135,14 @@ |
135 | 135 |
}, |
136 | 136 |
|
137 | 137 |
{ |
138 |
- title: "방문 관리", |
|
138 |
+ title: "방문/전화 관리", |
|
139 | 139 |
prefix: "/Visit", |
140 | 140 |
icon: ( |
141 | 141 |
<DoorFrontIcon sx={{ fontSize: 20, color: "#ffffff", marginRight: 1 }} /> |
142 | 142 |
), |
143 | 143 |
childrens: [ |
144 | 144 |
{ |
145 |
- title: "방문 관리", |
|
145 |
+ title: "방문/전화 관리", |
|
146 | 146 |
path: "/VisitSelect", |
147 | 147 |
}, |
148 | 148 |
], |
... | ... | @@ -304,7 +304,7 @@ |
304 | 304 |
// ), |
305 | 305 |
// }, |
306 | 306 |
// { |
307 |
- // title: "건강 관리", |
|
307 |
+ // title: "생활 복지 관리", |
|
308 | 308 |
// prefix: "/Medicine", |
309 | 309 |
// icon: ( |
310 | 310 |
// <Diversity1Icon sx={{ fontSize: 20, color: "#ffffff", marginRight: 1 }} /> |
... | ... | @@ -326,14 +326,14 @@ |
326 | 326 |
// }, |
327 | 327 |
|
328 | 328 |
// { |
329 |
- // title: "방문 관리", |
|
329 |
+ // title: "방문/전화 관리", |
|
330 | 330 |
// prefix: "/Visit", |
331 | 331 |
// icon: ( |
332 | 332 |
// <DoorFrontIcon sx={{ fontSize: 20, color: "#ffffff", marginRight: 1 }} /> |
333 | 333 |
// ), |
334 | 334 |
// childrens: [ |
335 | 335 |
// { |
336 |
- // title: "방문 관리", |
|
336 |
+ // title: "방문/전화 관리", |
|
337 | 337 |
// path: "/VisitSelect", |
338 | 338 |
// }, |
339 | 339 |
// ], |
... | ... | @@ -455,7 +455,7 @@ |
455 | 455 |
path: "/UserSelectOk", |
456 | 456 |
}, |
457 | 457 |
{ |
458 |
- title: "건강 관리", |
|
458 |
+ title: "생활 복지 관리", |
|
459 | 459 |
prefix: "/Medicine", |
460 | 460 |
icon: ( |
461 | 461 |
<Diversity1Icon sx={{ fontSize: 20, color: "#ffffff", marginRight: 1 }} /> |
... | ... | @@ -477,14 +477,14 @@ |
477 | 477 |
}, |
478 | 478 |
|
479 | 479 |
{ |
480 |
- title: "방문 관리", |
|
480 |
+ title: "방문/전화 관리", |
|
481 | 481 |
prefix: "/Visit", |
482 | 482 |
icon: ( |
483 | 483 |
<DoorFrontIcon sx={{ fontSize: 20, color: "#ffffff", marginRight: 1 }} /> |
484 | 484 |
), |
485 | 485 |
childrens: [ |
486 | 486 |
{ |
487 |
- title: "방문 관리", |
|
487 |
+ title: "방문/전화 관리", |
|
488 | 488 |
path: "/VisitSelect", |
489 | 489 |
}, |
490 | 490 |
], |
--- client/views/pages/App.jsx
+++ client/views/pages/App.jsx
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
import { setLoginUser, setSeniorList } from "./AppStore.jsx"; |
12 | 12 |
|
13 | 13 |
//Application의 Route 정보를 관리하는 Component |
14 |
-import {AdminApp, GovernmentApp, AgencyApp, GuardianApp} from "./AppRoute.jsx"; |
|
14 |
+import {AdminApp, GovernmentApp, AgencyApp, AgencyAdminApp, GuardianApp} from "./AppRoute.jsx"; |
|
15 | 15 |
|
16 | 16 |
//Test Layout |
17 | 17 |
import Header from "../layout/Header.jsx"; |
... | ... | @@ -235,6 +235,9 @@ |
235 | 235 |
} else if (loginResultData['authority'] == 'ROLE_GOVERNMENT') { |
236 | 236 |
setMenuItems(GovernmentApp.menuItems); |
237 | 237 |
setAppRoute(<GovernmentApp.AppRoute/>); |
238 |
+ } else if (loginResultData['authority'] == 'ROLE_AGENCYADMIN') { |
|
239 |
+ setMenuItems(AgencyAdminApp.menuItems); |
|
240 |
+ setAppRoute(<AgencyAdminApp.AppRoute/>); |
|
238 | 241 |
} else if (loginResultData['authority'] == 'ROLE_AGENCY') { |
239 | 242 |
setMenuItems(AgencyApp.menuItems); |
240 | 243 |
setAppRoute(<AgencyApp.AppRoute/>); |
--- client/views/pages/AppRoute.jsx
+++ client/views/pages/AppRoute.jsx
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 |
import Main_government from "./main/Main_government.jsx"; |
25 | 25 |
import Main_guardian from "./main/Main_guardian.jsx"; |
26 | 26 |
import Main_agency from "./main/Main_agency.jsx"; |
27 |
+import Main_agencyAdmin from "./main/Main_agencyAdmin.jsx"; |
|
27 | 28 |
import Main from "./main/Main.jsx"; |
28 | 29 |
import SeniorEdit from "./senior_management/SeniorEdit.jsx"; |
29 | 30 |
import SeniorSelectOne from "./senior_management/SeniorSelectOne.jsx"; |
... | ... | @@ -57,7 +58,9 @@ |
57 | 58 |
import QuestionSelect from "./callcenter/QuestionSelect.jsx"; |
58 | 59 |
import Join from "./join/Join.jsx"; |
59 | 60 |
import Healthcare from "./healthcare/Healthcare.jsx" |
61 |
+import TeamHealthcare from "./healthcare/TeamHealthcare.jsx" |
|
60 | 62 |
import Medicalcare from "./healthcare/Medicalcare.jsx" |
63 |
+import TeamMedicalcare from "./healthcare/TeamMedicalcare.jsx" |
|
61 | 64 |
|
62 | 65 |
import UserEdit from "./user_management/UserEdit.jsx"; |
63 | 66 |
import AgentSelectOne from "./user_management/AgentSelectOne.jsx"; |
... | ... | @@ -80,7 +83,7 @@ |
80 | 83 |
/> |
81 | 84 |
), |
82 | 85 |
}, |
83 |
-/* { |
|
86 |
+ { |
|
84 | 87 |
title: "사용자 관리", |
85 | 88 |
path: "/UserSelect", |
86 | 89 |
icon: ( |
... | ... | @@ -88,7 +91,7 @@ |
88 | 91 |
sx={{ fontSize: 20, marginRight: 1 }} |
89 | 92 |
/> |
90 | 93 |
), |
91 |
- }, */ |
|
94 |
+ }, |
|
92 | 95 |
{ |
93 | 96 |
title: "장비 관리", |
94 | 97 |
path: "/EquipmentSelect", |
... | ... | @@ -116,11 +119,11 @@ |
116 | 119 |
), |
117 | 120 |
childrens: [ |
118 | 121 |
{ |
119 |
- title: "건강 관리", |
|
122 |
+ title: "생활 복지 관리", |
|
120 | 123 |
path: "/Healthcare", |
121 | 124 |
}, |
122 | 125 |
{ |
123 |
- title: "진료 관리", |
|
126 |
+ title: "건강 관리", |
|
124 | 127 |
path:"/Medicalcare", |
125 | 128 |
}, |
126 | 129 |
], |
... | ... | @@ -140,7 +143,7 @@ |
140 | 143 |
<Route path="/EquipmentSelect" element={<EquipmentSelect />}></Route> |
141 | 144 |
<Route path="/EquipmentManagementSelectOne" element={<EquipmentManagementSelectOne />}></Route> |
142 | 145 |
<Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
143 |
- <Route path="/TemperatureManagementSelectOne" element={<TemperatureManagementSelectOne />}></Route> |
|
146 |
+ <Route path="/TemperatureManagementSelectOne" element={<TemperatureManagementSelectOne />}></Route> |
|
144 | 147 |
<Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route> |
145 | 148 |
<Route path="/QandAInsert" element={<QandAInsert />}></Route> |
146 | 149 |
<Route path="/QandAUpdate" element={<QandAUpdate />}></Route> |
... | ... | @@ -155,7 +158,7 @@ |
155 | 158 |
<Route path="/AgentSelectOne" element={<AgentSelectOne />}></Route> |
156 | 159 |
<Route path="/OrgSelect" element={<OrgSelect />}></Route> |
157 | 160 |
<Route path="/MedicineStatistics" element={<MedicineStatistics />}></Route> |
158 |
- |
|
161 |
+ |
|
159 | 162 |
</Routes> |
160 | 163 |
); |
161 | 164 |
} |
... | ... | @@ -203,11 +206,11 @@ |
203 | 206 |
), |
204 | 207 |
childrens: [ |
205 | 208 |
{ |
206 |
- title: "건강 관리", |
|
209 |
+ title: "생활 복지 관리", |
|
207 | 210 |
path: "/Healthcare", |
208 | 211 |
}, |
209 | 212 |
{ |
210 |
- title: "진료 관리", |
|
213 |
+ title: "건강 관리", |
|
211 | 214 |
path:"/Medicalcare", |
212 | 215 |
}, |
213 | 216 |
], |
... | ... | @@ -253,8 +256,8 @@ |
253 | 256 |
<Route path="/Healthcare" element={<Healthcare />}></Route> |
254 | 257 |
<Route path="/" element={<Main_government />}></Route> |
255 | 258 |
<Route path="/AgencySelect" element={<AgencySelect />}></Route> |
256 |
- <Route path="/UserSelectOk" element={<UserSelectOk />}></Route> |
|
257 |
- <Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
|
259 |
+ <Route path="/UserSelectOk" element={<UserSelectOk />}></Route> |
|
260 |
+ <Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
|
258 | 261 |
<Route path="/TemperatureManagementSelectOne" element={<TemperatureManagementSelectOne />}></Route> |
259 | 262 |
<Route path="/MedicineStatistics" element={<MedicineStatistics />} ></Route> |
260 | 263 |
<Route path="/VisitInsert" element={<VisitInsert />}></Route> |
... | ... | @@ -275,6 +278,93 @@ |
275 | 278 |
<Route path="/AgentSelectOne" element={<AgentSelectOne />}></Route> |
276 | 279 |
<Route path="/OrgSelect" element={<OrgSelect />}></Route> |
277 | 280 |
<Route path="/GovernmentEquipmentSelect" element={<GovernmentEquipmentSelect />}></Route> |
281 |
+ </Routes> |
|
282 |
+ ); |
|
283 |
+} |
|
284 |
+const AgencyAdminAppMenuItems = [ |
|
285 |
+ { |
|
286 |
+ title: "Home", |
|
287 |
+ path: "/", |
|
288 |
+ icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
289 |
+ }, |
|
290 |
+ { |
|
291 |
+ title: "대상자 관리", |
|
292 |
+ path: "/AgencySeniorSelect", |
|
293 |
+ icon: ( |
|
294 |
+ <PersonIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
295 |
+ ), |
|
296 |
+ }, |
|
297 |
+ { |
|
298 |
+ title: "장비 사용 현황", |
|
299 |
+ path: "/GovernmentEquipmentSelect", |
|
300 |
+ icon: ( |
|
301 |
+ <SpeakerPhoneIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
302 |
+ ), |
|
303 |
+ }, |
|
304 |
+ { |
|
305 |
+ title: "생활 복지 관리", |
|
306 |
+ path: "/TeamHealthcare", |
|
307 |
+ icon: ( |
|
308 |
+ <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
309 |
+ ), |
|
310 |
+ }, |
|
311 |
+ { |
|
312 |
+ title: "건강 관리", |
|
313 |
+ path: "/TeamMedicalcare", |
|
314 |
+ icon: ( |
|
315 |
+ <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
316 |
+ ), |
|
317 |
+ }, |
|
318 |
+ { |
|
319 |
+ title: "문의하기", |
|
320 |
+ path: "/QandASelect", |
|
321 |
+ icon: ( |
|
322 |
+ <ContactSupportIcon |
|
323 |
+ sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} |
|
324 |
+ /> |
|
325 |
+ ), |
|
326 |
+ }, |
|
327 |
+]; |
|
328 |
+function AgencyAdminAppRoute() { |
|
329 |
+ return ( |
|
330 |
+ <Routes> |
|
331 |
+ |
|
332 |
+ <Route path="/TeamMedicalcare" element={<TeamMedicalcare />}></Route> |
|
333 |
+ <Route path="/TeamHealthcare" element={<TeamHealthcare />}></Route> |
|
334 |
+ <Route path="/Join" element={<Join />}></Route> |
|
335 |
+ <Route path="/QuestionSelect" element={<QuestionSelect />}></Route> |
|
336 |
+ |
|
337 |
+ <Route path="/" element={<Main_agencyAdmin />}></Route> |
|
338 |
+ <Route path="/AgencySeniorSelect" element={<AgencySeniorSelect />}></Route> |
|
339 |
+ <Route path="/SeniorEdit" element={<SeniorEdit />}></Route> |
|
340 |
+ <Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route> |
|
341 |
+ <Route path="/UserEdit" element={<UserEdit />}></Route> |
|
342 |
+ <Route path="/AgentSelectOne" element={<AgentSelectOne />}></Route> |
|
343 |
+ <Route |
|
344 |
+ path="/MedicineCareSelectOne" |
|
345 |
+ element={<MedicineCareSelectOne />} |
|
346 |
+ ></Route> |
|
347 |
+ <Route |
|
348 |
+ path="/TemperatureManagementSelectOne" |
|
349 |
+ element={<TemperatureManagementSelectOne />} |
|
350 |
+ ></Route> |
|
351 |
+ <Route path="/VisitInsert" element={<VisitInsert />}></Route> |
|
352 |
+ <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route> |
|
353 |
+ <Route |
|
354 |
+ path="/EquipmentRentalInsert" |
|
355 |
+ element={<EquipmentRentalInsert />} |
|
356 |
+ ></Route> |
|
357 |
+ <Route |
|
358 |
+ path="/GovernmentEquipmentSelect" |
|
359 |
+ element={<GovernmentEquipmentSelect />} |
|
360 |
+ ></Route> |
|
361 |
+ <Route |
|
362 |
+ path="/QandASelect" |
|
363 |
+ element={<QandASelect />} |
|
364 |
+ ></Route> |
|
365 |
+ <Route path="/QandAInsert" element={<QandAInsert />}></Route> |
|
366 |
+ <Route path="/QandAUpdate" element={<QandAUpdate />}></Route> |
|
367 |
+ <Route path="/QandASelectOne" element={<QandASelectOne />}></Route> |
|
278 | 368 |
</Routes> |
279 | 369 |
); |
280 | 370 |
} |
... | ... | @@ -299,15 +389,15 @@ |
299 | 389 |
), |
300 | 390 |
}, |
301 | 391 |
{ |
302 |
- title: "건강 관리", |
|
303 |
- path:"/Healthcare", |
|
392 |
+ title: "생활 복지 관리", |
|
393 |
+ path: "/Healthcare", |
|
304 | 394 |
icon: ( |
305 | 395 |
<Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
306 | 396 |
), |
307 | 397 |
}, |
308 | 398 |
{ |
309 |
- title: "진료 관리", |
|
310 |
- path:"/Medicalcare", |
|
399 |
+ title: "건강 관리", |
|
400 |
+ path: "/Medicalcare", |
|
311 | 401 |
icon: ( |
312 | 402 |
<LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
313 | 403 |
), |
... | ... | @@ -330,7 +420,7 @@ |
330 | 420 |
<Route path="/Healthcare" element={<Healthcare />}></Route> |
331 | 421 |
<Route path="/Join" element={<Join />}></Route> |
332 | 422 |
<Route path="/QuestionSelect" element={<QuestionSelect />}></Route> |
333 |
- |
|
423 |
+ |
|
334 | 424 |
<Route path="/" element={<Main_agency />}></Route> |
335 | 425 |
<Route path="/AgencySeniorSelect" element={<AgencySeniorSelect />}></Route> |
336 | 426 |
<Route path="/SeniorEdit" element={<SeniorEdit />}></Route> |
... | ... | @@ -340,7 +430,7 @@ |
340 | 430 |
<Route |
341 | 431 |
path="/MedicineCareSelectOne" |
342 | 432 |
element={<MedicineCareSelectOne />} |
343 |
- ></Route> |
|
433 |
+ ></Route> |
|
344 | 434 |
<Route |
345 | 435 |
path="/TemperatureManagementSelectOne" |
346 | 436 |
element={<TemperatureManagementSelectOne />} |
... | ... | @@ -401,8 +491,9 @@ |
401 | 491 |
|
402 | 492 |
const AdminApp = { 'menuItems': AdminAppMenuItems, 'AppRoute': AdminAppRoute }; |
403 | 493 |
const GovernmentApp = { 'menuItems': GovernmentAppMenuItems, 'AppRoute': GovernmentAppRoute }; |
494 |
+const AgencyAdminApp = { 'menuItems': AgencyAdminAppMenuItems, 'AppRoute': AgencyAdminAppRoute }; |
|
404 | 495 |
const AgencyApp = { 'menuItems': AgencyAppMenuItems, 'AppRoute': AgencyAppRoute }; |
405 | 496 |
const GuardianApp = { 'menuItems': GuardianAppMenuItems, 'AppRoute': GuardianAppRoute }; |
406 | 497 |
|
407 | 498 |
export default AdminApp; |
408 |
-export { AdminApp, GovernmentApp, GuardianApp, AgencyApp }; |
|
499 |
+export { AdminApp, GovernmentApp, GuardianApp, AgencyApp, AgencyAdminApp }; |
--- client/views/pages/healthcare/Healthcare.jsx
+++ client/views/pages/healthcare/Healthcare.jsx
... | ... | @@ -276,7 +276,7 @@ |
276 | 276 |
</div> |
277 | 277 |
) |
278 | 278 |
}, { |
279 |
- title: `방문관리`, |
|
279 |
+ title: `방문/전화 관리`, |
|
280 | 280 |
content: ( |
281 | 281 |
<div> |
282 | 282 |
<div className="flex equip-tab"> |
--- client/views/pages/healthcare/Healthcare_back_230413.jsx
+++ client/views/pages/healthcare/Healthcare_back_230413.jsx
... | ... | @@ -180,7 +180,7 @@ |
180 | 180 |
}, |
181 | 181 |
{ |
182 | 182 |
id: 3, |
183 |
- title: "방문관리", |
|
183 |
+ title: "방문/전화 관리", |
|
184 | 184 |
description: ( |
185 | 185 |
<Table |
186 | 186 |
className={"senior-table"} |
... | ... | @@ -200,7 +200,7 @@ |
200 | 200 |
return ( |
201 | 201 |
<main> |
202 | 202 |
<div className="content-wrap"> |
203 |
- <DetailTitle contentTitle={"대상자의 복약 / 댁내온도 / 방문 관리를 할 수 있습니다."} /> |
|
203 |
+ <DetailTitle contentTitle={"대상자의 복약 / 댁내온도 / 방문/전화 관리를 할 수 있습니다."} /> |
|
204 | 204 |
<div |
205 | 205 |
style={{ height: "calc(100% - 61px)" }} |
206 | 206 |
> |
+++ client/views/pages/healthcare/TeamHealthcare.jsx
... | ... | @@ -0,0 +1,401 @@ |
1 | +import React from "react"; | |
2 | +import { useNavigate, useLocation } from "react-router"; | |
3 | +import { useSelector } from "react-redux"; | |
4 | + | |
5 | +import SubTitle from "../../component/SubTitle.jsx"; | |
6 | +import DetailTitle from "../../component/DetailTitle.jsx"; | |
7 | +import Pagination from "../../component/Pagination.jsx"; | |
8 | + | |
9 | +import CommonUtil from "../../../resources/js/CommonUtil.js"; | |
10 | + | |
11 | + | |
12 | +export default function UserAuthoriySelect() { | |
13 | + const navigate = useNavigate(); | |
14 | + const location = useLocation(); | |
15 | + | |
16 | + //전역 변수 저장 객체 | |
17 | + const state = useSelector((state) => { return state }); | |
18 | + | |
19 | + //검색(엔터) | |
20 | + const searchingEnter = (key) => { | |
21 | + if (key == 'Enter') { | |
22 | + searching(); | |
23 | + } else { | |
24 | + return; | |
25 | + } | |
26 | + } | |
27 | + //검색 | |
28 | + const searching = () => { | |
29 | + if (CommonUtil.isEmpty(state.loginUser) == false | |
30 | + && state.loginUser['authority'] == 'ROLE_AGENCY' && isMySenior) { | |
31 | + senior.search['agent_id'] = state.loginUser['user_id']; | |
32 | + } else { | |
33 | + senior.search['agent_id'] = null; | |
34 | + } | |
35 | + | |
36 | + setSenior({ ...senior }); | |
37 | + | |
38 | + seniorSelectList(1); | |
39 | + } | |
40 | + | |
41 | + const [seniorNum, setSeniorNum] = React.useState(); | |
42 | + const [isMySenior, setIsMySenior] = React.useState(true); | |
43 | + React.useEffect(() => { | |
44 | + searching(); | |
45 | + }, [isMySenior]) | |
46 | + //보호사(간호사)의 돌봄 대상자(시니어) | |
47 | + const [senior, setSenior] = React.useState({ | |
48 | + seniorList: [], seniorListCount: 0, search: { | |
49 | + 'government_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'], | |
50 | + 'agency_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id'], | |
51 | + 'searchType': null, | |
52 | + 'searchText': null, | |
53 | + 'currentPage': 1, | |
54 | + 'perPage': 10, | |
55 | + } | |
56 | + }); | |
57 | + //보호사(간호사)의 돌봄 대상자(시니어) 목록 조회 | |
58 | + const seniorSelectList = (currentPage) => { | |
59 | + senior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
60 | + | |
61 | + fetch("/user/seniorSelectList.json", { | |
62 | + method: "POST", | |
63 | + headers: { | |
64 | + 'Content-Type': 'application/json; charset=UTF-8' | |
65 | + }, | |
66 | + body: JSON.stringify(senior.search), | |
67 | + }).then((response) => response.json()).then((data) => { | |
68 | + data.search = senior.search; | |
69 | + data.seniorList.map((item, idx) => { | |
70 | + setSeniorNum(item); | |
71 | + seniorMedicationSelectList(item); | |
72 | + }) | |
73 | + console.log("돌봄 대상자(시니어) 목록 조회 : ", data); | |
74 | + setSenior(data); | |
75 | + }).catch((error) => { | |
76 | + console.log('seniorSelectList() /user/seniorSelectList.json error : ', error); | |
77 | + }); | |
78 | + } | |
79 | + | |
80 | + //특정 대상자의 실제 복약 정보 | |
81 | + const [seniorMedicationList, setSeniorMedicationList] = React.useState([]); | |
82 | + const [showMedicationTimeCode, setShowMedicationTimeCode] = React.useState({}); | |
83 | + //특정 대상자의 실제 복약 정보 목록 조회 | |
84 | + const seniorMedicationSelectList = (seniorNum) => { | |
85 | + fetch("/user/seniorMedicationSelectList.json", { | |
86 | + method: "POST", | |
87 | + headers: { | |
88 | + 'Content-Type': 'application/json; charset=UTF-8' | |
89 | + }, | |
90 | + body: JSON.stringify(seniorNum), | |
91 | + }).then((response) => response.json()).then((data) => { | |
92 | + console.log("seniorMedicationList data : ", data); | |
93 | + setSeniorMedicationList(data, seniorNum); | |
94 | + seniorMedicationSelectListByDay(data, seniorNum); | |
95 | + }).catch((error) => { | |
96 | + console.log('seniorMedicationSelectList() /user/seniorMedicationSelectList.json error : ', error); | |
97 | + }); | |
98 | + }; | |
99 | + | |
100 | + //특정 대상자의 일별, 복약시간별 복약 목록 | |
101 | + const [stackChartData, setStackChartData] = React.useState([]); | |
102 | + //특정 대상자의 일별, 복약시간별 복약 목록 조회 | |
103 | + const seniorMedicationSelectListByDay = (seniorMedicationList, seniorNum) => { | |
104 | + fetch("/user/seniorMedicationSelectListByDay.json", { | |
105 | + method: "POST", | |
106 | + headers: { | |
107 | + 'Content-Type': 'application/json; charset=UTF-8' | |
108 | + }, | |
109 | + body: JSON.stringify(seniorNum), | |
110 | + }).then((response) => response.json()).then((data) => { | |
111 | + let showMedicationTimeCode = {}; | |
112 | + for (let i = 0; i < seniorMedicationList.length; i++) { | |
113 | + showMedicationTimeCode[seniorMedicationList[i]] = true; | |
114 | + } | |
115 | + setShowMedicationTimeCode(showMedicationTimeCode); | |
116 | + console.log('showMedicationTimeCode : ', showMedicationTimeCode); | |
117 | + | |
118 | + if (CommonUtil.isEmpty(data) == false) { | |
119 | + let _stackChartData = []; | |
120 | + for (let i = data.length - 1; i >= data.length - 3; i--) { | |
121 | + let sum = 0; // 실제 복약량 | |
122 | + let counter = 0; // 복약해야하는 양 | |
123 | + let chartData = { | |
124 | + xName: data[i]['medication_default_date'] | |
125 | + }; | |
126 | + for (let j = 0; j < data[i]['medication_time_code_list'].length; j++) { | |
127 | + if (CommonUtil.isEmpty(showMedicationTimeCode[data[i]['medication_time_code_list'][j]]) == false) { | |
128 | + chartData[data[i]['medication_time_code_list'][j]] = data[i]['medication_time_code_count_list'][j]; | |
129 | + counter++; | |
130 | + if (i > 0) { | |
131 | + sum += data[i]['medication_time_code_count_list'][j]; | |
132 | + } | |
133 | + } else { | |
134 | + continue; | |
135 | + } | |
136 | + } | |
137 | + // _stackChartData.push(chartData); | |
138 | + _stackChartData.push({ "sum": sum, "total": counter }) | |
139 | + } | |
140 | + seniorNum.seniorMedicationList = _stackChartData; | |
141 | + } | |
142 | + }).catch((error) => { | |
143 | + console.log('seniorMedicationSelectListByDay() /user/seniorMedicationSelectListByDay.json error : ', error); | |
144 | + }); | |
145 | + }; | |
146 | + | |
147 | + React.useEffect(() => { | |
148 | + searching(); | |
149 | + }, []); | |
150 | + | |
151 | + | |
152 | + //현재 탭 Index | |
153 | + const [tabIndex, setTabIndex] = React.useState(0); | |
154 | + //탭 초기화 | |
155 | + const tab = [{ | |
156 | + title: `복약관리`, | |
157 | + content: ( | |
158 | + <div> | |
159 | + <div className="flex equip-tab"> | |
160 | + <SubTitle explanation={"돌봄 대상자 클릭 시, 상세페이지로 이동합니다."} /> | |
161 | + </div> | |
162 | + <table className={"protector-user"}> | |
163 | + <thead> | |
164 | + <tr> | |
165 | + <th>No</th> | |
166 | + <th>소속기관명</th> | |
167 | + <th>이름</th> | |
168 | + <th>생년월일</th> | |
169 | + <th>성별</th> | |
170 | + <th>연락처</th> | |
171 | + <th colSpan={3}>최근복약률</th> | |
172 | + </tr> | |
173 | + </thead> | |
174 | + <tbody> | |
175 | + {senior.seniorList.map((item, idx) => { | |
176 | + return ( | |
177 | + <tr key={idx} onClick={() => { | |
178 | + navigate("/MedicineCareSelectOne", { | |
179 | + state: { | |
180 | + 'senior_id': item['user_id'], | |
181 | + 'agency_id': item['agency_id'], | |
182 | + 'government_id': item['government_id'] | |
183 | + } | |
184 | + }) | |
185 | + }}> | |
186 | + <td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> | |
187 | + <td data-label="소속기관명">{item['agency_name']}</td> | |
188 | + <td data-label="이름">{item['user_name']}</td> | |
189 | + <td data-label="생년월일">{item['user_birth']}</td> | |
190 | + <td data-label="성별">{item['user_gender']}</td> | |
191 | + <td data-label="연락처">{item['user_phonenumber']}</td> | |
192 | + { | |
193 | + item['seniorMedicationList'] && item['seniorMedicationList'].length > 0 ? | |
194 | + item['seniorMedicationList'].map((date, dataIdx) => { | |
195 | + return ( | |
196 | + <td data-label="최근복약률"> | |
197 | + {date['sum']}/{date['total']} | |
198 | + </td> | |
199 | + ) | |
200 | + }) | |
201 | + : null} | |
202 | + </tr> | |
203 | + ) | |
204 | + })} | |
205 | + {CommonUtil.isEmpty(senior.seniorList) ? | |
206 | + <tr> | |
207 | + <td colSpan={7}>조회된 데이터가 없습니다</td> | |
208 | + </tr> | |
209 | + : null} | |
210 | + </tbody> | |
211 | + </table> | |
212 | + <Pagination | |
213 | + currentPage={senior.search.currentPage} | |
214 | + perPage={senior.search.perPage} | |
215 | + totalCount={senior.seniorListCount} | |
216 | + maxRange={5} | |
217 | + click={seniorSelectList} | |
218 | + /> | |
219 | + </div > | |
220 | + ) | |
221 | + }, { | |
222 | + title: `댁내온도관리`, | |
223 | + content: ( | |
224 | + <div> | |
225 | + <div className="flex equip-tab"> | |
226 | + <SubTitle explanation={"돌봄 대상자 클릭 시, 상세페이지로 이동합니다."} /> | |
227 | + </div> | |
228 | + <table className={"protector-user"}> | |
229 | + <thead> | |
230 | + <tr> | |
231 | + <th>No</th> | |
232 | + <th>소속기관명</th> | |
233 | + <th>이름</th> | |
234 | + <th>생년월일</th> | |
235 | + <th>성별</th> | |
236 | + <th>연락처</th> | |
237 | + <th>최근최저온도</th> | |
238 | + <th>최근최고온도</th> | |
239 | + </tr> | |
240 | + </thead> | |
241 | + <tbody> | |
242 | + {senior.seniorList.map((item, idx) => { | |
243 | + return ( | |
244 | + <tr key={idx} onClick={() => { | |
245 | + navigate("/TemperatureManagementSelectOne"); | |
246 | + }}> | |
247 | + <td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> | |
248 | + <td data-label="소속기관명">{item['agency_name']}</td> | |
249 | + <td data-label="이름">{item['user_name']}</td> | |
250 | + <td data-label="생년월일">{item['user_birth']}</td> | |
251 | + <td data-label="성별">{item['user_gender']}</td> | |
252 | + <td data-label="연락처">{item['user_phonenumber']}</td> | |
253 | + <td data-label="최근최저온도"> | |
254 | + 18℃ | |
255 | + </td> | |
256 | + <td data-label="최근최고온도"> | |
257 | + 26℃ | |
258 | + </td> | |
259 | + </tr> | |
260 | + ) | |
261 | + })} | |
262 | + {CommonUtil.isEmpty(senior.seniorList) ? | |
263 | + <tr> | |
264 | + <td colSpan={8}>조회된 데이터가 없습니다</td> | |
265 | + </tr> | |
266 | + : null} | |
267 | + </tbody> | |
268 | + </table> | |
269 | + <Pagination | |
270 | + currentPage={senior.search.currentPage} | |
271 | + perPage={senior.search.perPage} | |
272 | + totalCount={senior.seniorListCount} | |
273 | + maxRange={5} | |
274 | + click={seniorSelectList} | |
275 | + /> | |
276 | + </div> | |
277 | + ) | |
278 | + }, { | |
279 | + title: `방문/전화 관리`, | |
280 | + content: ( | |
281 | + <div> | |
282 | + <div className="flex equip-tab"> | |
283 | + <SubTitle explanation={"돌봄 대상자 클릭 시, 상세페이지로 이동합니다."} /> | |
284 | + </div> | |
285 | + <table className={"protector-user"}> | |
286 | + <thead> | |
287 | + <tr> | |
288 | + <th>No</th> | |
289 | + <th>소속기관명</th> | |
290 | + <th>이름</th> | |
291 | + <th>생년월일</th> | |
292 | + <th>성별</th> | |
293 | + <th>연락처</th> | |
294 | + | |
295 | + {/* <th>최근방문일</th> | |
296 | + <th>방문목적</th> */} | |
297 | + </tr> | |
298 | + </thead> | |
299 | + <tbody> | |
300 | + {senior.seniorList.map((item, idx) => { | |
301 | + return ( | |
302 | + <tr key={idx} onClick={() => { | |
303 | + navigate("/VisitSelectOne", { | |
304 | + state: { | |
305 | + 'senior_id': item['senior_id'], | |
306 | + } | |
307 | + }) | |
308 | + }}> | |
309 | + <td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> | |
310 | + <td data-label="소속기관명">{item['agency_name']}</td> | |
311 | + <td data-label="이름">{item['user_name']}</td> | |
312 | + <td data-label="생년월일">{item['user_birth']}</td> | |
313 | + <td data-label="성별">{item['user_gender']}</td> | |
314 | + <td data-label="연락처">{item['user_phonenumber']}</td> | |
315 | + | |
316 | + {/* <td>2023-04-11</td> | |
317 | + <td>정기방문</td> */} | |
318 | + </tr> | |
319 | + ) | |
320 | + })} | |
321 | + {CommonUtil.isEmpty(senior.seniorList) ? | |
322 | + <tr> | |
323 | + <td colSpan={6}>조회된 데이터가 없습니다</td> | |
324 | + </tr> | |
325 | + : null} | |
326 | + </tbody> | |
327 | + </table> | |
328 | + <Pagination | |
329 | + currentPage={senior.search.currentPage} | |
330 | + perPage={senior.search.perPage} | |
331 | + totalCount={senior.seniorListCount} | |
332 | + maxRange={5} | |
333 | + click={seniorSelectList} | |
334 | + /> | |
335 | + </div> | |
336 | + ) | |
337 | + }]; | |
338 | + | |
339 | + return ( | |
340 | + <main> | |
341 | + <div className="search-management flex-start margin-bottom2"> | |
342 | + <select style={{ maxWidth: '150px' }} | |
343 | + onChange={(e) => { senior.search.searchType = e.target.value; setSenior({ ...senior }); }}> | |
344 | + <option value="" selected={CommonUtil.isEmpty(senior.search.searchType)}>전체</option> | |
345 | + <option value="user_name" selected={senior.search.searchType == 'user_name'}>이름</option> | |
346 | + <option value="user_id" selected={senior.search.searchType == 'user_id'}>아이디</option> | |
347 | + <option value="user_phonenumber" selected={senior.search.searchType == 'user_phonenumber'}>연락처</option> | |
348 | + </select> | |
349 | + <input type="text" className="senior-search" value={senior.search.searchText} | |
350 | + onChange={(e) => { senior.search.searchText = e.target.value; setSenior({ ...senior }); }} | |
351 | + onKeyUp={(e) => searchingEnter(e.key)} /> | |
352 | + <button className="btn-small gray-btn" onClick={searching}>검색</button> | |
353 | + </div> | |
354 | + | |
355 | + <div className="content-wrap"> | |
356 | + <DetailTitle contentTitle={"대상자의 문진표 / 심전도 / 혈압 관리를 할 수 있습니다."} /> | |
357 | + | |
358 | + <div style={{ height: "calc(100% - 61px)" }}> | |
359 | + <div className="right" style={{ height: "100%", }}> | |
360 | + <div style={{ height: "100%" }}> | |
361 | + <div className="tab-container" style={{ marginTop: "5rem" }}> | |
362 | + {/* {CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_AGENCY' ? | |
363 | + <div className="flex-end margin-bottom"> | |
364 | + <div className="flex searchselect" style={{width: 'auto'}}> | |
365 | + | |
366 | + <input type="radio" id="my_senior" name="senior" checked={isMySenior} | |
367 | + onChange={(e) => {e.target.checked ? setIsMySenior(true) : null}}/> | |
368 | + <label for="my_senior" style={{marginRight: '3rem'}}>나의 대상자 보기</label> | |
369 | + | |
370 | + <input type="radio" id="all_senior" name="senior" checked={!isMySenior} | |
371 | + onChange={(e) => {e.target.checked ? setIsMySenior(false) : null}}/> | |
372 | + <label for="all_senior" style={{marginRight: '0'}}>전체 대상자 보기</label> | |
373 | + | |
374 | + </div> | |
375 | + </div> | |
376 | + :null} */} | |
377 | + <ul className="tab-menu flex-end"> | |
378 | + {tab.map((item, idx) => { | |
379 | + return ( | |
380 | + <li onClick={() => setTabIndex(idx)} className={idx == tabIndex ? 'active' : null}> | |
381 | + {item.title} | |
382 | + </li> | |
383 | + ) | |
384 | + })} | |
385 | + </ul> | |
386 | + <div className="content-wrap userlist"> | |
387 | + | |
388 | + <ul className="tab-content"> | |
389 | + <li> | |
390 | + {tab[tabIndex].content} | |
391 | + </li> | |
392 | + </ul> | |
393 | + </div> | |
394 | + </div> | |
395 | + </div> | |
396 | + </div> | |
397 | + </div> | |
398 | + </div> | |
399 | + </main> | |
400 | + ); | |
401 | +} |
+++ client/views/pages/healthcare/TeamMedicalcare.jsx
... | ... | @@ -0,0 +1,1705 @@ |
1 | +import React from "react"; | |
2 | +import { useNavigate, useLocation } from "react-router"; | |
3 | +import { useSelector } from "react-redux"; | |
4 | + | |
5 | + | |
6 | +import SubTitle from "../../component/SubTitle.jsx"; | |
7 | +import Modal from "../../component/Modal.jsx"; | |
8 | +import DetailTitle from "../../component/DetailTitle.jsx"; | |
9 | +import Pagination from "../../component/Pagination.jsx"; | |
10 | +import CommonFile from "../../component/file/CommonFile.jsx"; | |
11 | + | |
12 | +import CommonUtil from "../../../resources/js/CommonUtil.js"; | |
13 | + | |
14 | + | |
15 | +export default function UserAuthoriySelect() { | |
16 | + const navigate = useNavigate(); | |
17 | + const location = useLocation(); | |
18 | + | |
19 | + //전역 변수 저장 객체 | |
20 | + const state = useSelector((state) => {return state}); | |
21 | + const defaultUserId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['user_id']; | |
22 | + | |
23 | + //검색(엔터) | |
24 | + const searchingEnter = (key) => { | |
25 | + if (key == 'Enter') { | |
26 | + searching(); | |
27 | + } else { | |
28 | + return; | |
29 | + } | |
30 | + } | |
31 | + //검색 | |
32 | + const searching = () => { | |
33 | + if (CommonUtil.isEmpty(state.loginUser) == false | |
34 | + && state.loginUser['authority'] == 'ROLE_AGENCY' && isMySenior) { | |
35 | + senior.search['agent_id'] = state.loginUser['user_id']; | |
36 | + } else { | |
37 | + senior.search['agent_id'] = null; | |
38 | + } | |
39 | + | |
40 | + setSenior({...senior}); | |
41 | + | |
42 | + seniorSelectList(1); | |
43 | + } | |
44 | + | |
45 | + const [isMySenior, setIsMySenior] = React.useState(true); | |
46 | + React.useEffect(() => { | |
47 | + searching(); | |
48 | + }, [isMySenior]) | |
49 | + //보호사(간호사)의 돌봄 대상자(시니어) | |
50 | + const [senior, setSenior] = React.useState({seniorList: [], seniorListCount: 0, search: { | |
51 | + 'government_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'], | |
52 | + 'agency_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id'], | |
53 | + 'searchType': null, | |
54 | + 'searchText': null, | |
55 | + 'currentPage': 1, | |
56 | + 'perPage': 10, | |
57 | + }}); | |
58 | + //보호사(간호사)의 돌봄 대상자(시니어) 목록 조회 | |
59 | + const seniorSelectList = (currentPage) => { | |
60 | + senior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
61 | + | |
62 | + fetch("/user/seniorSelectList.json", { | |
63 | + method: "POST", | |
64 | + headers: { | |
65 | + 'Content-Type': 'application/json; charset=UTF-8' | |
66 | + }, | |
67 | + body: JSON.stringify(senior.search), | |
68 | + }).then((response) => response.json()).then((data) => { | |
69 | + data.search = senior.search; | |
70 | + console.log("돌봄 대상자(시니어) 목록 조회 : ", data); | |
71 | + setSenior(data); | |
72 | + }).catch((error) => { | |
73 | + console.log('seniorSelectList() /user/seniorSelectList.json error : ', error); | |
74 | + }); | |
75 | + } | |
76 | + | |
77 | + | |
78 | + //현재 선택한 대상자 정보 | |
79 | + const [targetSenior, setTargetSenior] = React.useState({'senior_id': null}); | |
80 | + | |
81 | + //문진표 | |
82 | + const [modalOpen, setModalOpen] = React.useState(false); | |
83 | + const openModal = (senior) => { | |
84 | + targetSenior['senior_id'] = senior['senior_id']; | |
85 | + setTargetSenior(senior); | |
86 | + questionnaireSelectList(); | |
87 | + | |
88 | + setModalOpen(true); | |
89 | + }; | |
90 | + const closeModal = () => { | |
91 | + setTargetSenior({'senior_id': null}); | |
92 | + setModalOpen(false); | |
93 | + }; | |
94 | + //내원기록 | |
95 | + const [modalOpen2, setModalOpen2] = React.useState(false); | |
96 | + const openModal2 = (senior) => { | |
97 | + targetSenior['senior_id'] = senior['senior_id']; | |
98 | + setTargetSenior(senior); | |
99 | + hospitalMedicalRecordSelectList(); | |
100 | + | |
101 | + setModalOpen2(true); | |
102 | + }; | |
103 | + const closeModal2 = () => { | |
104 | + setTargetSenior({'senior_id': null}); | |
105 | + setModalOpen2(false); | |
106 | + }; | |
107 | + //심전도 | |
108 | + const [modalOpen3, setModalOpen3] = React.useState(false); | |
109 | + const openModal3 = (senior) => { | |
110 | + targetSenior['senior_id'] = senior['senior_id']; | |
111 | + setTargetSenior(senior); | |
112 | + ecgSelectList(); | |
113 | + | |
114 | + setModalOpen3(true); | |
115 | + }; | |
116 | + const closeModal3 = () => { | |
117 | + setTargetSenior({'senior_id': null}); | |
118 | + setModalOpen3(false); | |
119 | + }; | |
120 | + //혈압 | |
121 | + const [modalOpen4, setModalOpen4] = React.useState(false); | |
122 | + const openModal4 = (senior) => { | |
123 | + targetSenior['senior_id'] = senior['senior_id']; | |
124 | + setTargetSenior(senior); | |
125 | + bloodPressureSelectList(); | |
126 | + | |
127 | + setModalOpen4(true); | |
128 | + }; | |
129 | + const closeModal4 = () => { | |
130 | + setTargetSenior({'senior_id': null}); | |
131 | + setModalOpen4(false); | |
132 | + }; | |
133 | + | |
134 | + /****************** 문진표 (시작) ******************/ | |
135 | + const questionnaireInit = { | |
136 | + 'senior_id': null, | |
137 | + 'questionnaire_record_idx': null, | |
138 | + 'weight_change_amount': 0, | |
139 | + 'past_history': null, | |
140 | + 'agent_id': defaultUserId, | |
141 | + 'medical_record_idx': null, | |
142 | + | |
143 | + 'smoke_type': false, | |
144 | + 'no_smoke_period': null, | |
145 | + 'smoke_period': null, | |
146 | + 'daily_smoke_amount': null, | |
147 | + | |
148 | + 'drink_type': false, | |
149 | + 'weekly_drink_amount': null, | |
150 | + 'onetime_alcoholic_kind': null, | |
151 | + 'onetime_bottle_amount': null, | |
152 | + 'onetime_cup_amount': null, | |
153 | + | |
154 | + 'exercise_type': false, | |
155 | + 'weekly_exercise_amount': null, | |
156 | + 'onetime_exercise_hour': null, | |
157 | + 'onetime_exercise_minute': null, | |
158 | + 'onetime_exercise_kind': null, | |
159 | + | |
160 | + 'medication_pill': '', | |
161 | + 'medication_pill_etc': '', | |
162 | + }; | |
163 | + //문진표 정보 | |
164 | + const [questionnaire, setQuestionnaire] = React.useState({...questionnaireInit}); | |
165 | + const questionnaireRef = React.useRef({...questionnaireInit}); | |
166 | + | |
167 | + //문진표 등록 | |
168 | + const questionnaireInsert = () => { | |
169 | + questionnaire['senior_id'] = targetSenior['senior_id']; | |
170 | + questionnaire['agent_id'] = defaultUserId; | |
171 | + setQuestionnaire({...questionnaire}); | |
172 | + | |
173 | + fetch("/hospital/questionnaireInsert.json", { | |
174 | + method: "POST", | |
175 | + headers: { | |
176 | + 'Content-Type': 'application/json; charset=UTF-8' | |
177 | + }, | |
178 | + body: JSON.stringify(questionnaire), | |
179 | + }).then((response) => response.json()).then((data) => { | |
180 | + console.log("문진표 등록 결과(건수) : ", data); | |
181 | + if (data > 0) { | |
182 | + alert("저장완료"); | |
183 | + closeModal(); | |
184 | + } else { | |
185 | + alert("저장에 실패하였습니다. 관리자에게 문의바랍니다."); | |
186 | + } | |
187 | + }).catch((error) => { | |
188 | + console.log('questionnaireInsert() /hospital/questionnaireInsert.json error : ', error); | |
189 | + }); | |
190 | + } | |
191 | + | |
192 | + //문진표 수정 | |
193 | + const questionnaireUpdate = () => { | |
194 | + questionnaire['senior_id'] = targetSenior['senior_id']; | |
195 | + questionnaire['agent_id'] = defaultUserId; | |
196 | + setQuestionnaire({...questionnaire}); | |
197 | + | |
198 | + fetch("/hospital/questionnaireUpdate.json", { | |
199 | + method: "POST", | |
200 | + headers: { | |
201 | + 'Content-Type': 'application/json; charset=UTF-8' | |
202 | + }, | |
203 | + body: JSON.stringify(questionnaire), | |
204 | + }).then((response) => response.json()).then((data) => { | |
205 | + console.log("문진표 수정 결과(건수) : ", data); | |
206 | + if (data > 0) { | |
207 | + alert("저장완료"); | |
208 | + closeModal(); | |
209 | + } else { | |
210 | + alert("저장에 실패하였습니다. 관리자에게 문의바랍니다."); | |
211 | + } | |
212 | + }).catch((error) => { | |
213 | + console.log('questionnaireUpdate() /hospital/questionnaireUpdate.json error : ', error); | |
214 | + }); | |
215 | + } | |
216 | + | |
217 | + //문진표 목록 조회 | |
218 | + const questionnaireSelectList = () => { | |
219 | + fetch("/hospital/questionnaireSelectList.json", { | |
220 | + method: "POST", | |
221 | + headers: { | |
222 | + 'Content-Type': 'application/json; charset=UTF-8' | |
223 | + }, | |
224 | + body: JSON.stringify(targetSenior), | |
225 | + }).then((response) => response.json()).then((data) => { | |
226 | + console.log("문진표 목록 조회 결과(건수) : ", data); | |
227 | + if (CommonUtil.isEmpty(data.questionnaireList) == false) { | |
228 | + let item = data.questionnaireList[0];//최신순으로 가지고오기 때문에, 0 인텍스가 젤 최신 | |
229 | + if (CommonUtil.isEmpty(item['medication_pill'])) { | |
230 | + item['medication_pill'] = ''; | |
231 | + } else { | |
232 | + const startCheckWord = '기타「'; | |
233 | + const endCheckWord = '」'; | |
234 | + if (item['medication_pill'].indexOf(startCheckWord) > -1) { | |
235 | + let startIndex = item['medication_pill'].indexOf(startCheckWord); | |
236 | + let lastIndex = item['medication_pill'].lastIndexOf(endCheckWord); | |
237 | + console.log("000000 item['medication_pill_etc'] : ", item['medication_pill_etc'], "item['medication_pill'] : ", item['medication_pill']); | |
238 | + item['medication_pill_etc'] = item['medication_pill'].substring(startIndex + startCheckWord.length, lastIndex); | |
239 | + let medicationPillFront = item['medication_pill'].substring(0, startIndex + startCheckWord.length); | |
240 | + let medicationPillBack = item['medication_pill'].substring(lastIndex); | |
241 | + item['medication_pill'] = medicationPillFront + medicationPillBack; | |
242 | + console.log("333333 item['medication_pill_etc'] : ", item['medication_pill_etc'], "item['medication_pill'] : ", item['medication_pill']); | |
243 | + } else { | |
244 | + item['medication_pill_etc'] = ''; | |
245 | + } | |
246 | + } | |
247 | + | |
248 | + setQuestionnaire(item); | |
249 | + } | |
250 | + }).catch((error) => { | |
251 | + console.log('questionnaireSelectList() /hospital/questionnaireSelectList.json error : ', error); | |
252 | + }); | |
253 | + } | |
254 | + /****************** 문진표 (종료) ******************/ | |
255 | + | |
256 | + | |
257 | + | |
258 | + /****************** 병원 진료 기록 (시작) ******************/ | |
259 | + const hospitalMedicalRecordInit = { | |
260 | + 'senior_id': null, | |
261 | + 'medical_record_idx': null, | |
262 | + 'medical_date': CommonUtil.getDate(), | |
263 | + 'medical_reason': '', | |
264 | + 'medical_content': '', | |
265 | + 'agent_id': defaultUserId | |
266 | + }; | |
267 | + //병원 진료 기록 정보 | |
268 | + const [hospitalMedicalRecord, setHospitalMedicalRecord] = React.useState({...hospitalMedicalRecordInit}); | |
269 | + const hospitalMedicalRecordRef = React.useRef({...hospitalMedicalRecordInit}); | |
270 | + | |
271 | + //병원 진료 기록 유효성 검사 | |
272 | + const hospitalMedicalRecordValidation = () => { | |
273 | + const target = hospitalMedicalRecord; | |
274 | + const targetRef = hospitalMedicalRecordRef; | |
275 | + | |
276 | + if (CommonUtil.isEmpty(target['medical_date']) == true) { | |
277 | + targetRef.current['medical_date'].focus(); | |
278 | + alert("진료 일자를 선택해 주세요."); | |
279 | + return false; | |
280 | + } | |
281 | + if (CommonUtil.isEmpty(target['medical_reason']) == true) { | |
282 | + targetRef.current['medical_reason'].focus(); | |
283 | + alert("진료 사유를 입력해 주세요."); | |
284 | + return false; | |
285 | + } | |
286 | + if (CommonUtil.isEmpty(target['medical_content']) == true) { | |
287 | + targetRef.current['medical_content'].focus(); | |
288 | + alert("진료 내용을 입력해 주세요."); | |
289 | + return false; | |
290 | + } | |
291 | + | |
292 | + return true; | |
293 | + } | |
294 | + | |
295 | + | |
296 | + //병원 진료 기록 등록 | |
297 | + const hospitalMedicalRecordInsert = () => { | |
298 | + if (hospitalMedicalRecordValidation() == false) { | |
299 | + return; | |
300 | + } | |
301 | + | |
302 | + hospitalMedicalRecord['senior_id'] = targetSenior['senior_id']; | |
303 | + hospitalMedicalRecord['agent_id'] = defaultUserId; | |
304 | + setHospitalMedicalRecord({...hospitalMedicalRecord}); | |
305 | + | |
306 | + fetch("/hospital/hospitalMedicalRecordInsert.json", { | |
307 | + method: "POST", | |
308 | + headers: { | |
309 | + 'Content-Type': 'application/json; charset=UTF-8' | |
310 | + }, | |
311 | + body: JSON.stringify(hospitalMedicalRecord), | |
312 | + }).then((response) => response.json()).then((data) => { | |
313 | + console.log("병원 진료 기록 등록 결과(건수) : ", data); | |
314 | + if (data > 0) { | |
315 | + setHospitalMedicalRecordInit(); | |
316 | + hospitalMedicalRecordSelectList(); | |
317 | + //closeModal2(); | |
318 | + alert("등록완료"); | |
319 | + | |
320 | + } else { | |
321 | + alert("등록에 실패하였습니다. 관리자에게 문의바랍니다."); | |
322 | + } | |
323 | + }).catch((error) => { | |
324 | + console.log('hospitalMedicalRecordInsert() /hospital/hospitalMedicalRecordInsert.json error : ', error); | |
325 | + }); | |
326 | + } | |
327 | + | |
328 | + //병원 진료 기록 수정 | |
329 | + const hospitalMedicalRecordUpdate = () => { | |
330 | + if (hospitalMedicalRecordValidation() == false) { | |
331 | + return; | |
332 | + } | |
333 | + | |
334 | + hospitalMedicalRecord['senior_id'] = targetSenior['senior_id']; | |
335 | + hospitalMedicalRecord['agent_id'] = defaultUserId; | |
336 | + setHospitalMedicalRecord({...hospitalMedicalRecord}); | |
337 | + | |
338 | + fetch("/hospital/hospitalMedicalRecordUpdate.json", { | |
339 | + method: "POST", | |
340 | + headers: { | |
341 | + 'Content-Type': 'application/json; charset=UTF-8' | |
342 | + }, | |
343 | + body: JSON.stringify(hospitalMedicalRecord), | |
344 | + }).then((response) => response.json()).then((data) => { | |
345 | + console.log("병원 진료 기록 수정 결과(건수) : ", data); | |
346 | + if (data > 0) { | |
347 | + setHospitalMedicalRecordInit(); | |
348 | + hospitalMedicalRecordSelectList(); | |
349 | + //closeModal2(); | |
350 | + alert("수정완료"); | |
351 | + } else { | |
352 | + alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); | |
353 | + } | |
354 | + }).catch((error) => { | |
355 | + console.log('hospitalMedicalRecordUpdate() /hospital/hospitalMedicalRecordUpdate.json error : ', error); | |
356 | + }); | |
357 | + } | |
358 | + | |
359 | + //병원 진료 기록 삭제 | |
360 | + const hospitalMedicalRecordDelete = () => { | |
361 | + if (confirm('진료 기록을 삭제하시겠습니까?') == false) { | |
362 | + return; | |
363 | + } | |
364 | + | |
365 | + fetch("/hospital/hospitalMedicalRecordDelete.json", { | |
366 | + method: "POST", | |
367 | + headers: { | |
368 | + 'Content-Type': 'application/json; charset=UTF-8' | |
369 | + }, | |
370 | + body: JSON.stringify(hospitalMedicalRecord), | |
371 | + }).then((response) => response.json()).then((data) => { | |
372 | + console.log("병원 진료 기록 삭제 결과(건수) : ", data); | |
373 | + if (data > 0) { | |
374 | + setHospitalMedicalRecordInit(); | |
375 | + hospitalMedicalRecordSelectList(); | |
376 | + //closeModal2(); | |
377 | + alert("삭제완료"); | |
378 | + } else { | |
379 | + alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); | |
380 | + } | |
381 | + }).catch((error) => { | |
382 | + console.log('hospitalMedicalRecordDelete() /hospital/hospitalMedicalRecordDelete.json error : ', error); | |
383 | + }); | |
384 | + } | |
385 | + | |
386 | + //초기화 취소 | |
387 | + const setHospitalMedicalRecordInit = () => { | |
388 | + setHospitalMedicalRecord({...hospitalMedicalRecordInit}); | |
389 | + } | |
390 | + | |
391 | + //병원 진료 기록 정보 | |
392 | + const [hospitalMedicalRecordList, setHospitalMedicalRecordList] = React.useState({hospitalMedicalRecordList: [], hospitalMedicalRecordListCount:0, search: {currentPage: 1, perPage: 5}}); | |
393 | + //병원 진료 기록 목록 조회 | |
394 | + const hospitalMedicalRecordSelectList = (currentPage) => { | |
395 | + hospitalMedicalRecordList.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
396 | + hospitalMedicalRecordList.search['senior_id'] = targetSenior['senior_id']; | |
397 | + setHospitalMedicalRecordList({...hospitalMedicalRecordList}); | |
398 | + | |
399 | + fetch("/hospital/hospitalMedicalRecordSelectList.json", { | |
400 | + method: "POST", | |
401 | + headers: { | |
402 | + 'Content-Type': 'application/json; charset=UTF-8' | |
403 | + }, | |
404 | + body: JSON.stringify(hospitalMedicalRecordList.search), | |
405 | + }).then((response) => response.json()).then((data) => { | |
406 | + console.log("병원 진료 기록 목록 조회 결과(건수) : ", data); | |
407 | + data.search = hospitalMedicalRecordList.search; | |
408 | + setHospitalMedicalRecordList(data); | |
409 | + }).catch((error) => { | |
410 | + console.log('hospitalMedicalRecordSelectList() /hospital/hospitalMedicalRecordSelectList.json error : ', error); | |
411 | + }); | |
412 | + } | |
413 | + /****************** 병원 진료 기록 (종료) ******************/ | |
414 | + | |
415 | + | |
416 | + | |
417 | + /****************** 심전도 (시작) ******************/ | |
418 | + const ecgInit = { | |
419 | + 'senior_id': null, | |
420 | + 'ecg_record_idx': null, | |
421 | + 'bradycardia_count': 0, | |
422 | + 'tachycardia_count': 0, | |
423 | + 'max_heart_rate': 0.0, | |
424 | + 'min_heart_rate': 0.0, | |
425 | + 'abnormal_heart_rate': 0.0, | |
426 | + 'average_heart_rate': 0.0, | |
427 | + 'max_rr': 0.0, | |
428 | + 'min_rr': 0.0, | |
429 | + 'average_rr': 0.0, | |
430 | + 'ecg_reading_date': CommonUtil.getDate(), | |
431 | + 'ecg_finding_type': '', | |
432 | + 'ecg_finding_content': '', | |
433 | + 'agent_id': defaultUserId, | |
434 | + 'medical_record_idx': null, | |
435 | + 'common_group_file_idx': null, | |
436 | + commonFileList: [],//심전도 업로드 파일 목록 | |
437 | + | |
438 | + isEdit: false,//직접 수정일 때, true (수정 or 등록 상관없음); | |
439 | + }; | |
440 | + //심전도 정보 | |
441 | + const [ecg, setEcg] = React.useState({...ecgInit}); | |
442 | + const ecgRef = React.useRef({...ecgInit}); | |
443 | + | |
444 | + //심전도 유효성 검사 | |
445 | + const ecgValidation = () => { | |
446 | + const target = ecg; | |
447 | + const targetRef = ecgRef; | |
448 | + | |
449 | + if (CommonUtil.isEmpty(target['ecg_reading_date']) == true) { | |
450 | + targetRef.current['ecg_reading_date'].focus(); | |
451 | + alert("판독 소견 측정 일자를 선택해 주세요."); | |
452 | + return false; | |
453 | + } | |
454 | + if (CommonUtil.isEmpty(target['ecg_finding_type']) == true) { | |
455 | + targetRef.current['ecg_finding_type'].focus(); | |
456 | + alert("판독 소견 측정 종류를 입력해 주세요."); | |
457 | + return false; | |
458 | + } | |
459 | + if (CommonUtil.isEmpty(target['ecg_finding_content']) == true) { | |
460 | + targetRef.current['ecg_finding_content'].focus(); | |
461 | + alert("판독 소견 측정 내용을 입력해 주세요."); | |
462 | + return false; | |
463 | + } | |
464 | + //파일 입력 | |
465 | + if (target.isEdit == false) { | |
466 | + if (CommonUtil.isEmpty(target['commonFileList']) == true) { | |
467 | + //targetRef.current['commonFileList'].focus(); | |
468 | + alert("심전도 측정 파일을 올려주세요."); | |
469 | + return false; | |
470 | + } | |
471 | + } else {//직접 입력 | |
472 | + if (CommonUtil.isEmpty(target['bradycardia_count']) == true) { | |
473 | + targetRef.current['bradycardia_count'].focus(); | |
474 | + alert("서맥 횟수를 입력해 주세요."); | |
475 | + return false; | |
476 | + } | |
477 | + if (CommonUtil.isEmpty(target['tachycardia_count']) == true) { | |
478 | + targetRef.current['tachycardia_count'].focus(); | |
479 | + alert("빈맥 횟수 입력해 주세요."); | |
480 | + return false; | |
481 | + } | |
482 | + if (CommonUtil.isEmpty(target['max_heart_rate']) == true) { | |
483 | + targetRef.current['average_heart_rate'].focus(); | |
484 | + alert("최대 심박수를 입력해 주세요."); | |
485 | + return false; | |
486 | + } | |
487 | + if (CommonUtil.isEmpty(target['min_heart_rate']) == true) { | |
488 | + targetRef.current['average_heart_rate'].focus(); | |
489 | + alert("최소 심박수를 입력해 주세요."); | |
490 | + return false; | |
491 | + } | |
492 | + if (CommonUtil.isEmpty(target['average_heart_rate']) == true) { | |
493 | + targetRef.current['average_heart_rate'].focus(); | |
494 | + alert("평균 심박수를 입력해 주세요."); | |
495 | + return false; | |
496 | + } | |
497 | + if (CommonUtil.isEmpty(target['abnormal_heart_rate']) == true) { | |
498 | + targetRef.current['abnormal_heart_rate'].focus(); | |
499 | + alert("이상 심박수를 입력해 주세요."); | |
500 | + return false; | |
501 | + } | |
502 | + if (CommonUtil.isEmpty(target['max_rr']) == true) { | |
503 | + targetRef.current['max_rr'].focus(); | |
504 | + alert("최대 R-R를 입력해 주세요."); | |
505 | + return false; | |
506 | + } | |
507 | + if (CommonUtil.isEmpty(target['min_rr']) == true) { | |
508 | + targetRef.current['min_rr'].focus(); | |
509 | + alert("최소 R-R를 입력해 주세요."); | |
510 | + return false; | |
511 | + } | |
512 | + if (CommonUtil.isEmpty(target['average_rr']) == true) { | |
513 | + targetRef.current['average_rr'].focus(); | |
514 | + alert("평균 R-R를 입력해 주세요."); | |
515 | + return false; | |
516 | + } | |
517 | + } | |
518 | + | |
519 | + return true; | |
520 | + } | |
521 | + | |
522 | + | |
523 | + //심전도 등록 | |
524 | + const ecgInsert = () => { | |
525 | + if (ecgValidation() == false) { | |
526 | + return; | |
527 | + } | |
528 | + | |
529 | + ecg['senior_id'] = targetSenior['senior_id']; | |
530 | + ecg['agent_id'] = defaultUserId; | |
531 | + setEcg({...ecg}); | |
532 | + | |
533 | + fetch("/hospital/ecgInsert.json", { | |
534 | + method: "POST", | |
535 | + headers: { | |
536 | + 'Content-Type': 'application/json; charset=UTF-8' | |
537 | + }, | |
538 | + body: JSON.stringify(ecg), | |
539 | + }).then((response) => response.json()).then((data) => { | |
540 | + console.log("심전도 등록 결과(건수) : ", data); | |
541 | + if (data > 0) { | |
542 | + setEcgInit(); | |
543 | + ecgSelectList(); | |
544 | + //closeModal3(); | |
545 | + alert("등록완료"); | |
546 | + | |
547 | + } else { | |
548 | + alert("등록에 실패하였습니다. 관리자에게 문의바랍니다."); | |
549 | + } | |
550 | + }).catch((error) => { | |
551 | + console.log('ecgInsert() /hospital/ecgInsert.json error : ', error); | |
552 | + }); | |
553 | + } | |
554 | + | |
555 | + //심전도 수정 | |
556 | + const ecgUpdate = () => { | |
557 | + if (ecgValidation() == false) { | |
558 | + return; | |
559 | + } | |
560 | + | |
561 | + ecg['senior_id'] = targetSenior['senior_id']; | |
562 | + ecg['agent_id'] = defaultUserId; | |
563 | + setEcg({...ecg}); | |
564 | + | |
565 | + fetch("/hospital/ecgUpdate.json", { | |
566 | + method: "POST", | |
567 | + headers: { | |
568 | + 'Content-Type': 'application/json; charset=UTF-8' | |
569 | + }, | |
570 | + body: JSON.stringify(ecg), | |
571 | + }).then((response) => response.json()).then((data) => { | |
572 | + console.log("심전도 수정 결과(건수) : ", data); | |
573 | + if (data > 0) { | |
574 | + setEcgInit(); | |
575 | + ecg.commonFileList = []; | |
576 | + setEcg({...ecg}); | |
577 | + ecgSelectList(); | |
578 | + //closeModal3(); | |
579 | + alert("수정완료"); | |
580 | + } else { | |
581 | + alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); | |
582 | + } | |
583 | + }).catch((error) => { | |
584 | + console.log('ecgUpdate() /hospital/ecgUpdate.json error : ', error); | |
585 | + }); | |
586 | + } | |
587 | + | |
588 | + //심전도 삭제 | |
589 | + const ecgDelete = () => { | |
590 | + if (confirm('심전도 판독 소견을 삭제하시겠습니까?') == false) { | |
591 | + return; | |
592 | + } | |
593 | + | |
594 | + fetch("/hospital/ecgDelete.json", { | |
595 | + method: "POST", | |
596 | + headers: { | |
597 | + 'Content-Type': 'application/json; charset=UTF-8' | |
598 | + }, | |
599 | + body: JSON.stringify(ecg), | |
600 | + }).then((response) => response.json()).then((data) => { | |
601 | + console.log("심전도 삭제 결과(건수) : ", data); | |
602 | + if (data > 0) { | |
603 | + setEcgInit(); | |
604 | + ecg.commonFileList = []; | |
605 | + setEcg({...ecg}); | |
606 | + ecgSelectList(); | |
607 | + //closeModal3(); | |
608 | + alert("삭제완료"); | |
609 | + } else { | |
610 | + alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); | |
611 | + } | |
612 | + }).catch((error) => { | |
613 | + console.log('ecgDelete() /hospital/ecgDelete.json error : ', error); | |
614 | + }); | |
615 | + } | |
616 | + | |
617 | + //초기화 취소 | |
618 | + const setEcgInit = () => { | |
619 | + setEcg({...ecgInit}); | |
620 | + } | |
621 | + | |
622 | + //심전도 정보 | |
623 | + const [ecgList, setEcgList] = React.useState({ecgList: [], ecgListCount:0, search: {currentPage: 1, perPage: 5}}); | |
624 | + //심전도 목록 조회 | |
625 | + const ecgSelectList = (currentPage) => { | |
626 | + ecgList.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
627 | + ecgList.search['senior_id'] = targetSenior['senior_id']; | |
628 | + setEcgList({...ecgList}); | |
629 | + | |
630 | + fetch("/hospital/ecgSelectList.json", { | |
631 | + method: "POST", | |
632 | + headers: { | |
633 | + 'Content-Type': 'application/json; charset=UTF-8' | |
634 | + }, | |
635 | + body: JSON.stringify(ecgList.search), | |
636 | + }).then((response) => response.json()).then((data) => { | |
637 | + console.log("심전도 목록 조회 결과(건수) : ", data); | |
638 | + data.search = ecgList.search; | |
639 | + setEcgList(data); | |
640 | + }).catch((error) => { | |
641 | + console.log('ecgSelectList() /hospital/ecgSelectList.json error : ', error); | |
642 | + }); | |
643 | + } | |
644 | + /****************** 심전도 기록 (종료) ******************/ | |
645 | + | |
646 | + | |
647 | + | |
648 | + /****************** 혈압 (시작) ******************/ | |
649 | + const bloodPressureInit = { | |
650 | + 'senior_id': null, | |
651 | + 'blood_pressure_record_idx': null, | |
652 | + 'max_blood_pressure': null, | |
653 | + 'min_blood_pressure': null, | |
654 | + 'pulse_rate': null, | |
655 | + 'medical_record_idx': null, | |
656 | + 'blood_pressure_record_date': CommonUtil.getDate(), | |
657 | + 'agent_id': defaultUserId | |
658 | + }; | |
659 | + //혈압 정보 | |
660 | + const [bloodPressure, setBloodPressure] = React.useState({...bloodPressureInit}); | |
661 | + const bloodPressureRef = React.useRef({...bloodPressureInit}); | |
662 | + | |
663 | + //혈압 유효성 검사 | |
664 | + const bloodPressureValidation = () => { | |
665 | + const target = bloodPressure; | |
666 | + const targetRef = bloodPressureRef; | |
667 | + | |
668 | + if (CommonUtil.isEmpty(target['blood_pressure_record_date']) == true) { | |
669 | + targetRef.current['blood_pressure_record_date'].focus(); | |
670 | + alert("진료 일자를 선택해 주세요."); | |
671 | + return false; | |
672 | + } | |
673 | + if (CommonUtil.isEmpty(target['max_blood_pressure']) == true) { | |
674 | + targetRef.current['max_blood_pressure'].focus(); | |
675 | + alert("최고 혈압을 입력해 주세요."); | |
676 | + return false; | |
677 | + } | |
678 | + if (CommonUtil.isEmpty(target['min_blood_pressure']) == true) { | |
679 | + targetRef.current['min_blood_pressure'].focus(); | |
680 | + alert("최저 혈압을 입력해 주세요."); | |
681 | + return false; | |
682 | + } | |
683 | + if (CommonUtil.isEmpty(target['pulse_rate']) == true) { | |
684 | + targetRef.current['pulse_rate'].focus(); | |
685 | + alert("맥박수를 입력해 주세요."); | |
686 | + return false; | |
687 | + } | |
688 | + | |
689 | + return true; | |
690 | + } | |
691 | + | |
692 | + | |
693 | + //혈압 등록 | |
694 | + const bloodPressureInsert = () => { | |
695 | + if (bloodPressureValidation() == false) { | |
696 | + return; | |
697 | + } | |
698 | + | |
699 | + bloodPressure['senior_id'] = targetSenior['senior_id']; | |
700 | + bloodPressure['agent_id'] = defaultUserId; | |
701 | + setBloodPressure({...bloodPressure}); | |
702 | + | |
703 | + fetch("/hospital/bloodPressureInsert.json", { | |
704 | + method: "POST", | |
705 | + headers: { | |
706 | + 'Content-Type': 'application/json; charset=UTF-8' | |
707 | + }, | |
708 | + body: JSON.stringify(bloodPressure), | |
709 | + }).then((response) => response.json()).then((data) => { | |
710 | + console.log("혈압 등록 결과(건수) : ", data); | |
711 | + if (data > 0) { | |
712 | + setBloodPressureInit(); | |
713 | + bloodPressureSelectList(); | |
714 | + //closeModal2(); | |
715 | + alert("등록완료"); | |
716 | + | |
717 | + } else { | |
718 | + alert("등록에 실패하였습니다. 관리자에게 문의바랍니다."); | |
719 | + } | |
720 | + }).catch((error) => { | |
721 | + console.log('bloodPressureInsert() /hospital/bloodPressureInsert.json error : ', error); | |
722 | + }); | |
723 | + } | |
724 | + | |
725 | + //혈압 수정 | |
726 | + const bloodPressureUpdate = () => { | |
727 | + if (bloodPressureValidation() == false) { | |
728 | + return; | |
729 | + } | |
730 | + | |
731 | + bloodPressure['senior_id'] = targetSenior['senior_id']; | |
732 | + bloodPressure['agent_id'] = defaultUserId; | |
733 | + setBloodPressure({...bloodPressure}); | |
734 | + | |
735 | + fetch("/hospital/bloodPressureUpdate.json", { | |
736 | + method: "POST", | |
737 | + headers: { | |
738 | + 'Content-Type': 'application/json; charset=UTF-8' | |
739 | + }, | |
740 | + body: JSON.stringify(bloodPressure), | |
741 | + }).then((response) => response.json()).then((data) => { | |
742 | + console.log("혈압 수정 결과(건수) : ", data); | |
743 | + if (data > 0) { | |
744 | + setBloodPressureInit(); | |
745 | + bloodPressureSelectList(); | |
746 | + //closeModal2(); | |
747 | + alert("수정완료"); | |
748 | + } else { | |
749 | + alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); | |
750 | + } | |
751 | + }).catch((error) => { | |
752 | + console.log('bloodPressureUpdate() /hospital/bloodPressureUpdate.json error : ', error); | |
753 | + }); | |
754 | + } | |
755 | + | |
756 | + //혈압 삭제 | |
757 | + const bloodPressureDelete = () => { | |
758 | + if (confirm('혈압 측정 정보를 삭제하시겠습니까?') == false) { | |
759 | + return; | |
760 | + } | |
761 | + | |
762 | + fetch("/hospital/bloodPressureDelete.json", { | |
763 | + method: "POST", | |
764 | + headers: { | |
765 | + 'Content-Type': 'application/json; charset=UTF-8' | |
766 | + }, | |
767 | + body: JSON.stringify(bloodPressure), | |
768 | + }).then((response) => response.json()).then((data) => { | |
769 | + console.log("혈압 삭제 결과(건수) : ", data); | |
770 | + if (data > 0) { | |
771 | + setBloodPressureInit(); | |
772 | + bloodPressureSelectList(); | |
773 | + //closeModal2(); | |
774 | + alert("삭제완료"); | |
775 | + } else { | |
776 | + alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); | |
777 | + } | |
778 | + }).catch((error) => { | |
779 | + console.log('bloodPressureDelete() /hospital/bloodPressureDelete.json error : ', error); | |
780 | + }); | |
781 | + } | |
782 | + | |
783 | + //초기화 취소 | |
784 | + const setBloodPressureInit = () => { | |
785 | + setBloodPressure({...bloodPressureInit}); | |
786 | + } | |
787 | + | |
788 | + //혈압 정보 | |
789 | + const [bloodPressureList, setBloodPressureList] = React.useState({bloodPressureList: [], bloodPressureListCount:0, search: {currentPage: 1, perPage: 5}}); | |
790 | + //혈압 목록 조회 | |
791 | + const bloodPressureSelectList = (currentPage) => { | |
792 | + bloodPressureList.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; | |
793 | + bloodPressureList.search['senior_id'] = targetSenior['senior_id']; | |
794 | + setBloodPressureList({...bloodPressureList}); | |
795 | + | |
796 | + fetch("/hospital/bloodPressureSelectList.json", { | |
797 | + method: "POST", | |
798 | + headers: { | |
799 | + 'Content-Type': 'application/json; charset=UTF-8' | |
800 | + }, | |
801 | + body: JSON.stringify(bloodPressureList.search), | |
802 | + }).then((response) => response.json()).then((data) => { | |
803 | + console.log("혈압 목록 조회 결과(건수) : ", data); | |
804 | + data.search = bloodPressureList.search; | |
805 | + setBloodPressureList(data); | |
806 | + }).catch((error) => { | |
807 | + console.log('bloodPressureSelectList() /hospital/bloodPressureSelectList.json error : ', error); | |
808 | + }); | |
809 | + } | |
810 | + /****************** 혈압 (종료) ******************/ | |
811 | + | |
812 | + React.useEffect(() => { | |
813 | + searching(); | |
814 | + }, []); | |
815 | + | |
816 | + | |
817 | + //현재 탭 Index | |
818 | + const [tabIndex, setTabIndex] = React.useState(0); | |
819 | + //탭 초기화 | |
820 | + const tab = [{ | |
821 | + title: `문진표관리`, | |
822 | + content: ( | |
823 | + <div> | |
824 | + <div className="flex equip-tab"> | |
825 | + <SubTitle explanation={"돌봄 대상자의 병원 내원 기록 및 문진표를 관리할 수 있습니다."} /> | |
826 | + </div> | |
827 | + <table className={"protector-user"}> | |
828 | + <thead> | |
829 | + <tr> | |
830 | + <th>No</th> | |
831 | + <th>소속기관명</th> | |
832 | + <th>이름</th> | |
833 | + <th>생년월일</th> | |
834 | + <th>성별</th> | |
835 | + <th>연락처</th> | |
836 | + <th>문진표관리</th> | |
837 | + <th>내원기록관리</th> | |
838 | + </tr> | |
839 | + </thead> | |
840 | + <tbody> | |
841 | + {senior.seniorList.map((item, idx) => { return ( | |
842 | + <tr key={idx}> | |
843 | + <td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> | |
844 | + <td data-label="소속기관명">{item['agency_name']}</td> | |
845 | + <td data-label="이름">{item['user_name']}</td> | |
846 | + <td data-label="생년월일">{item['user_birth']}</td> | |
847 | + <td data-label="성별">{item['user_gender']}</td> | |
848 | + <td data-label="연락처">{item['user_phonenumber']}</td> | |
849 | + <td data-label="문진표관리"> | |
850 | + <button className="btn-small gray-btn" onClick={() => openModal(item)}>작성하기</button> | |
851 | + </td> | |
852 | + <td data-label="내원기록관리"> | |
853 | + <button className="btn-small gray-btn" onClick={() => openModal2(item)}>작성하기</button> | |
854 | + </td> | |
855 | + </tr> | |
856 | + )})} | |
857 | + {CommonUtil.isEmpty(senior.seniorList) ? | |
858 | + <tr> | |
859 | + <td colSpan={8}>조회된 데이터가 없습니다</td> | |
860 | + </tr> | |
861 | + : null} | |
862 | + </tbody> | |
863 | + </table> | |
864 | + <Pagination | |
865 | + currentPage={senior.search.currentPage} | |
866 | + perPage={senior.search.perPage} | |
867 | + totalCount={senior.seniorListCount} | |
868 | + maxRange={5} | |
869 | + click={seniorSelectList} | |
870 | + /> | |
871 | + </div> | |
872 | + ) | |
873 | + }, { | |
874 | + title: `심전도관리`, | |
875 | + content: ( | |
876 | + <div> | |
877 | + <div className="flex equip-tab"> | |
878 | + <SubTitle explanation={"돌봄 대상자의 심전도 정보를 관리할 수 있습니다."} /> | |
879 | + </div> | |
880 | + <table className={"protector-user"}> | |
881 | + <thead> | |
882 | + <tr> | |
883 | + <th>No</th> | |
884 | + <th>소속기관명</th> | |
885 | + <th>이름</th> | |
886 | + <th>생년월일</th> | |
887 | + <th>성별</th> | |
888 | + <th>연락처</th> | |
889 | + <th>심전도관리</th> | |
890 | + </tr> | |
891 | + </thead> | |
892 | + <tbody> | |
893 | + {senior.seniorList.map((item, idx) => { return ( | |
894 | + <tr key={idx}> | |
895 | + <td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> | |
896 | + <td data-label="소속기관명">{item['agency_name']}</td> | |
897 | + <td data-label="이름">{item['user_name']}</td> | |
898 | + <td data-label="생년월일">{item['user_birth']}</td> | |
899 | + <td data-label="성별">{item['user_gender']}</td> | |
900 | + <td data-label="연락처">{item['user_phonenumber']}</td> | |
901 | + <td data-label="심전도관리"> | |
902 | + <button className="btn-small gray-btn" onClick={() => openModal3(item)}>심전도관리</button> | |
903 | + </td> | |
904 | + </tr> | |
905 | + )})} | |
906 | + {CommonUtil.isEmpty(senior.seniorList) ? | |
907 | + <tr> | |
908 | + <td colSpan={7}>조회된 데이터가 없습니다</td> | |
909 | + </tr> | |
910 | + : null} | |
911 | + </tbody> | |
912 | + </table> | |
913 | + <Pagination | |
914 | + currentPage={senior.search.currentPage} | |
915 | + perPage={senior.search.perPage} | |
916 | + totalCount={senior.seniorListCount} | |
917 | + maxRange={5} | |
918 | + click={seniorSelectList} | |
919 | + /> | |
920 | + </div> | |
921 | + ) | |
922 | + }, { | |
923 | + title: `혈압관리`, | |
924 | + content: ( | |
925 | + <div> | |
926 | + <div className="flex equip-tab"> | |
927 | + <SubTitle explanation={"돌봄 대상자의 혈압 정보를 관리할 수 있습니다."} /> | |
928 | + </div> | |
929 | + <table className={"protector-user"}> | |
930 | + <thead> | |
931 | + <tr> | |
932 | + <th>No</th> | |
933 | + <th>소속기관명</th> | |
934 | + <th>이름</th> | |
935 | + <th>생년월일</th> | |
936 | + <th>성별</th> | |
937 | + <th>연락처</th> | |
938 | + <th>혈압관리</th> | |
939 | + </tr> | |
940 | + </thead> | |
941 | + <tbody> | |
942 | + {senior.seniorList.map((item, idx) => { return ( | |
943 | + <tr key={idx}> | |
944 | + <td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> | |
945 | + <td data-label="소속기관명">{item['agency_name']}</td> | |
946 | + <td data-label="이름">{item['user_name']}</td> | |
947 | + <td data-label="생년월일">{item['user_birth']}</td> | |
948 | + <td data-label="성별">{item['user_gender']}</td> | |
949 | + <td data-label="연락처">{item['user_phonenumber']}</td> | |
950 | + <td data-label="혈압관리"> | |
951 | + <button className="btn-small gray-btn" onClick={() => openModal4(item)}>혈압관리</button> | |
952 | + </td> | |
953 | + </tr> | |
954 | + )})} | |
955 | + {CommonUtil.isEmpty(senior.seniorList) ? | |
956 | + <tr> | |
957 | + <td colSpan={7}>조회된 데이터가 없습니다</td> | |
958 | + </tr> | |
959 | + : null} | |
960 | + </tbody> | |
961 | + </table> | |
962 | + <Pagination | |
963 | + currentPage={senior.search.currentPage} | |
964 | + perPage={senior.search.perPage} | |
965 | + totalCount={senior.seniorListCount} | |
966 | + maxRange={5} | |
967 | + click={seniorSelectList} | |
968 | + /> | |
969 | + </div> | |
970 | + ) | |
971 | + }]; | |
972 | + | |
973 | + return ( | |
974 | + <main> | |
975 | + | |
976 | + {/* <Modal_Questionnaire open={modalOpen} close={closeModal} /> */} | |
977 | + {/* <Modal_MedicalHistory open={modalOpen2} close={closeModal2} /> */} | |
978 | + {/* <Modal_ECG open={modalOpen3} close={closeModal3} /> */} | |
979 | + {/* <Modal_Blood open={modalOpen4} close={closeModal4} /> */} | |
980 | + | |
981 | + <div className="search-management flex-start margin-bottom2"> | |
982 | + <select style={{maxWidth: '150px'}} | |
983 | + onChange={(e) => {senior.search.searchType = e.target.value; setSenior({...senior});}}> | |
984 | + <option value="" selected={CommonUtil.isEmpty(senior.search.searchType)}>전체</option> | |
985 | + <option value="user_name" selected={senior.search.searchType == 'user_name'}>이름</option> | |
986 | + <option value="user_id" selected={senior.search.searchType == 'user_id'}>아이디</option> | |
987 | + <option value="user_phonenumber" selected={senior.search.searchType == 'user_phonenumber'}>연락처</option> | |
988 | + </select> | |
989 | + <input type="text" className="senior-search" value={senior.search.searchText} | |
990 | + onChange={(e) => {senior.search.searchText = e.target.value; setSenior({...senior});}} | |
991 | + onKeyUp={(e) => searchingEnter(e.key)}/> | |
992 | + <button className="btn-small gray-btn" onClick={searching}>검색</button> | |
993 | + </div> | |
994 | + | |
995 | + <div className="content-wrap"> | |
996 | + <DetailTitle contentTitle={"대상자의 문진표 / 심전도 / 혈압 관리를 할 수 있습니다."} /> | |
997 | + | |
998 | + <div style={{ height: "calc(100% - 61px)" }}> | |
999 | + <div className="right" style={{ height: "100%", }}> | |
1000 | + <div style={{ height: "100%" }}> | |
1001 | + <div className="tab-container" style={{ marginTop: "5rem"}}> | |
1002 | + {/* {CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_AGENCY' ? | |
1003 | + <div className="flex-end margin-bottom"> | |
1004 | + <div className="flex searchselect" style={{width: 'auto'}}> | |
1005 | + | |
1006 | + <input type="radio" id="my_senior" name="senior" checked={isMySenior} | |
1007 | + onChange={(e) => {e.target.checked ? setIsMySenior(true) : null}}/> | |
1008 | + <label for="my_senior" style={{marginRight: '3rem'}}>나의 대상자 보기</label> | |
1009 | + | |
1010 | + <input type="radio" id="all_senior" name="senior" checked={!isMySenior} | |
1011 | + onChange={(e) => {e.target.checked ? setIsMySenior(false) : null}}/> | |
1012 | + <label for="all_senior" style={{marginRight: '0'}}>전체 대상자 보기</label> | |
1013 | + | |
1014 | + </div> | |
1015 | + </div> | |
1016 | + :null} */} | |
1017 | + <ul className="tab-menu flex-end"> | |
1018 | + {tab.map((item, idx) => { return ( | |
1019 | + <li onClick={() => setTabIndex(idx)} className={idx == tabIndex ? 'active' : null}> | |
1020 | + {item.title} | |
1021 | + </li> | |
1022 | + )})} | |
1023 | + </ul> | |
1024 | + <div className="content-wrap userlist"> | |
1025 | + | |
1026 | + <ul className="tab-content"> | |
1027 | + <li> | |
1028 | + {tab[tabIndex].content} | |
1029 | + </li> | |
1030 | + </ul> | |
1031 | + </div> | |
1032 | + </div> | |
1033 | + </div> | |
1034 | + </div> | |
1035 | + </div> | |
1036 | + </div> | |
1037 | + | |
1038 | + | |
1039 | + <Modal open={modalOpen} close={closeModal} header="문진표 작성"> | |
1040 | + <div className="board-wrap"> | |
1041 | + <div> | |
1042 | + <table className="margin-bottom2 questionnaire-table"> | |
1043 | + <tr> | |
1044 | + <th>흡연을 하십니까?</th> | |
1045 | + <td className="flex-start"> | |
1046 | + <input type="radio" name="smoke" id="smoke-true" | |
1047 | + checked={questionnaire['smoke_type'] == true} | |
1048 | + onChange={(e) => { | |
1049 | + if (e.target.checked) { | |
1050 | + questionnaire['smoke_type'] = true; | |
1051 | + setQuestionnaire({...questionnaire}); | |
1052 | + }} | |
1053 | + } | |
1054 | + /> | |
1055 | + <label for="smoke-true">예</label> | |
1056 | + <input type="radio" name="smoke" id="smoke-false" | |
1057 | + checked={questionnaire['smoke_type'] == false} | |
1058 | + onChange={(e) => { | |
1059 | + if (e.target.checked) { | |
1060 | + questionnaire['smoke_type'] = false; | |
1061 | + setQuestionnaire({...questionnaire}); | |
1062 | + }} | |
1063 | + } | |
1064 | + /> | |
1065 | + <label for="smoke-false">아니요</label> | |
1066 | + </td> | |
1067 | + </tr> | |
1068 | + <tr> | |
1069 | + <th>음주를 하십니까?</th> | |
1070 | + <td className="flex-start"> | |
1071 | + <input type="radio" name="drink" id="drink-true" | |
1072 | + checked={questionnaire['drink_type'] == true} | |
1073 | + onChange={(e) => { | |
1074 | + if (e.target.checked) { | |
1075 | + questionnaire['drink_type'] = true; | |
1076 | + setQuestionnaire({...questionnaire}); | |
1077 | + }} | |
1078 | + } | |
1079 | + /> | |
1080 | + <label for="drink-true">예</label> | |
1081 | + <input type="radio" name="drink" id="drink-false" | |
1082 | + checked={questionnaire['drink_type'] == false} | |
1083 | + onChange={(e) => { | |
1084 | + if (e.target.checked) { | |
1085 | + questionnaire['drink_type'] = false; | |
1086 | + setQuestionnaire({...questionnaire}); | |
1087 | + }} | |
1088 | + } | |
1089 | + /> | |
1090 | + <label for="drink-false">아니요</label> | |
1091 | + </td> | |
1092 | + </tr> | |
1093 | + <tr> | |
1094 | + <th>일주일에 운동을 몇회 하십니까?</th> | |
1095 | + <td className="flex-start"> | |
1096 | + <input type="radio" name="exercise" id="exercise-false" | |
1097 | + checked={questionnaire['exercise_type'] == false} | |
1098 | + onChange={(e) => { | |
1099 | + if (e.target.checked) { | |
1100 | + questionnaire['exercise_type'] = false; | |
1101 | + setQuestionnaire({...questionnaire}); | |
1102 | + }} | |
1103 | + } | |
1104 | + /> | |
1105 | + <label for="exercise-false">안함</label> | |
1106 | + | |
1107 | + <input type="radio" name="exercise" id="exercise-1" | |
1108 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 1} | |
1109 | + onChange={(e) => { | |
1110 | + if (e.target.checked) { | |
1111 | + questionnaire['exercise_type'] = true; | |
1112 | + questionnaire['weekly_exercise_amount'] = 1; | |
1113 | + setQuestionnaire({...questionnaire}); | |
1114 | + }} | |
1115 | + } | |
1116 | + /> | |
1117 | + <label for="exercise-1">1회</label> | |
1118 | + | |
1119 | + <input type="radio" name="exercise" id="exercise-2" | |
1120 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 2} | |
1121 | + onChange={(e) => { | |
1122 | + if (e.target.checked) { | |
1123 | + questionnaire['exercise_type'] = true; | |
1124 | + questionnaire['weekly_exercise_amount'] = 2; | |
1125 | + setQuestionnaire({...questionnaire}); | |
1126 | + }} | |
1127 | + } | |
1128 | + /> | |
1129 | + <label for="exercise-2">2회</label> | |
1130 | + | |
1131 | + <input type="radio" name="exercise" id="exercise-3" | |
1132 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 3} | |
1133 | + onChange={(e) => { | |
1134 | + if (e.target.checked) { | |
1135 | + questionnaire['exercise_type'] = true; | |
1136 | + questionnaire['weekly_exercise_amount'] = 3; | |
1137 | + setQuestionnaire({...questionnaire}); | |
1138 | + }} | |
1139 | + } | |
1140 | + /> | |
1141 | + <label for="exercise-3">3회</label> | |
1142 | + | |
1143 | + <input type="radio" name="exercise" id="exercise-4" | |
1144 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 4} | |
1145 | + onChange={(e) => { | |
1146 | + if (e.target.checked) { | |
1147 | + questionnaire['exercise_type'] = true; | |
1148 | + questionnaire['weekly_exercise_amount'] = 4; | |
1149 | + setQuestionnaire({...questionnaire}); | |
1150 | + }} | |
1151 | + } | |
1152 | + /> | |
1153 | + <label for="exercise-4">4회</label> | |
1154 | + | |
1155 | + <input type="radio" name="exercise" id="exercise-5" | |
1156 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 5} | |
1157 | + onChange={(e) => { | |
1158 | + if (e.target.checked) { | |
1159 | + questionnaire['exercise_type'] = true; | |
1160 | + questionnaire['weekly_exercise_amount'] = 5; | |
1161 | + setQuestionnaire({...questionnaire}); | |
1162 | + }} | |
1163 | + } | |
1164 | + /> | |
1165 | + <label for="exercise-5">5회</label> | |
1166 | + | |
1167 | + <input type="radio" name="exercise" id="exercise-6" | |
1168 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 6} | |
1169 | + onChange={(e) => { | |
1170 | + if (e.target.checked) { | |
1171 | + questionnaire['exercise_type'] = true; | |
1172 | + questionnaire['weekly_exercise_amount'] = 6; | |
1173 | + setQuestionnaire({...questionnaire}); | |
1174 | + }} | |
1175 | + } | |
1176 | + /> | |
1177 | + <label for="exercise-6">6회</label> | |
1178 | + | |
1179 | + <input type="radio" name="exercise" id="exercise-7" | |
1180 | + checked={questionnaire['exercise_type'] == true && questionnaire['weekly_exercise_amount'] == 7} | |
1181 | + onChange={(e) => { | |
1182 | + if (e.target.checked) { | |
1183 | + questionnaire['exercise_type'] = true; | |
1184 | + questionnaire['weekly_exercise_amount'] = 7; | |
1185 | + setQuestionnaire({...questionnaire}); | |
1186 | + }} | |
1187 | + } | |
1188 | + /> | |
1189 | + <label for="exercise-7">매일</label> | |
1190 | + </td> | |
1191 | + </tr> | |
1192 | + <tr> | |
1193 | + <th>최근 3개월 동안 갑작스런 체중 변화가 있었습니까?</th> | |
1194 | + <td className="flex-start"> | |
1195 | + <input type="radio" name="weight" id="weight-up" | |
1196 | + checked={questionnaire['weight_change_amount'] == 1} | |
1197 | + onChange={(e) => { | |
1198 | + if (e.target.checked) { | |
1199 | + questionnaire['weight_change_amount'] = 1; | |
1200 | + setQuestionnaire({...questionnaire}); | |
1201 | + }} | |
1202 | + } | |
1203 | + /> | |
1204 | + <label for="weight-up">예 - 증가</label> | |
1205 | + | |
1206 | + <input type="radio" name="weight" id="weight-down" | |
1207 | + checked={questionnaire['weight_change_amount'] == -1} | |
1208 | + onChange={(e) => { | |
1209 | + if (e.target.checked) { | |
1210 | + questionnaire['weight_change_amount'] = -1; | |
1211 | + setQuestionnaire({...questionnaire}); | |
1212 | + }} | |
1213 | + } | |
1214 | + /> | |
1215 | + <label for="weight-down">예 - 감소</label> | |
1216 | + | |
1217 | + <input type="radio" name="weight" id="weight-false" | |
1218 | + checked={questionnaire['weight_change_amount'] == 0} | |
1219 | + onChange={(e) => { | |
1220 | + if (e.target.checked) { | |
1221 | + questionnaire['weight_change_amount'] = 0; | |
1222 | + setQuestionnaire({...questionnaire}); | |
1223 | + }} | |
1224 | + } | |
1225 | + /> | |
1226 | + <label for="weight-false">아니요</label> | |
1227 | + </td> | |
1228 | + </tr> | |
1229 | + <tr> | |
1230 | + <th>현재 복용중인 약이 있으면 체크를 해주세요.</th> | |
1231 | + <td className="flex-start"> | |
1232 | + | |
1233 | + <input type="checkbox" name="pills" id="pills-1" | |
1234 | + checked={questionnaire['medication_pill'].indexOf('아스피린(항혈소판제)') > -1} | |
1235 | + onChange={(e) => { | |
1236 | + if (e.target.checked) { | |
1237 | + questionnaire['medication_pill'] += '아스피린(항혈소판제),'; | |
1238 | + setQuestionnaire({...questionnaire}); | |
1239 | + } else { | |
1240 | + questionnaire['medication_pill'] = questionnaire['medication_pill'].replace('아스피린(항혈소판제),', ''); | |
1241 | + setQuestionnaire({...questionnaire}); | |
1242 | + }} | |
1243 | + } | |
1244 | + /> | |
1245 | + <label for="pills-1">아스피린(항혈소판제)</label> | |
1246 | + | |
1247 | + <input type="checkbox" name="pills" id="pills-2" | |
1248 | + checked={questionnaire['medication_pill'].indexOf('당뇨약') > -1} | |
1249 | + onChange={(e) => { | |
1250 | + if (e.target.checked) { | |
1251 | + questionnaire['medication_pill'] += '당뇨약,'; | |
1252 | + setQuestionnaire({...questionnaire}); | |
1253 | + } else { | |
1254 | + questionnaire['medication_pill'] = questionnaire['medication_pill'].replace('당뇨약,', ''); | |
1255 | + setQuestionnaire({...questionnaire}); | |
1256 | + }} | |
1257 | + } | |
1258 | + /> | |
1259 | + <label for="pills-2">당뇨약</label> | |
1260 | + | |
1261 | + <input type="checkbox" name="pills" id="pills-3" | |
1262 | + checked={questionnaire['medication_pill'].indexOf('고혈압약') > -1} | |
1263 | + onChange={(e) => { | |
1264 | + if (e.target.checked) { | |
1265 | + questionnaire['medication_pill'] += '고혈압약,'; | |
1266 | + setQuestionnaire({...questionnaire}); | |
1267 | + } else { | |
1268 | + questionnaire['medication_pill'] = questionnaire['medication_pill'].replace('고혈압약,', ''); | |
1269 | + setQuestionnaire({...questionnaire}); | |
1270 | + }} | |
1271 | + } | |
1272 | + /> | |
1273 | + <label for="pills-3">고혈압약</label> | |
1274 | + | |
1275 | + <input type="checkbox" name="pills" id="pills-etc" | |
1276 | + checked={questionnaire['medication_pill'].indexOf('기타「」,') > -1} | |
1277 | + onChange={(e) => { | |
1278 | + if (e.target.checked) { | |
1279 | + questionnaire['medication_pill'] += '기타「」,'; | |
1280 | + setQuestionnaire({...questionnaire}); | |
1281 | + } else { | |
1282 | + questionnaire['medication_pill'] = questionnaire['medication_pill'].replace('기타「」,', ''); | |
1283 | + questionnaire['medication_pill_etc'] = ''; | |
1284 | + setQuestionnaire({...questionnaire}); | |
1285 | + }} | |
1286 | + } | |
1287 | + /> | |
1288 | + <label for="pills-etc">기타</label> | |
1289 | + <input type="text" style={{width: 'max-content', marginLeft: '1rem'}} | |
1290 | + disabled={questionnaire['medication_pill'].indexOf('기타「」,') == -1} | |
1291 | + value={questionnaire['medication_pill_etc']} | |
1292 | + onChange={(e) => { | |
1293 | + questionnaire['medication_pill_etc'] = e.target.value; | |
1294 | + setQuestionnaire({...questionnaire}); | |
1295 | + }} | |
1296 | + /> | |
1297 | + | |
1298 | + </td> | |
1299 | + </tr> | |
1300 | + </table> | |
1301 | + </div> | |
1302 | + <div className="flex-center"> | |
1303 | + {CommonUtil.isEmpty(questionnaire['questionnaire_record_idx']) | |
1304 | + ? <button className="btn-small red-btn" onClick={questionnaireInsert}>저장</button> | |
1305 | + : <button className="btn-small red-btn" onClick={questionnaireUpdate}>저장</button> | |
1306 | + } | |
1307 | + </div> | |
1308 | + </div> | |
1309 | + </Modal> | |
1310 | + | |
1311 | + | |
1312 | + <Modal open={modalOpen2} close={closeModal2} header="내원기록 관리 및 조회"> | |
1313 | + <div className="board-wrap"> | |
1314 | + <table className="margin-bottom2 senior-insert "> | |
1315 | + <tr> | |
1316 | + <th>진료 일자</th> | |
1317 | + <td> | |
1318 | + <input type="date" | |
1319 | + value={hospitalMedicalRecord['medical_date']} | |
1320 | + onChange={(e) => { | |
1321 | + hospitalMedicalRecord['medical_date'] = e.target.value; | |
1322 | + setHospitalMedicalRecord({...hospitalMedicalRecord}); | |
1323 | + }} | |
1324 | + ref={el => hospitalMedicalRecordRef.current['medical_date'] = el} | |
1325 | + /> | |
1326 | + </td> | |
1327 | + </tr> | |
1328 | + <tr> | |
1329 | + <th>진료 사유</th> | |
1330 | + <td className="flex-start "> | |
1331 | + <input type="text" | |
1332 | + value={hospitalMedicalRecord['medical_reason']} | |
1333 | + onChange={(e) => { | |
1334 | + hospitalMedicalRecord['medical_reason'] = e.target.value; | |
1335 | + setHospitalMedicalRecord({...hospitalMedicalRecord}); | |
1336 | + }} | |
1337 | + ref={el => hospitalMedicalRecordRef.current['medical_reason'] = el} | |
1338 | + /> | |
1339 | + </td> | |
1340 | + </tr> | |
1341 | + <tr> | |
1342 | + <th>진료 내용</th> | |
1343 | + <td colSpan={3}> | |
1344 | + <textarea className="medicine" cols="30" rows="2" | |
1345 | + value={hospitalMedicalRecord['medical_content']} | |
1346 | + onChange={(e) => { | |
1347 | + hospitalMedicalRecord['medical_content'] = e.target.value; | |
1348 | + setHospitalMedicalRecord({...hospitalMedicalRecord}); | |
1349 | + }} | |
1350 | + ref={el => hospitalMedicalRecordRef.current['medical_content'] = el} | |
1351 | + ></textarea> | |
1352 | + </td> | |
1353 | + </tr> | |
1354 | + </table> | |
1355 | + <div className="btn-wrap flex-center margin-bottom5"> | |
1356 | + {CommonUtil.isEmpty(hospitalMedicalRecord['medical_record_idx']) | |
1357 | + ? <button className="btn-small red-btn" onClick={hospitalMedicalRecordInsert}>등록</button> | |
1358 | + | |
1359 | + : <> | |
1360 | + <button className="btn-small gray-btn" onClick={setHospitalMedicalRecordInit}>수정취소</button> | |
1361 | + <button className="btn-small red-btn" onClick={hospitalMedicalRecordUpdate}>수정</button> | |
1362 | + <button className="btn-small red-btn" onClick={hospitalMedicalRecordDelete}>삭제</button> | |
1363 | + </> | |
1364 | + } | |
1365 | + </div> | |
1366 | + <div> | |
1367 | + <table className="caregiver-user senior-insert senior-table"> | |
1368 | + <thead> | |
1369 | + <tr> | |
1370 | + <th>No</th> | |
1371 | + <th>진료 일자</th> | |
1372 | + <th>진료 사유</th> | |
1373 | + <th>진료 내용</th> | |
1374 | + <th>기록 작성자</th> | |
1375 | + </tr> | |
1376 | + </thead> | |
1377 | + <tbody> | |
1378 | + {hospitalMedicalRecordList.hospitalMedicalRecordList.map((item, idx) => { return ( | |
1379 | + <tr key={idx} onClick={() => {setHospitalMedicalRecord(item)}}> | |
1380 | + <td data-label="No">{hospitalMedicalRecordList.hospitalMedicalRecordListCount - idx - (hospitalMedicalRecordList.search.currentPage - 1) * hospitalMedicalRecordList.search.perPage}</td> | |
1381 | + <td data-label="진료 일자">{item['medical_date']}</td> | |
1382 | + <td data-label="진료 내용">{item['medical_reason']}</td> | |
1383 | + <td data-label="진료 사유">{item['medical_content']}</td> | |
1384 | + <td data-label="기록 작성자">{item['insert_user_name']}</td> | |
1385 | + </tr> | |
1386 | + )})} | |
1387 | + {CommonUtil.isEmpty(hospitalMedicalRecordList.hospitalMedicalRecordList) ? | |
1388 | + <tr> | |
1389 | + <td colSpan={5}>조회된 데이터가 없습니다</td> | |
1390 | + </tr> | |
1391 | + : null} | |
1392 | + </tbody> | |
1393 | + </table> | |
1394 | + <Pagination | |
1395 | + currentPage={hospitalMedicalRecordList.search.currentPage} | |
1396 | + perPage={hospitalMedicalRecordList.search.perPage} | |
1397 | + totalCount={hospitalMedicalRecordList.hospitalMedicalRecordListCount} | |
1398 | + maxRange={5} | |
1399 | + click={hospitalMedicalRecordSelectList} | |
1400 | + /> | |
1401 | + </div> | |
1402 | + </div> | |
1403 | + </Modal> | |
1404 | + | |
1405 | + | |
1406 | + <Modal open={modalOpen3} close={closeModal3} header="심전도판독소견 관리 및 조회"> | |
1407 | + <div className="board-wrap"> | |
1408 | + <table className="margin-bottom2 senior-insert "> | |
1409 | + <tr> | |
1410 | + <th>측정 일자</th> | |
1411 | + <td colSpan={5}> | |
1412 | + <input type="date" value={ecg['ecg_reading_date']} | |
1413 | + onChange={(e) => { | |
1414 | + ecg['ecg_reading_date'] = e.target.value; | |
1415 | + setEcg({...ecg}); | |
1416 | + }} | |
1417 | + ref={el => ecgRef.current['ecg_reading_date'] = el} | |
1418 | + /> | |
1419 | + </td> | |
1420 | + </tr> | |
1421 | + <tr> | |
1422 | + <th>판독 소견 종류</th> | |
1423 | + <td colSpan={5}> | |
1424 | + <input type="text" value={ecg['ecg_finding_type']} | |
1425 | + onChange={(e) => { | |
1426 | + ecg['ecg_finding_type'] = e.target.value; | |
1427 | + setEcg({...ecg}); | |
1428 | + }} | |
1429 | + ref={el => ecgRef.current['ecg_finding_type'] = el} | |
1430 | + /> | |
1431 | + </td> | |
1432 | + </tr> | |
1433 | + <tr> | |
1434 | + <th>판독 소견 내용</th> | |
1435 | + <td colSpan={5}> | |
1436 | + <textarea className="medicine" cols="30" rows="2" | |
1437 | + value={ecg['ecg_finding_content']} | |
1438 | + onChange={(e) => { | |
1439 | + ecg['ecg_finding_content'] = e.target.value; | |
1440 | + setEcg({...ecg}); | |
1441 | + }} | |
1442 | + ref={el => ecgRef.current['ecg_finding_content'] = el} | |
1443 | + ></textarea> | |
1444 | + </td> | |
1445 | + </tr> | |
1446 | + {ecg.isEdit == false | |
1447 | + ? <tr> | |
1448 | + <th>측정 파일</th> | |
1449 | + <td colSpan={5}> | |
1450 | + <CommonFile commonFileList={ecg['commonFileList']} multiple={false} accept={'.dat, .ecg'}/> | |
1451 | + </td> | |
1452 | + </tr> | |
1453 | + : <> | |
1454 | + <tr> | |
1455 | + <th>서맥 횟수</th> | |
1456 | + <td> | |
1457 | + <input type="number" value={ecg['bradycardia_count']} | |
1458 | + onChange={(e) => { | |
1459 | + ecg['bradycardia_count'] = e.target.value; | |
1460 | + setEcg({...ecg}); | |
1461 | + }} | |
1462 | + ref={el => ecgRef.current['bradycardia_count'] = el} | |
1463 | + /> | |
1464 | + </td> | |
1465 | + <th>빈맥 횟수</th> | |
1466 | + <td> | |
1467 | + <input type="number" value={ecg['tachycardia_count']} | |
1468 | + onChange={(e) => { | |
1469 | + ecg['tachycardia_count'] = e.target.value; | |
1470 | + setEcg({...ecg}); | |
1471 | + }} | |
1472 | + ref={el => ecgRef.current['tachycardia_count'] = el} | |
1473 | + /> | |
1474 | + </td> | |
1475 | + <th>이상 심박수</th> | |
1476 | + <td> | |
1477 | + <input type="number" value={ecg['abnormal_heart_rate']} | |
1478 | + onChange={(e) => { | |
1479 | + ecg['abnormal_heart_rate'] = e.target.value; | |
1480 | + setEcg({...ecg}); | |
1481 | + }} | |
1482 | + ref={el => ecgRef.current['abnormal_heart_rate'] = el} | |
1483 | + /> | |
1484 | + </td> | |
1485 | + </tr> | |
1486 | + <tr> | |
1487 | + <th>최대 심박수</th> | |
1488 | + <td> | |
1489 | + <input type="number" value={ecg['max_heart_rate']} | |
1490 | + onChange={(e) => { | |
1491 | + ecg['max_heart_rate'] = e.target.value; | |
1492 | + setEcg({...ecg}); | |
1493 | + }} | |
1494 | + ref={el => ecgRef.current['max_heart_rate'] = el} | |
1495 | + /> | |
1496 | + </td> | |
1497 | + <th>최소 심박수</th> | |
1498 | + <td> | |
1499 | + <input type="number" value={ecg['min_heart_rate']} | |
1500 | + onChange={(e) => { | |
1501 | + ecg['min_heart_rate'] = e.target.value; | |
1502 | + setEcg({...ecg}); | |
1503 | + }} | |
1504 | + ref={el => ecgRef.current['min_heart_rate'] = el} | |
1505 | + /> | |
1506 | + </td> | |
1507 | + <th>평균 심박수</th> | |
1508 | + <td> | |
1509 | + <input type="number" value={ecg['average_heart_rate']} | |
1510 | + onChange={(e) => { | |
1511 | + ecg['average_heart_rate'] = e.target.value; | |
1512 | + setEcg({...ecg}); | |
1513 | + }} | |
1514 | + ref={el => ecgRef.current['average_heart_rate'] = el} | |
1515 | + /> | |
1516 | + </td> | |
1517 | + </tr> | |
1518 | + <tr> | |
1519 | + <th>최대 R-R</th> | |
1520 | + <td> | |
1521 | + <input type="number" value={ecg['max_rr']} | |
1522 | + onChange={(e) => { | |
1523 | + ecg['max_rr'] = e.target.value; | |
1524 | + setEcg({...ecg}); | |
1525 | + }} | |
1526 | + ref={el => ecgRef.current['max_rr'] = el} | |
1527 | + /> | |
1528 | + </td> | |
1529 | + <th>최소 R-R</th> | |
1530 | + <td> | |
1531 | + <input type="number" value={ecg['min_rr']} | |
1532 | + onChange={(e) => { | |
1533 | + ecg['min_rr'] = e.target.value; | |
1534 | + setEcg({...ecg}); | |
1535 | + }} | |
1536 | + ref={el => ecgRef.current['min_rr'] = el} | |
1537 | + /> | |
1538 | + </td> | |
1539 | + <th>평균 R-R</th> | |
1540 | + <td> | |
1541 | + <input type="number" value={ecg['average_rr']} | |
1542 | + onChange={(e) => { | |
1543 | + ecg['average_rr'] = e.target.value; | |
1544 | + setEcg({...ecg}); | |
1545 | + }} | |
1546 | + ref={el => ecgRef.current['average_rr'] = el} | |
1547 | + /> | |
1548 | + </td> | |
1549 | + </tr> | |
1550 | + </>} | |
1551 | + </table> | |
1552 | + <div className="btn-wrap flex-center margin-bottom5"> | |
1553 | + {CommonUtil.isEmpty(ecg['ecg_record_idx']) | |
1554 | + ? <button className="btn-small red-btn" onClick={ecgInsert}>등록</button> | |
1555 | + : <> | |
1556 | + <button className="btn-small gray-btn" onClick={setEcgInit}>수정취소</button> | |
1557 | + <button className="btn-small red-btn" onClick={ecgUpdate}>수정</button> | |
1558 | + <button className="btn-small red-btn" onClick={ecgDelete}>삭제</button> | |
1559 | + </> | |
1560 | + } | |
1561 | + </div> | |
1562 | + <div> | |
1563 | + <table className="caregiver-user senior-table"> | |
1564 | + <thead> | |
1565 | + <tr> | |
1566 | + <th>No</th> | |
1567 | + <th>소견 작성 일자</th> | |
1568 | + <th>판독 소견 종류</th> | |
1569 | + <th>소견 작성자</th> | |
1570 | + </tr> | |
1571 | + </thead> | |
1572 | + <tbody> | |
1573 | + {ecgList.ecgList.map((item, idx) => { return ( | |
1574 | + <tr key={idx} onClick={() => {item.isEdit = false; setEcg(item);}}> | |
1575 | + <td data-label="No">{ecgList.ecgListCount - idx - (ecgList.search.currentPage - 1) * ecgList.search.perPage}</td> | |
1576 | + <td data-label="소견 작성 일자">{item['ecg_reading_date']}</td> | |
1577 | + <td data-label="판독 소견 종류">{item['ecg_finding_type']}</td> | |
1578 | + <td data-label="소견 작성자">{item['insert_user_name']}</td> | |
1579 | + </tr> | |
1580 | + )})} | |
1581 | + {CommonUtil.isEmpty(ecgList.ecgList) ? | |
1582 | + <tr> | |
1583 | + <td colSpan={4}>조회된 데이터가 없습니다</td> | |
1584 | + </tr> | |
1585 | + : null} | |
1586 | + </tbody> | |
1587 | + </table> | |
1588 | + <Pagination | |
1589 | + currentPage={ecgList.search.currentPage} | |
1590 | + perPage={ecgList.search.perPage} | |
1591 | + totalCount={ecgList.ecgListCount} | |
1592 | + maxRange={5} | |
1593 | + click={ecgSelectList} | |
1594 | + /> | |
1595 | + </div> | |
1596 | + </div> | |
1597 | + </Modal> | |
1598 | + | |
1599 | + | |
1600 | + <Modal open={modalOpen4} close={closeModal4} header="혈압측정결과 관리 및 조회"> | |
1601 | + <div className="board-wrap"> | |
1602 | + <table className="margin-bottom2 senior-insert "> | |
1603 | + <tr> | |
1604 | + <th>측정일자</th> | |
1605 | + <td> | |
1606 | + <input type="date" value={bloodPressure['blood_pressure_record_date']} | |
1607 | + onChange={(e) => { | |
1608 | + bloodPressure['blood_pressure_record_date'] = e.target.value; | |
1609 | + setBloodPressure({...bloodPressure}); | |
1610 | + }} | |
1611 | + ref={el => bloodPressureRef.current['blood_pressure_record_date'] = el} | |
1612 | + /> | |
1613 | + </td> | |
1614 | + </tr> | |
1615 | + <tr> | |
1616 | + <th>최고혈압</th> | |
1617 | + <td> | |
1618 | + <input type="number" value={bloodPressure['max_blood_pressure']} | |
1619 | + onChange={(e) => { | |
1620 | + bloodPressure['max_blood_pressure'] = e.target.value; | |
1621 | + setBloodPressure({...bloodPressure}); | |
1622 | + }} | |
1623 | + ref={el => bloodPressureRef.current['max_blood_pressure'] = el} | |
1624 | + /> | |
1625 | + </td> | |
1626 | + </tr> | |
1627 | + <tr> | |
1628 | + <th>최저혈압</th> | |
1629 | + <td> | |
1630 | + <input type="number" value={bloodPressure['min_blood_pressure']} | |
1631 | + onChange={(e) => { | |
1632 | + bloodPressure['min_blood_pressure'] = e.target.value; | |
1633 | + setBloodPressure({...bloodPressure}); | |
1634 | + }} | |
1635 | + ref={el => bloodPressureRef.current['min_blood_pressure'] = el} | |
1636 | + /> | |
1637 | + </td> | |
1638 | + </tr> | |
1639 | + <tr> | |
1640 | + <th>맥박수</th> | |
1641 | + <td> | |
1642 | + <input type="number" value={bloodPressure['pulse_rate']} | |
1643 | + onChange={(e) => { | |
1644 | + bloodPressure['pulse_rate'] = e.target.value; | |
1645 | + setBloodPressure({...bloodPressure}); | |
1646 | + }} | |
1647 | + ref={el => bloodPressureRef.current['pulse_rate'] = el} | |
1648 | + /> | |
1649 | + </td> | |
1650 | + </tr> | |
1651 | + </table> | |
1652 | + <div className="btn-wrap flex-center margin-bottom5"> | |
1653 | + {CommonUtil.isEmpty(bloodPressure['blood_pressure_record_idx']) | |
1654 | + ? <button className="btn-small red-btn" onClick={bloodPressureInsert}>등록</button> | |
1655 | + : <> | |
1656 | + <button className="btn-small gray-btn" onClick={setBloodPressureInit}>수정취소</button> | |
1657 | + <button className="btn-small red-btn" onClick={bloodPressureUpdate}>수정</button> | |
1658 | + <button className="btn-small red-btn" onClick={bloodPressureDelete}>삭제</button> | |
1659 | + </> | |
1660 | + } | |
1661 | + </div> | |
1662 | + <div> | |
1663 | + <table className="caregiver-user senior-insert senior-table"> | |
1664 | + <thead> | |
1665 | + <tr> | |
1666 | + <th>No</th> | |
1667 | + <th>기록 작성일</th> | |
1668 | + <th>최고 혈압</th> | |
1669 | + <th>최저 혈압</th> | |
1670 | + <th>맥박수</th> | |
1671 | + <th>기록 작성자</th> | |
1672 | + </tr> | |
1673 | + </thead> | |
1674 | + <tbody> | |
1675 | + {bloodPressureList.bloodPressureList.map((item, idx) => { return ( | |
1676 | + <tr key={idx} onClick={() => {setBloodPressure(item);}}> | |
1677 | + <td data-label="No">{bloodPressureList.bloodPressureListCount - idx - (bloodPressureList.search.currentPage - 1) * bloodPressureList.search.perPage}</td> | |
1678 | + <td data-label="기록 작성일">{item['blood_pressure_record_date']}</td> | |
1679 | + <td data-label="최고 혈압">{item['max_blood_pressure']}</td> | |
1680 | + <td data-label="최저 혈압">{item['min_blood_pressure']}</td> | |
1681 | + <td data-label="맥박수">{item['pulse_rate']}</td> | |
1682 | + <td data-label="기록 작성자">{item['insert_user_name']}</td> | |
1683 | + </tr> | |
1684 | + )})} | |
1685 | + {CommonUtil.isEmpty(bloodPressureList.bloodPressureList) ? | |
1686 | + <tr> | |
1687 | + <td colSpan={6}>조회된 데이터가 없습니다</td> | |
1688 | + </tr> | |
1689 | + : null} | |
1690 | + </tbody> | |
1691 | + </table> | |
1692 | + <Pagination | |
1693 | + currentPage={bloodPressureList.search.currentPage} | |
1694 | + perPage={bloodPressureList.search.perPage} | |
1695 | + totalCount={bloodPressureList.bloodPressureListCount} | |
1696 | + maxRange={5} | |
1697 | + click={bloodPressureSelectList} | |
1698 | + /> | |
1699 | + </div> | |
1700 | + </div> | |
1701 | + </Modal> | |
1702 | + | |
1703 | + </main> | |
1704 | + ); | |
1705 | +} |
--- client/views/pages/main/Main_agency.jsx
+++ client/views/pages/main/Main_agency.jsx
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 |
</li> |
83 | 83 |
</ul> |
84 | 84 |
</div> |
85 |
- <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"방문 관리 리스트"} /></div> |
|
85 |
+ <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"방문/전화 관리 리스트"} /></div> |
|
86 | 86 |
<div className="main-grid-agency"> |
87 | 87 |
<div className="content-box combine-left-government3 visitlist"> |
88 | 88 |
<div className="margin-bottom2"> |
+++ client/views/pages/main/Main_agencyAdmin.jsx
... | ... | @@ -0,0 +1,301 @@ |
1 | +import React, { useState } from "react"; | |
2 | +import { useSelector } from "react-redux"; | |
3 | + | |
4 | + | |
5 | + | |
6 | +import { MapContainer, TileLayer, LayerGroup, Marker, Circle, CircleMarker, Tooltip, Popup, useMap } from 'react-leaflet'; | |
7 | +import L, { CRS, latLng, bounds } from 'leaflet'; | |
8 | + | |
9 | + | |
10 | +import Title from "../../component/Title.jsx"; | |
11 | +/* import Map from "../../component/chart/Map.jsx"; */ | |
12 | +import Chart5 from "../../component/chart/Chart5.jsx"; | |
13 | +import Chart2_govern from "../../component/chart/Chart2_govern.jsx"; | |
14 | +import Donut1_govern from "../../component/chart/Donut1_govern.jsx"; | |
15 | +import RowChart_govern from "../../component/chart/RowChart_govern.jsx"; | |
16 | +import AddCircleIcon from "@mui/icons-material/AddCircle"; | |
17 | +import BatteryCharging20Icon from '@mui/icons-material/BatteryCharging20'; | |
18 | +import DeviceThermostatIcon from '@mui/icons-material/DeviceThermostat'; | |
19 | +import MedicationIcon from '@mui/icons-material/Medication'; | |
20 | +import ElderlyIcon from '@mui/icons-material/Elderly'; | |
21 | + | |
22 | + | |
23 | +import "leaflet/dist/leaflet.css"; | |
24 | + | |
25 | +export default function Main_government() { | |
26 | + | |
27 | + //전역 변수 저장 객체 | |
28 | + const state = useSelector((state) => { return state }); | |
29 | + | |
30 | + const [cityName, setCityName] = useState(state.loginUser['government_name']); | |
31 | + | |
32 | + //대상자(시니어) 목록 조회 | |
33 | + const [senior, setSenior] = React.useState({ userList: [], userListCount: 0 }); | |
34 | + const seniorSelectList = () => { | |
35 | + fetch("/user/userSelectList.json", { | |
36 | + method: "POST", | |
37 | + headers: { | |
38 | + 'Content-Type': 'application/json; charset=UTF-8' | |
39 | + }, | |
40 | + body: JSON.stringify({ | |
41 | + 'government_id': state.loginUser['government_id'], | |
42 | + 'agency_id': state.loginUser['agency_id'], | |
43 | + 'authority': 'ROLE_SENIOR', | |
44 | + }), | |
45 | + }).then((response) => response.json()).then((data) => { | |
46 | + console.log("대상자(시니어) 목록 조회 : ", data); | |
47 | + setSenior(data); | |
48 | + }).catch((error) => { | |
49 | + console.log('seniorSelectList() /user/userSelectList.json error : ', error); | |
50 | + }); | |
51 | + } | |
52 | + | |
53 | + //전체 대상자(시니어) 수 조회 | |
54 | + const [seniorCount, setSeniorCount] = React.useState(0); | |
55 | + const seniorCountTotal = () => { | |
56 | + fetch("/stats/governmentSeniorCount.json", { | |
57 | + method: "POST", | |
58 | + headers: { | |
59 | + 'Content-Type': 'application/json; charset=UTF-8' | |
60 | + }, | |
61 | + body: JSON.stringify({ | |
62 | + 'government_id': state.loginUser['government_id'], | |
63 | + }), | |
64 | + }).then((response) => response.json()).then((data) => { | |
65 | + console.log("전체 대상자(시니어) 수 조회 : ", data); | |
66 | + setSeniorCount(data); | |
67 | + }).catch((error) => { | |
68 | + console.log('governmentSeniorCount() /stats/governmentSeniorCount.json error : ', error); | |
69 | + }); | |
70 | + } | |
71 | + | |
72 | + //온도 위험 대상자(시니어) 수 조회 | |
73 | + const [temperatureCount, setTemperatureCount] = React.useState(0); | |
74 | + const temperatureRiskCount = () => { | |
75 | + fetch("/stats/governmentTemperatureRisk.json", { | |
76 | + method: "POST", | |
77 | + headers: { | |
78 | + 'Content-Type': 'application/json; charset=UTF-8' | |
79 | + }, | |
80 | + body: JSON.stringify({ | |
81 | + 'government_id': state.loginUser['government_id'], | |
82 | + }), | |
83 | + }).then((response) => response.json()).then((data) => { | |
84 | + console.log("온도 위험 대상자(시니어) 수 조회 : ", data); | |
85 | + setTemperatureCount(data); | |
86 | + }).catch((error) => { | |
87 | + console.log('temperatureRiskCount() /stats/governmentTemperatureRisk.json error : ', error); | |
88 | + }); | |
89 | + } | |
90 | + | |
91 | + //배터리 부족 대상자(시니어) 수 조회 | |
92 | + const [batteryCount, setbatteryCount] = React.useState(0); | |
93 | + const batteryRiskCount = () => { | |
94 | + fetch("/stats/governmentBatteryRisk.json", { | |
95 | + method: "POST", | |
96 | + headers: { | |
97 | + 'Content-Type': 'application/json; charset=UTF-8' | |
98 | + }, | |
99 | + body: JSON.stringify({ | |
100 | + 'government_id': state.loginUser['government_id'], | |
101 | + }), | |
102 | + }).then((response) => response.json()).then((data) => { | |
103 | + console.log("배터리 부족 대상자(시니어) 수 조회 : ", data); | |
104 | + setbatteryCount(data); | |
105 | + }).catch((error) => { | |
106 | + console.log('batteryRiskCount() /stats/governmentBatteryRisk.json error : ', error); | |
107 | + }); | |
108 | + } | |
109 | + | |
110 | + //월별 방문 횟수 조회 | |
111 | + const [visit, setVisit] = React.useState([]); | |
112 | + const visitByMonthList = () => { | |
113 | + fetch("/stats/visitByMonthList.json", { | |
114 | + method: "POST", | |
115 | + headers: { | |
116 | + 'Content-Type': 'application/json; charset=UTF-8' | |
117 | + }, | |
118 | + body: JSON.stringify({ | |
119 | + 'government_id': state.loginUser['government_id'], | |
120 | + }), | |
121 | + }).then((response) => response.json()).then((data) => { | |
122 | + console.log("월별 방문 횟수 조회 : ", data); | |
123 | + setVisit(data); | |
124 | + }).catch((error) => { | |
125 | + console.log('visitByMonthList() /stats/visitByMonthList.json error : ', error); | |
126 | + }); | |
127 | + } | |
128 | + | |
129 | + //시행 기관별 약상자 사용 현황 | |
130 | + const [equipmentUsage, setEquipmentUsage] = React.useState([]); | |
131 | + const equipmentByAgency = () => { | |
132 | + fetch("/stats/equipmentByAgency.json", { | |
133 | + method: "POST", | |
134 | + headers: { | |
135 | + 'Content-Type': 'application/json; charset=UTF-8' | |
136 | + }, | |
137 | + body: JSON.stringify({ | |
138 | + 'government_id': state.loginUser['government_id'], | |
139 | + }), | |
140 | + }).then((response) => response.json()).then((data) => { | |
141 | + console.log("시행기관별 약상자 사용 현황 : ", data); | |
142 | + let newEquipmentList = updateList(data['agencyList'], data['equipmentList']); | |
143 | + console.log("new equipment list", newEquipmentList); | |
144 | + setEquipmentUsage(newEquipmentList); | |
145 | + }).catch((error) => { | |
146 | + console.log('equipmentByAgency() /stats/equipmentByAgency.json error : ', error); | |
147 | + }); | |
148 | + } | |
149 | + | |
150 | + //시행 기관별 대상자(시니어) 등록 현황 | |
151 | + const [seniorEnroll, setSeniorEnroll] = React.useState([]); | |
152 | + const seniorByAgency = () => { | |
153 | + fetch("/stats/seniorByAgency.json", { | |
154 | + method: "POST", | |
155 | + headers: { | |
156 | + 'Content-Type': 'application/json; charset=UTF-8' | |
157 | + }, | |
158 | + body: JSON.stringify({ | |
159 | + 'government_id': state.loginUser['government_id'], | |
160 | + }), | |
161 | + }).then((response) => response.json()).then((data) => { | |
162 | + console.log("시행기관별 시니어 등록 현황 : ", data); | |
163 | + let newSeniorList = updateList(data['agencyList'], data['seniorList']); | |
164 | + console.log("new senior list", newSeniorList); | |
165 | + setSeniorEnroll(newSeniorList); | |
166 | + }).catch((error) => { | |
167 | + console.log('seniorByAgency() /stats/seniorByAgency.json error : ', error); | |
168 | + }); | |
169 | + } | |
170 | + | |
171 | + function updateList(agencyList, countList) { | |
172 | + | |
173 | + const result = []; | |
174 | + for (let i = 0; i < agencyList.length; i++) { | |
175 | + const agency = agencyList[i]; | |
176 | + let count = 0; | |
177 | + for (let j = 0; j < countList.length; j++) { | |
178 | + if (countList[j].agency_id === agency.agency_id) { | |
179 | + count = countList[j].count; | |
180 | + break; | |
181 | + } | |
182 | + } | |
183 | + result.push({ agency_id: agency.agency_id, agency_name: agency.agency_name, count: count }); | |
184 | + } | |
185 | + return result; | |
186 | + } | |
187 | + | |
188 | + | |
189 | + | |
190 | + const iconHouse = new L.Icon({ | |
191 | + iconUrl: '/client/resources/files/images/house.png', | |
192 | + iconRetinaUrl: '/client/resources/files/images/house.png', | |
193 | + iconSize: [20, 20], | |
194 | + className: 'leaflet-background-radius-icon'//leaflet-div-icon | |
195 | + }); | |
196 | + | |
197 | + React.useEffect(() => { | |
198 | + seniorSelectList(); | |
199 | + seniorCountTotal(); | |
200 | + temperatureRiskCount(); | |
201 | + batteryRiskCount(); | |
202 | + visitByMonthList(); | |
203 | + equipmentByAgency(); | |
204 | + seniorByAgency(); | |
205 | + }, []); | |
206 | + | |
207 | + | |
208 | + return ( | |
209 | + <main> | |
210 | + <div className="main-grid-government"> | |
211 | + <div className="sub-grid-government"> | |
212 | + <ul className="content-box statistics-govern" background="#f7acba"> | |
213 | + <li> | |
214 | + <p><ElderlyIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#bf0629", borderRadius: "50px" }} /></p> | |
215 | + <p>{cityName} 전체 대상자</p> | |
216 | + <p>{seniorCount}</p> | |
217 | + </li> | |
218 | + </ul> | |
219 | + <ul className="content-box statistics-govern" background="#8ef3d1"> | |
220 | + <li> | |
221 | + <p><MedicationIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#076143", borderRadius: "50px" }} /></p> | |
222 | + <p>{cityName} 미복약 위험 대상자</p> | |
223 | + <p>11</p> | |
224 | + </li> | |
225 | + </ul> | |
226 | + <ul className="content-box statistics-govern" background="#ebe7b9" > | |
227 | + <li> | |
228 | + <p><DeviceThermostatIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#f1de05", borderRadius: "50px" }} /></p> | |
229 | + <p>{cityName} 댁내 온도 위험 대상자</p> | |
230 | + <p>{temperatureCount}</p> | |
231 | + </li> | |
232 | + </ul> | |
233 | + <ul className="content-box statistics-govern" background="#5f9af3"> | |
234 | + <li> | |
235 | + <p><BatteryCharging20Icon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#5f9af3", borderRadius: "50px" }} /></p> | |
236 | + <p>{cityName} 배터리 부족 대상자 </p> | |
237 | + <p>{batteryCount}</p> | |
238 | + </li> | |
239 | + </ul> | |
240 | + </div> | |
241 | + <div className="content-box combine-left-government combine-bottom-government2 main-main"> | |
242 | + <div className="flex"> | |
243 | + <Title title={"지역별 케어 대상자 분포 현황"} explanation={"지역 선택 시 해당 지역의 대상자리스트가 보여집니다."} /> | |
244 | + </div> | |
245 | + <div style={{ height: 'calc(100% - 60px)' }}> | |
246 | + <MapContainer center={latLng(35.8713802646197, 128.601805491072)} zoom={13} scrollWheelZoom={true} style={{ height: '100%' }}> | |
247 | + <TileLayer | |
248 | + attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
249 | + url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | |
250 | + /> | |
251 | + {/* <Marker position={[128.601405491072, 35.8913802646197]}> | |
252 | + <Popup> | |
253 | + A pretty CSS3 popup. <br /> Easily customizable. | |
254 | + </Popup> | |
255 | + </Marker> */} | |
256 | + | |
257 | + <LayerGroup> | |
258 | + {senior.userList.map((item, idx) => { | |
259 | + return item['y'] != null && item['x'] != null ? ( | |
260 | + <Marker position={[item['y'], item['x']]} icon={iconHouse}> | |
261 | + <Popup> | |
262 | + <div> | |
263 | + {item['user_name']}({item['user_birth']} - {item['user_gender']}) | |
264 | + </div> | |
265 | + </Popup> | |
266 | + </Marker> | |
267 | + ): null | |
268 | + })} | |
269 | + </LayerGroup> | |
270 | + </MapContainer> | |
271 | + </div> | |
272 | + {/* <Map setCityName={setCityName} /> */} | |
273 | + </div> | |
274 | + <div className="content-box combine-all-government combine-bottom-government2"> | |
275 | + <div className="flex"> | |
276 | + <Title title={`${cityName} 월별 방문 횟수`} explanation={"최근 6개월간 방문 횟수의 변화를 확인할 수 있습니다."} /> | |
277 | + </div> | |
278 | + <RowChart_govern data={visit} /> | |
279 | + </div> | |
280 | + <div className="content-box combine-left-government2"> | |
281 | + <div className="flex"> | |
282 | + <Title title={`${cityName} 복용률 평균`} explanation={"해당 지역의 대상자 복용률이 그래프로 보여집니다."} /> | |
283 | + </div> | |
284 | + <Chart2_govern /> | |
285 | + </div> | |
286 | + <div className="content-box combine-right-government2"> | |
287 | + <div className="flex"> | |
288 | + <Title title={`기관별 대상자 등록 현황`} explanation={"약상자 사용자의 데이터 차트가 보여집니다."} /> | |
289 | + </div> | |
290 | + <Chart5 data={seniorEnroll} /> | |
291 | + </div> | |
292 | + <div className="content-box combine-right-government"> | |
293 | + <div className="flex"> | |
294 | + <Title title={`기관별 약상자 사용 현황`} explanation={""} /> | |
295 | + </div> | |
296 | + <Donut1_govern data={equipmentUsage} /> | |
297 | + </div> | |
298 | + </div> | |
299 | + </main> | |
300 | + ); | |
301 | +} |
--- client/views/pages/setting/AuthorityManagement.jsx
+++ client/views/pages/setting/AuthorityManagement.jsx
... | ... | @@ -12,8 +12,8 @@ |
12 | 12 |
{ |
13 | 13 |
menu: { |
14 | 14 |
대상자관리: ["대상자관리"], |
15 |
- 건강관리: ["복약관리", "댁내온도관리", "복약통계"], |
|
16 |
- 방문관리: ["방문관리"], |
|
15 |
+ 생활복지관리: ["복약관리", "댁내온도관리", "복약통계"], |
|
16 |
+ 방문전화관리: ["방문/전화 관리"], |
|
17 | 17 |
장비관리: ["장비관리"], |
18 | 18 |
설정: ["내정보 관리", "사용자 관리", "권한 관리"], |
19 | 19 |
}, |
... | ... | @@ -115,8 +115,8 @@ |
115 | 115 |
<tr> |
116 | 116 |
<th rowSpan="2">구분</th> |
117 | 117 |
<th rowSpan="2">사용자 관리</th> |
118 |
- <th colSpan="3">건강관리</th> |
|
119 |
- <th rowSpan="2">방문관리</th> |
|
118 |
+ <th colSpan="3">생활 복지 관리</th> |
|
119 |
+ <th rowSpan="2">방문/전화 관리</th> |
|
120 | 120 |
<th rowSpan="2">장비관리</th> |
121 | 121 |
<th rowSpan="2">고객지원센터</th> |
122 | 122 |
<th rowSpan="2">Q&A</th> |
... | ... | @@ -194,7 +194,7 @@ |
194 | 194 |
<td>사용자(노인, 보호자 등)를 등록하고 삭제할 수 있다.</td> |
195 | 195 |
</tr> |
196 | 196 |
<tr> |
197 |
- <td rowSpan="3">건강관리</td> |
|
197 |
+ <td rowSpan="3">생활 복지 관리</td> |
|
198 | 198 |
<td>복약관리</td> |
199 | 199 |
<td>사용자(노인)의 아침, 점심, 저녁 복약여부를 확인하고 관리할 수 있다.</td> |
200 | 200 |
</tr> |
... | ... | @@ -207,7 +207,7 @@ |
207 | 207 |
<td>시행기관에 등록되어 있는 사용자(노인)의 복약 통계 자료를 볼 수 있다.</td> |
208 | 208 |
</tr> |
209 | 209 |
<tr> |
210 |
- <td>방문 관리</td> |
|
210 |
+ <td>방문/전화 관리</td> |
|
211 | 211 |
<td>-</td> |
212 | 212 |
<td>시행기관의 복지사가 사용자(노인)을 방문한 내역을 확인하고 관리할 수 있다.</td> |
213 | 213 |
</tr> |
+++ client/views/pages/user_management/AgentAdminSelectOne.jsx
... | ... | @@ -0,0 +1,267 @@ |
1 | +import React from "react"; | |
2 | +import { useNavigate, useLocation } from "react-router"; | |
3 | + | |
4 | +import SubTitle from "../../component/SubTitle.jsx"; | |
5 | +import Modal_Guardian from "../../component/Modal_Guardian.jsx"; | |
6 | +import Modal_SeniorInsert from "../../component/Modal_SeniorInsert.jsx"; | |
7 | + | |
8 | + | |
9 | +export default function AgentSelectOne() { | |
10 | + const navigate = useNavigate(); | |
11 | + const location = useLocation(); | |
12 | + | |
13 | + | |
14 | + //대상자(시니어) 등록 모달 오픈 여부 | |
15 | + const [modalSeniorInsertIsOpen, setModalSeniorInsertIsOpen] = React.useState(false); | |
16 | + //대상자(시니어) 등록 모달 오픈 | |
17 | + const modalSeniorInsertOpen = () => { | |
18 | + setModalSeniorInsertIsOpen(true); | |
19 | + }; | |
20 | + //대상자(시니어) 등록 모달 닫기 | |
21 | + const modalSeniorInsertClose = () => { | |
22 | + setModalSeniorInsertIsOpen(false); | |
23 | + }; | |
24 | + | |
25 | + | |
26 | + //시니어 정보 | |
27 | + const [agent, setAgent] = React.useState({ | |
28 | + 'user_id': location.state['agent_id'], | |
29 | + 'user_name': null, | |
30 | + 'user_password': null, | |
31 | + 'user_phonenumber': null, | |
32 | + 'user_birth': null, | |
33 | + 'user_gender': null, | |
34 | + 'user_address': null, | |
35 | + 'user_email': null, | |
36 | + 'authority': 'ROLE_AGENCY', | |
37 | + 'agency_id': null, | |
38 | + 'government_id': null, | |
39 | + | |
40 | + 'agent_id': location.state['agent_id'], | |
41 | + }); | |
42 | + //시니어 상세 조회 | |
43 | + const agentSelectOne = () => { | |
44 | + fetch("/user/userSelectOne.json", { | |
45 | + method: "POST", | |
46 | + headers: { | |
47 | + 'Content-Type': 'application/json; charset=UTF-8' | |
48 | + }, | |
49 | + body: JSON.stringify(agent), | |
50 | + }).then((response) => response.json()).then((data) => { | |
51 | + console.log("agentSelectOne data : ", data); | |
52 | + data['agent_id'] = location.state['agent_id']; | |
53 | + setAgent(data); | |
54 | + }).catch((error) => { | |
55 | + console.log('agentSelectOne() /user/userSelectOne.json error : ', error); | |
56 | + }); | |
57 | + }; | |
58 | + | |
59 | + //보호사의 대상자 목록 | |
60 | + const [seniorByAgent, setSeniorByAgent] = React.useState({seniorListByAgent: [], seniorListCountByAgent: 0}); | |
61 | + //보호사의 선택한 대상자 정보 | |
62 | + const [senior, setSenior] = React.useState({}); | |
63 | + //보호사의 대상자 목록 조회 | |
64 | + const seniorSelectListByAgent = () => { | |
65 | + fetch("/user/seniorSelectListByAgent.json", { | |
66 | + method: "POST", | |
67 | + headers: { | |
68 | + 'Content-Type': 'application/json; charset=UTF-8' | |
69 | + }, | |
70 | + body: JSON.stringify(agent), | |
71 | + }).then((response) => response.json()).then((data) => { | |
72 | + console.log("seniorSelectListByAgent data : ", data); | |
73 | + setSeniorByAgent(data); | |
74 | + }).catch((error) => { | |
75 | + console.log('seniorSelectListByAgent() /user/seniorSelectListByAgent.json error : ', error); | |
76 | + }); | |
77 | + }; | |
78 | + | |
79 | + //선택한 보호자 정보 관리 | |
80 | + const guardianByAgentManagement = (item) => { | |
81 | + setSenior(item); | |
82 | + } | |
83 | + | |
84 | + //가입승인 | |
85 | + const userUpdate = () => { | |
86 | + agent['is_accept'] = true; | |
87 | + | |
88 | + fetch("/user/userUpdate.json", { | |
89 | + method: "POST", | |
90 | + headers: { | |
91 | + 'Content-Type': 'application/json; charset=UTF-8' | |
92 | + }, | |
93 | + body: JSON.stringify(agent), | |
94 | + }).then((response) => response.json()).then((data) => { | |
95 | + console.log("가입승인 결과(건수) : ", data); | |
96 | + if (data > 0) { | |
97 | + alert("승인완료"); | |
98 | + agentSelectOne(); | |
99 | + } else { | |
100 | + alert("승인에 실패하였습니다. 관리자에게 문의바랍니다."); | |
101 | + } | |
102 | + }).catch((error) => { | |
103 | + console.log('userUpdate() /user/userUpdate.json error : ', error); | |
104 | + }); | |
105 | + } | |
106 | + | |
107 | + | |
108 | + | |
109 | + //보호자의 대상자 제거 | |
110 | + const agentSeniorDelete = (senior) => { | |
111 | + if (confirm('해당 보호대상자의 케어를 종료하시겠습니까?') == false) { | |
112 | + return; | |
113 | + } | |
114 | + | |
115 | + fetch("/user/agentSeniorDelete.json", { | |
116 | + method: "POST", | |
117 | + headers: { | |
118 | + 'Content-Type': 'application/json; charset=UTF-8' | |
119 | + }, | |
120 | + body: JSON.stringify(senior), | |
121 | + }).then((response) => response.json()).then((data) => { | |
122 | + console.log("보호자의 대상자 제거 결과(건수) : ", data); | |
123 | + if (data > 0) { | |
124 | + alert("케어종료완료"); | |
125 | + seniorSelectListByAgent(); | |
126 | + } else { | |
127 | + alert("케어종료에 실패하였습니다. 관리자에게 문의바랍니다."); | |
128 | + } | |
129 | + }).catch((error) => { | |
130 | + console.log('agentSeniorDelete() /user/agentSeniorDelete.json error : ', error); | |
131 | + }); | |
132 | + } | |
133 | + | |
134 | + React.useEffect(() => { | |
135 | + agentSelectOne(); | |
136 | + seniorSelectListByAgent(); | |
137 | + }, []) | |
138 | + | |
139 | + | |
140 | + return ( | |
141 | + <main> | |
142 | + <Modal_SeniorInsert | |
143 | + open={modalSeniorInsertIsOpen} | |
144 | + close={modalSeniorInsertClose} | |
145 | + seniorInsertCallback={() => {seniorSelectListByAgent(); modalSeniorInsertClose();}} | |
146 | + defaultAgentId={agent['agent_id']} | |
147 | + defaultAgencyId={agent['agency_id']} | |
148 | + defaultGovernmentId={agent['government_id']} | |
149 | + /> | |
150 | + | |
151 | + <div className="content-wrap row"> | |
152 | + <SubTitle explanation={"대상자 상세 프로필"} className="margin-bottom" /> | |
153 | + <div className="margin-bottom5"> | |
154 | + <table className="margin-bottom senior-detail"> | |
155 | + <tbody> | |
156 | + <tr> | |
157 | + <th>관리기관</th> | |
158 | + <td> | |
159 | + <span>{agent['government_name']}</span> | |
160 | + </td> | |
161 | + </tr> | |
162 | + | |
163 | + <tr> | |
164 | + <th>시행기관</th> | |
165 | + <td> | |
166 | + <span>{agent['agency_name']}</span> | |
167 | + </td> | |
168 | + </tr> | |
169 | + | |
170 | + <tr> | |
171 | + <th>이름(아이디)</th> | |
172 | + <td> | |
173 | + <span>{agent['user_name']}({agent['user_id']})</span> | |
174 | + </td> | |
175 | + </tr> | |
176 | + | |
177 | + <tr> | |
178 | + <th>연락처</th> | |
179 | + <td> | |
180 | + <span>{agent['user_phonenumber']}</span> | |
181 | + </td> | |
182 | + </tr> | |
183 | + | |
184 | + <tr> | |
185 | + <th>이메일</th> | |
186 | + <td> | |
187 | + <span>{agent['user_email']}</span> | |
188 | + </td> | |
189 | + </tr> | |
190 | + | |
191 | + <tr> | |
192 | + <th>가입승인관리</th> | |
193 | + <td> | |
194 | + {agent['is_accept'] ? <span>승인완료</span> : | |
195 | + <button className={"btn-small red-btn"} onClick={userUpdate}>가입승인</button> | |
196 | + } | |
197 | + </td> | |
198 | + </tr> | |
199 | + | |
200 | + </tbody> | |
201 | + </table> | |
202 | + <div className="btn-wrap flex-center"> | |
203 | + <button className={"btn-large gray-btn"} onClick={() => {navigate("/UserEdit", {state: {'user_id': agent['user_id']}})}}>수정</button> | |
204 | + <button className={"btn-large red-btn"} onClick={() => alert("삭제할 수 없습니다.")}>삭제</button> | |
205 | + </div> | |
206 | + </div> | |
207 | + | |
208 | + <SubTitle explanation={"보호사의 보호대상자"} className="margin-bottom display-inline-block" /> | |
209 | + <button className={"btn-small gray-btn display-inline-block float-right"} onClick={() => modalSeniorInsertOpen()}>보호대상자 추가</button> | |
210 | + <div className="margin-bottom5"> | |
211 | + <table className={"agent-user"}> | |
212 | + <thead> | |
213 | + <tr> | |
214 | + <th>No</th> | |
215 | + {/* <th>관리기관명</th> | |
216 | + <th>소속기관명</th> */} | |
217 | + <th>이름</th> | |
218 | + <th>연락처</th> | |
219 | + <th>생년월일</th> | |
220 | + <th>성별</th> | |
221 | + <th>상태</th> | |
222 | + <th>배정시작일</th> | |
223 | + <th>배정종료일</th> | |
224 | + <th>상세보기</th> | |
225 | + </tr> | |
226 | + </thead> | |
227 | + <tbody> | |
228 | + {seniorByAgent.seniorListByAgent.map((item, idx) => { return ( | |
229 | + <tr key={idx}> | |
230 | + <td>{idx + 1}</td> | |
231 | + {/* <td>{item['government_name']}</td> | |
232 | + <td>{item['agency_name']}</td> */} | |
233 | + <td>{item['user_name']}</td> | |
234 | + <td>{item['user_phonenumber']}</td> | |
235 | + <td>{item['user_birth']}</td> | |
236 | + <td>{item['user_gender']}</td> | |
237 | + <td>{item['agent_match_state'] ? <span className="green">케어중</span> : <span className="grey">케어완료</span>}</td> | |
238 | + <td>{item['agent_match_start_date']}</td> | |
239 | + <td> | |
240 | + {item['agent_match_state'] ? | |
241 | + <button className={"btn-small red-btn"} onClick={() => {agentSeniorDelete(item)}}>케어종료</button> | |
242 | + : item['agent_match_end_date'] | |
243 | + } | |
244 | + </td> | |
245 | + <td> | |
246 | + <button className={"btn-small lightgray-btn"} onClick={() => {navigate("/SeniorSelectOne", {state: {'senior_id': item['user_id']}})}}>상세 페이지 이동</button> | |
247 | + </td> | |
248 | + </tr> | |
249 | + )})} | |
250 | + {seniorByAgent.seniorListByAgent == null || seniorByAgent.seniorListByAgent.length == 0 ? | |
251 | + <tr> | |
252 | + <td colSpan={9}>조회된 데이터가 없습니다</td> | |
253 | + </tr> | |
254 | + : null} | |
255 | + </tbody> | |
256 | + </table> | |
257 | + </div> | |
258 | + | |
259 | + <div className="btn-wrap flex-center"> | |
260 | + <button className={"btn-large gray-btn"} onClick={() => navigate(-1)}>이전</button> | |
261 | + </div> | |
262 | + | |
263 | + </div> | |
264 | + | |
265 | + </main> | |
266 | + ); | |
267 | +} |
--- client/views/pages/user_management/UserSelect.jsx
+++ client/views/pages/user_management/UserSelect.jsx
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 |
const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
22 | 22 |
|
23 | 23 |
//활성화 탭 (시스템 업무 역할별) |
24 |
- const [tabActiveByRoleType, setTabActiveByRoleType] = React.useState('ROLE_SENIOR'); |
|
24 |
+ const [tabActiveByRoleType, setTabActiveByRoleType] = React.useState('ROLE_AGENCY'); |
|
25 | 25 |
|
26 | 26 |
//보호자 모달 오픈 여부 |
27 | 27 |
const [modalGuardianIsOpen, setModalGuardianIsOpen] = React.useState(false); |
... | ... | @@ -394,7 +394,7 @@ |
394 | 394 |
|
395 | 395 |
{/* 탭 제목 */} |
396 | 396 |
<ul className="tab-menu flex-end" > |
397 |
- <li onClick={() => setTabActiveByRoleType('ROLE_SENIOR')} className={tabActiveByRoleType == 'ROLE_SENIOR' ? "active" : null}>대상자(어르신) ({senior.userListCount})</li> |
|
397 |
+ {/* <li onClick={() => setTabActiveByRoleType('ROLE_SENIOR')} className={tabActiveByRoleType == 'ROLE_SENIOR' ? "active" : null}>대상자(어르신) ({senior.userListCount})</li> */} |
|
398 | 398 |
<li onClick={() => setTabActiveByRoleType('ROLE_AGENCY')} className={tabActiveByRoleType == 'ROLE_AGENCY' ? "active" : null}>보호사 ({agent.userListCount})</li> |
399 | 399 |
{state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' ? |
400 | 400 |
<li onClick={() => setTabActiveByRoleType('ROLE_GOVERNMENT')} className={tabActiveByRoleType == 'ROLE_GOVERNMENT' ? "active" : null}>기관 관리자 ({government.userListCount})</li> |
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?