ソースを参照

문진작성 수정 vaildate

huiwon.seo 4 年 前
コミット
49f7b3e968

+ 2 - 2
src/main/webapp/WEB-INF/jsp/mobile/history/serveyhistory.jsp

@@ -8,7 +8,7 @@
         <div class="container">
             <div class="header">
                 <div class="previous">
-                    <a href="./history">이전</a>
+                    <a href="javascript:;" onclick="history.back();">이전</a>
                 </div>
                 <div class="title">
                     문진내역보기
@@ -166,7 +166,7 @@
             <div class="btn_group">
                 <ul>
                     <li>
-                        <a href="./history" class="confirm"><span class="check">확인</span></a>
+                        <button onclick="history.back();" class="confirm"><span class="check">확인</span></button>
                     </li>
                 </ul>
             </div>

+ 111 - 17
src/main/webapp/WEB-INF/jsp/mobile/servey/servey.jsp

@@ -6,10 +6,12 @@
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
 
 <script type="text/javascript">
-
 $( function(){
-    patientNewInit()
-    setEventHandler()
+    patientNewInit();
+    setEventHandler();
+    basalCheck();
+    drugYnCheck();
+    pregnancyStatusCheck();
     
     $( ".select-date" ).on( "change", function(){
         var $this = $( this );
@@ -24,8 +26,100 @@ $( function(){
         
         wrap.find( "input.error-box" ).val( dateYear  + "-" + dateMonth  + "-" + dateDay );
     });
+    
+    $( "input[name='basalDiseaseYn']" ).on( "change", function(){
+        basalDiseaseYn();
+    });
+    
+    $( "input[name='drugYn']" ).on( "change", function(){
+        drugYnCheck();
+    });
+    
+    $( "input[name='pregnancyStatus']" ).on( "change", function(){
+        pregnancyStatusCheck();
+    });
+    
+    $( "#patientForm" ).validate({
+        rules: {
+            hospitalizationDate : {
+                date : true
+            },
+            confirmationDate : {
+                date : true
+            },
+            symptomStartDate : {
+                date : true
+            },
+            gender : {
+                required :true
+            },
+            jumin : {
+                date : true
+            },
+            basalDiseaseYn : {
+                required : true
+            },
+            drugYn : {
+                required : true
+            },
+            pregnancyStatus : {
+            	required : true
+            }
+        },
+        messages : {
+            gender: "성별을 선택해주세요",
+            hospitalizationDate : {
+                required : "입원일을 선택해주세요",
+                date : "입원일을 모두 선택해주세요  [년-월-일]"
+            },
+            confirmationDate : {
+                required : "코로나 19 확진일을 선택해주세요",
+                date : "코로나 19 확진일을 선택해주세요 [년-월-일]"
+            },
+            symptomStartDate : {
+                required : "증상 시작일을 선택하세요",
+                date : "증상 시작일을 선택하세요 [년-월-일]"
+            },
+            jumin : {
+                required : "생년월일을 선택하세요",
+                date :"생년월일을 선택하세요 [년-월-일]"
+            },
+            basalDiseaseYn : "기저질환 여부를 선택해주세요"
+        },
+        errorPlacement: function(error, element) {
+            if (element.attr("type") == "radio") {
+                error.insertBefore(element);
+            } else {
+                error.insertAfter(element);
+            }
+        },
+        submitHandler: function(form) {
+            form.submit();
+        }
+    });
 });
 
+function basalCheck(){
+    if( $( "#diseaseY" ).is( ":checked" ) ) {
+        $( "ul.basalDisease" ).find( "input" ).prop( "disabled", false );
+    } else {
+        $( "ul.basalDisease" ).find( "input" ).prop( "disabled", true ).prop( "checked", false );
+    }
+}
+function drugYnCheck(){
+    if( $( "#drugYn1" ).is( ":checked" ) ) {
+        $( "input[name='drugContent']" ).prop( "readonly", false );
+    } else {
+        $( "input[name='drugContent']" ).prop( "readonly", true ).val( "" );
+    }
+}
+function pregnancyStatusCheck(){
+    if( $( "#pregnancyStatus1" ).is( ":checked" ) ) {
+        $( "input[name='pregnancyWeek']" ).prop( "readonly", false );
+    } else {
+        $( "input[name='pregnancyWeek']" ).prop( "readonly", true ).val( "" );
+    }
+}
 function patientNewInit() {
     $( "ul.basalDisease input" ).prop( "disabled", true );
     
@@ -202,11 +296,11 @@ function setEventHandler() {
                         <div class="list">
                             <ul class="circle half">
                                 <li>
-                                    <input type="radio" id="gender1" name="gender" value="M" />
+                                    <input type="radio" id="gender1" name="gender" value="M" required>
                                     <label for="gender1"><span></span>남</label>
                                 </li>
                                 <li>
-                                    <input type="radio" id="gender2" name="gender" value="F" />
+                                    <input type="radio" id="gender2" name="gender" value="F" required>
                                     <label for="gender2"><span></span>여</label>
                                 </li>
                             </ul>
@@ -392,7 +486,7 @@ function setEventHandler() {
                                 <li class="full">
                                     <input type="checkbox" id="symptomEtc" name="etcCheckSymptom" value="Y" />
                                     <label for="symptomEtc"><span></span>기타</label>
-                                    <div class="comment">
+                                    <div class="comment label-readonly-check">
                                         <input type="text" name="etcContentSymptom" placeholder="기타 증상 및 암명/수술명을 입력하세요.">
                                     </div>
                                 </li>
@@ -405,10 +499,10 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                우측 ( <input type="text" name="feverRight"> ) ℃
+                                좌측 ( <input type="text" name="feverLeft" required> ) ℃
                             </label>
                             <label class="inline">
-                                좌측 ( <input type="text" name="feverLeft"> ) ℃
+                                우측 ( <input type="text" name="feverRight" required> ) ℃
                             </label>
                         </div>
                     </div>
@@ -418,7 +512,7 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                ( <input type="text" name="pulseRate"> ) 회/분
+                                ( <input type="text" name="pulseRate" required> ) 회/분
                             </label>
                         </div>
                     </div>
@@ -428,7 +522,7 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                ( <input type="text" name="respirationRate"> ) 회/분
+                                ( <input type="text" name="respirationRate" required> ) 회/분
                             </label>
                         </div>
                     </div>
@@ -438,10 +532,10 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                수축기( <input type="text" name="bloodPressureLevelCon"> )mmHg
+                                수축기( <input type="text" name="bloodPressureLevelCon" required> )mmHg
                             </label>
                             <label class="inline">
-                                이완기( <input type="text" name="bloodPressureLevelRel"> )mmHg
+                                이완기( <input type="text" name="bloodPressureLevelRel" required> )mmHg
                             </label>
                         </div>
                     </div>
@@ -451,7 +545,7 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                ( <input type="text" name="oxygenSaturation"> )%
+                                ( <input type="text" name="oxygenSaturation" required> )%
                             </label>
                         </div>
                     </div>
@@ -462,11 +556,11 @@ function setEventHandler() {
                         <div class="list">
                             <ul class="circle half">
                                 <li>
-                                    <input type="radio" id="drugYn1" name="drugYn" value="Y" />
+                                    <input type="radio" id="drugYn1" name="drugYn" value="Y">
                                     <label for="drugYn1"><span></span>예</label>
                                 </li>
                                 <li>
-                                    <input type="radio" id="drugYn2" name="drugYn" value="N" />
+                                    <input type="radio" id="drugYn2" name="drugYn" value="N">
                                     <label for="drugYn2"><span></span>아니오</label>
                                 </li>
                             </ul>
@@ -479,7 +573,7 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                약명 ( <input type="text" name="drugContent"> )
+                                약명 ( <input type="text" name="drugContent" style="max-width:120px;"> )
                             </label>
                         </div>
                     </div>
@@ -507,7 +601,7 @@ function setEventHandler() {
                         </div>
                         <div class="data">
                             <label class="inline">
-                                임신 주차 ( <input type="text" name="pregnancyWeek"> ) 주
+                                임신 주차 ( <input type="text" name="pregnancyWeek" onkeypress="onlyNumber();"> ) 주
                             </label>
                         </div>
                     </div>

+ 1 - 1
src/main/webapp/resources/css/mobile/style.css

@@ -146,7 +146,7 @@ caption {text-align:left;}
 .list input[type="checkbox"] + label { font-size: 14px; letter-spacing: -1px; }
 .list input[type="checkbox"] + label span { display:inline-block; width:19px; height:19px; margin:-2px 10px 0 0; vertical-align:middle; background-image:url('../../images/mobile/check_circle_icon.png'); background-repeat: no-repeat; background-position: center; background-size: 19px; cursor:pointer; }
 .list input[type="checkbox"]:checked + label span {  background-image:url('../../images/mobile/check_circle_icon_check.png'); background-repeat: no-repeat; background-position: center; background-size: 19px; }
-input[type="radio"] { display:none; }
+input[type="radio"] {height:0;width:0;margin:0;padding:0;}
 input[type="radio"] + label { font-size: 14px; letter-spacing: -1px; }
 input[type="radio"] + label span { display:inline-block; width:19px; height:19px; margin:-2px 10px 0 0; vertical-align:middle; background-image:url('../../images/mobile/check_circle_icon.png'); background-repeat: no-repeat; background-position: center; background-size: 19px; cursor:pointer; }
 input[type="radio"]:checked + label span {  background-image:url('../../images/mobile/check_circle_icon_check.png'); background-repeat: no-repeat; background-position: center; background-size: 19px; }

ファイルの差分が大きいため隠しています
+ 29 - 1
src/main/webapp/resources/js/mobile/common.js