Explorar el Código

生日改年龄

zhouna hace 5 años
padre
commit
62638f8edd
Se han modificado 2 ficheros con 10 adiciones y 4 borrados
  1. 3 3
      src/html/qcScore.html
  2. 7 1
      src/js/qcScore.js

+ 3 - 3
src/html/qcScore.html

@@ -22,10 +22,10 @@
         <span>住院号:${fileCode}</span>
         <span>姓名:${name}</span>
         <span>性别:${sex}</span>
-        <span>出生日期:${birthday.substr(0,10)}</span>
+        <span>年龄:${age}</span>
         <span>科室:${behDeptName}</span>
-        <span>级:${level}</span>
-        <span>分:${scoreRes}</span>
+        <span>质控等级:${level}</span>
+        <span>质控得分:${scoreRes}</span>
     </script>
     <script type="text/html" id="contentTmpl">
         <div class="content-item" code="${title}">

+ 7 - 1
src/js/qcScore.js

@@ -68,7 +68,10 @@ function getRecordDetail(){
 
 //填充患者信息
 function initPatientInfo(data){
-  $("#infoTmpl").tmpl(data).appendTo("#patientInfo");
+  const date = data.birthday.substr(0,10);
+  const age=new Date(date).getTime()/(365*24*60*60*1000);
+  const obj=Object.assign({},data,{age:Math.floor(-age)});
+  $("#infoTmpl").tmpl(obj).appendTo("#patientInfo");
 }
 //显示病例模块明细
 function initContent(data){
@@ -157,6 +160,9 @@ function showModal(flag,code,i){
       }
     });
     $("#delModal .confirm").click(function(){
+      if($(".edit-box .warning").is(":visible")){
+        return;
+      }
       const obj = Object.assign({},info,{msg:$("#delModal #qcMsg").val(),score:$("#delModal #qcScore").val()});
       editScore(obj);
     });