Ver código fonte

[진료관리 상세] 의료진 메모 수정 버튼 추가.

sjpark 4 anos atrás
pai
commit
54d7bcb5bf

+ 12 - 0
src/main/java/com/lemon/lifecenter/dto/PatientMemoDTO.java

@@ -1,5 +1,9 @@
 package com.lemon.lifecenter.dto;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+
 public class PatientMemoDTO {
 
 	private int patientIdx;
@@ -52,4 +56,12 @@ public class PatientMemoDTO {
 	public void setLimitMax(int limitMax) {
 		this.limitMax = limitMax;
 	}
+	public boolean getCanModify() {
+		LocalDateTime today = LocalDateTime.now();
+		LocalDateTime targetDay = LocalDateTime.parse(this.createDate, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
+
+		long hours = ChronoUnit.HOURS.between(targetDay, today);
+
+		return hours < 24;
+	}
 }

+ 7 - 2
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -547,8 +547,13 @@ function retrieveMemoData() {
 				html = "";
 				contents = datas.forEach(function(d) {
 					html += "<tr>";
-					html += "<td>" + gridDateFormatter(d.createDate) + "</td>";
-					html += "<td><pre>" + d.contents + "</pre></td>";
+          html += "<td>" + gridDateFormatter(d.createDate) + "</td>";
+          if (d.canModify) {
+            html += "<td><pre class='contentsEdit'>" + d.contents + "</pre></td>";
+          }
+          else {
+            html += "<td><pre>" + d.contents + "</pre></td>";
+          }
 					html += "<td>" + d.recordedByName + "</td>";
 					html += "</tr>";
 				});

+ 29 - 1
src/main/webapp/resources/css/common/classic.css

@@ -179,4 +179,32 @@ div.daterangepicker div.calendar-time{margin-top:10px !important;margin:10px !im
 div.daterangepicker div.calendar-time>select{height:30px !important;font-size:14px !important;width:28% !important;min-width:50px;}
 div.daterangepicker select.monthselect,
 div.daterangepicker select.yearselect{height:30px !important;font-size:14px !important;border:1px solid #d0d0d0 !important;}
-div.daterangepicker select.ampmselect{float:left;margin:0 10px 0 0 !important;}
+div.daterangepicker select.ampmselect{float:left;margin:0 10px 0 0 !important;}
+
+/* 의료진 메모 수정 추가되는 CSS */
+.contentsEdit {
+  position: relative;
+  padding-right: 20px;
+  cursor: pointer;
+  z-index: 1;
+}
+.contentsEdit:after {
+  content: "\F3EA";
+  font-family: 'Material Design Icons';
+  position: absolute;
+  top: 50%;
+  right: 0px;
+  font-size: 20px;
+  line-height: 1;
+  color: #999999;
+  transform: translateY(-50%);
+  -webkit-transform: translateY(-50%);
+  -moz-transform: translateY(-50%);
+  -ms-transform: translateY(-50%);
+  -o-transform: translateY(-50%);
+}
+.contentsEdit:hover,
+.contentsEdit:hover:after {
+  color: #47bac1;
+}
+/* 의료진 메모 수정 추가되는 CSS */