
--- client/resources/css/common.css
+++ client/resources/css/common.css
... | ... | @@ -6,6 +6,10 @@ |
6 | 6 |
width: unset;} |
7 | 7 |
/* grid */ |
8 | 8 |
.gap{gap: 1rem;} |
9 |
+.gap2{gap: 2rem;} |
|
10 |
+.gap5{gap: 5rem;} |
|
11 |
+.gap10{gap: 10rem;} |
|
12 |
+.gap15{gap: 15rem;} |
|
9 | 13 |
.main-grid-admin { |
10 | 14 |
height: 100%; |
11 | 15 |
display: grid; |
--- client/resources/css/main.css
+++ client/resources/css/main.css
... | ... | @@ -1244,7 +1244,7 @@ |
1244 | 1244 |
} |
1245 | 1245 |
|
1246 | 1246 |
/* 사용자 관리 */ |
1247 |
-.userauthoriylist .left{width: 33%;} |
|
1247 |
+.userauthoriylist .left{width: 22%; min-width: fit-content;} |
|
1248 | 1248 |
.userauthoriylist .right{width: 100%;} |
1249 | 1249 |
.bSXvtB{display: none;} |
1250 | 1250 |
.tab-menu .tab-menu-agency { |
--- client/views/component/Modal_Guardian.jsx
+++ client/views/component/Modal_Guardian.jsx
... | ... | @@ -49,6 +49,39 @@ |
49 | 49 |
setGuardian(newGuardian); |
50 | 50 |
} |
51 | 51 |
|
52 |
+ //아이디 중복 확인 |
|
53 |
+ const [isIdCheck, setIsIdCheck] = React.useState(false); |
|
54 |
+ //로그인 아이디 중복 검사 |
|
55 |
+ const userIdCheck = () => { |
|
56 |
+ if (CommonUtil.isEmpty(guardian['user_phonenumber']) == true) { |
|
57 |
+ guardianRef.current['user_phonenumber'].focus(); |
|
58 |
+ alert("연락처를 입력해 주세요."); |
|
59 |
+ return false; |
|
60 |
+ } |
|
61 |
+ |
|
62 |
+ guardian['user_id'] = guardian['user_phonenumber']; |
|
63 |
+ fetch("/user/userSelectOne.json", { |
|
64 |
+ method: "POST", |
|
65 |
+ headers: { |
|
66 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
67 |
+ }, |
|
68 |
+ body: JSON.stringify(guardian), |
|
69 |
+ }).then((response) => response.json()).then((data) => { |
|
70 |
+ console.log("로그인 아이디 중복 검사(아이디를 통한 사용자 조회) : ", data); |
|
71 |
+ if (CommonUtil.isEmpty(data) == true) { |
|
72 |
+ setIsIdCheck(true); |
|
73 |
+ guardianRef.current['user_address'].focus(); |
|
74 |
+ alert("사용가능한 연락처 입니다."); |
|
75 |
+ } else { |
|
76 |
+ setIsIdCheck(false); |
|
77 |
+ guardianRef.current['user_phonenumber'].focus(); |
|
78 |
+ alert("이미 존재하는 연락처 입니다."); |
|
79 |
+ } |
|
80 |
+ }).catch((error) => { |
|
81 |
+ console.log('userIdCheck() /user/userSelectOne.json error : ', error); |
|
82 |
+ }); |
|
83 |
+ } |
|
84 |
+ |
|
52 | 85 |
//보호자 등록 유효성 검사 |
53 | 86 |
const guardianInsertValidation = () => { |
54 | 87 |
if (CommonUtil.isEmpty(guardian['user_name']) == true) { |
... | ... | @@ -69,6 +102,10 @@ |
69 | 102 |
if (CommonUtil.isEmpty(guardian['user_phonenumber']) == true) { |
70 | 103 |
guardianRef.current['user_phonenumber'].focus(); |
71 | 104 |
alert("연락처를 입력해 주세요."); |
105 |
+ return false; |
|
106 |
+ } |
|
107 |
+ if (isIdCheck == false) { |
|
108 |
+ alert("연락처 중복확인을 해주세요."); |
|
72 | 109 |
return false; |
73 | 110 |
} |
74 | 111 |
if (CommonUtil.isEmpty(guardian['user_address']) == true) { |
... | ... | @@ -230,11 +267,14 @@ |
230 | 267 |
<tr> |
231 | 268 |
<th><span style={{color : "red"}}>*</span>연락처</th> |
232 | 269 |
<td colSpan={3}> |
233 |
- <input type="number" maxLength="11" |
|
270 |
+ <input type="number" maxLength="11" style={{width: 'calc(100% - 160px)'}} |
|
234 | 271 |
value={guardian['user_phonenumber']} |
235 |
- onChange={(e) => {guardianValueChange('user_phonenumber', e.target.value)}} |
|
272 |
+ onChange={(e) => {guardianValueChange('user_phonenumber', e.target.value); setIsIdCheck(false);}} |
|
236 | 273 |
ref={el => guardianRef.current['user_phonenumber'] = el} |
237 | 274 |
/> |
275 |
+ <button className={"red-btn btn-large"} onClick={userIdCheck}> |
|
276 |
+ 중복확인 |
|
277 |
+ </button> |
|
238 | 278 |
</td> |
239 | 279 |
</tr> |
240 | 280 |
<tr> |
--- client/views/component/Modal_SeniorInsert.jsx
+++ client/views/component/Modal_SeniorInsert.jsx
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 |
/**** 기본 조회 데이터 (시작) ****/ |
12 | 12 |
//전역 변수 저장 객체 |
13 | 13 |
const state = useSelector((state) => {return state}); |
14 |
+ //const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
14 | 15 |
|
15 | 16 |
//기관 계층 구조 목록 |
16 | 17 |
const [orgListOfHierarchy, setOrgListOfHierarchy] = React.useState([]); |
... | ... | @@ -21,7 +22,7 @@ |
21 | 22 |
headers: { |
22 | 23 |
'Content-Type': 'application/json; charset=UTF-8' |
23 | 24 |
}, |
24 |
- body: JSON.stringify({}), |
|
25 |
+ body: JSON.stringify({'government_id': defaultGovernmentId}), |
|
25 | 26 |
}).then((response) => response.json()).then((data) => { |
26 | 27 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
27 | 28 |
setOrgListOfHierarchy(data); |
... | ... | @@ -346,7 +347,7 @@ |
346 | 347 |
<td colSpan={3}> |
347 | 348 |
<input type="number" maxLength="11" style={{width: 'calc(100% - 160px)'}} |
348 | 349 |
value={senior['user_phonenumber']} |
349 |
- onChange={(e) => {seniorValueChange('user_phonenumber', e.target.value)}} |
|
350 |
+ onChange={(e) => {seniorValueChange('user_phonenumber', e.target.value); setIsIdCheck(false);}} |
|
350 | 351 |
ref={el => seniorRef.current['user_phonenumber'] = el} |
351 | 352 |
/> |
352 | 353 |
<button className={"red-btn btn-large"} onClick={userIdCheck} |
--- client/views/pages/App.jsx
+++ client/views/pages/App.jsx
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
import { setLoginUser } from "./AppStore.jsx"; |
12 | 12 |
|
13 | 13 |
//Application의 Route 정보를 관리하는 Component |
14 |
-import AllApp, {AdminApp, GovernmentApp, AgencyApp, GuardianApp} from "./AppRoute.jsx"; |
|
14 |
+import {AdminApp, GovernmentApp, AgencyApp, GuardianApp} from "./AppRoute.jsx"; |
|
15 | 15 |
|
16 | 16 |
//Test Layout |
17 | 17 |
import Header from "../layout/Header.jsx"; |
--- client/views/pages/AppRoute.jsx
+++ client/views/pages/AppRoute.jsx
... | ... | @@ -16,6 +16,9 @@ |
16 | 16 |
import EqualizerIcon from '@mui/icons-material/Equalizer'; |
17 | 17 |
import ApartmentIcon from '@mui/icons-material/Apartment'; |
18 | 18 |
import LocalHospitalIcon from '@mui/icons-material/LocalHospital'; |
19 |
+import QuestionMarkIcon from '@mui/icons-material/QuestionMark'; |
|
20 |
+import ContactSupportIcon from '@mui/icons-material/ContactSupport'; |
|
21 |
+ |
|
19 | 22 |
|
20 | 23 |
import Main_government from "./main/Main_government.jsx"; |
21 | 24 |
import Main_guardian from "./main/Main_guardian.jsx"; |
... | ... | @@ -54,325 +57,7 @@ |
54 | 57 |
import UserEdit from "./user_management/UserEdit.jsx"; |
55 | 58 |
import AgentSelectOne from "./user_management/AgentSelectOne.jsx"; |
56 | 59 |
|
57 |
-const AllAppMenuItems = [ |
|
58 |
- { |
|
59 |
- title: "올잇메디", |
|
60 |
- path: "/Main", |
|
61 |
- childrens: [ |
|
62 |
- { |
|
63 |
- title: "Home", |
|
64 |
- path: "/Main", |
|
65 |
- icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
66 |
- }, |
|
67 |
- { |
|
68 |
- title: "사용자 관리", |
|
69 |
- path: "/UserAuthoriySelect", |
|
70 |
- icon: ( |
|
71 |
- <PersonIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
72 |
- ), |
|
73 |
- }, |
|
74 |
- { |
|
75 |
- title: "건강관리", |
|
76 |
- path: "/Healthcare", |
|
77 |
- icon: ( |
|
78 |
- <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
79 |
- ), |
|
80 |
- }, |
|
81 |
- { |
|
82 |
- title: "진료 관리", |
|
83 |
- path:"/Medicalcare", |
|
84 |
- icon: ( |
|
85 |
- <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
86 |
- ), |
|
87 |
- }, |
|
88 |
- { |
|
89 |
- title: "장비 관리", |
|
90 |
- icon: ( |
|
91 |
- <ConstructionIcon |
|
92 |
- sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} |
|
93 |
- /> |
|
94 |
- ), |
|
95 |
- childrens: [ |
|
96 |
- { |
|
97 |
- title: "장비 조회", |
|
98 |
- path: "/EquipmentManagementSelect", |
|
99 |
- }, |
|
100 |
- { |
|
101 |
- title: "장비 문의 관리", |
|
102 |
- path: "/QandASelect", |
|
103 |
- }, |
|
104 |
- ], |
|
105 |
- }, |
|
106 |
- ], |
|
107 |
- }, |
|
108 |
- { |
|
109 |
- title: "관리기관", |
|
110 |
- path: "/Main_government", |
|
111 |
- childrens: [ |
|
112 |
- { |
|
113 |
- title: "Home", |
|
114 |
- path: "/Main_government", |
|
115 |
- icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
116 |
- }, |
|
117 |
- { |
|
118 |
- title: "기관 관리", |
|
119 |
- icon: ( |
|
120 |
- <ApartmentIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
121 |
- ), |
|
122 |
- childrens: [ |
|
123 |
- { |
|
124 |
- title: "기관 조회", |
|
125 |
- path: "/AgencySelect", |
|
126 |
- }, |
|
127 |
- { |
|
128 |
- title: "사용자 계정 승인", |
|
129 |
- path: "/UserSelectOk", |
|
130 |
- }, |
|
131 |
- ], |
|
132 |
- }, |
|
133 |
- { |
|
134 |
- title: "건강 관리", |
|
135 |
- path: "/Healthcare", |
|
136 |
- icon: ( |
|
137 |
- <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
138 |
- ), |
|
139 |
- }, |
|
140 |
- { |
|
141 |
- title: "진료 관리", |
|
142 |
- path:"/Medicalcare", |
|
143 |
- icon: ( |
|
144 |
- <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
145 |
- ), |
|
146 |
- }, |
|
147 |
- { |
|
148 |
- title: "문의 현황 관리", |
|
149 |
- path: "/QandASelect", |
|
150 |
- icon: ( |
|
151 |
- <SpeakerPhoneIcon |
|
152 |
- sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} |
|
153 |
- /> |
|
154 |
- ), |
|
155 |
- }, |
|
156 |
- { |
|
157 |
- title: "설정 관리", |
|
158 |
- icon: ( |
|
159 |
- <SettingsIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
160 |
- ), |
|
161 |
- childrens: [ |
|
162 |
- { |
|
163 |
- title: "위험 기준 관리", |
|
164 |
- path: "/RiskSet", |
|
165 |
- }, |
|
166 |
- { |
|
167 |
- title: "사용자 권한 관리", |
|
168 |
- path: "/AuthorityManagement", |
|
169 |
- }, |
|
170 |
- ], |
|
171 |
- }, |
|
172 |
- ], |
|
173 |
- }, |
|
174 |
- { |
|
175 |
- title: "시행기관", |
|
176 |
- path: "/Main_agency", |
|
177 |
- childrens: [ |
|
178 |
- { |
|
179 |
- title: "Home", |
|
180 |
- path: "/Main_agency", |
|
181 |
- icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
182 |
- }, |
|
183 |
- { |
|
184 |
- title: "대상자 관리", |
|
185 |
- path: "/UserAuthoriySelect_agency", |
|
186 |
- icon: ( |
|
187 |
- <PersonIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
188 |
- ), |
|
189 |
- }, |
|
190 |
- { |
|
191 |
- title: "건강 관리", |
|
192 |
- path:"/Healthcare", |
|
193 |
- icon: ( |
|
194 |
- <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
195 |
- ), |
|
196 |
- }, |
|
197 |
- { |
|
198 |
- title: "진료 관리", |
|
199 |
- path:"/Medicalcare", |
|
200 |
- icon: ( |
|
201 |
- <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
202 |
- ), |
|
203 |
- }, |
|
204 |
- { |
|
205 |
- title: "장비 관리", |
|
206 |
- icon: ( |
|
207 |
- <ConstructionIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
208 |
- ), |
|
209 |
- childrens: [ |
|
210 |
- { |
|
211 |
- title: "장비 대여 관리", |
|
212 |
- path: "/EquipmentManagementSelect", |
|
213 |
- }, |
|
214 |
- { |
|
215 |
- title: "문의게시판", |
|
216 |
- path: "/QandASelect", |
|
217 |
- }, |
|
218 |
- ] |
|
219 |
- }, |
|
220 |
- { |
|
221 |
- title: "Q&A", |
|
222 |
- path: "/QuestionSelect", |
|
223 |
- icon: ( |
|
224 |
- <SpeakerPhoneIcon |
|
225 |
- sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} |
|
226 |
- /> |
|
227 |
- ), |
|
228 |
- }, |
|
229 |
- ], |
|
230 |
- }, |
|
231 |
- { |
|
232 |
- title: "보호자", |
|
233 |
- childrens: [ |
|
234 |
- { |
|
235 |
- title: "Home", |
|
236 |
- path: "/Main_guardian", |
|
237 |
- icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
238 |
- }, |
|
239 |
- { |
|
240 |
- title: "그래프로 보기", |
|
241 |
- path: "/GuardianStatistics", |
|
242 |
- icon: <EqualizerIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
243 |
- }, |
|
244 |
- { |
|
245 |
- title: "Q&A", |
|
246 |
- path: "/QuestionSelect", |
|
247 |
- icon: ( |
|
248 |
- <SpeakerPhoneIcon |
|
249 |
- sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} |
|
250 |
- /> |
|
251 |
- ), |
|
252 |
- }, |
|
253 |
- ], |
|
254 |
- }, |
|
255 |
-]; |
|
256 |
- |
|
257 |
-function AllAppRoute() { |
|
258 |
- return ( |
|
259 |
- <Routes> |
|
260 |
- |
|
261 |
- <Route path="/Medicalcare" element={<Medicalcare />}></Route> |
|
262 |
- <Route path="/Healthcare" element={<Healthcare />}></Route> |
|
263 |
- <Route path="/QuestionConfirm/:qnaIdx" element={<QuestionConfirm />}></Route> |
|
264 |
- |
|
265 |
- <Route path="/GuardianStatistics" element={<GuardianStatistics />}></Route> |
|
266 |
- <Route path="/Main_guardian" element={<Main_guardian />}></Route> |
|
267 |
- <Route path="/QuestionSelect" element={<QuestionSelect />}></Route> |
|
268 |
- <Route path="/Join" element={<Join />}></Route> |
|
269 |
- <Route path="/QuestionSelect" element={<QuestionSelect />}></Route> |
|
270 |
- <Route path="/Main_agency" element={<Main_agency />}></Route> |
|
271 |
- <Route path="/UserAuthoriySelect_agency" element={<UserAuthoriySelect_agency />}></Route> |
|
272 |
- <Route path="/SeniorEdit/:seniorId" element={<SeniorEdit />}></Route> |
|
273 |
- <Route path="/SeniorSelectOne/:seniorId" element={<SeniorSelectOne />}></Route> |
|
274 |
- <Route |
|
275 |
- path="/MedicineCareSelectOne" |
|
276 |
- element={<MedicineCareSelectOne />} |
|
277 |
- ></Route> |
|
278 |
- <Route |
|
279 |
- path="/TemperatureManagementSelectOne" |
|
280 |
- element={<TemperatureManagementSelectOne />} |
|
281 |
- ></Route> |
|
282 |
- <Route path="/VisitInsert" element={<VisitInsert />}></Route> |
|
283 |
- <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route> |
|
284 |
- <Route |
|
285 |
- path="/EquipmentRentalInsert" |
|
286 |
- element={<EquipmentRentalInsert />} |
|
287 |
- ></Route> |
|
288 |
- <Route |
|
289 |
- path="/EquipmentManagementSelect" |
|
290 |
- element={<EquipmentManagementSelect />} |
|
291 |
- ></Route> |
|
292 |
- <Route |
|
293 |
- path="/EquipmentManagementSelectOne" |
|
294 |
- element={<EquipmentManagementSelectOne />} |
|
295 |
- ></Route> |
|
296 |
- <Route |
|
297 |
- path="/QandASelect" |
|
298 |
- element={<QandASelect />} |
|
299 |
- ></Route> |
|
300 |
- <Route |
|
301 |
- path="/QandAInsert" |
|
302 |
- element={<QandAInsert />} |
|
303 |
- ></Route> |
|
304 |
- <Route |
|
305 |
- path="/QandAConfirm" |
|
306 |
- element={<QandAConfirm />} |
|
307 |
- ></Route> |
|
308 |
- <Route path="/Main_government" element={<Main_government />}></Route> |
|
309 |
- <Route path="/AgencySelect" element={<AgencySelect />}></Route> |
|
310 |
- <Route path="/UserSelectOk" element={<UserSelectOk />}></Route> |
|
311 |
- <Route |
|
312 |
- path="/MedicineCareSelectOne" |
|
313 |
- element={<MedicineCareSelectOne />} |
|
314 |
- ></Route> |
|
315 |
- <Route |
|
316 |
- path="/TemperatureManagementSelectOne" |
|
317 |
- element={<TemperatureManagementSelectOne />} |
|
318 |
- ></Route> |
|
319 |
- <Route |
|
320 |
- path="/MedicineStatistics" |
|
321 |
- element={<MedicineStatistics />} |
|
322 |
- ></Route> |
|
323 |
- <Route path="/VisitInsert" element={<VisitInsert />}></Route> |
|
324 |
- <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route> |
|
325 |
- <Route |
|
326 |
- path="/UserAuthoriySelect" |
|
327 |
- element={<UserAuthoriySelect />} |
|
328 |
- ></Route> |
|
329 |
- <Route path="/RiskSet" element={<RiskSet />}></Route> |
|
330 |
- <Route path="/AuthorityManagement" element={<AuthorityManagement />}></Route> |
|
331 |
- <Route path="/QandASelect" element={<QandASelect />}></Route> |
|
332 |
- <Route path="/QandAConfirm" element={<QandAConfirm />}></Route> |
|
333 |
- <Route path="/QandAInsert" element={<QandAInsert />}></Route> |
|
334 |
- <Route path="/ProtectorSelect" element={<ProtectorSelect />}></Route> |
|
335 |
- <Route path="/SeniorEdit/:seniorId" element={<SeniorEdit />}></Route> |
|
336 |
- <Route path="/AgencyInsert" element={<AgencyInsert />}></Route> |
|
337 |
- <Route path="/Join" element={<Join />}></Route> |
|
338 |
- <Route path="/Main" element={<Main />}></Route> |
|
339 |
- <Route |
|
340 |
- path="/EquipmentRentalInsert" |
|
341 |
- element={<EquipmentRentalInsert />} |
|
342 |
- ></Route> |
|
343 |
- <Route |
|
344 |
- path="/EquipmentManagementInsert" |
|
345 |
- element={<EquipmentManagementInsert />} |
|
346 |
- ></Route> |
|
347 |
- <Route |
|
348 |
- path="/EquipmentManagementSelect" |
|
349 |
- element={<EquipmentManagementSelect />} |
|
350 |
- ></Route> |
|
351 |
- <Route |
|
352 |
- path="/EquipmentManagementSelectOne" |
|
353 |
- element={<EquipmentManagementSelectOne />} |
|
354 |
- ></Route> |
|
355 |
- <Route |
|
356 |
- path="/MedicineCareSelectOne" |
|
357 |
- element={<MedicineCareSelectOne />} |
|
358 |
- ></Route> |
|
359 |
- <Route |
|
360 |
- path="/TemperatureManagementSelectOne" |
|
361 |
- element={<TemperatureManagementSelectOne />} |
|
362 |
- ></Route> |
|
363 |
- <Route |
|
364 |
- path="/VisitSelectOne" |
|
365 |
- element={<VisitSelectOne />} |
|
366 |
- ></Route> |
|
367 |
- <Route path="/QandAInsert" element={<QandAInsert />}></Route> |
|
368 |
- <Route path="/QandASelect" element={<QandASelect />}></Route> |
|
369 |
- <Route path="/EquipmentManagementSelectAdd" element={<EquipmentManagementSelectAdd />}></Route> |
|
370 |
- <Route path="/UserAuthoriySelect" element={<UserAuthoriySelect />}></Route> |
|
371 |
- <Route path="/QandAConfirm" element={<QandAConfirm />}></Route> |
|
372 |
- </Routes> |
|
373 |
- ); |
|
374 |
-} |
|
375 |
- |
|
60 |
+import OrgSelect from "./org/OrgSelect.jsx"; |
|
376 | 61 |
|
377 | 62 |
|
378 | 63 |
const AdminAppMenuItems = [ |
... | ... | @@ -382,44 +67,60 @@ |
382 | 67 |
icon: <HouseIcon sx={{ fontSize: 20, marginRight: 1 }} />, |
383 | 68 |
}, |
384 | 69 |
{ |
385 |
- title: "사용자 관리", |
|
386 |
- path: "/UserAuthoriySelect", |
|
70 |
+ title: "기관 관리", |
|
387 | 71 |
icon: ( |
388 |
- <PersonIcon sx={{ fontSize: 20, marginRight: 1 }} /> |
|
389 |
- ), |
|
390 |
- }, |
|
391 |
- { |
|
392 |
- title: "건강 관리", |
|
393 |
- path:"/Healthcare", |
|
394 |
- icon: ( |
|
395 |
- <Diversity1Icon sx={{ fontSize: 20, marginRight: 1 }} /> |
|
396 |
- ), |
|
397 |
- }, |
|
398 |
- { |
|
399 |
- title: "진료 관리", |
|
400 |
- path:"/Medicalcare", |
|
401 |
- icon: ( |
|
402 |
- <LocalHospitalIcon sx={{ fontSize: 20, marginRight: 1 }} /> |
|
403 |
- ), |
|
404 |
- }, |
|
405 |
- { |
|
406 |
- title: "장비 관리", |
|
407 |
- icon: ( |
|
408 |
- <ConstructionIcon |
|
72 |
+ <PersonIcon |
|
409 | 73 |
sx={{ fontSize: 20, marginRight: 1 }} |
410 | 74 |
/> |
411 | 75 |
), |
412 | 76 |
childrens: [ |
413 | 77 |
{ |
414 |
- title: "장비 조회", |
|
415 |
- path: "/EquipmentManagementSelect", |
|
78 |
+ title: "기관 관리", |
|
79 |
+ path: "/OrgSelect", |
|
416 | 80 |
}, |
417 | 81 |
{ |
418 |
- title: "장비 문의 관리", |
|
419 |
- path: "/QandASelect", |
|
82 |
+ title: "사용자 관리", |
|
83 |
+ path: "/UserAuthoriySelect", |
|
420 | 84 |
}, |
421 | 85 |
], |
422 | 86 |
}, |
87 |
+ { |
|
88 |
+ title: "장비 관리", |
|
89 |
+ path: "/EquipmentManagementSelect", |
|
90 |
+ icon: ( |
|
91 |
+ <SpeakerPhoneIcon |
|
92 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
93 |
+ /> |
|
94 |
+ ), |
|
95 |
+ }, |
|
96 |
+ { |
|
97 |
+ title: "문의 관리", |
|
98 |
+ path: "/QandASelect", |
|
99 |
+ icon: ( |
|
100 |
+ <ContactSupportIcon |
|
101 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
102 |
+ /> |
|
103 |
+ ), |
|
104 |
+ }, |
|
105 |
+ { |
|
106 |
+ title: "대상자 관리", |
|
107 |
+ icon: ( |
|
108 |
+ <Diversity1Icon |
|
109 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
110 |
+ /> |
|
111 |
+ ), |
|
112 |
+ childrens: [ |
|
113 |
+ { |
|
114 |
+ title: "건강 관리", |
|
115 |
+ path: "/Healthcare", |
|
116 |
+ }, |
|
117 |
+ { |
|
118 |
+ title: "진료 관리", |
|
119 |
+ path:"/Medicalcare", |
|
120 |
+ }, |
|
121 |
+ ], |
|
122 |
+ }, |
|
123 |
+ |
|
423 | 124 |
|
424 | 125 |
]; |
425 | 126 |
function AdminAppRoute() { |
... | ... | @@ -429,34 +130,13 @@ |
429 | 130 |
<Route path="/Medicalcare" element={<Medicalcare />}></Route> |
430 | 131 |
<Route path="/Healthcare" element={<Healthcare />}></Route> |
431 | 132 |
<Route path="/Main" element={<Main />}></Route> |
432 |
- <Route |
|
433 |
- path="/EquipmentRentalInsert" |
|
434 |
- element={<EquipmentRentalInsert />} |
|
435 |
- ></Route> |
|
436 |
- <Route |
|
437 |
- path="/EquipmentManagementInsert" |
|
438 |
- element={<EquipmentManagementInsert />} |
|
439 |
- ></Route> |
|
440 |
- <Route |
|
441 |
- path="/EquipmentManagementSelect" |
|
442 |
- element={<EquipmentManagementSelect />} |
|
443 |
- ></Route> |
|
444 |
- <Route |
|
445 |
- path="/EquipmentManagementSelectOne" |
|
446 |
- element={<EquipmentManagementSelectOne />} |
|
447 |
- ></Route> |
|
448 |
- <Route |
|
449 |
- path="/MedicineCareSelectOne" |
|
450 |
- element={<MedicineCareSelectOne />} |
|
451 |
- ></Route> |
|
452 |
- <Route |
|
453 |
- path="/TemperatureManagementSelectOne" |
|
454 |
- element={<TemperatureManagementSelectOne />} |
|
455 |
- ></Route> |
|
456 |
- <Route |
|
457 |
- path="/VisitSelectOne" |
|
458 |
- element={<VisitSelectOne />} |
|
459 |
- ></Route> |
|
133 |
+ <Route path="/EquipmentRentalInsert" element={<EquipmentRentalInsert />}></Route> |
|
134 |
+ <Route path="/EquipmentManagementInsert" element={<EquipmentManagementInsert />}></Route> |
|
135 |
+ <Route path="/EquipmentManagementSelect" element={<EquipmentManagementSelect />}></Route> |
|
136 |
+ <Route path="/EquipmentManagementSelectOne" element={<EquipmentManagementSelectOne />}></Route> |
|
137 |
+ <Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
|
138 |
+ <Route path="/TemperatureManagementSelectOne" element={<TemperatureManagementSelectOne />}></Route> |
|
139 |
+ <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route> |
|
460 | 140 |
<Route path="/QandAInsert" element={<QandAInsert />}></Route> |
461 | 141 |
<Route path="/QandASelect" element={<QandASelect />}></Route> |
462 | 142 |
<Route path="/EquipmentManagementSelectAdd" element={<EquipmentManagementSelectAdd />}></Route> |
... | ... | @@ -467,6 +147,8 @@ |
467 | 147 |
<Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route> |
468 | 148 |
<Route path="/UserEdit" element={<UserEdit />}></Route> |
469 | 149 |
<Route path="/AgentSelectOne" element={<AgentSelectOne />}></Route> |
150 |
+ <Route path="/OrgSelect" element={<OrgSelect />}></Route> |
|
151 |
+ <Route path="/MedicineStatistics" element={<MedicineStatistics />}></Route> |
|
470 | 152 |
|
471 | 153 |
</Routes> |
472 | 154 |
); |
... | ... | @@ -477,51 +159,56 @@ |
477 | 159 |
{ |
478 | 160 |
title: "Home", |
479 | 161 |
path: "/Main", |
480 |
- icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
|
162 |
+ icon: <HouseIcon sx={{ fontSize: 20, marginRight: 1 }} />, |
|
481 | 163 |
}, |
482 | 164 |
{ |
483 | 165 |
title: "기관 관리", |
484 | 166 |
icon: ( |
485 |
- <ApartmentIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
167 |
+ <PersonIcon |
|
168 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
169 |
+ /> |
|
486 | 170 |
), |
487 | 171 |
childrens: [ |
488 | 172 |
{ |
489 |
- title: "기관 조회", |
|
490 |
- path: "/AgencySelect", |
|
173 |
+ title: "기관 관리", |
|
174 |
+ path: "/OrgSelect", |
|
491 | 175 |
}, |
492 | 176 |
{ |
493 |
- title: "사용자 계정 승인", |
|
494 |
- path: "/UserSelectOk", |
|
177 |
+ title: "사용자 관리", |
|
178 |
+ path: "/UserAuthoriySelect", |
|
495 | 179 |
}, |
496 | 180 |
], |
497 | 181 |
}, |
498 | 182 |
{ |
499 |
- title: "건강 관리", |
|
500 |
- path:"/Healthcare", |
|
501 |
- icon: ( |
|
502 |
- <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
503 |
- ), |
|
504 |
- }, |
|
505 |
- { |
|
506 |
- title: "진료 관리", |
|
507 |
- path:"/Medicalcare", |
|
508 |
- icon: ( |
|
509 |
- <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
510 |
- ), |
|
511 |
- }, |
|
512 |
- { |
|
513 | 183 |
title: "문의 현황 관리", |
514 |
- path: "/QandASelect", |
|
515 | 184 |
icon: ( |
516 |
- <SpeakerPhoneIcon |
|
517 |
- sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} |
|
185 |
+ <ContactSupportIcon |
|
186 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
518 | 187 |
/> |
519 | 188 |
), |
520 | 189 |
}, |
521 | 190 |
{ |
191 |
+ title: "대상자 관리", |
|
192 |
+ icon: ( |
|
193 |
+ <Diversity1Icon |
|
194 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
195 |
+ /> |
|
196 |
+ ), |
|
197 |
+ childrens: [ |
|
198 |
+ { |
|
199 |
+ title: "건강 관리", |
|
200 |
+ path: "/Healthcare", |
|
201 |
+ }, |
|
202 |
+ { |
|
203 |
+ title: "진료 관리", |
|
204 |
+ path:"/Medicalcare", |
|
205 |
+ }, |
|
206 |
+ ], |
|
207 |
+ }, |
|
208 |
+ { |
|
522 | 209 |
title: "설정 관리", |
523 | 210 |
icon: ( |
524 |
- <SettingsIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} /> |
|
211 |
+ <SettingsIcon sx={{ fontSize: 20, marginRight: 1 }} /> |
|
525 | 212 |
), |
526 | 213 |
childrens: [ |
527 | 214 |
{ |
... | ... | @@ -544,24 +231,12 @@ |
544 | 231 |
<Route path="/Main" element={<Main_government />}></Route> |
545 | 232 |
<Route path="/AgencySelect" element={<AgencySelect />}></Route> |
546 | 233 |
<Route path="/UserSelectOk" element={<UserSelectOk />}></Route> |
547 |
- <Route |
|
548 |
- path="/MedicineCareSelectOne" |
|
549 |
- element={<MedicineCareSelectOne />} |
|
550 |
- ></Route> |
|
551 |
- <Route |
|
552 |
- path="/TemperatureManagementSelectOne" |
|
553 |
- element={<TemperatureManagementSelectOne />} |
|
554 |
- ></Route> |
|
555 |
- <Route |
|
556 |
- path="/MedicineStatistics" |
|
557 |
- element={<MedicineStatistics />} |
|
558 |
- ></Route> |
|
234 |
+ <Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
|
235 |
+ <Route path="/TemperatureManagementSelectOne" element={<TemperatureManagementSelectOne />}></Route> |
|
236 |
+ <Route path="/MedicineStatistics" element={<MedicineStatistics />} ></Route> |
|
559 | 237 |
<Route path="/VisitInsert" element={<VisitInsert />}></Route> |
560 | 238 |
<Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route> |
561 |
- <Route |
|
562 |
- path="/UserAuthoriySelect" |
|
563 |
- element={<UserAuthoriySelect />} |
|
564 |
- ></Route> |
|
239 |
+ <Route path="/UserAuthoriySelect" element={<UserAuthoriySelect />}></Route> |
|
565 | 240 |
<Route path="/RiskSet" element={<RiskSet />}></Route> |
566 | 241 |
{/* <Route path="/AuthorityManagement" element={<AuthorityManagement />}></Route> */} |
567 | 242 |
<Route path="/QandASelect" element={<QandASelect />}></Route> |
... | ... | @@ -574,6 +249,8 @@ |
574 | 249 |
<Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route> |
575 | 250 |
<Route path="/UserEdit" element={<UserEdit />}></Route> |
576 | 251 |
<Route path="/AgentSelectOne" element={<AgentSelectOne />}></Route> |
252 |
+ <Route path="/OrgSelect" element={<OrgSelect />}></Route> |
|
253 |
+ <Route path="/UserAuthoriySelect" element={<UserAuthoriySelect />}></Route> |
|
577 | 254 |
</Routes> |
578 | 255 |
); |
579 | 256 |
} |
... | ... | @@ -715,11 +392,10 @@ |
715 | 392 |
); |
716 | 393 |
} |
717 | 394 |
|
718 |
-const AllApp = { 'menuItems': AllAppMenuItems, 'AppRoute': AllAppRoute }; |
|
719 | 395 |
const AdminApp = { 'menuItems': AdminAppMenuItems, 'AppRoute': AdminAppRoute }; |
720 | 396 |
const GovernmentApp = { 'menuItems': GovernmentAppMenuItems, 'AppRoute': GovernmentAppRoute }; |
721 | 397 |
const AgencyApp = { 'menuItems': AgencyAppMenuItems, 'AppRoute': AgencyAppRoute }; |
722 | 398 |
const GuardianApp = { 'menuItems': GuardianAppMenuItems, 'AppRoute': GuardianAppRoute }; |
723 | 399 |
|
724 |
-export default AllApp; |
|
400 |
+export default AdminApp; |
|
725 | 401 |
export { AdminApp, GovernmentApp, GuardianApp, AgencyApp }; |
--- client/views/pages/equipment/EquipmentManagementSelect.jsx
+++ client/views/pages/equipment/EquipmentManagementSelect.jsx
... | ... | @@ -1,17 +1,23 @@ |
1 | 1 |
import React from "react"; |
2 | 2 |
import { useNavigate } from "react-router"; |
3 | 3 |
import { useSelector } from "react-redux"; |
4 |
+import { useStateWithCallbackLazy } from 'use-state-with-callback'; |
|
4 | 5 |
import SubTitle from "../../component/SubTitle.jsx"; |
5 | 6 |
import Modal from "../../component/Modal.jsx"; |
6 | 7 |
|
7 | 8 |
import House from "../../../resources/files/icon/house.png"; |
8 | 9 |
import Arrow from "../../../resources/files/icon/arrow.png"; |
10 |
+import Pagination from "../../component/Pagination.jsx"; |
|
11 |
+ |
|
9 | 12 |
import CommonUtil from "../../../resources/js/CommonUtil.js"; |
10 | 13 |
|
11 | 14 |
export default function EquipmentManagementSelect() { |
15 |
+ |
|
16 |
+ const navigate = useNavigate(); |
|
17 |
+ |
|
12 | 18 |
//전역 변수 저장 객체 |
13 | 19 |
const state = useSelector((state) => {return state}); |
14 |
- const navigate = useNavigate(); |
|
20 |
+ const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
15 | 21 |
|
16 | 22 |
|
17 | 23 |
//기관 계층 구조 목록 |
... | ... | @@ -23,7 +29,7 @@ |
23 | 29 |
headers: { |
24 | 30 |
'Content-Type': 'application/json; charset=UTF-8' |
25 | 31 |
}, |
26 |
- body: JSON.stringify({}), |
|
32 |
+ body: JSON.stringify({'government_id': defaultGovernmentId}), |
|
27 | 33 |
}).then((response) => response.json()).then((data) => { |
28 | 34 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
29 | 35 |
setOrgListOfHierarchy(data); |
... | ... | @@ -38,25 +44,27 @@ |
38 | 44 |
}); |
39 | 45 |
//올잇메디 선택 |
40 | 46 |
const adminChange = () => { |
41 |
- const newOrg = {...org}; |
|
42 |
- newOrg['government_id'] = null; |
|
43 |
- newOrg['agency_id'] = null; |
|
44 |
- setOrg(newOrg); |
|
47 |
+ org['government_id'] = null; |
|
48 |
+ org['agency_id'] = null; |
|
49 |
+ setOrg({...org}); |
|
45 | 50 |
} |
46 | 51 |
//관리 기관 선택 |
47 | 52 |
const governmentChange = (government_id) => { |
48 |
- const newOrg = {...org}; |
|
49 |
- newOrg['government_id'] = government_id; |
|
50 |
- newOrg['agency_id'] = null; |
|
51 |
- setOrg(newOrg); |
|
53 |
+ org['government_id'] = government_id; |
|
54 |
+ org['agency_id'] = null; |
|
55 |
+ setOrg({...org}); |
|
52 | 56 |
} |
53 | 57 |
//시행 기관 선택 |
54 | 58 |
const agencyChange = (government_id, agency_id) => { |
55 |
- const newOrg = {...org}; |
|
56 |
- newOrg['government_id'] = government_id; |
|
57 |
- newOrg['agency_id'] = agency_id; |
|
58 |
- setOrg(newOrg); |
|
59 |
+ org['government_id'] = government_id; |
|
60 |
+ org['agency_id'] = agency_id; |
|
61 |
+ setOrg({...org}); |
|
59 | 62 |
} |
63 |
+ //Mounted |
|
64 |
+ React.useEffect(() => { |
|
65 |
+ equipmentSearching(); |
|
66 |
+ }, [org]); |
|
67 |
+ |
|
60 | 68 |
|
61 | 69 |
|
62 | 70 |
// 시스템 코드 - 장비 상태 |
... | ... | @@ -100,7 +108,7 @@ |
100 | 108 |
'senior_id': null |
101 | 109 |
} |
102 | 110 |
//장비 |
103 |
- const [equipment, setEquipment] = React.useState({...equipmentInit}); |
|
111 |
+ const [equipment, setEquipment] = useStateWithCallbackLazy({...equipmentInit}); |
|
104 | 112 |
//각 데이터별로 Dom 정보 담을 Ref 생성 |
105 | 113 |
const equipmentRef = React.useRef({...equipmentInit}); |
106 | 114 |
//장비 정보 변경 |
... | ... | @@ -137,10 +145,46 @@ |
137 | 145 |
|
138 | 146 |
return true; |
139 | 147 |
} |
148 |
+ //시리얼 번호 중복 확인 |
|
149 |
+ const [isSerialNumberCheck, setIsSerialNumberCheck] = React.useState(false); |
|
150 |
+ //시리얼 번호 중복 검사 |
|
151 |
+ const serialNumberCheck = () => { |
|
152 |
+ if (CommonUtil.isEmpty(equipment['equipment_serial_number']) == true) { |
|
153 |
+ equipmentRef.current['equipment_serial_number'].focus(); |
|
154 |
+ alert("모델명을 입력해 주세요."); |
|
155 |
+ return false; |
|
156 |
+ } |
|
157 |
+ |
|
158 |
+ fetch("/equipment/equipmentSelectOne.json", { |
|
159 |
+ method: "POST", |
|
160 |
+ headers: { |
|
161 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
162 |
+ }, |
|
163 |
+ body: JSON.stringify(equipment), |
|
164 |
+ }).then((response) => response.json()).then((data) => { |
|
165 |
+ console.log("시리얼 번호 중복 검사 : ", data); |
|
166 |
+ if (CommonUtil.isEmpty(data) == true) { |
|
167 |
+ setIsSerialNumberCheck(true); |
|
168 |
+ equipmentRef.current['equipment_product_date'].focus(); |
|
169 |
+ alert("사용가능한 시리얼 번호 입니다."); |
|
170 |
+ } else { |
|
171 |
+ setIsSerialNumberCheck(false); |
|
172 |
+ equipmentRef.current['equipment_serial_number'].focus(); |
|
173 |
+ alert("이미 존재하는 시리얼 번호 입니다."); |
|
174 |
+ } |
|
175 |
+ }).catch((error) => { |
|
176 |
+ console.log('userIdCheck() /user/equipmentSelectOne.json error : ', error); |
|
177 |
+ }); |
|
178 |
+ } |
|
140 | 179 |
//장비 등록 |
141 | 180 |
const equipmentInsert = () => { |
142 | 181 |
if (equipmentValidation() == false) { |
143 | 182 |
return; |
183 |
+ } |
|
184 |
+ if (isSerialNumberCheck == false) { |
|
185 |
+ alert("시리얼 번호 중복확인을 해주세요."); |
|
186 |
+ equipmentRef.current['equipment_serial_number'].focus(); |
|
187 |
+ return; |
|
144 | 188 |
} |
145 | 189 |
console.log('equipmentInsert equipment : ', equipment); |
146 | 190 |
|
... | ... | @@ -163,8 +207,9 @@ |
163 | 207 |
console.log('equipmentInsert() /equipment/equipmentInsert.json error : ', error); |
164 | 208 |
}); |
165 | 209 |
} |
210 |
+ |
|
166 | 211 |
//장비 수정 |
167 |
- const equipmentUpdate = (callback) => { |
|
212 |
+ const equipmentUpdate = () => { |
|
168 | 213 |
if (equipmentValidation() == false) { |
169 | 214 |
return; |
170 | 215 |
} |
... | ... | @@ -178,12 +223,40 @@ |
178 | 223 |
}).then((response) => response.json()).then((data) => { |
179 | 224 |
console.log("장비 수정 결과(건수) : ", data); |
180 | 225 |
if (data > 0) { |
181 |
- callback(); |
|
226 |
+ alert("수정완료"); |
|
227 |
+ equipmentSearching(); |
|
228 |
+ modalEquipmentClose(); |
|
182 | 229 |
} else { |
183 | 230 |
alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); |
184 | 231 |
} |
185 | 232 |
}).catch((error) => { |
186 | 233 |
console.log('equipmentUpdate() /equipment/equipmentUpdate.json error : ', error); |
234 |
+ }); |
|
235 |
+ } |
|
236 |
+ |
|
237 |
+ //장비 삭제 |
|
238 |
+ const equipmentDelete = () => { |
|
239 |
+ if (confirm('해당 장비를 삭제하시겠습니까?') == false) { |
|
240 |
+ return; |
|
241 |
+ } |
|
242 |
+ |
|
243 |
+ fetch("/equipment/equipmentDelete.json", { |
|
244 |
+ method: "POST", |
|
245 |
+ headers: { |
|
246 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
247 |
+ }, |
|
248 |
+ body: JSON.stringify(equipment), |
|
249 |
+ }).then((response) => response.json()).then((data) => { |
|
250 |
+ console.log("장비 삭제 결과(건수) : ", data); |
|
251 |
+ if (data > 0) { |
|
252 |
+ alert("삭제완료"); |
|
253 |
+ equipmentSearching(); |
|
254 |
+ modalEquipmentClose(); |
|
255 |
+ } else { |
|
256 |
+ alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
257 |
+ } |
|
258 |
+ }).catch((error) => { |
|
259 |
+ console.log('equipmentDelete() /equipment/equipmentDelete.json error : ', error); |
|
187 | 260 |
}); |
188 | 261 |
} |
189 | 262 |
|
... | ... | @@ -195,6 +268,8 @@ |
195 | 268 |
// 장비 관리(등록,수정) 모달창 열기 |
196 | 269 |
const modalEquipmentOpen = (item) => { |
197 | 270 |
if (CommonUtil.isEmpty(item)) { |
271 |
+ equipment['equipment_insert_datetime'] = null; |
|
272 |
+ setIsSerialNumberCheck(false); |
|
198 | 273 |
setEquipment({...equipment}); |
199 | 274 |
} else { |
200 | 275 |
setEquipment(item); |
... | ... | @@ -209,22 +284,115 @@ |
209 | 284 |
// 장비 납품 모달창 |
210 | 285 |
const [modalDeliveryIsOpen, setModalDeliveryIsOpen] = React.useState(false); |
211 | 286 |
// 장비 납품 모달창 열기 |
212 |
- const modalDeliveryOpen = (item) => { |
|
213 |
- setEquipment(item); |
|
287 |
+ const modalDeliveryOpen = () => { |
|
288 |
+ if (CommonUtil.isEmpty(equipmentDelivery.equipmentDeliveryDetailList)) { |
|
289 |
+ alert("납품할 장비가 선택되지 않았습니다."); |
|
290 |
+ return; |
|
291 |
+ } |
|
214 | 292 |
setModalDeliveryIsOpen(true); |
215 | 293 |
}; |
216 | 294 |
// 장비 납품 모달창 닫기 |
217 | 295 |
const modalDeliveryClose = () => { |
218 | 296 |
setModalDeliveryIsOpen(false); |
219 | 297 |
}; |
298 |
+ //장비 납품 초기값 |
|
299 |
+ const equipmentDeliveryInit = { |
|
300 |
+ 'government_id': null, |
|
301 |
+ 'delivery_idx': null, |
|
302 |
+ 'delivery_date': CommonUtil.getDate(), |
|
303 |
+ 'delivery_total_price': null, |
|
304 |
+ 'delivery_insert_user_id': null, |
|
305 |
+ |
|
306 |
+ equipmentDeliveryDetailList: [], |
|
307 |
+ } |
|
308 |
+ //장비 납품 정보 |
|
309 |
+ const [equipmentDelivery, setEquipmentDelivery] = useStateWithCallbackLazy({...equipmentDeliveryInit}); |
|
310 |
+ //장비 납품 모드 유무 |
|
311 |
+ const [isEquipmentDelivery, setIsEquipmentDelivery] = React.useState(false); |
|
312 |
+ |
|
313 |
+ //장비 납품 선택 |
|
314 |
+ const equipmentDeliveryAdd = (equipment, isChecked) => { |
|
315 |
+ const index = equipmentDelivery.equipmentDeliveryDetailList.findIndex(item => item['equipment_serial_number'] == equipment['equipment_serial_number']); |
|
316 |
+ console.log('equipmentDeliveryAdd : ', equipment, isChecked, index); |
|
317 |
+ if (isChecked == true && index == -1) { |
|
318 |
+ equipmentDelivery.equipmentDeliveryDetailList.push(equipment); |
|
319 |
+ setEquipmentDelivery({...equipmentDelivery}); |
|
320 |
+ } else if (isChecked == false && index > -1) { |
|
321 |
+ equipmentDelivery.equipmentDeliveryDetailList.splice(index, 1); |
|
322 |
+ setEquipmentDelivery({...equipmentDelivery}); |
|
323 |
+ } else { |
|
324 |
+ return; |
|
325 |
+ } |
|
326 |
+ } |
|
327 |
+ //장비 납품 선택 전체 |
|
328 |
+ const equipmentDeliveryAddAll = (isChecked) => { |
|
329 |
+ if (isChecked) { |
|
330 |
+ equipmentDelivery.equipmentDeliveryDetailList = [...stockEquipment.equipmentList]; |
|
331 |
+ setEquipmentDelivery({...equipmentDelivery}); |
|
332 |
+ } else { |
|
333 |
+ equipmentDelivery.equipmentDeliveryDetailList = []; |
|
334 |
+ setEquipmentDelivery({...equipmentDelivery}); |
|
335 |
+ } |
|
336 |
+ } |
|
220 | 337 |
|
221 | 338 |
//장비 납품 |
222 |
- const modalDelivery = (governmentId) => { |
|
223 |
- equipment['government_id'] = governmentId; |
|
224 |
- setEquipment({...equipment}); |
|
225 |
- equipmentUpdate(() => { |
|
226 |
- alert("납품완료"); |
|
227 |
- modalDeliveryClose(); |
|
339 |
+ const equipmentDeliveryInsert = (governmentId) => { |
|
340 |
+ if (CommonUtil.isEmpty(equipmentDelivery['delivery_date'])) { |
|
341 |
+ alert("납품일자를 선택해 주세요."); |
|
342 |
+ return; |
|
343 |
+ } |
|
344 |
+ if (CommonUtil.isEmpty(equipmentDelivery.equipmentDeliveryDetailList)) { |
|
345 |
+ alert("납품할 장비가 선택되지 않았습니다."); |
|
346 |
+ return; |
|
347 |
+ } |
|
348 |
+ |
|
349 |
+ equipmentDelivery['government_id'] = governmentId; |
|
350 |
+ setEquipmentDelivery({...equipmentDelivery}); |
|
351 |
+ |
|
352 |
+ fetch("/equipment/equipmentDeliveryInsert.json", { |
|
353 |
+ method: "POST", |
|
354 |
+ headers: { |
|
355 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
356 |
+ }, |
|
357 |
+ body: JSON.stringify(equipmentDelivery), |
|
358 |
+ }).then((response) => response.json()).then((data) => { |
|
359 |
+ console.log("장비 납품 결과(건수) : ", data); |
|
360 |
+ if (data > 0) { |
|
361 |
+ modalDeliveryClose() |
|
362 |
+ alert("납품완료"); |
|
363 |
+ equipmentSearching(); |
|
364 |
+ setIsEquipmentDelivery(false); |
|
365 |
+ setTabIndex(1); |
|
366 |
+ } else { |
|
367 |
+ alert("장비납품에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
368 |
+ } |
|
369 |
+ }).catch((error) => { |
|
370 |
+ console.log('modalDelivery() /equipment/equipmentUpdate.json error : ', error); |
|
371 |
+ }); |
|
372 |
+ } |
|
373 |
+ //장비 납품 취소 |
|
374 |
+ const equipmentDeliveryDetailDeleteByDeliveryCancel = (equipment) => { |
|
375 |
+ if (confirm('해당 장비의 납품을 취소하시겠습니까?') == false) { |
|
376 |
+ return; |
|
377 |
+ } |
|
378 |
+ |
|
379 |
+ fetch("/equipment/equipmentDeliveryDetailDeleteByDeliveryCancel.json", { |
|
380 |
+ method: "POST", |
|
381 |
+ headers: { |
|
382 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
383 |
+ }, |
|
384 |
+ body: JSON.stringify(equipment), |
|
385 |
+ }).then((response) => response.json()).then((data) => { |
|
386 |
+ console.log("장비 납품 취소 결과(건수) : ", data); |
|
387 |
+ if (data > 0) { |
|
388 |
+ alert("삭제완료"); |
|
389 |
+ equipmentSearching(); |
|
390 |
+ modalEquipmentClose(); |
|
391 |
+ } else { |
|
392 |
+ alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
393 |
+ } |
|
394 |
+ }).catch((error) => { |
|
395 |
+ console.log('equipmentDelete() /equipment/equipmentDelete.json error : ', error); |
|
228 | 396 |
}); |
229 | 397 |
} |
230 | 398 |
|
... | ... | @@ -232,8 +400,6 @@ |
232 | 400 |
|
233 | 401 |
//공통 검색 정보 |
234 | 402 |
const [equipmentSearch, setEquipmentSearch] = React.useState({ |
235 |
- 'government_id': null, |
|
236 |
- 'senior_id': null, |
|
237 | 403 |
'equipment_state': null, |
238 | 404 |
|
239 | 405 |
'searchType': null, |
... | ... | @@ -247,7 +413,17 @@ |
247 | 413 |
} |
248 | 414 |
//장비 검색 |
249 | 415 |
const equipmentSearching = () => { |
416 |
+ for (const key in equipmentSearch) { |
|
417 |
+ stockEquipmentSearch[key] = equipmentSearch[key]; |
|
418 |
+ deliveryEquipmentSearch[key] = equipmentSearch[key]; |
|
419 |
+ } |
|
250 | 420 |
stockEquipmentSelectList(1); |
421 |
+ deliveryEquipmentSelectList(1); |
|
422 |
+ |
|
423 |
+ const newStockEquipmentSearch = {...stockEquipmentSearch}; |
|
424 |
+ setStockEquipmentSearch(newStockEquipmentSearch); |
|
425 |
+ const newDeliveryEquipmentSearch = {...deliveryEquipmentSearch}; |
|
426 |
+ setDeliveryEquipmentSearch(newDeliveryEquipmentSearch); |
|
251 | 427 |
} |
252 | 428 |
const equipmentSearchingEnter = (key) => { |
253 | 429 |
if (key == 'Enter') { |
... | ... | @@ -257,20 +433,18 @@ |
257 | 433 |
} |
258 | 434 |
} |
259 | 435 |
|
260 |
- //재고 검색 정보 |
|
436 |
+ //재고 장비 검색 정보 |
|
261 | 437 |
const [stockEquipmentSearch, setStockEquipmentSearch] = React.useState({ |
262 | 438 |
'currentPage': 1, |
263 | 439 |
'perPage': 10, |
264 | 440 |
}); |
265 | 441 |
//재고 장비 목록 |
266 |
- const [stockEquipmentList, setStockEquipmentList] = React.useState({equipmentList: [], equipmentListCount: 0}); |
|
442 |
+ const [stockEquipment, setStockEquipment] = React.useState({equipmentList: [], equipmentListCount: 0}); |
|
267 | 443 |
//재고 장비 목록 조회 |
268 | 444 |
const stockEquipmentSelectList = (currentPage) => { |
445 |
+ stockEquipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; |
|
446 |
+ stockEquipmentSearch['government_id'] = null; |
|
269 | 447 |
const newStockEquipmentSearch = {...stockEquipmentSearch}; |
270 |
- for (const key in equipmentSearch) { |
|
271 |
- newStockEquipmentSearch[key] = equipmentSearch[key]; |
|
272 |
- } |
|
273 |
- newStockEquipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; |
|
274 | 448 |
setStockEquipmentSearch(newStockEquipmentSearch); |
275 | 449 |
|
276 | 450 |
fetch("/equipment/equipmentSelectList.json", { |
... | ... | @@ -281,25 +455,244 @@ |
281 | 455 |
body: JSON.stringify(newStockEquipmentSearch) |
282 | 456 |
}).then((response) => response.json()).then((data) => { |
283 | 457 |
console.log('stockEquipmentSelectList response : ', data); |
284 |
- setStockEquipmentList(data); |
|
458 |
+ setStockEquipment(data); |
|
285 | 459 |
}).catch((error) => { |
286 | 460 |
console.log('stockEquipmentSelectList error : ', error); |
287 | 461 |
}); |
288 | 462 |
} |
289 | 463 |
|
464 |
+ //납품 장비 검색 정보 |
|
465 |
+ const [deliveryEquipmentSearch, setDeliveryEquipmentSearch] = React.useState({ |
|
466 |
+ 'currentPage': 1, |
|
467 |
+ 'perPage': 10, |
|
468 |
+ }); |
|
469 |
+ //납품 장비 목록 |
|
470 |
+ const [deliveryEquipment, setDeliveryEquipment] = React.useState({equipmentList: [], equipmentListCount: 0}); |
|
471 |
+ //납품 장비 목록 조회 |
|
472 |
+ const deliveryEquipmentSelectList = (currentPage) => { |
|
473 |
+ deliveryEquipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage; |
|
474 |
+ deliveryEquipmentSearch['government_id'] = CommonUtil.isEmpty(org['government_id']) ? '' : org['government_id']; |
|
475 |
+ deliveryEquipmentSearch['government_id'] = CommonUtil.isEmpty(org['government_id']) ? '' : org['government_id']; |
|
476 |
+ const newDeliveryEquipmentSearch = {...deliveryEquipmentSearch}; |
|
477 |
+ setDeliveryEquipmentSearch(newDeliveryEquipmentSearch); |
|
478 |
+ |
|
479 |
+ fetch("/equipment/equipmentSelectList.json", { |
|
480 |
+ method: "POST", |
|
481 |
+ headers: { |
|
482 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
483 |
+ }, |
|
484 |
+ body: JSON.stringify(newDeliveryEquipmentSearch) |
|
485 |
+ }).then((response) => response.json()).then((data) => { |
|
486 |
+ console.log('deliveryEquipmentSelectList response : ', data); |
|
487 |
+ setDeliveryEquipment(data); |
|
488 |
+ }).catch((error) => { |
|
489 |
+ console.log('deliveryEquipmentSelectList error : ', error); |
|
490 |
+ }); |
|
491 |
+ } |
|
492 |
+ |
|
493 |
+ //현재 탭 Index |
|
494 |
+ const [tabIndex, setTabIndex] = React.useState(0); |
|
495 |
+ //탭 초기화 |
|
496 |
+ const tab = [{ |
|
497 |
+ title: `재고 장비 (${stockEquipment.equipmentListCount})`, |
|
498 |
+ content: ( |
|
499 |
+ <div> |
|
500 |
+ <div className="flex equip-tab"> |
|
501 |
+ <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> |
|
502 |
+ <div className="btn-wrap flex-end margin-bottom "> |
|
503 |
+ {isEquipmentDelivery |
|
504 |
+ ? <> |
|
505 |
+ <button className={"btn-small green-btn"} onClick={modalDeliveryOpen}>장비납품</button> |
|
506 |
+ <button className={"btn-small red-btn"} onClick={() => {setIsEquipmentDelivery(false)}}>납품취소</button> |
|
507 |
+ </> |
|
508 |
+ : <> |
|
509 |
+ <button className={"btn-small gray-btn"} onClick={() => {setIsEquipmentDelivery(true)}}>납품장비선택</button> |
|
510 |
+ <button className={"btn-small gray-btn"} onClick={() => {modalEquipmentOpen()}}>등록</button> |
|
511 |
+ </> |
|
512 |
+ } |
|
513 |
+ </div> |
|
514 |
+ </div> |
|
515 |
+ <table class="caregiver-user protector-user"> |
|
516 |
+ <thead> |
|
517 |
+ <tr> |
|
518 |
+ {isEquipmentDelivery == true ? |
|
519 |
+ <th> |
|
520 |
+ <input type="checkbox" |
|
521 |
+ onClick={(e) => equipmentDeliveryAddAll(e.target.checked)} |
|
522 |
+ checked={equipmentDelivery.equipmentDeliveryDetailList.length == stockEquipment.equipmentList.length} |
|
523 |
+ /> |
|
524 |
+ </th> |
|
525 |
+ : null} |
|
526 |
+ <th>No</th> |
|
527 |
+ <th>모델명</th> |
|
528 |
+ <th>시리얼넘버</th> |
|
529 |
+ <th>생산일자</th> |
|
530 |
+ <th>입고일자</th> |
|
531 |
+ <th>상태</th> |
|
532 |
+ {isEquipmentDelivery == false ? <th>관리</th> : null} |
|
533 |
+ </tr> |
|
534 |
+ </thead> |
|
535 |
+ <tbody> |
|
536 |
+ {stockEquipment.equipmentList.map((item, idx) => { return ( |
|
537 |
+ <tr> |
|
538 |
+ {isEquipmentDelivery == true |
|
539 |
+ ? <td> |
|
540 |
+ <input type="checkbox" |
|
541 |
+ onClick={(e) => equipmentDeliveryAdd(item, e.target.checked)} |
|
542 |
+ checked={equipmentDelivery.equipmentDeliveryDetailList.findIndex(searchItem => searchItem['equipment_serial_number'] == item['equipment_serial_number']) > -1} |
|
543 |
+ /> |
|
544 |
+ </td> |
|
545 |
+ : null} |
|
546 |
+ <td data-label="No">{stockEquipment.equipmentListCount - idx - (stockEquipmentSearch.currentPage - 1) * stockEquipmentSearch.perPage}</td> |
|
547 |
+ <td data-label="모델명">{item['equipment_name']}</td> |
|
548 |
+ <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> |
|
549 |
+ <td data-label="생산일자">{item['equipment_product_date']}</td> |
|
550 |
+ <td data-label="입고일자">{item['equipment_stock_date']}</td> |
|
551 |
+ <td data-label="상태">{equipmentStates[item['equipment_state']]}</td> |
|
552 |
+ {isEquipmentDelivery == false ? |
|
553 |
+ <td data-label="관리"> |
|
554 |
+ <button className={"btn-small gray-btn"} onClick={() => modalEquipmentOpen(item)}>정보 수정</button> |
|
555 |
+ </td> |
|
556 |
+ : null} |
|
557 |
+ |
|
558 |
+ </tr> |
|
559 |
+ )})} |
|
560 |
+ {CommonUtil.isEmpty(stockEquipment.equipmentList) ? |
|
561 |
+ <tr> |
|
562 |
+ <td colSpan={8}>조회된 데이터가 없습니다</td> |
|
563 |
+ </tr> |
|
564 |
+ : null} |
|
565 |
+ |
|
566 |
+ </tbody> |
|
567 |
+ </table> |
|
568 |
+ <Pagination |
|
569 |
+ currentPage={stockEquipmentSearch.currentPage} |
|
570 |
+ perPage={stockEquipmentSearch.perPage} |
|
571 |
+ totalCount={stockEquipment.equipmentListCount} |
|
572 |
+ maxRange={5} |
|
573 |
+ click={stockEquipmentSelectList} |
|
574 |
+ /> |
|
575 |
+ </div> |
|
576 |
+ ) |
|
577 |
+ }, { |
|
578 |
+ title: `납품 장비 (${deliveryEquipment.equipmentListCount})`, |
|
579 |
+ content: ( |
|
580 |
+ <div> |
|
581 |
+ |
|
582 |
+ <div className="flex-align-start userauthoriylist gap5"> |
|
583 |
+ <div className="left"> |
|
584 |
+ <SubTitle explanation={"기관 리스트"}/> |
|
585 |
+ <div style={{fontSize: '16px', marginTop: '0px'}} className="category"> |
|
586 |
+ {state.loginUser['authority'] == 'ROLE_ADMIN' ? |
|
587 |
+ <a onClick={adminChange} |
|
588 |
+ className={org['government_id'] == null && org['agency_id'] == null ? "active" : ""}> |
|
589 |
+ 올잇메디 |
|
590 |
+ </a> |
|
591 |
+ : null} |
|
592 |
+ <ul style={{marginLeft: '15px'}}> |
|
593 |
+ {orgListOfHierarchy.map((item, idx) => { return ( |
|
594 |
+ <li style={{margin: '10px 0px'}} key={idx}> |
|
595 |
+ <span style={{marginRight: '5px'}}><img src={House} alt="" /></span> |
|
596 |
+ <a onClick={() => {governmentChange(item['government_id'])}} |
|
597 |
+ className={item['government_id'] == org['government_id'] ? "active" : ""}> |
|
598 |
+ {item['government_name']} |
|
599 |
+ </a> |
|
600 |
+ {item['agencyList'] != undefined && item['agencyList'] != null ? |
|
601 |
+ <ul style={{marginLeft: '15px'}}> |
|
602 |
+ {item['agencyList'].map((item2, idx2) => { return ( |
|
603 |
+ <li style={{margin: '10px 0px'}} key={idx2}> |
|
604 |
+ <span style={{marginRight: '5px'}}><img src={Arrow} alt="" /></span> |
|
605 |
+ <a onClick={() => {agencyChange(item['government_id'], item2['agency_id'])}} |
|
606 |
+ className={item2['agency_id'] == org['agency_id'] ? "active" : ""}> |
|
607 |
+ {item2['agency_name']} |
|
608 |
+ </a> |
|
609 |
+ </li> |
|
610 |
+ )})} |
|
611 |
+ </ul> |
|
612 |
+ : null |
|
613 |
+ } |
|
614 |
+ </li> |
|
615 |
+ )})} |
|
616 |
+ </ul> |
|
617 |
+ </div> |
|
618 |
+ </div> |
|
619 |
+ <div className="right"> |
|
620 |
+ <div className="flex equip-tab"> |
|
621 |
+ <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> |
|
622 |
+ <div className="btn-wrap flex-end margin-bottom "> |
|
623 |
+ {/* <button className={"btn-small gray-btn"} onClick={() => {modalEquipmentOpen()}}>등록</button> */} |
|
624 |
+ </div> |
|
625 |
+ </div> |
|
626 |
+ <table class="caregiver-user protector-user"> |
|
627 |
+ <thead> |
|
628 |
+ <tr> |
|
629 |
+ <th>No </th> |
|
630 |
+ <th>납품기관</th> |
|
631 |
+ <th>모델명</th> |
|
632 |
+ <th>시리얼넘버</th> |
|
633 |
+ <th>생산일자</th> |
|
634 |
+ <th>입고일자</th> |
|
635 |
+ <th>장비상태</th> |
|
636 |
+ <th>대여상태</th> |
|
637 |
+ <th>납품취소</th> |
|
638 |
+ <th>관리</th> |
|
639 |
+ </tr> |
|
640 |
+ </thead> |
|
641 |
+ <tbody> |
|
642 |
+ {deliveryEquipment.equipmentList.map((item, idx) => { return ( |
|
643 |
+ <tr> |
|
644 |
+ <td data-label="No">{deliveryEquipment.equipmentListCount - idx - (deliveryEquipmentSearch.currentPage - 1) * deliveryEquipmentSearch.perPage}</td> |
|
645 |
+ <td data-label="납품기관">{item['government_name']}</td> |
|
646 |
+ <td data-label="모델명">{item['equipment_name']}</td> |
|
647 |
+ <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> |
|
648 |
+ <td data-label="생산일자">{item['equipment_product_date']}</td> |
|
649 |
+ <td data-label="입고일자">{item['equipment_stock_date']}</td> |
|
650 |
+ <td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td> |
|
651 |
+ <td data-label="대여상태"> |
|
652 |
+ {CommonUtil.isEmpty(item['senior_id']) |
|
653 |
+ ? <span className={"red"}>미대여</span> |
|
654 |
+ : <span className={"green"}>대여중</span> |
|
655 |
+ } |
|
656 |
+ </td> |
|
657 |
+ <td data-label="납품취소"> |
|
658 |
+ <button className={"btn-small red-btn"} onClick={() => equipmentDeliveryDetailDeleteByDeliveryCancel(item)}>납품 취소</button> |
|
659 |
+ </td> |
|
660 |
+ <td data-label="관리"> |
|
661 |
+ <button className={"btn-small gray-btn"} onClick={() => modalEquipmentOpen(item)}>정보 수정</button> |
|
662 |
+ </td> |
|
663 |
+ </tr> |
|
664 |
+ )})} |
|
665 |
+ {CommonUtil.isEmpty(deliveryEquipment.equipmentList) ? |
|
666 |
+ <tr> |
|
667 |
+ <td colSpan={9}>조회된 데이터가 없습니다</td> |
|
668 |
+ </tr> |
|
669 |
+ : null} |
|
670 |
+ </tbody> |
|
671 |
+ </table> |
|
672 |
+ <Pagination |
|
673 |
+ currentPage={deliveryEquipmentSearch.currentPage} |
|
674 |
+ perPage={deliveryEquipmentSearch.perPage} |
|
675 |
+ totalCount={deliveryEquipment.equipmentListCount} |
|
676 |
+ maxRange={5} |
|
677 |
+ click={deliveryEquipmentSelectList} |
|
678 |
+ /> |
|
679 |
+ </div> |
|
680 |
+ </div> |
|
681 |
+ </div> |
|
682 |
+ ) |
|
683 |
+ }]; |
|
684 |
+ |
|
290 | 685 |
|
291 | 686 |
//Mounted |
292 | 687 |
React.useEffect(() => { |
293 |
- console.log('equipment : ', equipment); |
|
294 | 688 |
orgSelectListOfHierarchy(); |
295 | 689 |
equipmentStatesSelect(); |
296 | 690 |
equipmentSearching(); |
297 | 691 |
}, []); |
298 | 692 |
|
299 | 693 |
|
300 |
- //시작 탭 설정 |
|
301 |
- const [index, setIndex] = React.useState(1); |
|
302 |
- |
|
694 |
+ |
|
695 |
+ |
|
303 | 696 |
return ( |
304 | 697 |
<main> |
305 | 698 |
|
... | ... | @@ -330,10 +723,22 @@ |
330 | 723 |
<tr> |
331 | 724 |
<th><span style={{color : "red"}}>*</span>시리얼넘버</th> |
332 | 725 |
<td> |
333 |
- <input type="text" placeholder="S/N를 입력해 주세요" |
|
334 |
- value={equipment['equipment_serial_number']} |
|
335 |
- ref={el => equipmentRef.current['equipment_serial_number'] = el} |
|
336 |
- onChange={(e) => equipmentValueChange('equipment_serial_number', e.target.value)}/> |
|
726 |
+ |
|
727 |
+ {CommonUtil.isEmpty(equipment['equipment_insert_datetime']) |
|
728 |
+ ? <> |
|
729 |
+ <input type="text" placeholder="S/N를 입력해 주세요" |
|
730 |
+ style={{width: 'calc(100% - 110px)'}} |
|
731 |
+ value={equipment['equipment_serial_number']} |
|
732 |
+ ref={el => equipmentRef.current['equipment_serial_number'] = el} |
|
733 |
+ onChange={(e) => {equipmentValueChange('equipment_serial_number', e.target.value); setIsSerialNumberCheck(false);}} |
|
734 |
+ /> |
|
735 |
+ <button className={"btn-small red-btn"} style={{width:'110px'}} onClick={serialNumberCheck}>중복확인</button> |
|
736 |
+ </> |
|
737 |
+ : <input type="text" |
|
738 |
+ value={equipment['equipment_serial_number']} |
|
739 |
+ disabled={true} |
|
740 |
+ /> |
|
741 |
+ } |
|
337 | 742 |
</td> |
338 | 743 |
</tr> |
339 | 744 |
<tr> |
... | ... | @@ -354,18 +759,36 @@ |
354 | 759 |
onChange={(e) => equipmentValueChange('equipment_stock_date', e.target.value)}/> |
355 | 760 |
</td> |
356 | 761 |
</tr> |
762 |
+ {CommonUtil.isEmpty(equipment['equipment_insert_datetime']) == false |
|
763 |
+ ? <tr> |
|
764 |
+ <th><span style={{color : "red"}}>*</span>장비상태</th> |
|
765 |
+ <td> |
|
766 |
+ <div className="gender flex-start gap2"> |
|
767 |
+ {Object.keys(equipmentStates).map((key, idx) => { return ( |
|
768 |
+ <div className="flex-start"> |
|
769 |
+ <input type="radio" name="equipment_state" id={key} key={key} value={key} |
|
770 |
+ style={{width: '25px'}} |
|
771 |
+ checked={equipment['equipment_state'] == key} |
|
772 |
+ onChange={(e) => {e.target.checked ? equipmentValueChange('equipment_state', e.target.value) : null}} |
|
773 |
+ /> |
|
774 |
+ <label for={key}>{equipmentStates[key]}</label> |
|
775 |
+ </div> |
|
776 |
+ )})} |
|
777 |
+ </div> |
|
778 |
+ </td> |
|
779 |
+ </tr> |
|
780 |
+ : null} |
|
357 | 781 |
</tbody> |
358 | 782 |
</table> |
359 | 783 |
</div> |
360 | 784 |
<div className="flex-center"> |
361 |
- {CommonUtil.isEmpty(equipment.equipment_insert_datetime) |
|
785 |
+ {CommonUtil.isEmpty(equipment['equipment_insert_datetime']) |
|
362 | 786 |
? <button className={"btn-small gray-btn"} onClick={equipmentInsert}>등록</button> |
363 |
- : <button className={"btn-small gray-btn"} |
|
364 |
- onClick={() => equipmentUpdate(() => { |
|
365 |
- alert("수정완료"); |
|
366 |
- equipmentSearching(); |
|
367 |
- modalEquipmentClose(); |
|
368 |
- })}>수정</button> |
|
787 |
+ : <> |
|
788 |
+ <button className={"btn-small gray-btn"} |
|
789 |
+ onClick={equipmentUpdate}>수정</button> |
|
790 |
+ <button className={"btn-small red-btn"} onClick={equipmentDelete}>삭제</button> |
|
791 |
+ </> |
|
369 | 792 |
} |
370 | 793 |
</div> |
371 | 794 |
</div> |
... | ... | @@ -375,7 +798,15 @@ |
375 | 798 |
<div className="board-wrap"> |
376 | 799 |
<div> |
377 | 800 |
<div style={{textAlign:'left', fontSize: '16px',margin:'2rem 0'}} className="category"> |
378 |
- <a>올잇메디</a> |
|
801 |
+ <div className="search-management flex-end margin-bottom2 margin-top"> |
|
802 |
+ <div style={{width: '90px', fontWeight: '600'}}>납품일자</div> |
|
803 |
+ <input type="date" |
|
804 |
+ value={equipmentDelivery['delivery_date']} |
|
805 |
+ onChange={(e) => { |
|
806 |
+ equipmentDelivery['delivery_date'] = e.target.value; |
|
807 |
+ setEquipmentDelivery({...equipmentDelivery})} |
|
808 |
+ }/> |
|
809 |
+ </div> |
|
379 | 810 |
<ul style={{marginLeft: '15px'}}> |
380 | 811 |
{orgListOfHierarchy.map((item, idx) => { return ( |
381 | 812 |
<li style={{margin: '10px 0px'}} key={idx}> |
... | ... | @@ -383,7 +814,7 @@ |
383 | 814 |
<a>{item['government_name']}</a> |
384 | 815 |
<button onClick={() => { |
385 | 816 |
if (confirm(`'${item['government_name']}'에 장비를 납품하시겠습니까?`)) { |
386 |
- modalDelivery(item['government_id']) |
|
817 |
+ equipmentDeliveryInsert(item['government_id']) |
|
387 | 818 |
} else { |
388 | 819 |
return; |
389 | 820 |
} |
... | ... | @@ -397,76 +828,43 @@ |
397 | 828 |
</Modal> |
398 | 829 |
|
399 | 830 |
|
831 |
+ <div className="search-management flex-end margin-bottom2 margin-top gap"> |
|
832 |
+ <select style={{maxWidth: '150px'}} |
|
833 |
+ onChange={(e) => equipmentSearchChange('equipment_state', e.target.value)}> |
|
834 |
+ <option value="">상태</option> |
|
835 |
+ {Object.keys(equipmentStates).map((key, idx) => { return ( |
|
836 |
+ <option key={key} value={key}> |
|
837 |
+ {equipmentStates[key]} |
|
838 |
+ </option> |
|
839 |
+ )})} |
|
840 |
+ </select> |
|
841 |
+ <select style={{maxWidth: '150px'}} |
|
842 |
+ onChange={(e) => equipmentSearchChange('searchType', e.target.value)}> |
|
843 |
+ <option value="">전체</option> |
|
844 |
+ <option value="equipment_name">모델명</option> |
|
845 |
+ <option value="equipment_serial_number">시리얼넘버</option> |
|
846 |
+ </select> |
|
847 |
+ <input type="text" |
|
848 |
+ value={equipmentSearch.searchText} |
|
849 |
+ onChange={(e) => equipmentSearchChange('searchText', e.target.value)} |
|
850 |
+ onKeyUp={(e) => equipmentSearchingEnter(e.key)} |
|
851 |
+ /> |
|
852 |
+ <button className={"btn-small gray-btn"} style={{maxWidth: '150px'}} onClick={equipmentSearching}>검색</button> |
|
853 |
+ </div> |
|
854 |
+ |
|
400 | 855 |
<div className="tab-container"> |
401 | 856 |
<ul className="tab-menu flex-start"> |
402 |
- <li>재고 장비</li> |
|
403 |
- <li>납품 장비</li> |
|
857 |
+ {tab.map((item, idx) => { return ( |
|
858 |
+ <li onClick={() => setTabIndex(idx)} className={idx == tabIndex ? 'active' : null}> |
|
859 |
+ {item.title} |
|
860 |
+ </li> |
|
861 |
+ )})} |
|
404 | 862 |
</ul> |
405 | 863 |
<div className="content-wrap"> |
406 |
- <div className="search-management flex-end margin-bottom2 margin-top gap"> |
|
407 |
- <select style={{maxWidth: 'fit-content'}} |
|
408 |
- onChange={(e) => equipmentSearchChange('searchType', e.target.value)}> |
|
409 |
- <option value="equipment_name">모델명</option> |
|
410 |
- <option value="equipment_serial_number">시리얼넘버</option> |
|
411 |
- </select> |
|
412 |
- <input type="text" |
|
413 |
- value={equipmentSearch.searchText} |
|
414 |
- onChange={(e) => equipmentSearchChange('searchText', e.target.value)} |
|
415 |
- onKeyUp={(e) => equipmentSearchingEnter(e.key)} |
|
416 |
- /> |
|
417 |
- <button className={"btn-small gray-btn"} onClick={equipmentSearching}>검색</button> |
|
418 |
- </div> |
|
419 |
- |
|
420 | 864 |
<ul className="tab-content"> |
421 | 865 |
<li> |
422 |
- <div> |
|
423 |
- <div className="flex equip-tab"> |
|
424 |
- <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> |
|
425 |
- <div className="btn-wrap flex-end margin-bottom "> |
|
426 |
- <button className={"btn-small gray-btn"} onClick={() => {modalEquipmentOpen()}}>등록</button> |
|
427 |
- </div> |
|
428 |
- </div> |
|
429 |
- <table class="caregiver-user protector-user"> |
|
430 |
- <thead> |
|
431 |
- <tr> |
|
432 |
- <th>No</th> |
|
433 |
- <th>모델명</th> |
|
434 |
- <th>시리얼넘버</th> |
|
435 |
- <th>생산일자</th> |
|
436 |
- <th>입고일자</th> |
|
437 |
- <th>상태</th> |
|
438 |
- <th>납품</th> |
|
439 |
- <th>관리</th> |
|
440 |
- </tr> |
|
441 |
- </thead> |
|
442 |
- <tbody> |
|
443 |
- {stockEquipmentList.equipmentList.map((item, idx) => { return ( |
|
444 |
- <tr> |
|
445 |
- <td data-label="No">{stockEquipmentList.equipmentListCount - idx - (stockEquipmentSearch.currentPage - 1) * stockEquipmentSearch.perPage}</td> |
|
446 |
- <td data-label="모델명">{item['equipment_name']}</td> |
|
447 |
- <td data-label="시리얼넘버">{item['equipment_serial_number']}</td> |
|
448 |
- <td data-label="생산일자">{item['equipment_product_date']}</td> |
|
449 |
- <td data-label="입고일자">{item['equipment_stock_date']}</td> |
|
450 |
- <td data-label="상태">{equipmentStates[item['equipment_state']]}</td> |
|
451 |
- <td data-label="납품"> |
|
452 |
- <button className={"btn-small gray-btn"} onClick={() => modalDeliveryOpen(item)}>장비 납품</button> |
|
453 |
- </td> |
|
454 |
- <td data-label="관리"> |
|
455 |
- <button className={"btn-small gray-btn"} onClick={() => modalEquipmentOpen(item)}>정보 수정</button> |
|
456 |
- </td> |
|
457 |
- </tr> |
|
458 |
- )})} |
|
459 |
- {CommonUtil.isEmpty(stockEquipmentList.equipmentList) ? |
|
460 |
- <tr> |
|
461 |
- <td colSpan={8}>조회된 데이터가 없습니다</td> |
|
462 |
- </tr> |
|
463 |
- : null} |
|
464 |
- |
|
465 |
- </tbody> |
|
466 |
- </table> |
|
467 |
- </div> |
|
866 |
+ {tab[tabIndex].content} |
|
468 | 867 |
</li> |
469 |
- |
|
470 | 868 |
</ul> |
471 | 869 |
</div> |
472 | 870 |
</div> |
--- client/views/pages/equipment/EquipmentManagementSelect_back_230403.jsx
+++ client/views/pages/equipment/EquipmentManagementSelect_back_230403.jsx
... | ... | @@ -969,27 +969,9 @@ |
969 | 969 |
'currentPage': 1, |
970 | 970 |
'perPage': 10, |
971 | 971 |
}); |
972 |
- //기관 계층 구조 목록 |
|
973 |
- const [orgListOfHierarchy, setOrgListOfHierarchy] = React.useState([]); |
|
974 |
- //기관(관리, 시행) 계층 구조 목록 조회 |
|
975 |
- const orgSelectListOfHierarchy = () => { |
|
976 |
- fetch("/org/orgSelectListOfHierarchy.json", { |
|
977 |
- method: "POST", |
|
978 |
- headers: { |
|
979 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
980 |
- }, |
|
981 |
- body: JSON.stringify({}), |
|
982 |
- }).then((response) => response.json()).then((data) => { |
|
983 |
- console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
|
984 |
- setOrgListOfHierarchy(data); |
|
985 |
- }).catch((error) => { |
|
986 |
- console.log('orgSelectListOfHierarchy() /org/orgSelectListOfHierarchy.json error : ', error); |
|
987 |
- }); |
|
988 |
- }; |
|
989 | 972 |
|
990 | 973 |
//Mounted |
991 | 974 |
React.useEffect(() => { |
992 |
- orgSelectListOfHierarchy(); |
|
993 | 975 |
// agentSelectList(); |
994 | 976 |
if (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') { |
995 | 977 |
} |
... | ... | @@ -1012,40 +994,7 @@ |
1012 | 994 |
{ |
1013 | 995 |
No: 1, |
1014 | 996 |
agency: ( |
1015 |
- <div> |
|
1016 |
- <div style={{textAlign:'left', fontSize: '16px',margin:'2rem 0'}} className="category"> |
|
1017 |
- {/* <a className={() => {return "active"}} onClick={adminChange}>올잇메디</a> */} |
|
1018 |
- <a onClick={adminChange} |
|
1019 |
- className={userSearch['government_id'] == null && userSearch['agency_id'] == null ? "active" : ""}> |
|
1020 |
- 올잇메디 |
|
1021 |
- </a> |
|
1022 |
- <ul style={{marginLeft: '15px'}}> |
|
1023 |
- {orgListOfHierarchy.map((item, idx) => { return ( |
|
1024 |
- <li style={{margin: '10px 0px'}} key={idx}> |
|
1025 |
- <span style={{marginRight: '5px'}}><img src={House} alt="" /></span> |
|
1026 |
- <a onClick={() => {governmentChange(item['government_id'])}} |
|
1027 |
- className={item['government_id'] == userSearch['government_id'] ? "active" : ""}> |
|
1028 |
- {item['government_name']} |
|
1029 |
- </a> |
|
1030 |
- {item['agencyList'] != undefined && item['agencyList'] != null ? |
|
1031 |
- <ul style={{marginLeft: '15px'}}> |
|
1032 |
- {item['agencyList'].map((item2, idx2) => { return ( |
|
1033 |
- <li style={{margin: '10px 0px'}} key={idx2}> |
|
1034 |
- <span style={{marginRight: '5px'}}><img src={Arrow} alt="" /></span> |
|
1035 |
- <a onClick={() => {agencyChange(item['government_id'], item2['agency_id'])}} |
|
1036 |
- className={item2['agency_id'] == userSearch['agency_id'] ? "active" : ""}> |
|
1037 |
- {item2['agency_name']} |
|
1038 |
- </a> |
|
1039 |
- </li> |
|
1040 |
- )})} |
|
1041 |
- </ul> |
|
1042 |
- : null |
|
1043 |
- } |
|
1044 |
- </li> |
|
1045 |
- )})} |
|
1046 |
- </ul> |
|
1047 |
- </div> |
|
1048 |
- </div> |
|
997 |
+ |
|
1049 | 998 |
) |
1050 | 999 |
, |
1051 | 1000 |
choice: (<Button |
--- client/views/pages/join/Join.jsx
+++ client/views/pages/join/Join.jsx
... | ... | @@ -8,15 +8,19 @@ |
8 | 8 |
export default function Join() { |
9 | 9 |
const navigate = useNavigate(); |
10 | 10 |
const location = useLocation(); |
11 |
- const defaultAuthority = CommonUtil.isEmpty(location.state) ? null : location.state['authority']; |
|
12 |
- const defaultAgencyId = CommonUtil.isEmpty(location.state) ? null : location.state['agency_id']; |
|
13 |
- const defaultGovernmentId = CommonUtil.isEmpty(location.state) ? null :location.state['government_id']; |
|
11 |
+ let defaultAuthority = CommonUtil.isEmpty(location.state) ? null : location.state['authority']; |
|
12 |
+ let defaultAgencyId = CommonUtil.isEmpty(location.state) ? null : location.state['agency_id']; |
|
13 |
+ let defaultGovernmentId = CommonUtil.isEmpty(location.state) ? null :location.state['government_id']; |
|
14 | 14 |
|
15 | 15 |
|
16 | 16 |
|
17 | 17 |
/**** 기본 조회 데이터 (시작) ****/ |
18 | 18 |
//전역 변수 저장 객체 |
19 | 19 |
const state = useSelector((state) => {return state}); |
20 |
+ defaultAuthority = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['authority']; |
|
21 |
+ defaultAgencyId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id']; |
|
22 |
+ defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null :state.loginUser['government_id']; |
|
23 |
+ |
|
20 | 24 |
|
21 | 25 |
//권한 타입 종류 |
22 | 26 |
const [authorities, setAuthorities] = React.useState([]); |
... | ... | @@ -44,7 +48,7 @@ |
44 | 48 |
headers: { |
45 | 49 |
'Content-Type': 'application/json; charset=UTF-8' |
46 | 50 |
}, |
47 |
- body: JSON.stringify({}), |
|
51 |
+ body: JSON.stringify({'government_id': defaultGovernmentId}), |
|
48 | 52 |
}).then((response) => response.json()).then((data) => { |
49 | 53 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
50 | 54 |
setOrgListOfHierarchy(data); |
... | ... | @@ -272,8 +276,12 @@ |
272 | 276 |
<div className="flex-start margin-bottom2"> |
273 | 277 |
<label className="flex25"><span style={{color : "red"}}>*</span>사용자구분</label> |
274 | 278 |
<select name="division" id="section" onChange={(e) => {userAuthorityChange(e.target.value)}}> |
275 |
- <option value="ROLE_ADMIN" selected={user['authority'] == "ROLE_ADMIN"}>시스템 관리자</option> |
|
276 |
- <option value="ROLE_GOVERNMENT" selected={user['authority'] == "ROLE_GOVERNMENT"}>기관 관리자</option> |
|
279 |
+ {CommonUtil.isEmpty(defaultAuthority) == true || defaultAuthority == 'ROLE_ADMIN' ? |
|
280 |
+ <option value="ROLE_ADMIN" selected={user['authority'] == "ROLE_ADMIN"}>시스템 관리자</option> |
|
281 |
+ : null} |
|
282 |
+ {CommonUtil.isEmpty(defaultAuthority) == true || defaultAuthority == 'ROLE_ADMIN' || defaultAuthority == 'ROLE_GOVERNMENT' ? |
|
283 |
+ <option value="ROLE_GOVERNMENT" selected={user['authority'] == "ROLE_GOVERNMENT"}>기관 관리자</option> |
|
284 |
+ : null} |
|
277 | 285 |
<option value="ROLE_AGENCY" selected={user['authority'] == "ROLE_AGENCY"}>보호사</option> |
278 | 286 |
</select> |
279 | 287 |
</div> |
--- client/views/pages/main/Main_government.jsx
+++ client/views/pages/main/Main_government.jsx
... | ... | @@ -1,4 +1,6 @@ |
1 | 1 |
import React,{useState} from "react"; |
2 |
+import { useSelector } from "react-redux"; |
|
3 |
+ |
|
2 | 4 |
import Title from "../../component/Title.jsx"; |
3 | 5 |
import Map from "../../component/chart/Map.jsx"; |
4 | 6 |
import Chart5 from "../../component/chart/Chart5.jsx"; |
... | ... | @@ -12,7 +14,16 @@ |
12 | 14 |
import ElderlyIcon from '@mui/icons-material/Elderly'; |
13 | 15 |
|
14 | 16 |
export default function Main_government() { |
17 |
+ |
|
18 |
+ //전역 변수 저장 객체 |
|
19 |
+ const state = useSelector((state) => {return state}); |
|
20 |
+ |
|
15 | 21 |
const [cityName, setCityName] = useState("군위군"); |
22 |
+ |
|
23 |
+ React.useEffect(() => { |
|
24 |
+ setCityName(state.loginUser['government_name']); |
|
25 |
+ }, []); |
|
26 |
+ |
|
16 | 27 |
// const tableHead = ["방문날짜", "방문사유", "방문 상세 사유"]; |
17 | 28 |
// const Key = ["date", "reason", "detail_reason"]; |
18 | 29 |
// const content = [ |
... | ... | @@ -91,28 +102,28 @@ |
91 | 102 |
<li> |
92 | 103 |
<p><ElderlyIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background:"#bf0629", borderRadius:"50px" }}/></p> |
93 | 104 |
<p>{cityName} 전체 대상자</p> |
94 |
- <p>400</p> |
|
105 |
+ <p>30</p> |
|
95 | 106 |
</li> |
96 | 107 |
</ul> |
97 | 108 |
<ul className="content-box statistics-govern" background="#8ef3d1"> |
98 | 109 |
<li> |
99 | 110 |
<p><MedicationIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background:"#076143", borderRadius:"50px" }}/></p> |
100 | 111 |
<p>{cityName} 미복약 위험 대상자</p> |
101 |
- <p>400</p> |
|
112 |
+ <p>11</p> |
|
102 | 113 |
</li> |
103 | 114 |
</ul> |
104 | 115 |
<ul className="content-box statistics-govern" background="#ebe7b9" > |
105 | 116 |
<li> |
106 | 117 |
<p><DeviceThermostatIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background:"#f1de05", borderRadius:"50px" }}/></p> |
107 | 118 |
<p>{cityName} 댁내 온도 위험 대상자</p> |
108 |
- <p>400</p> |
|
119 |
+ <p>7</p> |
|
109 | 120 |
</li> |
110 | 121 |
</ul> |
111 | 122 |
<ul className="content-box statistics-govern" background="#5f9af3"> |
112 | 123 |
<li> |
113 | 124 |
<p><BatteryCharging20Icon sx={{ width: "50px", height: "50px", color: "#ffffff", background:"#5f9af3", borderRadius:"50px" }}/></p> |
114 | 125 |
<p>{cityName} 배터리 부족 대상자 </p> |
115 |
- <p>400</p> |
|
126 |
+ <p>13</p> |
|
116 | 127 |
</li> |
117 | 128 |
</ul> |
118 | 129 |
</div> |
+++ client/views/pages/org/OrgSelect.jsx
... | ... | @@ -0,0 +1,739 @@ |
1 | +import React from "react"; | |
2 | +import { useNavigate, useLocation } from "react-router"; | |
3 | +import { useSelector } from "react-redux"; | |
4 | + | |
5 | +import ContentTitle from "../../component/ContentTitle.jsx"; | |
6 | +import Modal from "../../component/Modal.jsx"; | |
7 | +import SubTitle from "../../component/SubTitle.jsx"; | |
8 | + | |
9 | +import Pagination from "../../component/Pagination.jsx"; | |
10 | + | |
11 | +import CommonUtil from "../../../resources/js/CommonUtil.js"; | |
12 | + | |
13 | +export default function OrgSelect() { | |
14 | + const navigate = useNavigate(); | |
15 | + const location = useLocation(); | |
16 | + | |
17 | + //전역 변수 저장 객체 | |
18 | + const state = useSelector((state) => {return state}); | |
19 | + | |
20 | + // 시스템 코드 - 기관 종류 | |
21 | + const [orgTypes, setOrgTypes] = React.useState({}); | |
22 | + // 시스템 코드 - 기관 종류 조회 | |
23 | + const orgTypesSelect = () => { | |
24 | + //fetch post | |
25 | + fetch("/common/systemCode/orgTypesSelect.json", { | |
26 | + method: "POST", | |
27 | + headers: { | |
28 | + 'Content-Type': 'application/json; charset=UTF-8' | |
29 | + }, | |
30 | + body: JSON.stringify({}) | |
31 | + }).then((response) => response.json()).then((data) => { | |
32 | + console.log('orgTypesSelect response : ', data); | |
33 | + setOrgTypes(data); | |
34 | + }).catch((error) => { | |
35 | + console.log('orgTypesSelect error : ', error); | |
36 | + }); | |
37 | + } | |
38 | + | |
39 | + | |
40 | + | |
41 | + //관리기관 모달 오픈 여부 | |
42 | + const [isGovermentModalOpen, setIsGovermentModalOpen] = React.useState(false); | |
43 | + //관리기관 모달 오픈 | |
44 | + const governmentModalOpen = () => { | |
45 | + setIsGovermentModalOpen(true); | |
46 | + }; | |
47 | + //관리기관 모달 닫기 | |
48 | + const governmentModalClose = () => { | |
49 | + setIsGovermentModalOpen(false); | |
50 | + }; | |
51 | + | |
52 | + //관리기관 초기화 정보 | |
53 | + const governmentInit = { | |
54 | + 'government_id': state.loginUser['government_id'], | |
55 | + 'government_type': 'WELFARE', | |
56 | + 'government_name': null, | |
57 | + 'government_address': null, | |
58 | + 'government_phonenumber': null, | |
59 | + 'government_insert_datetime': null, | |
60 | + 'government_insert_user_id': null, | |
61 | + 'government_update_datetime': null, | |
62 | + 'government_update_user_id': null, | |
63 | + } | |
64 | + //관리기관 데이터 | |
65 | + const [government, setGovernment] = React.useState({ | |
66 | + search: {currentPage: 1, perPage: 5, 'government_id': state.loginUser['government_id']}, | |
67 | + government: {...governmentInit}, | |
68 | + governmentList: [], | |
69 | + governmentListCount: 0, | |
70 | + }) | |
71 | + //관리기관 Ref | |
72 | + const governmentRef = React.useRef(governmentInit); | |
73 | + | |
74 | + //관리기관 정보 수정 | |
75 | + const governmentValueChange = (targetKey, value) => { | |
76 | + government.government[targetKey] = value; | |
77 | + setGovernment({...government}); | |
78 | + } | |
79 | + | |
80 | + //관리기관 유효성 검사 | |
81 | + const governmentValidation = () => { | |
82 | + const target = government.government; | |
83 | + const targetRef = governmentRef; | |
84 | + | |
85 | + if (CommonUtil.isEmpty(target['government_name']) == true) { | |
86 | + targetRef.current['government_name'].focus(); | |
87 | + alert("기관명을 입력해 주세요."); | |
88 | + return false; | |
89 | + } | |
90 | + if (CommonUtil.isEmpty(target['government_phonenumber']) == true) { | |
91 | + targetRef.current['government_phonenumber'].focus(); | |
92 | + alert("대표 연락처를 입력해 주세요."); | |
93 | + return false; | |
94 | + } | |
95 | + if (CommonUtil.isEmpty(target['government_address']) == true) { | |
96 | + targetRef.current['government_address'].focus(); | |
97 | + alert("주소를 입력해 주세요."); | |
98 | + return false; | |
99 | + } | |
100 | + | |
101 | + return true; | |
102 | + } | |
103 | + | |
104 | + | |
105 | + //관리기관 등록 | |
106 | + const governmentInsert = () => { | |
107 | + if (governmentValidation() == false) { | |
108 | + return; | |
109 | + } | |
110 | + | |
111 | + fetch("/org/governmentInsert.json", { | |
112 | + method: "POST", | |
113 | + headers: { | |
114 | + 'Content-Type': 'application/json; charset=UTF-8' | |
115 | + }, | |
116 | + body: JSON.stringify(government.government), | |
117 | + }).then((response) => response.json()).then((data) => { | |
118 | + console.log("관리기관 등록 결과 : ", data); | |
119 | + if (data > 0) { | |
120 | + alert("등록완료"); | |
121 | + governmentSelectList(); | |
122 | + governmentModalClose(); | |
123 | + } else { | |
124 | + alert("등록에 실패하였습니다. 관리자에게 문의바랍니다."); | |
125 | + } | |
126 | + }).catch((error) => { | |
127 | + console.log('governmentInsert() /org/governmentInsert.json error : ', error); | |
128 | + }); | |
129 | + } | |
130 | + | |
131 | + //관리기관 수정 | |
132 | + const governmentUpdate = () => { | |
133 | + if (governmentValidation() == false) { | |
134 | + return; | |
135 | + } | |
136 | + | |
137 | + fetch("/org/governmentUpdate.json", { | |
138 | + method: "POST", | |
139 | + headers: { | |
140 | + 'Content-Type': 'application/json; charset=UTF-8' | |
141 | + }, | |
142 | + body: JSON.stringify(government.government), | |
143 | + }).then((response) => response.json()).then((data) => { | |
144 | + console.log("관리기관 수정 결과 : ", data); | |
145 | + if (data > 0) { | |
146 | + alert("수정완료"); | |
147 | + governmentSelectList(); | |
148 | + governmentModalClose(); | |
149 | + } else { | |
150 | + alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); | |
151 | + } | |
152 | + }).catch((error) => { | |
153 | + console.log('governmentUpdate() /org/governmentUpdate.json error : ', error); | |
154 | + }); | |
155 | + } | |
156 | + | |
157 | + //관리기관 삭제 | |
158 | + const governmentDelete = (item) => { | |
159 | + if (item['government_user_count'] > 0 || item['agent_user_count'] > 0 | |
160 | + || item['guardian_user_count'] > 0 || item['senior_user_count'] > 0) { | |
161 | + alert('해당 기관에 사용자가 존재합니다. (삭제 불가능)'); | |
162 | + return; | |
163 | + } | |
164 | + if (item['equipment_count'] > 0) { | |
165 | + alert('해당 기관에 납품된 장비가 존재합니다. (삭제 불가능)'); | |
166 | + return; | |
167 | + } | |
168 | + if (item['agency_count'] > 0) { | |
169 | + alert('해당 기관의 하위기관이 존재합니다. (삭제 불가능)'); | |
170 | + return; | |
171 | + } | |
172 | + if (confirm("해당 기관을 삭제하시겠습니까?") == false) { | |
173 | + return; | |
174 | + } | |
175 | + | |
176 | + fetch("/org/governmentDelete.json", { | |
177 | + method: "POST", | |
178 | + headers: { | |
179 | + 'Content-Type': 'application/json; charset=UTF-8' | |
180 | + }, | |
181 | + body: JSON.stringify(item), | |
182 | + }).then((response) => response.json()).then((data) => { | |
183 | + console.log("관리기관 삭제 결과 : ", data); | |
184 | + if (data > 0) { | |
185 | + alert("삭제완료"); | |
186 | + governmentSelectList(); | |
187 | + governmentModalClose(); | |
188 | + } else { | |
189 | + alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); | |
190 | + } | |
191 | + }).catch((error) => { | |
192 | + console.log('governmentDelete() /org/governmentDelete.json error : ', error); | |
193 | + }); | |
194 | + } | |
195 | + | |
196 | + //관리기관 목록 조회 | |
197 | + const governmentSelectList = () => { | |
198 | + fetch("/org/governmentSelectList.json", { | |
199 | + method: "POST", | |
200 | + headers: { | |
201 | + 'Content-Type': 'application/json; charset=UTF-8' | |
202 | + }, | |
203 | + body: JSON.stringify(government.search), | |
204 | + }).then((response) => response.json()).then((data) => { | |
205 | + console.log("관리기관 목록 조회 결과 : ", data); | |
206 | + government.governmentList = data.governmentList; | |
207 | + government.governmentListCount = data.governmentListCount; | |
208 | + setGovernment({...government}); | |
209 | + }).catch((error) => { | |
210 | + console.log('governmentSelectList() /org/governmentSelectList.json error : ', error); | |
211 | + }); | |
212 | + } | |
213 | + | |
214 | + | |
215 | + | |
216 | + | |
217 | + | |
218 | + | |
219 | + //시행기관 모달 오픈 여부 | |
220 | + const [isAgencyModalOpen, setIsAgencyModalOpen] = React.useState(false); | |
221 | + //시행기관 모달 오픈 | |
222 | + const agencyModalOpen = () => { | |
223 | + setIsAgencyModalOpen(true); | |
224 | + }; | |
225 | + //시행기관 모달 닫기 | |
226 | + const agencyModalClose = () => { | |
227 | + setIsAgencyModalOpen(false); | |
228 | + }; | |
229 | + //시행기관 초기화 정보 | |
230 | + const agencyInit = { | |
231 | + 'government_id': state.loginUser['government_id'], | |
232 | + 'agency_id': state.loginUser['agency_id'], | |
233 | + 'agency_type': 'WELFARE', | |
234 | + 'agency_name': null, | |
235 | + 'agency_address': null, | |
236 | + 'agency_phonenumber': null, | |
237 | + 'agency_insert_datetime': null, | |
238 | + 'agency_insert_user_id': null, | |
239 | + 'agency_update_datetime': null, | |
240 | + 'agency_update_user_id': null | |
241 | + } | |
242 | + //시행기관 데이터 | |
243 | + const [agency, setAgency] = React.useState({ | |
244 | + search: {currentPage: 1, perPage: 5, 'government_id': state.loginUser['government_id'], 'agency_id': state.loginUser['agency_id']}, | |
245 | + agency: {...agencyInit}, | |
246 | + agencyList: [], | |
247 | + agencyListCount: 0, | |
248 | + }) | |
249 | + | |
250 | + //시행기관 Ref | |
251 | + const agencyRef = React.useRef(agencyInit); | |
252 | + | |
253 | + //시행기관 정보 수정 | |
254 | + const agencyValueChange = (targetKey, value) => { | |
255 | + agency.agency[targetKey] = value; | |
256 | + | |
257 | + //'시행기관 구분' 정보는 '관리기관의 구분'으로 자동 선택 | |
258 | + if (targetKey == 'government_id') { | |
259 | + const findGovernment = government.governmentList.find(item => item['government_id'] == value); | |
260 | + if (CommonUtil.isEmpty(findGovernment) == false) { | |
261 | + agency.agency['agency_type'] = findGovernment['government_type']; | |
262 | + } else { | |
263 | + agency.agency['agency_type'] = 'WELFARE'; | |
264 | + } | |
265 | + } | |
266 | + | |
267 | + setAgency({...agency}); | |
268 | + } | |
269 | + | |
270 | + //시행기관 유효성 검사 | |
271 | + const agencyValidation = () => { | |
272 | + const target = agency.agency; | |
273 | + const targetRef = agencyRef; | |
274 | + | |
275 | + if (CommonUtil.isEmpty(target['government_id']) == true) { | |
276 | + targetRef.current['government_id'].focus(); | |
277 | + alert("관리기관을 선택해 주세요."); | |
278 | + return false; | |
279 | + } | |
280 | + if (CommonUtil.isEmpty(target['agency_name']) == true) { | |
281 | + targetRef.current['agency_name'].focus(); | |
282 | + alert("기관명을 입력해 주세요."); | |
283 | + return false; | |
284 | + } | |
285 | + if (CommonUtil.isEmpty(target['agency_phonenumber']) == true) { | |
286 | + targetRef.current['agency_phonenumber'].focus(); | |
287 | + alert("대표 연락처를 입력해 주세요."); | |
288 | + return false; | |
289 | + } | |
290 | + if (CommonUtil.isEmpty(target['agency_address']) == true) { | |
291 | + targetRef.current['agency_address'].focus(); | |
292 | + alert("주소를 입력해 주세요."); | |
293 | + return false; | |
294 | + } | |
295 | + | |
296 | + return true; | |
297 | + } | |
298 | + | |
299 | + | |
300 | + //시행기관 등록 | |
301 | + const agencyInsert = () => { | |
302 | + if (agencyValidation() == false) { | |
303 | + return; | |
304 | + } | |
305 | + | |
306 | + fetch("/org/agencyInsert.json", { | |
307 | + method: "POST", | |
308 | + headers: { | |
309 | + 'Content-Type': 'application/json; charset=UTF-8' | |
310 | + }, | |
311 | + body: JSON.stringify(agency.agency), | |
312 | + }).then((response) => response.json()).then((data) => { | |
313 | + console.log("시행기관 등록 결과 : ", data); | |
314 | + if (data > 0) { | |
315 | + alert("등록완료"); | |
316 | + agencySelectList(); | |
317 | + agencyModalClose(); | |
318 | + } else { | |
319 | + alert("등록에 실패하였습니다. 관리자에게 문의바랍니다."); | |
320 | + } | |
321 | + }).catch((error) => { | |
322 | + console.log('agencyInsert() /org/agencyInsert.json error : ', error); | |
323 | + }); | |
324 | + } | |
325 | + | |
326 | + //시행기관 수정 | |
327 | + const agencyUpdate = () => { | |
328 | + if (agencyValidation() == false) { | |
329 | + return; | |
330 | + } | |
331 | + | |
332 | + fetch("/org/agencyUpdate.json", { | |
333 | + method: "POST", | |
334 | + headers: { | |
335 | + 'Content-Type': 'application/json; charset=UTF-8' | |
336 | + }, | |
337 | + body: JSON.stringify(agency.agency), | |
338 | + }).then((response) => response.json()).then((data) => { | |
339 | + console.log("시행기관 수정 결과 : ", data); | |
340 | + if (data > 0) { | |
341 | + alert("수정완료"); | |
342 | + agencySelectList(); | |
343 | + agencyModalClose(); | |
344 | + } else { | |
345 | + alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); | |
346 | + } | |
347 | + }).catch((error) => { | |
348 | + console.log('agencyUpdate() /org/agencyUpdate.json error : ', error); | |
349 | + }); | |
350 | + } | |
351 | + | |
352 | + //시행기관 삭제 | |
353 | + const agencyDelete = (item) => { | |
354 | + if (item['agent_user_count'] > 0 || item['guardian_user_count'] > 0 | |
355 | + || item['senior_user_count'] > 0) { | |
356 | + alert('해당 기관에 사용자가 존재합니다. (삭제 불가능)'); | |
357 | + return; | |
358 | + } | |
359 | + if (confirm("해당 기관을 삭제하시겠습니까?") == false) { | |
360 | + return; | |
361 | + } | |
362 | + | |
363 | + fetch("/org/agencyDelete.json", { | |
364 | + method: "POST", | |
365 | + headers: { | |
366 | + 'Content-Type': 'application/json; charset=UTF-8' | |
367 | + }, | |
368 | + body: JSON.stringify(item), | |
369 | + }).then((response) => response.json()).then((data) => { | |
370 | + console.log("시행기관 삭제 결과 : ", data); | |
371 | + if (data > 0) { | |
372 | + alert("삭제완료"); | |
373 | + agencySelectList(); | |
374 | + agencyModalClose(); | |
375 | + } else { | |
376 | + alert("삭제에 실패하였습니다. 관리자에게 문의바랍니다."); | |
377 | + } | |
378 | + }).catch((error) => { | |
379 | + console.log('agencyDelete() /org/agencyDelete.json error : ', error); | |
380 | + }); | |
381 | + } | |
382 | + | |
383 | + //시행기관 목록 조회 | |
384 | + const agencySelectList = () => { | |
385 | + console.log('government.government : ', government.government); | |
386 | + fetch("/org/agencySelectList.json", { | |
387 | + method: "POST", | |
388 | + headers: { | |
389 | + 'Content-Type': 'application/json; charset=UTF-8' | |
390 | + }, | |
391 | + body: JSON.stringify(agency.search), | |
392 | + }).then((response) => response.json()).then((data) => { | |
393 | + console.log("시행기관 목록 조회 결과 : ", data); | |
394 | + agency.agencyList = data.agencyList; | |
395 | + agency.agencyListCount = data.agencyListCount; | |
396 | + setAgency({...agency}); | |
397 | + }).catch((error) => { | |
398 | + console.log('agencySelectList() /org/agencySelectList.json error : ', error); | |
399 | + }); | |
400 | + } | |
401 | + | |
402 | + | |
403 | + | |
404 | + //사용자 관리 페이지 이동 | |
405 | + const userManagementPage = (governmentId, agencyId, auth) => { | |
406 | + navigate("/UserAuthoriySelect", {state: { | |
407 | + 'government_id': governmentId, | |
408 | + 'agency_id': agencyId, | |
409 | + 'tabActiveByRoleType': auth, | |
410 | + }}) | |
411 | + }; | |
412 | + | |
413 | + | |
414 | + | |
415 | + React.useEffect(() => { | |
416 | + orgTypesSelect(); | |
417 | + governmentSelectList(); | |
418 | + agencySelectList(); | |
419 | + }, []) | |
420 | + | |
421 | + return ( | |
422 | + <main> | |
423 | + <Modal open={isGovermentModalOpen} close={governmentModalClose} header={CommonUtil.isEmpty(government.government['government_id']) ? '관리기관 등록' : '관리기관 수정'}> | |
424 | + <div className="board-wrap"> | |
425 | + <table className="flex70 margin-bottom agency-insert"> | |
426 | + <tbody className=""> | |
427 | + <tr> | |
428 | + <th><span style={{color : "red"}}>*</span>구분</th> | |
429 | + <td colSpan={5}> | |
430 | + <select name="division" id="section" | |
431 | + onChange={(e) => {governmentValueChange('government_type', e.target.value)}} | |
432 | + ref={el => governmentRef.current['government_type'] = el}> | |
433 | + {Object.keys(orgTypes).map((key, idx) => { return ( | |
434 | + <option key={key} value={key} selected={key == government.government['government_type']}> | |
435 | + {orgTypes[key]} | |
436 | + </option> | |
437 | + )})} | |
438 | + </select> | |
439 | + </td> | |
440 | + </tr> | |
441 | + <tr> | |
442 | + <th><span style={{color : "red"}}>*</span>기관명</th> | |
443 | + <td colSpan={5}> | |
444 | + <input type="text" | |
445 | + value={government.government['government_name']} | |
446 | + onChange={(e) => {governmentValueChange('government_name', e.target.value)}} | |
447 | + ref={el => governmentRef.current['government_name'] = el}/> | |
448 | + </td> | |
449 | + </tr> | |
450 | + <tr> | |
451 | + <th><span style={{color : "red"}}>*</span>대표 연락처</th> | |
452 | + <td colSpan={5}> | |
453 | + <input type="number" | |
454 | + value={government.government['government_phonenumber']} | |
455 | + onChange={(e) => {governmentValueChange('government_phonenumber', e.target.value)}} | |
456 | + ref={el => governmentRef.current['government_phonenumber'] = el}/> | |
457 | + </td> | |
458 | + </tr> | |
459 | + <tr> | |
460 | + <th><span style={{color : "red"}}>*</span>주소</th> | |
461 | + <td colSpan={5}> | |
462 | + <input type="text" | |
463 | + value={government.government['government_address']} | |
464 | + onChange={(e) => {governmentValueChange('government_address', e.target.value)}} | |
465 | + ref={el => governmentRef.current['government_address'] = el}/> | |
466 | + </td> | |
467 | + </tr> | |
468 | + </tbody> | |
469 | + </table> | |
470 | + <div className="btn-wrap flex-center"> | |
471 | + {CommonUtil.isEmpty(government.government['government_id']) | |
472 | + ? <button className={"btn-small gray-btn"} onClick={governmentInsert}>등록</button> | |
473 | + : <button className={"btn-small gray-btn"} onClick={governmentUpdate}>수정</button> | |
474 | + } | |
475 | + </div> | |
476 | + </div> | |
477 | + </Modal> | |
478 | + | |
479 | + | |
480 | + <Modal open={isAgencyModalOpen} close={agencyModalClose} header={CommonUtil.isEmpty(agency.agency['agency_id']) ? '관리기관 등록' : '관리기관 수정'}> | |
481 | + <div className="board-wrap"> | |
482 | + <table className="flex70 margin-bottom agency-insert"> | |
483 | + <tbody className=""> | |
484 | + <tr> | |
485 | + <th><span style={{color : "red"}}>*</span>관리기관</th> | |
486 | + <td colSpan={5}> | |
487 | + <select name="division" id="section" disabled={CommonUtil.isEmpty(agency.agency['agency_id']) == false} | |
488 | + onChange={(e) => {agencyValueChange('government_id', e.target.value)}} | |
489 | + ref={el => agencyRef.current['government_id'] = el}> | |
490 | + <option value="" selected={agency.agency['government_id'] == null}>관리기관선택</option> | |
491 | + {government.governmentList.map((item, idx) => { return ( | |
492 | + <option key={idx} value={item['government_id']} selected={item['government_id'] == agency.agency['government_id']}> | |
493 | + {item['government_name']} | |
494 | + </option> | |
495 | + )})} | |
496 | + </select> | |
497 | + </td> | |
498 | + </tr> | |
499 | + <tr> | |
500 | + <th><span style={{color : "red"}}>*</span>구분</th> | |
501 | + <td colSpan={5}> | |
502 | + <select name="division" id="section" disabled={true} | |
503 | + onChange={(e) => {agencyValueChange('agency_type', e.target.value)}} | |
504 | + ref={el => agencyRef.current['agency_type'] = el}> | |
505 | + {Object.keys(orgTypes).map((key, idx) => { return ( | |
506 | + <option key={key} value={key} selected={key == agency.agency['agency_type']}> | |
507 | + {orgTypes[key]} | |
508 | + </option> | |
509 | + )})} | |
510 | + </select> | |
511 | + </td> | |
512 | + </tr> | |
513 | + <tr> | |
514 | + <th><span style={{color : "red"}}>*</span>기관명</th> | |
515 | + <td colSpan={5}> | |
516 | + <input type="text" | |
517 | + value={agency.agency['agency_name']} | |
518 | + onChange={(e) => {agencyValueChange('agency_name', e.target.value)}} | |
519 | + ref={el => agencyRef.current['agency_name'] = el}/> | |
520 | + </td> | |
521 | + </tr> | |
522 | + <tr> | |
523 | + <th><span style={{color : "red"}}>*</span>대표 연락처</th> | |
524 | + <td colSpan={5}> | |
525 | + <input type="number" | |
526 | + value={agency.agency['agency_phonenumber']} | |
527 | + onChange={(e) => {agencyValueChange('agency_phonenumber', e.target.value)}} | |
528 | + ref={el => agencyRef.current['agency_phonenumber'] = el}/> | |
529 | + </td> | |
530 | + </tr> | |
531 | + <tr> | |
532 | + <th><span style={{color : "red"}}>*</span>주소</th> | |
533 | + <td colSpan={5}> | |
534 | + <input type="text" | |
535 | + value={agency.agency['agency_address']} | |
536 | + onChange={(e) => {agencyValueChange('agency_address', e.target.value)}} | |
537 | + ref={el => agencyRef.current['agency_address'] = el}/> | |
538 | + </td> | |
539 | + </tr> | |
540 | + </tbody> | |
541 | + </table> | |
542 | + <div className="btn-wrap flex-center"> | |
543 | + {CommonUtil.isEmpty(agency.agency['agency_id']) | |
544 | + ? <button className={"btn-small gray-btn"} onClick={agencyInsert}>등록</button> | |
545 | + : <button className={"btn-small gray-btn"} onClick={agencyUpdate}>수정</button> | |
546 | + } | |
547 | + </div> | |
548 | + </div> | |
549 | + </Modal> | |
550 | + | |
551 | + | |
552 | + <div className="content-wrap"> | |
553 | + <ContentTitle contentTitle={`관리기관 조회 (${government.governmentListCount})`} /> | |
554 | + <div className="margin-bottom10"> | |
555 | + {/* <div className="search-management flex-start margin-bottom2"> | |
556 | + <select id="searchType" style={{maxWidth: 'fit-content'}} onChange={(e) => {}}> | |
557 | + <option value="">전체</option> | |
558 | + <option value="user_name">기관명</option> | |
559 | + <option value="user_phonenumber">기관연락처</option> | |
560 | + </select> | |
561 | + <input id="searchText" type="text" | |
562 | + onChange={(e) => {}} | |
563 | + onKeyUp={(e) => {}} | |
564 | + /> | |
565 | + <button className={"btn-small gray-btn"} onClick={() => {}}>검색</button> | |
566 | + </div> */} | |
567 | + <div className="board-wrap"> | |
568 | + {/* <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> */} | |
569 | + <div className="btn-wrap flex-end margin-bottom "> | |
570 | + {state.loginUser['authority'] == 'ROLE_ADMIN' ? | |
571 | + <button className={"btn-small gray-btn"} onClick={() => {governmentValueChange('government_id', null); governmentModalOpen()}}>등록</button> | |
572 | + : null} | |
573 | + </div> | |
574 | + <table className={"senior-user protector-user"}> | |
575 | + <thead> | |
576 | + <tr> | |
577 | + <th>No</th> | |
578 | + <th>구분</th> | |
579 | + <th>기관명</th> | |
580 | + <th>관리장비개수</th> | |
581 | + <th>관리자(명)</th> | |
582 | + <th>보호사(명)</th> | |
583 | + <th>관리대상자(명)</th> | |
584 | + <th>주소</th> | |
585 | + <th>대표연락처</th> | |
586 | + <th>시행기관조회</th> | |
587 | + {/* <th>장비관리</th> */} | |
588 | + <th>사용자관리</th> | |
589 | + <th>관리</th> | |
590 | + </tr> | |
591 | + </thead> | |
592 | + <tbody> | |
593 | + {government.governmentList.map((item, idx) => { return ( | |
594 | + <tr key={idx}> | |
595 | + <td data-label="No">{government.governmentListCount - idx - (government.search.currentPage - 1) * government.search.perPage}</td> | |
596 | + <td data-label="구분">{orgTypes[item['government_type']]}</td> | |
597 | + <td data-label="기관명">{item['government_name']}</td> | |
598 | + <td data-label="관리 장비 개수">{item['equipment_count']}</td> | |
599 | + <td data-label="관리자(명)">{item['government_user_count']}</td> | |
600 | + <td data-label="보호사(명)">{item['agent_user_count']}</td> | |
601 | + <td data-label="관리 대상자(명)">{item['senior_user_count']}</td> | |
602 | + <td data-label="주소">{item['government_address']}</td> | |
603 | + <td data-label="대표 연락처">{item['government_phonenumber']}</td> | |
604 | + <td> | |
605 | + <button className={"btn-small lightgray-btn"} onClick={() => { | |
606 | + government.government = item; | |
607 | + setGovernment({...government}); | |
608 | + agency.search['government_id'] = item['government_id']; | |
609 | + agency.search['ageny_id'] = null; | |
610 | + setAgency({...agency}); | |
611 | + agencySelectList(); | |
612 | + }}>시행기관조회</button> | |
613 | + </td> | |
614 | + {/* <td> | |
615 | + <button className={"btn-small gray-btn"} onClick={() => {userManagementPage(item['government_id'], null, 'ROLE_GOVERNMENT')}}>장비관리</button> | |
616 | + </td> */} | |
617 | + <td> | |
618 | + <button className={"btn-small gray-btn"} onClick={() => {userManagementPage(item['government_id'], null, 'ROLE_GOVERNMENT')}}>사용자관리</button> | |
619 | + </td> | |
620 | + <td data-label="관리"> | |
621 | + <button className={"btn-small lightgray-btn"} onClick={() => {government.government = item; setGovernment({...government}); governmentModalOpen()}}>정보 수정</button> | |
622 | + {state.loginUser['authority'] == 'ROLE_ADMIN' ? | |
623 | + <button className={"btn-small red-btn"} onClick={() => {governmentDelete(item)}}>삭제</button> | |
624 | + : null} | |
625 | + </td> | |
626 | + </tr> | |
627 | + )})} | |
628 | + {CommonUtil.isEmpty(government.governmentList) ? | |
629 | + <tr> | |
630 | + <td colSpan={12}>조회된 데이터가 없습니다</td> | |
631 | + </tr> | |
632 | + : null} | |
633 | + </tbody> | |
634 | + </table> | |
635 | + <Pagination | |
636 | + currentPage={government.search.currentPage} | |
637 | + perPage={government.search.perPage} | |
638 | + totalCount={government.governmentListCount} | |
639 | + maxRange={5} | |
640 | + click={governmentSelectList} | |
641 | + /> | |
642 | + </div> | |
643 | + </div> | |
644 | + | |
645 | + | |
646 | + {state.loginUser['authority'] == 'ROLE_ADMIN' | |
647 | + ? <ContentTitle contentTitle={government.government['government_id'] != null ? `[${government.government['government_name']}] 시행기관 조회 (${agency.agencyListCount})` : `시행기관 조회 (${agency.agencyListCount})`} /> | |
648 | + : <ContentTitle contentTitle={`시행기관 조회 (${agency.agencyListCount})`} /> | |
649 | + } | |
650 | + <div> | |
651 | + {/* <div className="search-management flex-start margin-bottom2"> | |
652 | + <select id="searchType" style={{maxWidth: 'fit-content'}} onChange={(e) => {}}> | |
653 | + <option value="">전체</option> | |
654 | + <option value="user_name">기관명</option> | |
655 | + <option value="user_phonenumber">기관연락처</option> | |
656 | + </select> | |
657 | + <input id="searchText" type="text" | |
658 | + onChange={(e) => {}} | |
659 | + onKeyUp={(e) => {}} | |
660 | + /> | |
661 | + <button className={"btn-small gray-btn"} onClick={() => {}}>검색</button> | |
662 | + </div> */} | |
663 | + <div className="board-wrap"> | |
664 | + {/* <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> */} | |
665 | + <div className="btn-wrap flex-end margin-bottom "> | |
666 | + {state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' ? | |
667 | + <button className={"btn-small gray-btn"} onClick={() => { | |
668 | + agency.agency['agency_id'] = null; | |
669 | + if (CommonUtil.isEmpty(government.government['government_id']) == false) { | |
670 | + agency.agency['government_id'] = government.government['government_id']; | |
671 | + agency.agency['agency_type'] = government.government['government_type']; | |
672 | + } | |
673 | + setAgency({...agency}); | |
674 | + agencyModalOpen(); | |
675 | + }}>등록</button> | |
676 | + : null} | |
677 | + </div> | |
678 | + <table className={"senior-user protector-user"}> | |
679 | + <thead> | |
680 | + <tr> | |
681 | + <th>No</th> | |
682 | + <th>구분</th> | |
683 | + <th>관리기관명</th> | |
684 | + <th>기관명</th> | |
685 | + <th>보호사(명)</th> | |
686 | + <th>관리대상자(명)</th> | |
687 | + <th>주소</th> | |
688 | + <th>대표연락처</th> | |
689 | + {/* <th>장비관리</th> */} | |
690 | + <th>사용자관리</th> | |
691 | + <th>관리</th> | |
692 | + </tr> | |
693 | + </thead> | |
694 | + <tbody> | |
695 | + {agency.agencyList.map((item, idx) => { return ( | |
696 | + <tr key={idx}> | |
697 | + <td data-label="No">{agency.agencyListCount - idx - (agency.search.currentPage - 1) * agency.search.perPage}</td> | |
698 | + <td data-label="구분">{orgTypes[item['agency_type']]}</td> | |
699 | + <td data-label="관리기관명">{item['government_name']}</td> | |
700 | + <td data-label="기관명">{item['agency_name']}</td> | |
701 | + <td data-label="보호사(명)">{item['agent_user_count']}</td> | |
702 | + <td data-label="관리 대상자(명)">{item['senior_user_count']}</td> | |
703 | + <td data-label="주소">{item['agency_address']}</td> | |
704 | + <td data-label="대표 연락처">{item['agency_phonenumber']}</td> | |
705 | + {/* <td> | |
706 | + <button className={"btn-small gray-btn"} onClick={() => {userManagementPage(item['agency_id'], null, 'ROLE_AGENCY')}}>장비관리</button> | |
707 | + </td> */} | |
708 | + <td> | |
709 | + <button className={"btn-small gray-btn"} onClick={() => {userManagementPage(item['government_id'], item['agency_id'], 'ROLE_AGENCY')}}>사용자관리</button> | |
710 | + </td> | |
711 | + <td data-label="관리"> | |
712 | + <button className={"btn-small lightgray-btn"} onClick={() => {agency.agency = item; setAgency({...agency}); agencyModalOpen()}}>정보 수정</button> | |
713 | + {state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' ? | |
714 | + <button className={"btn-small red-btn"} onClick={() => {agencyDelete(item)}}>삭제</button> | |
715 | + : null} | |
716 | + </td> | |
717 | + </tr> | |
718 | + )})} | |
719 | + {CommonUtil.isEmpty(agency.agencyList) ? | |
720 | + <tr> | |
721 | + <td colSpan={12}>조회된 데이터가 없습니다</td> | |
722 | + </tr> | |
723 | + : null} | |
724 | + </tbody> | |
725 | + </table> | |
726 | + <Pagination | |
727 | + currentPage={agency.search.currentPage} | |
728 | + perPage={agency.search.perPage} | |
729 | + totalCount={agency.agencyListCount} | |
730 | + maxRange={5} | |
731 | + click={agencySelectList} | |
732 | + /> | |
733 | + </div> | |
734 | + </div> | |
735 | + | |
736 | + </div> | |
737 | + </main> | |
738 | + ); | |
739 | +} |
--- client/views/pages/senior_management/SeniorEdit.jsx
+++ client/views/pages/senior_management/SeniorEdit.jsx
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 |
headers: { |
23 | 23 |
'Content-Type': 'application/json; charset=UTF-8' |
24 | 24 |
}, |
25 |
- body: JSON.stringify({}), |
|
25 |
+ body: JSON.stringify({'government_id': state.loginUser['government_id']}), |
|
26 | 26 |
}).then((response) => response.json()).then((data) => { |
27 | 27 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
28 | 28 |
setOrgListOfHierarchy(data); |
--- client/views/pages/user_management/UserAuthoriySelect.jsx
+++ client/views/pages/user_management/UserAuthoriySelect.jsx
... | ... | @@ -1,5 +1,5 @@ |
1 | 1 |
import React, { useState } from "react"; |
2 |
-import { useNavigate } from "react-router"; |
|
2 |
+import { useNavigate, useLocation } from "react-router"; |
|
3 | 3 |
import { useSelector } from "react-redux"; |
4 | 4 |
|
5 | 5 |
import ContentTitle from "../../component/ContentTitle.jsx"; |
... | ... | @@ -20,9 +20,11 @@ |
20 | 20 |
|
21 | 21 |
export default function UserAuthoriySelect() { |
22 | 22 |
const navigate = useNavigate(); |
23 |
+ const location = useLocation(); |
|
23 | 24 |
|
24 | 25 |
//전역 변수 저장 객체 |
25 | 26 |
const state = useSelector((state) => {return state}); |
27 |
+ const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
26 | 28 |
|
27 | 29 |
//활성화 탭 (시스템 업무 역할별) |
28 | 30 |
const [tabActiveByRoleType, setTabActiveByRoleType] = React.useState('ROLE_SENIOR'); |
... | ... | @@ -58,7 +60,7 @@ |
58 | 60 |
headers: { |
59 | 61 |
'Content-Type': 'application/json; charset=UTF-8' |
60 | 62 |
}, |
61 |
- body: JSON.stringify({}), |
|
63 |
+ body: JSON.stringify({'government_id': defaultGovernmentId}), |
|
62 | 64 |
}).then((response) => response.json()).then((data) => { |
63 | 65 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
64 | 66 |
setOrgListOfHierarchy(data); |
... | ... | @@ -312,11 +314,22 @@ |
312 | 314 |
//Mounted |
313 | 315 |
React.useEffect(() => { |
314 | 316 |
orgSelectListOfHierarchy(); |
315 |
- seniorSelectList(); |
|
316 |
- agentSelectList(); |
|
317 |
- if (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') { |
|
318 |
- governmentSelectList(); |
|
317 |
+ |
|
318 |
+ if (CommonUtil.isEmpty(location.state) == false) { |
|
319 |
+ const param = location.state; |
|
320 |
+ if (CommonUtil.isEmpty(param['tabActiveByRoleType']) == false) { |
|
321 |
+ setTabActiveByRoleType(param['tabActiveByRoleType']); |
|
322 |
+ } |
|
323 |
+ governmentChange(param['government_id']); |
|
324 |
+ agencyChange(param['government_id'], param['agency_id']); |
|
325 |
+ } else { |
|
326 |
+ seniorSelectList(); |
|
327 |
+ agentSelectList(); |
|
328 |
+ if (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') { |
|
329 |
+ governmentSelectList(); |
|
330 |
+ } |
|
319 | 331 |
} |
332 |
+ |
|
320 | 333 |
if (state.loginUser['authority'] == 'ROLE_ADMIN') { |
321 | 334 |
adminSelectList(); |
322 | 335 |
} |
... | ... | @@ -336,7 +349,7 @@ |
336 | 349 |
|
337 | 350 |
<ContentTitle explanation={"사용자 관리"} /> |
338 | 351 |
<div className="content-wrap"> |
339 |
- <div className="flex-align-start userauthoriylist" style={{ height: "calc(100% - 61px)" }}> |
|
352 |
+ <div className="flex-align-start userauthoriylist gap5" style={{ height: "calc(100% - 61px)" }}> |
|
340 | 353 |
<div className="left" style={{ height: "100%", }}> |
341 | 354 |
<div style={{ height: "100%" }}> |
342 | 355 |
<SubTitle |
... | ... | @@ -344,12 +357,13 @@ |
344 | 357 |
className="margin-bottom" |
345 | 358 |
/> |
346 | 359 |
{/* 카테고리 디자인 필요 (a.active 클래스 필요) */} |
347 |
- <div style={{width: '88%', fontSize: '16px'}} className="category"> |
|
348 |
- {/* <a className={() => {return "active"}} onClick={adminChange}>올잇메디</a> */} |
|
349 |
- <a onClick={adminChange} |
|
350 |
- className={userSearch['government_id'] == null && userSearch['agency_id'] == null ? "active" : ""}> |
|
351 |
- 올잇메디 |
|
352 |
- </a> |
|
360 |
+ <div style={{fontSize: '16px'}} className="category"> |
|
361 |
+ {state.loginUser['authority'] == 'ROLE_ADMIN' ? |
|
362 |
+ <a onClick={adminChange} |
|
363 |
+ className={userSearch['government_id'] == null && userSearch['agency_id'] == null ? "active" : ""}> |
|
364 |
+ 올잇메디 |
|
365 |
+ </a> |
|
366 |
+ : null} |
|
353 | 367 |
<ul style={{marginLeft: '15px'}}> |
354 | 368 |
{orgListOfHierarchy.map((item, idx) => { return ( |
355 | 369 |
<li style={{margin: '10px 0px'}} key={idx}> |
... | ... | @@ -388,8 +402,12 @@ |
388 | 402 |
<ul className="tab-menu flex-end" > |
389 | 403 |
<li onClick={() => setTabActiveByRoleType('ROLE_SENIOR')} className={tabActiveByRoleType == 'ROLE_SENIOR' ? "active" : null}>대상자(어르신) ({senior.userListCount})</li> |
390 | 404 |
<li onClick={() => setTabActiveByRoleType('ROLE_AGENCY')} className={tabActiveByRoleType == 'ROLE_AGENCY' ? "active" : null}>보호사 ({agent.userListCount})</li> |
391 |
- <li onClick={() => setTabActiveByRoleType('ROLE_GOVERNMENT')} className={tabActiveByRoleType == 'ROLE_GOVERNMENT' ? "active" : null}>기관 관리자 ({government.userListCount})</li> |
|
392 |
- <li onClick={() => setTabActiveByRoleType('ROLE_ADMIN')} className={tabActiveByRoleType == 'ROLE_ADMIN' ? "active" : null}>시스템 관리자 ({admin.userListCount})</li> |
|
405 |
+ {state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' ? |
|
406 |
+ <li onClick={() => setTabActiveByRoleType('ROLE_GOVERNMENT')} className={tabActiveByRoleType == 'ROLE_GOVERNMENT' ? "active" : null}>기관 관리자 ({government.userListCount})</li> |
|
407 |
+ : null} |
|
408 |
+ {state.loginUser['authority'] == 'ROLE_ADMIN' ? |
|
409 |
+ <li onClick={() => setTabActiveByRoleType('ROLE_ADMIN')} className={tabActiveByRoleType == 'ROLE_ADMIN' ? "active" : null}>시스템 관리자 ({admin.userListCount})</li> |
|
410 |
+ : null} |
|
393 | 411 |
</ul> |
394 | 412 |
|
395 | 413 |
{/* 탭 내용 */} |
--- client/views/pages/user_management/UserEdit.jsx
+++ client/views/pages/user_management/UserEdit.jsx
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 |
/**** 기본 조회 데이터 (시작) ****/ |
12 | 12 |
//전역 변수 저장 객체 |
13 | 13 |
const state = useSelector((state) => {return state}); |
14 |
+ const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
14 | 15 |
|
15 | 16 |
//권한 타입 종류 |
16 | 17 |
const [authorities, setAuthorities] = React.useState([]); |
... | ... | @@ -38,7 +39,7 @@ |
38 | 39 |
headers: { |
39 | 40 |
'Content-Type': 'application/json; charset=UTF-8' |
40 | 41 |
}, |
41 |
- body: JSON.stringify({}), |
|
42 |
+ body: JSON.stringify({'government_id': defaultGovernmentId}), |
|
42 | 43 |
}).then((response) => response.json()).then((data) => { |
43 | 44 |
console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
44 | 45 |
setOrgListOfHierarchy(data); |
--- node_modules/.package-lock.json
+++ node_modules/.package-lock.json
... | ... | @@ -8162,6 +8162,15 @@ |
8162 | 8162 |
"node": ">=0.10.0" |
8163 | 8163 |
} |
8164 | 8164 |
}, |
8165 |
+ "node_modules/use-state-with-callback": { |
|
8166 |
+ "version": "3.0.2", |
|
8167 |
+ "resolved": "https://registry.npmjs.org/use-state-with-callback/-/use-state-with-callback-3.0.2.tgz", |
|
8168 |
+ "integrity": "sha512-gs6t5ilsbi2UvoYXdw8+dwQg6yT3QfO/sYhm5Wa3tfwcL6BSad85FiET8ZtTWid4gjul1T1TJ8ReV4Wk1B7UZg==", |
|
8169 |
+ "peerDependencies": { |
|
8170 |
+ "react": ">=16.8.0", |
|
8171 |
+ "react-dom": ">=16.8.0" |
|
8172 |
+ } |
|
8173 |
+ }, |
|
8165 | 8174 |
"node_modules/use-sync-external-store": { |
8166 | 8175 |
"version": "1.2.0", |
8167 | 8176 |
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", |
--- package-lock.json
+++ package-lock.json
... | ... | @@ -48,6 +48,7 @@ |
48 | 48 |
"topojson": "^3.0.2", |
49 | 49 |
"topojson-client": "^3.1.0", |
50 | 50 |
"url-loader": "^4.1.1", |
51 |
+ "use-state-with-callback": "^3.0.2", |
|
51 | 52 |
"webpack": "^5.74.0", |
52 | 53 |
"webpack-cli": "^4.10.0", |
53 | 54 |
"yarn": "^1.22.19" |
... | ... | @@ -8264,6 +8265,15 @@ |
8264 | 8265 |
"node": ">=0.10.0" |
8265 | 8266 |
} |
8266 | 8267 |
}, |
8268 |
+ "node_modules/use-state-with-callback": { |
|
8269 |
+ "version": "3.0.2", |
|
8270 |
+ "resolved": "https://registry.npmjs.org/use-state-with-callback/-/use-state-with-callback-3.0.2.tgz", |
|
8271 |
+ "integrity": "sha512-gs6t5ilsbi2UvoYXdw8+dwQg6yT3QfO/sYhm5Wa3tfwcL6BSad85FiET8ZtTWid4gjul1T1TJ8ReV4Wk1B7UZg==", |
|
8272 |
+ "peerDependencies": { |
|
8273 |
+ "react": ">=16.8.0", |
|
8274 |
+ "react-dom": ">=16.8.0" |
|
8275 |
+ } |
|
8276 |
+ }, |
|
8267 | 8277 |
"node_modules/use-sync-external-store": { |
8268 | 8278 |
"version": "1.2.0", |
8269 | 8279 |
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", |
--- package.json
+++ package.json
... | ... | @@ -43,6 +43,7 @@ |
43 | 43 |
"topojson": "^3.0.2", |
44 | 44 |
"topojson-client": "^3.1.0", |
45 | 45 |
"url-loader": "^4.1.1", |
46 |
+ "use-state-with-callback": "^3.0.2", |
|
46 | 47 |
"webpack": "^5.74.0", |
47 | 48 |
"webpack-cli": "^4.10.0", |
48 | 49 |
"yarn": "^1.22.19" |
--- server/modules/web/Server.js
+++ server/modules/web/Server.js
... | ... | @@ -104,7 +104,8 @@ |
104 | 104 |
+ */ |
105 | 105 |
webServer.use('*.json', expressProxy(API_SERVER_HOST, { |
106 | 106 |
proxyReqPathResolver: function (request) { |
107 |
- //console.log('request : ', request.url, request.params[0]); |
|
107 |
+ //console.log('API_SERVER_HOST : ', API_SERVER_HOST); |
|
108 |
+ //console.log('request : ', request.url, `${request.params['0']}.json`); |
|
108 | 109 |
return `${request.params['0']}.json`; |
109 | 110 |
} |
110 | 111 |
})); |
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?