Browse Source

[phr] 진료관리 목록 검색 기능 추가.

sjpark 4 years ago
parent
commit
7e0e9a5d49

+ 2 - 4
src/main/java/com/lemon/lifecenter/controller/ClinicController.java

@@ -38,8 +38,7 @@ public class ClinicController extends LifeCenterController {
     public ModelAndView clinicState(
     		HttpServletRequest request,
     		@RequestParam(value="page", required=true, defaultValue="1") int page,
-    		@RequestParam(value="wardNumber", required=false, defaultValue="") String wardNumber,
-    		@RequestParam(value="patientName", required=false, defaultValue="") String patientName) {
+    		@RequestParam(value="searchText", required=false, defaultValue="") String searchText) {
     	
     	System.err.println( "page : " + page );
     	
@@ -50,8 +49,7 @@ public class ClinicController extends LifeCenterController {
         dto.setLimit( ( Integer.valueOf( page ) - 1 ) * pageSize );
         dto.setLimitMax( pageSize );
         dto.setCenterCode(centerCode);
-        dto.setWardNumber(wardNumber);
-        dto.setPatientName(patientName);
+        dto.setSearchText(searchText);
         
         int total = clinicService.selectPHRLatestCount(dto);
         List<PatientPHRLatestDTO> result = new ArrayList<PatientPHRLatestDTO>();

+ 9 - 2
src/main/webapp/WEB-INF/jsp/clinic/state.jsp

@@ -4,6 +4,13 @@
 <%@ page language="java" contentType="text/html; charset=UTF-8"
     pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script>
+function searchPatients() {
+	const keyword = $("#searchKeyword").val();
+
+	location.href = "./state?searchText="+keyword;
+}
+</script>
 </head>
 
 <body>
@@ -56,8 +63,8 @@
                                                     <i class="fas fa-pause"></i>
                                                 </button>
                                             </label>
-                                            <input type="text" class="form-control w150" id="inputPassword4" placeholder="호실 or 환자명">
-                                            <button class="btn btn-primary">검색</button>
+                                            <input type="text" class="form-control w150" id="searchKeyword" placeholder="호실 or 환자명" onkeypress="searchPatients()">
+                                            <button class="btn btn-primary" onclick="searchPatients()">검색</button>
                                         </div>
                                     </div>
                                 </div>