
--- client/views/component/Modal_Guardian.jsx
+++ client/views/component/Modal_Guardian.jsx
... | ... | @@ -192,6 +192,30 @@ |
192 | 192 |
}); |
193 | 193 |
}; |
194 | 194 |
|
195 |
+ // 시니어 보호자 매칭 제거 |
|
196 |
+ const updateSeniorGuardianMatch = (guardian_id) => { |
|
197 |
+ let insertBtn = confirm("삭제하시겠습니까?"); |
|
198 |
+ if (insertBtn) { |
|
199 |
+ fetch("/user/updateGuardianMatchEnd.json", { |
|
200 |
+ method: "POST", |
|
201 |
+ headers: { |
|
202 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
203 |
+ }, |
|
204 |
+ body: JSON.stringify({ |
|
205 |
+ senior_id: seniorId, |
|
206 |
+ guardian_id: guardian_id, |
|
207 |
+ }), |
|
208 |
+ }).then((response) => response.json()).then((data) => { |
|
209 |
+ alert('삭제되었습니다.'); |
|
210 |
+ setAddGuardian(true); |
|
211 |
+ }).catch((error) => { |
|
212 |
+ console.log('updateSeniorGuardianMatch() /user/updateGuardianMatchEnd.json error : ', error); |
|
213 |
+ }); |
|
214 |
+ } else { |
|
215 |
+ return; |
|
216 |
+ } |
|
217 |
+ } |
|
218 |
+ |
|
195 | 219 |
// 보호자 등록페이지 데이터 |
196 | 220 |
const thead3 = [ |
197 | 221 |
"No", |
... | ... | @@ -259,11 +283,11 @@ |
259 | 283 |
<SubTitle explanation={"최초 ID는 연락처, PW는 생년월일 8자리입니다."} className="margin-bottom" /> |
260 | 284 |
<table className="margin-bottom2 senior-insert"> |
261 | 285 |
<tr> |
262 |
- <th>이름</th> |
|
286 |
+ <th><span style={{color : "red"}}>*</span>이름</th> |
|
263 | 287 |
<td> |
264 | 288 |
<input type="text" value={userName} onChange={handleUserName} /> |
265 | 289 |
</td> |
266 |
- <th>생년월일</th> |
|
290 |
+ <th><span style={{color : "red"}}>*</span>생년월일</th> |
|
267 | 291 |
<td> |
268 | 292 |
<div className="flex"> |
269 | 293 |
<input type='date' value={brith} onChange={handleBrithday} /> |
... | ... | @@ -271,7 +295,7 @@ |
271 | 295 |
</td> |
272 | 296 |
</tr> |
273 | 297 |
<tr> |
274 |
- <th>연락처</th> |
|
298 |
+ <th><span style={{color : "red"}}>*</span>연락처</th> |
|
275 | 299 |
<td colSpan={3}> |
276 | 300 |
<input type="input" maxLength="13" value={telNum} onChange={handleTelNum} /> |
277 | 301 |
</td> |
... | ... | @@ -293,7 +317,7 @@ |
293 | 317 |
/> |
294 | 318 |
</div> |
295 | 319 |
<div> |
296 |
- <Table |
|
320 |
+ {/* <Table |
|
297 | 321 |
className={"caregiver-user"} |
298 | 322 |
head={thead3} |
299 | 323 |
contents={sgMatchList} |
... | ... | @@ -301,7 +325,47 @@ |
301 | 325 |
view={"guadianMatch"} |
302 | 326 |
offset={offset} |
303 | 327 |
limit={limit} |
304 |
- /> |
|
328 |
+ /> */} |
|
329 |
+ <table className='caregiver-user'> |
|
330 |
+ <thead> |
|
331 |
+ <tr> |
|
332 |
+ {thead3.map((i) => { |
|
333 |
+ return <th>{i}</th>; |
|
334 |
+ })} |
|
335 |
+ </tr> |
|
336 |
+ </thead> |
|
337 |
+ <tbody> |
|
338 |
+ {sgMatchList.slice(offset, offset + limit).map((i, index) => { |
|
339 |
+ const guardian_id = i.guardian_id; |
|
340 |
+ return ( |
|
341 |
+ <tr key={index}> |
|
342 |
+ {key3.map((kes) => { |
|
343 |
+ return ( |
|
344 |
+ <> |
|
345 |
+ <td |
|
346 |
+ onClick={() => { |
|
347 |
+ // 대상자 페이지일 때만 상세페이지로 이동하도록 설정 |
|
348 |
+ console.log("i.guardian_id : ", i.guardian_id); |
|
349 |
+ }}> |
|
350 |
+ {i[kes]} |
|
351 |
+ </td> |
|
352 |
+ </> |
|
353 |
+ ); |
|
354 |
+ })} |
|
355 |
+ <td> |
|
356 |
+ <Button |
|
357 |
+ className={"btn-small gray-btn"} |
|
358 |
+ btnName={"삭제"} |
|
359 |
+ onClick={() => { |
|
360 |
+ updateSeniorGuardianMatch(guardian_id); |
|
361 |
+ }} |
|
362 |
+ /> |
|
363 |
+ </td> |
|
364 |
+ </tr> |
|
365 |
+ ); |
|
366 |
+ })} |
|
367 |
+ </tbody> |
|
368 |
+ </table> |
|
305 | 369 |
</div> |
306 | 370 |
<div> |
307 | 371 |
<Pagination total={guardianTotal} limit={limit} page={page} setPage={setPage} /> |
--- client/views/component/Modal_SeniorInsert.jsx
+++ client/views/component/Modal_SeniorInsert.jsx
... | ... | @@ -182,11 +182,11 @@ |
182 | 182 |
</td> |
183 | 183 |
</tr>*/} |
184 | 184 |
<tr> |
185 |
- <th>이름</th> |
|
185 |
+ <th><span style={{color : "red"}}>*</span>이름</th> |
|
186 | 186 |
<td> |
187 | 187 |
<input type="text" value={userName} onChange={handleUserName} /> |
188 | 188 |
</td> |
189 |
- <th>성별</th> |
|
189 |
+ <th><span style={{color : "red"}}>*</span>성별</th> |
|
190 | 190 |
<td className="flex-start gender"> |
191 | 191 |
<div className="flex-start"> |
192 | 192 |
<input type="radio" name="genderSelect" value="남" onChange={handleGender} /> |
... | ... | @@ -199,7 +199,7 @@ |
199 | 199 |
</td> |
200 | 200 |
</tr> |
201 | 201 |
<tr> |
202 |
- <th>생년월일</th> |
|
202 |
+ <th><span style={{color : "red"}}>*</span>생년월일</th> |
|
203 | 203 |
<td> |
204 | 204 |
<div className="flex"> |
205 | 205 |
<input type='date' value={brith} onChange={handleBrithday} /> |
... | ... | @@ -212,13 +212,13 @@ |
212 | 212 |
|
213 | 213 |
</tr> |
214 | 214 |
<tr> |
215 |
- <th>연락처</th> |
|
215 |
+ <th><span style={{color : "red"}}>*</span>연락처</th> |
|
216 | 216 |
<td colSpan={3}> |
217 | 217 |
<input type="text" maxLength="13" value={telNum} onChange={handleTelNum} /> |
218 | 218 |
</td> |
219 | 219 |
</tr> |
220 | 220 |
<tr> |
221 |
- <th>주소</th> |
|
221 |
+ <th><span style={{color : "red"}}>*</span>주소</th> |
|
222 | 222 |
<td colSpan={3}> |
223 | 223 |
<input type="text" value={homeAddress} onChange={handleHomeAddress} /> |
224 | 224 |
</td> |
--- client/views/component/Table.jsx
+++ client/views/component/Table.jsx
... | ... | @@ -39,34 +39,7 @@ |
39 | 39 |
setModalOpen2(false); |
40 | 40 |
}; |
41 | 41 |
|
42 |
- // 시니어 보호자 매칭 제거 |
|
43 |
- const updateSeniorGuardianMatch = (useSeniorId,useGuardianId) => { |
|
44 |
- console.log("useSeniorId",useSeniorId); |
|
45 |
- console.log("useGuardianId",useGuardianId); |
|
46 |
- var insertBtn = confirm("삭제하시겠습니까?"); |
|
47 |
- if (insertBtn) { |
|
48 |
- fetch("/user/updateGuardianMatchEnd.json", { |
|
49 |
- method: "POST", |
|
50 |
- headers: { |
|
51 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
52 |
- }, |
|
53 |
- body: JSON.stringify({ |
|
54 |
- senior_id: useSeniorId, |
|
55 |
- guardian_id: useGuardianId, |
|
56 |
- }), |
|
57 |
- }).then((response) => response.json()).then((data) => { |
|
58 |
- alert('삭제되었습니다.'); |
|
59 |
- }).catch((error) => { |
|
60 |
- console.log('updateSeniorGuardianMatch() /user/updateGuardianMatchEnd.json error : ', error); |
|
61 |
- }); |
|
62 |
- } else { |
|
63 |
- return; |
|
64 |
- } |
|
65 |
- } |
|
66 |
- |
|
67 |
- |
|
68 |
- |
|
69 |
- const buttonPrint = (name, id, guardianId, seniorId) => { |
|
42 |
+ const buttonPrint = (name, id) => { |
|
70 | 43 |
if (view == "mySenior") { |
71 | 44 |
return ( |
72 | 45 |
<td> |
... | ... | @@ -109,33 +82,7 @@ |
109 | 82 |
); |
110 | 83 |
} else if (view == "qna") { |
111 | 84 |
return; |
112 |
- } else if (view == "guadianMatch") { |
|
113 |
- return ( |
|
114 |
- <td> |
|
115 |
- <Button |
|
116 |
- className={"btn-small gray-btn"} |
|
117 |
- btnName={"삭제"} |
|
118 |
- onClick={() => { |
|
119 |
- // setUseSeniorId(seniorId); |
|
120 |
- // setUseGuardianId(guardianId); |
|
121 |
- updateSeniorGuardianMatch(seniorId,guardianId,name,id); |
|
122 |
- }} |
|
123 |
- /> |
|
124 |
- </td> |
|
125 |
- ); |
|
126 |
- } else { |
|
127 |
- return ( |
|
128 |
- <td> |
|
129 |
- <Button |
|
130 |
- className={"btn-small gray-btn"} |
|
131 |
- btnName={"삭제"} |
|
132 |
- onClick={() => { |
|
133 |
- alert("삭제만들거예여."); |
|
134 |
- }} |
|
135 |
- /> |
|
136 |
- </td> |
|
137 |
- ); |
|
138 |
- } |
|
85 |
+ } |
|
139 | 86 |
}; |
140 | 87 |
return ( |
141 | 88 |
<> |
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?