최정임 최정임 2023-04-04
Merge branch 'front-end' of http://210.180.118.83/yjryu/senior_care_system into front-end
@514bbd8917dac036f89276ccb463ba2e8771d1f6
client/views/component/Modal_Guardian.jsx
--- client/views/component/Modal_Guardian.jsx
+++ client/views/component/Modal_Guardian.jsx
@@ -4,6 +4,18 @@
 
 export default function Modal_Guardian({ open, close, guardianManagementCallback, seniorId, guardianBySenior }) {
 
+  const relationshipList = [
+    '자녀',
+    '손자녀',
+    '배우자',
+    '사위',
+    '며느리',
+    '형제',
+    '자매',
+    '남매',
+    '친척'
+  ];
+
   const guardianInit = {
     'user_id': '',
     'user_name': '',
@@ -14,8 +26,8 @@
     'user_address': '',
     'user_email': '',
     'authority': 'ROLE_GUARDIAN',
-    'agency_id': '',
-    'government_id': '',
+    'agency_id': null,
+    'government_id': null,
 
     'senior_id': seniorId,
     'senior_relationship': '자녀',
@@ -82,6 +94,10 @@
   const guardianInsert = () => {
     if (guardianInsertValidation() == false) {
       return;
+    }
+
+    if (guardian['senior_relationship'] == '기타') {
+      guardian['senior_relationship'] = guardian['senior_relationship_etc'];
     }
 
     fetch("/user/guardianInsert.json", {
@@ -246,18 +262,12 @@
                   <td colSpan={3}>
                     <select onChange={(e) => {guardianValueChange('senior_relationship', e.target.value)}}
                             ref={el => guardianRef.current['senior_relationship'] = el}>
-                      <option>자녀</option>
-                      <option>손자녀</option>
-                      <option>배우자</option>
-                      <option>사위</option>
-                      <option>며느리</option>
-                      <option>형제</option>
-                      <option>자매</option>
-                      <option>남매</option>
-                      <option>친척</option>
-                      <option selected={guardian['senior_relationship'].indexOf('기타') > -1}>기타</option>
+                      {relationshipList.map((relationship, idx) => { return (
+                        <option key={idx}>{relationship}</option>
+                      )})}
+                      <option value="기타" selected={guardian['senior_relationship'] == '기타' || relationshipList.indexOf(guardian['senior_relationship']) == -1}>기타</option>
                     </select>
-                    {guardian['senior_relationship'].indexOf('기타') > -1 ? (
+                    {guardian['senior_relationship'] == '기타' || relationshipList.indexOf(guardian['senior_relationship']) == -1 ? (
                       <input type="text"
                         value={guardian['senior_relationship_etc']}
                         onChange={(e) => {guardianValueChange('senior_relationship_etc', e.target.value)}}
client/views/pages/senior_management/SeniorSelectOne.jsx
--- client/views/pages/senior_management/SeniorSelectOne.jsx
+++ client/views/pages/senior_management/SeniorSelectOne.jsx
@@ -218,6 +218,7 @@
               <th>이름</th>
               <th>관계</th>
               <th>연락처</th>
+              <th>생년월일</th>
               <th>주소</th>
               <th>관리</th>
               <th>가입승인</th>
@@ -230,6 +231,7 @@
                 <td>{item['user_name']}</td>
                 <td>{item['senior_relationship']}</td>
                 <td>{item['user_phonenumber']}</td>
+                <td>{item['user_birth']}</td>
                 <td>{item['user_address']}</td>
                 <td>
                   {item['is_accept'] ? "승인완료" : 
Add a comment
List