Quellcode durchsuchen

病案首页表格

zhouna vor 5 Jahren
Ursprung
Commit
a9128155ec
3 geänderte Dateien mit 62 neuen und 53 gelöschten Zeilen
  1. 45 43
      src/css/qcScore.less
  2. 9 9
      src/html/qcScore.html
  3. 8 1
      src/js/qcScore.js

+ 45 - 43
src/css/qcScore.less

@@ -100,8 +100,52 @@
       height: 100%;
       overflow-y: auto;
     }
+    .info-table{
+      margin: 0 0 15px;
+    }
+    table{
+      width: 100%;
+      border:1px @tableBorderColor solid;
+    }
+    .embed-table{
+      border:1px @tableBorderColor solid;
+      &>tbody>tr:first-child>td{
+        padding: 0;
+        border:none;
+        &>table td{
+          border:1px @tableBorderColor solid;
+          line-height: 20px;
+          padding: 7px 8px;
+        }
+      }
+      .table-tip{
+        text-align: left;
+      }
+    }
+    th{
+      table{
+        border:none;
+      }
+      border:1px @tableBorderColor solid;
+      background: @thBgColor;
+      line-height: 20px;
+      padding: 7px 8px;
+    }
+    td{
+      text-align: center;
+      border:1px @tableBorderColor solid;
+      padding:7px  8px;
+      height: 20px;
+      table,td{
+        border:none;
+      }
+    }
     .info-item{
       border-bottom: 1px @borderColor solid;
+      &.no-border{
+        border-bottom: none;
+        margin-bottom: 0;
+      }
       margin-bottom: 10px;
       .info-title{
         font-weight: bold;
@@ -111,49 +155,7 @@
     .cont{
       display: inline-block;
       min-width: 33%;
-      margin-bottom: 15px;/*
-      .table-tip{
-        line-height: 20px;
-        padding: 7px 8px;
-        border:1px @tableBorderColor solid;
-      }*/
-      table{
-        width: 100%;
-        border:1px @tableBorderColor solid;
-      }
-      .embed-table{
-        border:1px @tableBorderColor solid;
-        &>tbody>tr:first-child>td{
-          padding: 0;
-          border:none;
-          &>table td{
-            border:1px @tableBorderColor solid;
-            line-height: 20px;
-            padding: 7px 8px;
-          }
-        }
-        .table-tip{
-          text-align: left;
-        }
-      }
-      th{
-        table{
-          border:none;
-        }
-        border:1px @tableBorderColor solid;
-        background: @thBgColor;
-        line-height: 20px;
-        padding: 7px 8px;
-      }
-      td{
-        text-align: center;
-        border:1px @tableBorderColor solid;
-        padding:7px  8px;
-        height: 20px;
-        table,td{
-          border:none;
-        }
-      }
+      margin-bottom: 15px;
       span{
         line-height: 20px;
         vertical-align: middle;

+ 9 - 9
src/html/qcScore.html

@@ -38,8 +38,8 @@
                              <th>疾病编码</th>
                              <th>入院病情</th>
                          </tr>
-                         {{each(i,v) JSON.parse(text)}}
-                         {{if i<(JSON.parse(text).length/2)}}
+                         {{each(i,v) data}}
+                         {{if i<(data.length/2)}}
                          <tr>
                              <td>${诊断名称}</td>
                              <td>${诊断编码}</td>
@@ -56,8 +56,8 @@
                              <th>疾病编码</th>
                              <th>入院病情</th>
                          </tr>
-                         {{each(i,v) JSON.parse(text)}}
-                         {{if i>=(JSON.parse(text).length/2)}}
+                         {{each(i,v) data}}
+                         {{if i>=(data.length/2)}}
                          <tr>
                              <td>${诊断名称}</td>
                              <td>${诊断编码}</td>
@@ -65,7 +65,7 @@
                          </tr>
                          {{/if}}
                          {{/each}}
-                         {{if (JSON.parse(text).length)%2===1}}
+                         {{if (data.length)%2===1}}
                          <tr>
                              <td></td>
                              <td></td>
@@ -92,7 +92,7 @@
              <th rowspan="2">麻醉医师</th>
          </tr>
          <tr><th>术者</th><th>I助</th><th>II助</th></tr>
-         {{each JSON.parse(text)}}
+         {{each data}}
          <tr>
              <td>${手术编码}</td>
              <td>${手术日期}</td>
@@ -665,7 +665,7 @@
                         <span>${实际住院天数}天</span>
                     </div>
                 </div>
-                <div class="info-item">
+                <div class="info-item no-border">
                     <div class="cont">
                         <span class="label">门(急)诊诊断:</span>
                         <span>${门急诊诊断}</span>
@@ -675,7 +675,7 @@
                         <span>${门急诊诊断编码}</span>
                     </div>
                 </div>
-                <div class="info-table">------表格</div>
+                <div class="info-table" id="diagTable"></div>
                 <div class="info-item">
                     <div class="cont">
                         <span class="label">损伤、中毒的外部原因:</span>
@@ -778,7 +778,7 @@
                         <span>${质控日期}</span>
                     </div>
                 </div>
-                <div class="info-table">------表格</div>
+                <div class="info-table" id="surgeryTable"></div>
                 <div class="info-item">
                     <div class="cont">
                         <span class="label">离院方式:</span>

+ 8 - 1
src/js/qcScore.js

@@ -77,6 +77,14 @@ function initContent(data){
     info=formatInfoData(k,obj[k][0]);
     nameMap[k]&&$(nameMap[k]).tmpl(info).appendTo("#contentInfo");
   }
+  if(obj["病案首页"][0]["出院诊断"]){
+    const diag = JSON.parse(obj["病案首页"][0]["出院诊断"]);
+    $("#tableTmpl").tmpl({k:"出院诊断",data:diag}).appendTo("#diagTable");
+  }
+  if(obj["病案首页"][0]["手术信息"]){
+    const diag = JSON.parse(obj["病案首页"][0]["手术信息"]);
+    $("#tableTmpl").tmpl({k:"手术信息",data:diag}).appendTo("#surgeryTable");
+  }
   $(".content-item[code="+global_activeTab+"]").show();
   console.log(obj)
 }
@@ -87,7 +95,6 @@ function formatInfoData(k,data){
     name=i.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g,"").replace(/^[0-9]+/,"a");    //过滤key中存在的特殊符号,模板会渲染不出来且不报错
     obj[name]=data[i]||"";
   }
-  console.log(data["出院诊断"]);
   return Object.assign({title:k},obj);
 }