최정임 최정임 2023-02-24
Merge branch 'admin' of http://210.180.118.83/yjryu/senior_care_system into admin
@cd13ca86888fbf1384af6255cd2dab3e9440b0d4
 
client/views/component/Pagination.jsx (added)
+++ client/views/component/Pagination.jsx
@@ -0,0 +1,26 @@
+import React from "react";
+import styled from "styled-components";
+
+export default function Pagination({ total, limit, page, setPage }) {
+    const numPages = Math.ceil(total / limit);
+
+    return (
+        <>
+            <Paging>
+                <button onClick={() => setPage(page - 1)} disabled={page === 1}>&lt;</button>
+                {Array(numPages).fill().map((_, i) => (
+                    <button key={i + 1} onClick={() => setPage(i + 1)} aria-current={page === i + 1 ? "page" : null}> {i + 1} </button>
+                ))}
+                <button onClick={() => setPage(page + 1)} disabled={page === numPages}>&gt;</button>
+            </Paging>
+        </>
+    );
+}
+
+const Paging = styled.div`
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  gap: 4px;
+  margin: 16px;
+`;(No newline at end of file)
client/views/component/Table.jsx
--- client/views/component/Table.jsx
+++ client/views/component/Table.jsx
@@ -1,7 +1,52 @@
 import React from "react";
+import Button from "./Button.jsx";
 // import styled from "styled-components";
 
-export default function Table({ head, contents, contentKey, onClick, className}) {
+export default function Table({ head, contents, contentKey, onClick, className, view, offset, limit}) {
+  const [modalOpen, setModalOpen] = React.useState(false);
+  const openModal = () => {
+    setModalOpen(true);
+  };
+
+  const [modalOpen2, setModalOpen2] = React.useState(false);
+  const openModal2 = () => {
+    setModalOpen2(true);
+  };
+  
+
+  const buttonPrint = () => {
+    if(view == 'mySenior'){
+      return(
+      <td>
+        <Button
+          className={"btn-small gray-btn"}
+          btnName={"보기"}
+          onClick={openModal}
+        />
+      </td>)
+    }
+    else if(view == 'allSenior'){
+      return(
+        <>
+          <td>
+          <Button
+              className={"btn-small gray-btn"}
+              btnName={"선택"}
+              onClick={openModal2}
+            />
+          </td>
+          <td>
+            <Button
+              className={"btn-small gray-btn"}
+              btnName={"보기"}
+              onClick={openModal}
+            />
+            </td>
+          </>
+      )
+    }
+  }
+  
   return (
     <table className={className}>
       <thead>
@@ -12,17 +57,30 @@
         </tr>
       </thead>
       <tbody>
-        {contents.map((i, index) => {
+        {contents.slice(offset, offset + limit).map((i, index) => {
           return (
             <tr key={index}>
-              {contentKey.map((kes) => {
-                return <td onClick={onClick}>{i[kes]}</td>;
-              })}
+            {/* //   <td>{i.rn}</td>
+            //   <td>{i.user_name}</td>
+            //   <td>{i.user_phonenumber}</td>
+            //   <td>{i.user_gender}</td>
+            //   <td>{i.user_birth}</td>
+            //   <td>{i.user_address}</td>
+            //   {buttonPrint()} */}
+            {contentKey.map((kes) => {
+                return (
+                  <>
+                  <td onClick={onClick}>{i[kes]}</td>
+                  </>
+                )
+            })}
+            {buttonPrint()}
             </tr>
           );
         })}
       </tbody>
     </table>
+    
   );
 }
 
client/views/pages/equipment/EquipmentManagementSelect.jsx
--- client/views/pages/equipment/EquipmentManagementSelect.jsx
+++ client/views/pages/equipment/EquipmentManagementSelect.jsx
@@ -9,6 +9,11 @@
 
 export default function EquipmentManagementSelect() {
 
+	// 시스템 코드 - 장비 상태
+	const [equipmentStates, setEquipmentStates] = React.useState({});
+	// 시스템 코드 - 장비 대여 상태
+	const [equipmentRentalStates, setEquipmentRentalStates] = React.useState({});
+
 	const [modalOpen, setModalOpen] = React.useState(false);
 	const openModal = () => {
 		setModalOpen(true);
@@ -16,7 +21,7 @@
 	const closeModal = () => {
 		setModalOpen(false);
 	};
-	
+
 	const [modalOpen3, setModalOpen3] = React.useState(false);
 	const openModal3 = () => {
 		// equipmentListData();
@@ -26,15 +31,122 @@
 		setModalOpen3(false);
 	};
 
-	// 대상자 매칭 삭제
+	// 대상자 매칭 반납
 	const seniorMatchDelete = () => {
-		if(confirm('등록된 대상자를 삭제하시겠습니까?') == false) {
+		if (confirm('아니다') == false) {
 			return;
 		}
-		// 대상자 매칭 삭제 함수 사용하기
+		// 대상자 매칭 반납 함수 사용하기
 	};
 
 	const navigate = useNavigate();
+
+	// 시스템 코드 - 장비 대여 상태 조회
+	const equipmentStatesSelect = () => {
+		console.log('equipmentStatesSelect Function Run');
+
+		//fetch post
+		fetch("/common/systemCode/equipmentStatesSelect.json", {
+			method: "POST",
+			headers: {
+				'Content-Type': 'application/json; charset=UTF-8'
+			},
+			body: JSON.stringify({})
+		}).then((response) => response.json()).then((data) => {
+			console.log('equipmentStatesSelect response : ', data);
+			setEquipmentStates(data);
+		}).catch((error) => {
+			console.log('equipmentStatesSelect error : ', error);
+		});
+	}
+
+	// 시스템 코드 - 장비 대여 상태 조회
+	const equipmentRentalStatesSelect = () => {
+		console.log('equipmentRentalStatesSelect Function Run');
+
+		//fetch post
+		fetch("/common/systemCode/equipmentRentalStatesSelect.json", {
+			method: "POST",
+			headers: {
+				'Content-Type': 'application/json; charset=UTF-8'
+			},
+			body: JSON.stringify({})
+		}).then((response) => response.json()).then((data) => {
+			console.log('equipmentRentalStatesSelect response : ', data);
+			setEquipmentRentalStates(data);
+		}).catch((error) => {
+			console.log('equipmentRentalStatesSelect error : ', error);
+		});
+
+		//fetch get
+		/* fetch('/common/systemCode/equipmentRentalStatesSelect.json')
+		.then((response) => response.json()).then((data) => {
+			console.log('equipmentRentalStatesSelect response : ', data);
+		}).catch((error) => {
+			console.log('equipmentRentalStatesSelect error : ', error);
+		}); */
+
+		//axios get
+		/* axios.get('/common/systemCode/equipmentRentalStatesSelect.json')
+		.then(function (response) {
+			console.log('equipmentRentalStatesSelect : ', response.data);
+		}).catch(function (error) {
+			console.log("equipmentRentalStatesSelect - error : ", error);
+		}); */
+
+		//axios post
+		/* axios({
+			url: '/common/systemCode/equipmentRentalStatesSelect.json',
+			method: 'post',
+			headers: {
+				'Content-Type': "application/json; charset=UTF-8",
+			},
+			data: {}
+		}).then(function (response) {
+			console.log("equipmentRentalStatesSelect - response : ", response.data);
+		}).catch(function (error) {
+			console.log("equipmentRentalStatesSelect - error : ", error);
+		}); */
+	}
+
+	// 장비 비매칭 대상자 목록 조회
+	const equipmentNotMatchSeniorSelectList = () => {
+		console.log('seniorSelectList Function Run');
+		fetch("/user/equipmentMatchStateSelectListBySenior.json", {
+			method: "POST",
+			headers: {
+				'Content-Type': 'application/json; charset=UTF-8'
+			},
+			body: JSON.stringify({
+				agency_id: 'AGENCY01',
+				matchState: false
+			})
+		}).then((response) => response.json()).then((data) => {
+			console.log('equipmentNotMatchSeniorSelectList response : ', data);
+			setEquipmentNotMatchSeniorList(data);
+		}).catch((error) => {
+			console.log('equipmentNotMatchSeniorSelectList error : ', error);
+		});
+	}
+
+	// 담당자 목록 조회
+	const workerSelectList = () => {
+		console.log('workerSelectList Function Run');
+		fetch("/user/selectUserList.json", {
+			method: "POST",
+			headers: {
+				'Content-Type': 'application/json; charset=UTF-8'
+			},
+			body: JSON.stringify({
+				user_code: 'WORKER01'
+			})
+		}).then((response) => response.json()).then((data) => {
+			console.log('workerSelectList response : ', data);
+			setWorkerList(data);
+		}).catch((error) => {
+			console.log('workerSelectList error : ', error);
+		});
+	}
 
 	/********************************** 관리자 장비 (시작) **********************************/
 	// 관리자 전체 장비 목록
@@ -48,6 +160,7 @@
 			headers: {
 				'Content-Type': 'application/json; charset=UTF-8'
 			},
+			body: JSON.stringify({})
 		}).then((response) => response.json()).then((data) => {
 			console.log('equipmentSelectList response : ', data);
 			setEquipmentList(data);
@@ -72,7 +185,7 @@
 		"equipment_stock_date",
 		"equipment_state",
 		"agency_name",
-		"user_name",
+		"senior_name",
 	];
 
 	const thead2 = [
@@ -99,16 +212,16 @@
 			date: "2022.12.02",
 			agency: (
 				<Button
-					className={"btn-small lightgray-btn"}
+					className={"btn-small gray-btn"}
 					btnName={"선택"}
 					onClick={openModal}
 				/>
 			),
 			senior: (
 				<Button
-					className={"btn-small lightgray-btn"}
+					className={"btn-small gray-btn"}
 					btnName={"선택"}
-					// onClick={openModal2}
+				// onClick={openModal2}
 				/>
 			),
 		},
@@ -118,15 +231,15 @@
 			serialNumber: "ABCD-1",
 			date: "2022.12.02",
 			agency: (<Button
-				className={"btn-small lightgray-btn"}
+				className={"btn-small gray-btn"}
 				btnName={"선택"}
 				onClick={openModal}
 			/>),
 			senior: (
 				<Button
-					className={"btn-small lightgray-btn"}
+					className={"btn-small gray-btn"}
 					btnName={"선택"}
-					// onClick={openModal2}
+				// onClick={openModal2}
 				/>
 			),
 		},
@@ -168,7 +281,7 @@
 	/********************************** 시행기관 장비 (시작) **********************************/
 	//로그 확인
 	const logCheck = () => {
-		console.log('seniorList - change: ', seniorList);
+		console.log('equipmentNotMatchSeniorList - change: ', equipmentNotMatchSeniorList);
 	};
 
 	// 시행기관 전체 장비 목록
@@ -177,22 +290,27 @@
 	const [agencySeniorEquipmentList, setAgencySeniorEquipmentList] = React.useState([]);
 	// 시행기관 재고 장비 목록
 	const [agencyStockEquipmentList, setAgencyStockEquipmentList] = React.useState([]);
-	// 선택 대상자 장비
+	// 선택한 대상자 장비
 	const [seniorEquipment, setSeniorEquipment] = React.useState({});
-	// 대상자 목록
-	const [seniorList, setSeniorList] = React.useState([]);
 	// 대상자 장비 등록 모달창
-	const [seniorMatchModal, setSeniorMatchModal] = React.useState(false);
-	
+	const [seniorMatchInsertModal, setSeniorMatchInsertModal] = React.useState(false);
+	// 대상자 장비 반납 모달창
+	const [seniorMatchReturnModal, setSeniorMatchReturnModal] = React.useState(false);
+
+	// 장비 비매칭 대상자 목록
+	const [equipmentNotMatchSeniorList, setEquipmentNotMatchSeniorList] = React.useState([]);
+	// 담당자 목록
+	const [workerList, setWorkerList] = React.useState([]);
+
 
 	// 대상자 장비 등록 모달창 열기
-	const seniorMatchModalOpen = (item) => {
+	const seniorMatchInsertModalOpen = (item) => {
 		setSeniorEquipment(item); // 선택한 장비 데이터 저장
-		setSeniorMatchModal(true);
+		setSeniorMatchInsertModal(true);
 	};
 	// 대상자 장비 등록 모달창 닫기
-	const seniorMatchModalClose = () => {
-		setSeniorMatchModal(false);
+	const seniorMatchInsertModalClose = () => {
+		setSeniorMatchInsertModal(false);
 	};
 
 	// 대상자 장비 등록 - 대상자
@@ -240,16 +358,53 @@
 	};
 
 
+	// 대상자 장비 반납 모달창 열기
+	const seniorMatchReturnModalOpen = (item) => {
+		setSeniorEquipment(item); // 선택한 장비 데이터 저장
+		setSeniorMatchReturnModal(true);
+	};
+
+	// 대상자 장비 반납 모달창 닫기
+	const seniorMatchReturnModalClose = () => {
+		setSeniorMatchReturnModal(false);
+	};
+
+	// 대상자 장비 - 반납일
+	const seniorEquipmentRentalReturnDateInsert = (e) => {
+		console.log('@@@', e.target.value);
+		// 원본 데이터 복사 및 수정
+		let data = {
+			...seniorEquipment,
+			equipment_rental_return_date: e.target.value
+		}
+		// 복사 데이터를 원본 데이터에 덮어쓰기
+		setSeniorEquipment(data);
+	};
+
+	// 대상자 장비 - 반납 담당자
+	const seniorEquipmentReturnUserIdInsert = (e) => {
+		console.log('@@@@@', e.target.value);
+		// 원본 데이터 복사 및 수정
+		let data = {
+			...seniorEquipment,
+			return_user_id: e.target.value
+		}
+		// 복사 데이터를 원본 데이터에 덮어쓰기
+		setSeniorEquipment(data);
+	};
+
+
 	// 시행기관 전체 장비 목록 조회
 	const agencyEquipmentSelectList = () => {
 		console.log('agencyEquipmentSelectList Function Run');
-		fetch("/equipment/agencyEquipmentSelectList.json", {
+		fetch("/equipment/equipmentSelectList.json", {
 			method: "POST",
 			headers: {
 				'Content-Type': 'application/json; charset=UTF-8'
 			},
 			body: JSON.stringify({
 				agency_id: 'AGENCY01',
+				searchAll: true
 			}),
 		}).then((response) => response.json()).then((data) => {
 			console.log('agencyEquipmentSelectList response : ', data);
@@ -260,23 +415,44 @@
 	}
 
 	// 시행기관 대상자 장비 목록 조회
-	// const agencySeniorEquipmentSelectList = () => {
-	// 	console.log('agencySeniorEquipmentSelectList Function Run');
-	// 	fetch("/equipment/agencySeniorEquipmentSelectList.json", {
-	// 		method: "POST",
-	// 		headers: {
-	// 			'Content-Type': 'application/json; charset=UTF-8'
-	// 		},
-	// 		body: JSON.stringify({
-	// 			agency_id: 'AGENCY01',
-	// 		}),
-	// 	}).then((response) => response.json()).then((data) => {
-	// 		console.log('agencySeniorEquipmentSelectList response : ', data);
-	// 		setAgencySeniorEquipmentList(data);
-	// 	}).catch((error) => {
-	// 		console.log('agencySeniorEquipmentSelectList error : ', error);
-	// 	});
-	// }
+	const agencySeniorEquipmentSelectList = () => {
+		console.log('agencySeniorEquipmentSelectList Function Run');
+		fetch("/equipment/equipmentSelectList.json", {
+			method: "POST",
+			headers: {
+				'Content-Type': 'application/json; charset=UTF-8'
+			},
+			body: JSON.stringify({
+				agency_id: 'AGENCY01',
+				seniorCheck: true
+			}),
+		}).then((response) => response.json()).then((data) => {
+			console.log('agencySeniorEquipmentSelectList response : ', data);
+			setAgencySeniorEquipmentList(data);
+		}).catch((error) => {
+			console.log('agencySeniorEquipmentSelectList error : ', error);
+		});
+	}
+
+	// 시행기관 재고 장비 목록 조회
+	const agencyStockEquipmentSelectList = () => {
+		console.log('agencyStockEquipmentList Function Run');
+		fetch("/equipment/equipmentSelectList.json", {
+			method: "POST",
+			headers: {
+				'Content-Type': 'application/json; charset=UTF-8'
+			},
+			body: JSON.stringify({
+				agency_id: 'AGENCY01',
+				seniorCheck: false
+			}),
+		}).then((response) => response.json()).then((data) => {
+			console.log('agencyStockEquipmentList response : ', data);
+			setAgencyStockEquipmentList(data);
+		}).catch((error) => {
+			console.log('agencyStockEquipmentList error : ', error);
+		});
+	}
 
 	// 대상자 장비 등록
 	const seniorEquipmentInsert = () => {
@@ -284,14 +460,14 @@
 
 		// 대상자 아이디 유효성 검사
 		let check = 0;
-		for(let i = 0; i < seniorList.length; i++) {
-			// 입력한 데이터가 대상자 목록에 있을 경우
-			if(seniorList[i]['user_id'] == seniorEquipment['senior_id']) {
-				console.log('success: ', seniorList[i]['user_id']);
+		for (let i = 0; i < equipmentNotMatchSeniorList.length; i++) {
+			// 입력한 대상자 아이디가 대상자 목록에 있을 경우
+			if (equipmentNotMatchSeniorList[i]['senior_id'] == seniorEquipment['senior_id']) {
+				console.log('success: ', equipmentNotMatchSeniorList[i]['senior_id']);
 				// 원본 데이터 복사 및 수정
 				let data = {
 					...seniorEquipment,
-					user_name: seniorList[i]['user_name']
+					user_name: equipmentNotMatchSeniorList[i]['user_name'],
 				}
 				// 복사 데이터를 원본 데이터에 덮어쓰기
 				setSeniorEquipment(data);
@@ -299,12 +475,24 @@
 				check = 1;
 			}
 		}
-		// 입력한 데이터가 대상자 목록에 없을 경우
-		if(check != 1) {
-			console.log('fail: ', seniorList, seniorEquipment['senior_id']);
+		// 입력한 대상자 아이디가 대상자 목록에 없을 경우
+		if (check != 1) {
+			console.log('fail: ', equipmentNotMatchSeniorList, seniorEquipment['senior_id']);
 			alert('존재하지 않는 대상자입니다.');
 			return;
 		}
+
+		// 대여일 유효성 검사
+		/* if(seniorEquipment['equipment_rental_start_date'] == null) {
+			alert('대여일을 입력해 주세요');
+			return;
+		} */
+
+		// 반납 예정일 유효성 검사
+		/* if(seniorEquipment['equipment_rental_end_date'] == null) {
+			alert('반납 예정일 입력해 주세요');
+			return;
+		} */
 
 		fetch("/equipment/seniorEquipmentInsert.json", {
 			method: "POST",
@@ -316,6 +504,15 @@
 			console.log('seniorEquipmentInsert response : ', data);
 			// 대상자 장비 데이터 초기화
 			setSeniorEquipment({});
+			//장비 비매칭 대상자 목록 조회
+			equipmentNotMatchSeniorSelectList();
+			// 장비 목록 조회
+			agencyEquipmentSelectList();
+			agencySeniorEquipmentSelectList();
+			agencyStockEquipmentSelectList();
+			// 모달창 닫기
+			setSeniorMatchInsertModal(false);
+
 			alert('등록이 완료됐습니다.');
 		}).catch((error) => {
 			console.log('seniorEquipmentInsert error : ', error);
@@ -323,145 +520,146 @@
 		});
 	}
 
-	// 대상자 목록 조회
-	const seniorSelectList = () => {
-		console.log('seniorSelectList Function Run');
-		fetch("/user/selectSubjectList.json", {
+	// 대상자 장비 반납
+	const seniorEquipmentReturn = () => {
+		console.log('seniorEquipmentReturn Function Run');
+
+		// 담당자 아이디 유효성 검사
+		let check = 0;
+		for (let i = 0; i < workerList.length; i++) {
+			// 입력한 담당자 아이디가 담당자 목록에 있을 경우
+			if (workerList[i]['user_id'] == seniorEquipment['return_user_id']) {
+				console.log('success: ', workerList[i]['user_id']);
+				check = 1;
+			}
+		}
+		// 입력한 담당자 아이디가 담당자 목록에 없을 경우
+		if (check != 1) {
+			console.log('fail: ', workerList, seniorEquipment['return_user_id']);
+			alert('존재하지 않는 담당자입니다.');
+			return;
+		}
+
+		// 반납 예정일 유효성 검사
+		/* if(seniorEquipment['equipment_rental_return_date'] == null) {
+			alert('반납일 입력해 주세요');
+			return;
+		} */
+
+		fetch("/equipment/seniorEquipmentReturn.json", {
 			method: "POST",
 			headers: {
 				'Content-Type': 'application/json; charset=UTF-8'
 			},
+			body: JSON.stringify(seniorEquipment),
 		}).then((response) => response.json()).then((data) => {
-			console.log('seniorSelectList response : ', data);
-			setSeniorList(data);
+			console.log('seniorEquipmentReturn response : ', data);
+			// 대상자 장비 데이터 초기화
+			setSeniorEquipment({});
+			//장비 비매칭 대상자 목록 조회
+			equipmentNotMatchSeniorSelectList();
+			// 장비 목록 조회
+			agencyEquipmentSelectList();
+			agencySeniorEquipmentSelectList();
+			agencyStockEquipmentSelectList();
+			// 모달창 닫기
+			setSeniorMatchReturnModal(false);
+
+			alert('반납이 완료됐습니다.');
 		}).catch((error) => {
-			console.log('seniorSelectList error : ', error);
+			console.log('seniorEquipmentReturn error : ', error);
+			alert('반납에 실패했습니다.');
 		});
 	}
 
+
+	// 시행기관 전체 장비 thead, key
 	const thead11 = [
 		"No",
 		"모델 명",
 		"시리얼 넘버",
-		"상태",
-		"대상자",
-		"대여일",
-		"반납예정일",
-		"반납일",
-		"관리"
+		"기기 상태",
+		"대여 상태",
+		"동일 기기 매칭 순번",
+		"대상자 관리",
 	];
 	const key11 = [
 		"equipment_name",
 		"equipment_serial_number",
 		"equipment_state",
-		"user_name",
-		"equipment_rental_start_date",
-		"equipment_rental_end_date",
-		"equipment_rental_return_date"
+		"equipment_rental_state",
 	];
 
+	// 시행기관 대상자 장비 thead, key
 	const thead22 = [
 		"No",
 		"모델 명",
 		"시리얼 넘버",
-		"상태",
+		"기기 상태",
 		"대상자",
 		"대여일",
 		"반납예정일",
-		"반납일",
-		"관리"
+		"동일 기기 매칭 순번",
+		"대상자 관리",
 	];
 	const key22 = [
 		"equipment_name",
 		"equipment_serial_number",
 		"equipment_state",
-		"user_name",
+		"senior_name",
 		"equipment_rental_start_date",
 		"equipment_rental_end_date",
-		"equipment_rental_return_date"
+		"equipment_match_idx",
 	];
 
+	// 시행기관 재고 장비 thead, key
 	const thead33 = [
 		"No",
-		"장비명",
+		"모델 명",
 		"시리얼 넘버",
-		"입고일자",
-		"납품 기관",//관리기관, 올잇메디
-		"대상자",//시행기관
+		"기기 상태",
+		"대상자 관리",
 	];
 	const key33 = [
-		"No",
-		"equipment",
-		"serialNumber",
-		"date",
-		"agency",
-		"senior",
+		"equipment_name",
+		"equipment_serial_number",
+		"equipment_state",
 	];
-	const content33 = [
-		{
-			No: 1,
-			equipment: "스마트약상자",
-			serialNumber: "ABCD-1",
-			date: "2022.12.02",
-			agency: (
-				<Button
-					className={"btn-small lightgray-btn"}
-					btnName={"선택"}
-					onClick={openModal}
-				/>
-			),
-			senior: (
-				<Button
-					className={"btn-small lightgray-btn"}
-					btnName={"선택"}
-					// onClick={openModal2}
-				/>
-			),
-		},
-		{
-			No: 2,
-			equipment: "스마트약상자",
-			serialNumber: "ABCD-1",
-			date: "2022.12.02",
-			agency: (<Button
-				className={"btn-small lightgray-btn"}
-				btnName={"선택"}
-				onClick={openModal}
-			/>),
-			senior: (
-				<Button
-					className={"btn-small lightgray-btn"}
-					btnName={"선택"}
-					// onClick={openModal2}
-				/>
-			),
-		},
+
+	// 장비 대상자 등록 모달창 thead
+	const thead44 = [
+		"대상자",
+		"대여일",
+		"반납예정일",
+		"선택",
+	];
+
+	// 장비 대상자 반납 모달창 thead
+	const thead55 = [
+		"반납일",
+		"반납 담당자",
+		"선택",
 	];
 
 	// 마운트 시 실행 함수
 	React.useEffect(() => {
+		equipmentStatesSelect();
+		equipmentRentalStatesSelect();
+		equipmentNotMatchSeniorSelectList();
+		workerSelectList();
+
+		//관리자
 		equipmentSelectList();
 
+		//시행기관
 		agencyEquipmentSelectList();
-		// agencySeniorEquipmentSelectList();
-		seniorSelectList();
+		agencySeniorEquipmentSelectList();
+		agencyStockEquipmentSelectList();
 	}, [])
-
-	// 대상자, 재고 장비 목록 
-	React.useEffect(() => {
-		console.log('@@@', agencyEquipmentList);
-		let data = [];
-		for(let i = 0; i < agencyEquipmentList.length; i++) {
-			if(agencyEquipmentList[i]['senior_id'] != null) {
-				data.push(agencyEquipmentList[i]);
-			}
-		}
-		console.log('@@@data', data);
-		setAgencySeniorEquipmentList(data);
-	}, [agencyEquipmentList])
 
 	/********************************** 시행기관 장비 (끝) **********************************/
 
+	// 장비 납품 모달창 thead, key
 	const thead4 = [
 		"No",
 		"기관명",
@@ -476,7 +674,7 @@
 		{
 			No: 1,
 			agency: (
-				<div className="select-agency">
+				<div>
 					<Category />
 				</div>
 			)
@@ -488,41 +686,8 @@
 
 		},
 	];
-	const thead5 = [
-		"대상자",
-		"대여일",
-		"반납예정일",
-		"선택",
-	];
-	const key5 = [
-		"senior",
-		"date",
-		"choice",
-	];
-	const content5 = [
-		{
-			No: 1,
-			senior: (
-				<div>
-					<input type="text" list="senior_list" />
-					<datalist id="senior_list">
-						<option value="대상자1(ID)"></option>
-						<option value="대상자2(ID)"></option>
-						<option value="대상자3(ID)"></option>
-					</datalist>
-				</div>
-			)
-			,
-			choice: (<Button
-				className={"btn-small gray-btn"}
-				btnName={"선택"}
-			/>)
 
-		},
-	];
-
-
-
+	// 장비 탭별 화면
 	const data = [
 		{
 			id: 1,
@@ -533,7 +698,7 @@
 						<SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} />
 						<div className="btn-wrap flex-end margin-bottom ">
 							<Button
-								className={"btn-small gray-btn"}
+								className={"btn-small green-btn"}
 								btnName={"등록"}
 								onClick={openModal3}
 							/>
@@ -548,39 +713,39 @@
 							navigate("/EquipmentManagementSelectOne");
 						}}
 					/> */}
-					<table class = "caregiver-user">
+					<table class="caregiver-user">
 						<thead>
 							<tr>
-							{thead1.map((i) => {
-								return <th>{i}</th>;
-							})}
+								{thead1.map((i) => {
+									return <th>{i}</th>;
+								})}
 							</tr>
 						</thead>
 						<tbody>
 							{equipmentList.map((item, index) => {
-							return (
-								<tr key={index}>
-									<td>{equipmentList.length - index}</td>
-									{key1.map((kes) => {
-										return <td>{item[kes]}</td>
-									})}
-									<td>
-									{
-										item['senior_id'] == null
-										? <Button
-												className={"btn-small green-btn"}
-												btnName={"등록"}
-												onClick={() => seniorMatchModalOpen(item)}
-											/>
-										: <Button
-											className={"btn-small green-btn"}
-											btnName={"삭제"}
-											onClick={seniorMatchDelete}
-										/>
-									}
-									</td>
-								</tr>
-							);
+								return (
+									<tr key={index}>
+										<td>{equipmentList.length - index}</td>
+										{key1.map((kes) => {
+											return <td>{item[kes]}</td>
+										})}
+										<td>
+											{
+												item['senior_id'] == null
+													? <Button
+														className={"btn-small green-btn"}
+														btnName={"등록"}
+														onClick={() => seniorMatchInsertModalOpen(item)}
+													/>
+													: <Button
+														className={"btn-small green-btn"}
+														btnName={"반납"}
+														onClick={seniorMatchDelete}
+													/>
+											}
+										</td>
+									</tr>
+								);
 							})}
 						</tbody>
 					</table>
@@ -623,50 +788,64 @@
 						<SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} />
 						<div className="btn-wrap flex-end margin-bottom ">
 							<Button
-								className={"btn-small gray-btn"}
+								className={"btn-small green-btn"}
 								btnName={"LOG"}
 								onClick={logCheck}
 							/>
-							<Button
-								className={"btn-small gray-btn"}
-								btnName={"등록"}
-								onClick={openModal3}
-							/>
 						</div>
 					</div>
-					<table class = "caregiver-user">
+					<table class="caregiver-user">
 						<thead>
 							<tr>
-							{thead11.map((i) => {
-								return <th>{i}</th>;
-							})}
+								{thead11.map((i) => {
+									return <th>{i}</th>;
+								})}
 							</tr>
 						</thead>
 						<tbody>
 							{agencyEquipmentList.map((item, index) => {
-							return (
-								<tr key={index}>
-									<td>{agencyEquipmentList.length - index}</td>
-									{key11.map((kes) => {
-										return <td>{item[kes]}</td>
-									})}
-									<td>
-									{
-										item['senior_id'] == null
-										? <Button
-												className={"btn-small green-btn"}
-												btnName={"등록"}
-												onClick={() => seniorMatchModalOpen(item)}
-											/>
-										: <Button
-											className={"btn-small green-btn"}
-											btnName={"삭제"}
-											onClick={seniorMatchDelete}
-										/>
-									}
-									</td>
-								</tr>
-							);
+								if(item)
+								return (
+									<tr key={index}>
+										<td>{agencyEquipmentList.length - index}</td>
+										{/* {key11.map((kes) => {
+											if(kes == "equipment_rental_state") {
+												for(let i = 0; i < Object.keys(equipmentRentalStates).length; i++) {
+													if(item[kes].toString().toUpperCase() == Object.keys(equipmentRentalStates)[i]) {
+														item[kes] = Object.values(equipmentRentalStates)[i];
+													}
+												}
+											}
+											return <td>{item[kes]}</td>
+										})} */}
+										<td>{item['equipment_name']}</td>
+										<td>{item['equipment_serial_number']}</td>
+										{Object.keys(equipmentStates).map((key, idx) => {
+											if(item['equipment_state'] == key)
+											return <td>{Object.values(equipmentStates)[idx]}</td>
+										})}
+										{Object.keys(equipmentRentalStates).map((key, idx) => {
+											if(item['equipment_rental_state'] == key)
+											return <td>{Object.values(equipmentRentalStates)[idx]}</td>
+										})}
+										<td>{item['equipment_match_idx']}</td>
+										<td>
+											{
+												item['equipment_rental_state'] == 'RENTABLE'
+													? <Button
+														className={"btn-small green-btn"}
+														btnName={"등록"}
+														onClick={() => seniorMatchInsertModalOpen(item)}
+													/>
+													: <Button
+														className={"btn-small green-btn"}
+														btnName={"반납"}
+														onClick={() => seniorMatchReturnModalOpen(item)}
+													/>
+											}
+										</td>
+									</tr>
+								);
 							})}
 						</tbody>
 					</table>
@@ -678,59 +857,36 @@
 			title: "대상자 장비(시행기관)" + "(" + agencySeniorEquipmentList.length + ")",
 			description: (
 				<div>
-					{/* <table class = "caregiver-user">
+					<div className="flex">
+						<SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} />
+					</div>
+					<table class="caregiver-user">
 						<thead>
 							<tr>
-							{thead22.map((i) => {
-								return <th>{i}</th>;
-							})}
+								{thead22.map((i) => {
+									return <th>{i}</th>;
+								})}
 							</tr>
 						</thead>
 						<tbody>
 							{agencySeniorEquipmentList.map((item, index) => {
-							return (
-								<tr key={index}>
-									<td>{agencySeniorEquipmentList.length - index}</td>
-									{key22.map((kes) => {
-										return <td>{item[kes]}</td>
-									})}
-									<td>
-										<Button
-											className={"btn-small green-btn"}
-											btnName={"삭제"}
-											onClick={seniorMatchDelete}
-										/>
-									</td>
-								</tr>
-							);
-							})}
-						</tbody>
-					</table> */}
-					<table class = "caregiver-user">
-						<thead>
-							<tr>
-							{thead22.map((i) => {
-								return <th>{i}</th>;
-							})}
-							</tr>
-						</thead>
-						<tbody>
-							{agencySeniorEquipmentList.map((item, index) => {
-							return (
-								<tr key={index}>
-									<td>{agencySeniorEquipmentList.length - index}</td>
-									{key22.map((kes) => {
-										return <td>{item[kes]}</td>
-									})}
-									<td>
-										<Button
-											className={"btn-small green-btn"}
-											btnName={"삭제"}
-											onClick={seniorMatchDelete}
-										/>
-									</td>
-								</tr>
-							);
+								return (
+									<tr key={index}>
+										<td>{agencySeniorEquipmentList.length - index}</td>
+										{key22.map((kes) => {
+											return <td>{item[kes]}</td>
+										})}
+										<td>
+											{
+												<Button
+													className={"btn-small green-btn"}
+													btnName={"반납"}
+													onClick={() => seniorMatchReturnModalOpen(item)}
+												/>
+											}
+										</td>
+									</tr>
+								);
 							})}
 						</tbody>
 					</table>
@@ -739,20 +895,50 @@
 		},
 		{
 			id: 6,
-			title: "재고 장비(시행기관)" + "(" + ")",
+			title: "재고 장비(시행기관)" + "(" + agencyStockEquipmentList.length + ")",
 			description: (
-				<Table
-					className={"caregiver-user"}
-					head={thead33}
-					contents={content33}
-					contentKey={key33}
-				/>
+				<div>
+					<div className="flex">
+						<SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} />
+					</div>
+					<table class="caregiver-user">
+						<thead>
+							<tr>
+								{thead33.map((i) => {
+									return <th>{i}</th>;
+								})}
+							</tr>
+						</thead>
+						<tbody>
+							{agencyStockEquipmentList.map((item, index) => {
+								return (
+									<tr key={index}>
+										<td>{agencyStockEquipmentList.length - index}</td>
+										{key33.map((kes) => {
+											return <td>{item[kes]}</td>
+										})}
+										<td>
+											{
+												<Button
+													className={"btn-small green-btn"}
+													btnName={"등록"}
+													onClick={() => seniorMatchInsertModalOpen(item)}
+												/>
+											}
+										</td>
+									</tr>
+								);
+							})}
+						</tbody>
+					</table>
+				</div>
 			),
 		},
 	];
 
 	//시작 탭 설정
 	const [index, setIndex] = React.useState(4);
+
 	return (
 		<main>
 			<Modal open={modalOpen} close={closeModal} header="납품 기관 선택">
@@ -765,57 +951,16 @@
 							contentKey={key4}
 						/>
 					</div>
-				</div>
-			</Modal>
-			<Modal open={seniorMatchModal} close={seniorMatchModalClose} header="대상자 장비 등록">
-				<div className="board-wrap">
-					<div>
-						<table className={"caregiver-user"}>
-							<thead>
-								<tr>
-								{thead5.map((i) => {
-									return <th>{i}</th>;
-								})}
-								</tr>
-							</thead>
-							<tbody>
-								<tr>
-									<td>
-										<input type="text" list="senior_list" placeholder="대상자를 입력해 주세요" onChange={seniorEquipmentSeniorInsert}/>
-										<datalist id="senior_list">
-											{seniorList.map((item) => {
-												// return <option value={item['user_name'] + " (" + item['user_id'] + ")"}></option>
-												return <option value={item['user_id']}>{item['user_name']}</option>
-
-											})}
-										</datalist>
-									</td>
-									<td>
-										<input type="date" onChange={seniorEquipmentRentalStartDateInsert}/>
-									</td>
-									<td>
-										<input type="date" onChange={seniorEquipmentRentalEndDateInsert}/>
-									</td>
-									<td>
-										<Button
-											className={"btn-small gray-btn"}
-											btnName={"선택"}
-											onClick={seniorEquipmentInsert}
-										/>
-									</td>
-								</tr>
-							</tbody>
-						</table>
-					</div>
 					<div>
 						<Button
 							className={"btn-100 green-btn"}
 							btnName={"닫기"}
-							onClick={seniorMatchModalClose}
+							onClick={closeModal}
 						/>
 					</div>
 				</div>
 			</Modal>
+
 			<Modal open={modalOpen3} close={closeModal3} header="장비 등록">
 				<div className="board-wrap">
 					<div>
@@ -842,15 +987,112 @@
 							</tbody>
 						</table>
 					</div>
-					<div className="flex-center">
+					<div>
 						<Button
-							className={"btn-small red-btn"}
+							className={"btn-100 green-btn"}
 							btnName={"저장"}
 							onClick={closeModal3}
 						/>
 					</div>
 				</div>
 			</Modal>
+			
+			<Modal open={seniorMatchInsertModal} close={seniorMatchInsertModalClose} header="대상자 장비 등록">
+				<div className="board-wrap">
+					<div>
+						<table className={"caregiver-user"}>
+							<thead>
+								<tr>
+									{thead44.map((i) => {
+										return <th>{i}</th>;
+									})}
+								</tr>
+							</thead>
+							<tbody>
+								<tr>
+									<td>
+										<input type="text" list="senior_list" placeholder="대상자를 입력해 주세요" onChange={seniorEquipmentSeniorInsert} />
+										<datalist id="senior_list">
+											{equipmentNotMatchSeniorList.map((item) => {
+												// return <option value={item['user_name'] + " (" + item['senior_id'] + ")"}></option>
+												return <option value={item['senior_id']}>{item['user_name']}</option>
+
+											})}
+										</datalist>
+									</td>
+									<td>
+										<input type="date" onChange={seniorEquipmentRentalStartDateInsert} />
+									</td>
+									<td>
+										<input type="date" onChange={seniorEquipmentRentalEndDateInsert} />
+									</td>
+									<td>
+										<Button
+											className={"btn-small gray-btn"}
+											btnName={"선택"}
+											onClick={seniorEquipmentInsert}
+										/>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+					</div>
+					<div>
+						<Button
+							className={"btn-100 green-btn"}
+							btnName={"닫기"}
+							onClick={seniorMatchInsertModalClose}
+						/>
+					</div>
+				</div>
+			</Modal>
+
+			<Modal open={seniorMatchReturnModal} close={seniorMatchReturnModalClose} header="대상자 장비 반납">
+				<div className="board-wrap">
+					<div>
+						<table className={"caregiver-user"}>
+							<thead>
+								<tr>
+									{thead55.map((i) => {
+										return <th>{i}</th>;
+									})}
+								</tr>
+							</thead>
+							<tbody>
+								<tr>
+									<td>
+										<input type="date" onChange={seniorEquipmentRentalReturnDateInsert} />
+									</td>
+									<td>
+										<input type="text" list="senior_list" placeholder="반납 담당자를 입력해 주세요" onChange={seniorEquipmentReturnUserIdInsert} />
+										<datalist id="senior_list">
+											{workerList.map((item) => {
+												return <option value={item['user_id']}>{item['user_name']}</option>
+											})}
+										</datalist>
+									</td>
+									<td>
+										<Button
+											className={"btn-small gray-btn"}
+											btnName={"선택"}
+											onClick={seniorEquipmentReturn}
+										/>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+					</div>
+					<div>
+						<Button
+							className={"btn-100 green-btn"}
+							btnName={"닫기"}
+							onClick={seniorMatchInsertModalClose}
+						/>
+					</div>
+				</div>
+			</Modal>
+
+
 			<div className="tab-container">
 				<ul className="tab-menu">
 					{data.map((item) => (
client/views/pages/user_management/UserAuthoriySelect_agency.jsx
--- client/views/pages/user_management/UserAuthoriySelect_agency.jsx
+++ client/views/pages/user_management/UserAuthoriySelect_agency.jsx
@@ -4,13 +4,23 @@
 import SubTitle from "../../component/SubTitle.jsx";
 import Modal from "../../component/Modal.jsx";
 import { useNavigate } from "react-router";
+import Pagination from "../../component/Pagination.jsx";
 
 export default function UserAuthoriySelect_agency() {
   // 화면 진입 시 탭 별 노출될ㄹ 리스트 초기화 
   const [subjectList, setSubjectList] = React.useState([]);
   const [subjectMyList, setSubjectMyList] = React.useState([]);
   
+
+  //페이징 작업
+  const limit = 10; // 페이지당 보여줄 공지 개수
+  const [page, setPage] = React.useState(1); //page index
+  const offset = (page - 1) * limit; //게시물 위치 계산
+  const [myUserTotal, setMyUserTotal] = React.useState(0); //최대길이 넣을 변수
+  const [userTotal, setUserTotal] = React.useState(0); //최대길이 넣을 변수
+
   // ------ 등록 버튼 클릭 시 노출되는 모달 데이터 ------//
+
   // 사용자 등록 시 초기값 세팅
   const [userName, setUserName] = React.useState("");
   const [gender, setGender] = React.useState("");
@@ -22,7 +32,20 @@
   const [medicineD, setMedicineD] = React.useState(false);
   const [medication, setMedication] = React.useState("");
   const [note, setNote] = React.useState("");
-
+  
+  // 등록 후 초기화 진행
+  const dataReset = () => {
+    setUserName("");
+    setGender("");
+    setBrith("");
+    setTelNum("");
+    setHomeAddress("");
+    setMedicineM("");
+    setMedicineL("");
+    setMedicineD("");
+    setMedication("");
+    setNote("");
+  }
   // 변경되는 데이터 Handler
   const handleUserName = (e) => {
     setUserName(e.target.value);
@@ -34,7 +57,7 @@
     setBrith(e.target.value);
   };
   const handleTelNum = (e) => {
-    e.target.value =  e.target.value.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`);
+    e.target.value = e.target.value.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`);
     setTelNum(e.target.value);
   };
   const handleHomeAddress = (e) => {
@@ -57,82 +80,103 @@
   };
 
   // 대상자 등록 함수 
-  const seniorInsert = () => {
-    // userName,gender,brith, telNum, homeAddress, note, medicineM, medicineL, medicineD
-    // console.log("userName : ",userName);
-    // console.log("gender : ",gender);
-    // console.log("brith : ",brith);
-    // console.log("telNum : ",telNum);
-    // console.log("homeAddress : ",homeAddress);
-    // console.log("note : ",note);
-    // console.log("medicineM : ",medicineM);
-    // console.log("medicineL : ",medicineL);
-    // console.log("medicineD : ",medicineD);
+  const InsertSenior = () => {
     var insertBtn = confirm("등록하시겠습니까?");
-    if(insertBtn){
-      fetch("/user/userInsert_userMadicationInsert.json", {
-        method: "POST",
-        headers: {
-          'Content-Type': 'application/json; charset=UTF-8'
-        },
-        body: JSON.stringify({
-          userName:userName,
-          gender:gender,
-          brith :brith,
-          userTel :telNum,
-          homeAddress:homeAddress,
-          medicineM:medicineM,
-          medicineL:medicineL,
-          medicineD:medicineD,
-          medication:medication,
-          note:note,
-          agancyId:'agency1',
-          govId:'government1',
-          userCode : '4'
-        }),
-      }).then((response) => response.json()).then((data) => {
-        alert("등록 되었습니다.");
-      }).catch((error) => {
-        console.log('selectNotice() /Notice/selectNotice.json error : ', error);
-      });
-    }else{
-        return;
+    if (insertBtn) {
+      InsertUserData();
+      alert("등록 되었습니다.");
+      dataReset();
+      closeModal3();
+      getSelectSubjectList();
+      getSelectMySubjectList();
+    } else {
+      return;
     }
-    
+
   };
-
+  // 대상자 정보 등록을 위한 함수 
+  const InsertUserData = () => {
+    fetch("/user/insertSeniorData.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        user_name: userName,
+        user_gender: gender,
+        user_birth: brith,
+        user_phonenumber: telNum,
+        user_address: homeAddress,
+        agency_id: 'agency1',
+        government_id: 'government1',
+        user_code: '4'
+      }),
+    }).then((response) => response.json()).then((data) => {
+      console.log("대상자 정보 등록");
+      InsertUserPillData();
+    }).catch((error) => {
+      console.log('insertSeniorData() /Notice/insertSeniorData.json error : ', error);
+    });
+  };
+  // 대상자 약 복용 정보 등록을 위한 함수 
+  const InsertUserPillData = () => {
+    fetch("/user/insertSeniorMadication.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        user_phonenumber: telNum,
+        breakfast_medication_check: medicineM,
+        lunch_medication_check: medicineL,
+        dinner_medication_check: medicineD,
+        medication_pill: medication,
+        senior_note: note,
+      }),
+    }).then((response) => response.json()).then((data) => {
+      console.log("약 정보 등록");
+    }).catch((error) => {
+      console.log('InsertUserPillData() /user/insertSeniorMadication.json error : ', error);
+    });
+  };
+ //select 
   const getSelectSubjectList = () => {
-    fetch("/user/selectSubjectList.json", {
-          method: "POST",
-          headers: {
-            'Content-Type': 'application/json; charset=UTF-8'
-          },
-        }).then((response) => response.json()).then((data) => {
-          const rowData = data;
-          console.log(data);
-          setSubjectList(rowData)
-
-        }).catch((error) => {
-          console.log('getSelectSubjectList() /user/selectSubjectList.json error : ', error);
-        });
+    fetch("/user/selectUserList.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        user_code: '4',
+      }),
+    }).then((response) => response.json()).then((data) => {
+      const rowData = data;
+      console.log(data);
+      setSubjectList(rowData)
+      setUserTotal(rowData.length)
+    }).catch((error) => {
+      console.log('getSelectSubjectList() /user/selectUserList.json error : ', error);
+    });
   };
 
   const getSelectMySubjectList = () => {
-    fetch("/user/selectMySubjectList.json", {
-          method: "POST",
-          headers: {
-            'Content-Type': 'application/json; charset=UTF-8'
-          },
-          body: JSON.stringify({
-            agancyId: 'agency1',
-          }),
-        }).then((response) => response.json()).then((data) => {
-          const rowData = data;
-          console.log(data);
-          setSubjectMyList(rowData)
-        }).catch((error) => {
-          console.log('getSubjectMySelect() /user/selectMySubjectList.json error : ', error);
-        });
+    fetch("/user/selectMyUserList.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        agency_id: 'agency1',
+        user_code: '4',
+      }),
+    }).then((response) => response.json()).then((data) => {
+      const rowData = data;
+      console.log(data);
+      setSubjectMyList(rowData)
+      setMyUserTotal(rowData.length)
+    }).catch((error) => {
+      console.log('getSubjectMySelect() /user/selectMyUserList.json error : ', error);
+    });
   };
 
   const navigate = useNavigate();
@@ -181,7 +225,7 @@
     "생년월일",
     "주소",
     "보호자",
-    
+
   ];
   const key1 = [
     // "No", "name", "Id", "call", "gender", "birth", "address", "management"
@@ -339,12 +383,15 @@
       id: 1,
       title: "내가 관리하는 대상자",
       description: (
-        
+
         <Table
           className={"protector-user"}
           head={thead1}
           contents={subjectMyList}
           contentKey={key1}
+          view={"mySenior"}
+          offset={offset}
+          limit={limit}
         />
       ),
     },
@@ -357,6 +404,9 @@
           head={thead2}
           contents={subjectList}
           contentKey={key2}
+          view={"allSenior"}
+          offset={offset}
+          limit={limit}
         />
       ),
     },
@@ -364,6 +414,7 @@
 
   const [index, setIndex] = React.useState(1);
 
+  
   React.useEffect(() => {
     getSelectSubjectList();
     getSelectMySubjectList();
@@ -429,7 +480,7 @@
       </Modal>
       <Modal open={modalOpen2} close={closeModal2} header="담당자 배정">
         <div className="board-wrap">
-          <SubTitle explanation={"담당자 선택"} className="margin-bottom"/>
+          <SubTitle explanation={"담당자 선택"} className="margin-bottom" />
           <div className="flex-start protectorlist margin-bottom5">
             <input type="text" list="protectorlist" />
             <datalist id="protectorlist">
@@ -456,9 +507,9 @@
       </Modal>
       <Modal open={modalOpen3} close={closeModal3} header="대상자 등록">
         <div className="board-wrap">
-          <SubTitle explanation={"회원 등록 시 ID는 연락처, 패스워드는 생년월일 8자리입니다."} className="margin-bottom"/>
+          <SubTitle explanation={"회원 등록 시 ID는 연락처, 패스워드는 생년월일 8자리입니다."} className="margin-bottom" />
           <table className="margin-bottom2 senior-insert">
-          {/* <tr>
+            {/* <tr>
               <th>대상자등록번호</th>
               <td colSpan={3} className="flex">
                 <input type="text" placeholder="생성하기 버튼 클릭 시 자동으로 생성됩니다."/>
@@ -486,7 +537,7 @@
               </td>
             </tr>
             <tr>
-            <th>생년월일</th>
+              <th>생년월일</th>
               <td>
                 <div className="flex">
                   <input type='date' value={brith} onChange={handleBrithday} />
@@ -496,7 +547,7 @@
               <td>
               <input type="text" />
               </td> */}
-              
+
             </tr>
             <tr>
               <th>연락처</th>
@@ -513,10 +564,10 @@
             <tr>
               <th>필요 복약</th>
               <td>
-              <div className="flex">
-                  <input type="checkbox" name="medicationSelect" checked={medicineM} onClick={(e) => {handleMedicineM(e)}} /><label for="medicationTime">아침</label>
-                  <input type="checkbox" name="medicationSelect" checked={medicineL} onClick={(e) => {handleMedicineL(e)}}/><label for="medicationTime">점심</label>
-                  <input type="checkbox" name="medicationSelect" checked={medicineD} onClick={(e) => {handleMedicineD(e)}}/><label for="medicationTime">저녁</label>
+                <div className="flex">
+                  <input type="checkbox" name="medicationSelect" checked={medicineM} onClick={(e) => { handleMedicineM(e) }} /><label for="medicationTime">아침</label>
+                  <input type="checkbox" name="medicationSelect" checked={medicineL} onClick={(e) => { handleMedicineL(e) }} /><label for="medicationTime">점심</label>
+                  <input type="checkbox" name="medicationSelect" checked={medicineD} onClick={(e) => { handleMedicineD(e) }} /><label for="medicationTime">저녁</label>
                 </div>
               </td>
             </tr>
@@ -532,7 +583,7 @@
                 <textarea className="note" cols="30" rows="2" value={note} onChange={handleNote}></textarea>
               </td>
             </tr>
-            
+
             {/* <tr>
               <th>기저질환</th>
               <td colSpan={3}>
@@ -540,15 +591,15 @@
               </td>
             </tr> */}
           </table>
-            <div className="btn-wrap flex-center">
-              <Button
-                className={"btn-small green-btn"}
-                btnName={"등록"}
-                onClick={() => {
-                  seniorInsert(userName,gender,brith, telNum, homeAddress, note, medicineM, medicineL, medicineD)
-                }}
-              />
-            </div>
+          <div className="btn-wrap flex-center">
+            <Button
+              className={"btn-small green-btn"}
+              btnName={"등록"}
+              onClick={() => {
+                InsertSenior(userName, gender, brith, telNum, homeAddress, note, medicineM, medicineL, medicineD)
+              }}
+            />
+          </div>
         </div>
       </Modal>
 
@@ -584,7 +635,7 @@
             />
           </div>
           <div className="btn-wrap flex-end">
-            <Button className={"btn-small green-btn"} btnName={"등록"} onClick={openModal3}/>
+            <Button className={"btn-small green-btn"} btnName={"등록"} onClick={openModal3} />
           </div>
           <ul className="tab-content">
             {data
@@ -593,6 +644,9 @@
                 <li>{item.description}</li>
               ))}
           </ul>
+          <div>
+            <Pagination total={data.id == 1 ? myUserTotal:userTotal} limit={limit} page={page} setPage={setPage} />
+          </div>
         </div>
       </div>
     </main>
Add a comment
List