Bläddra i källkod

详情页中非模板页空状态

zhouna 5 år sedan
förälder
incheckning
49d3cf145b
4 ändrade filer med 76 tillägg och 24 borttagningar
  1. 19 6
      src/css/qcScore.less
  2. 48 11
      src/html/qcScore.html
  3. 7 5
      src/js/qcScore.js
  4. 2 2
      src/js/utils.js

+ 19 - 6
src/css/qcScore.less

@@ -14,9 +14,9 @@
 .patient-info{
   /*height: 50px;*/
   line-height: 50px;
-  border-bottom: 1px #E2E5EF solid;
+  border-bottom: 10px #F5F6FA solid;
   text-align: center;
-  margin-bottom: 20px;
+  /*margin-bottom: 20px;*/
   span{
     color: #333;
     margin-right: 40px;
@@ -170,6 +170,7 @@
     height: 100%;
     position: relative;
     overflow-y: auto;
+    border-right: 10px #F5F6FA solid;
   }
   .content-item{
     display: none;
@@ -522,9 +523,9 @@
 
 /********缺陷总览*********/
 .flaw-table{
-  height: 100%;
+  height: 97%;
   overflow-y: auto;
-  margin: 0 30px 0 20px;
+  /*margin: 0 30px 0 20px;*/
   .slide-up{
     cursor: pointer;
     color: @activeColor;
@@ -540,12 +541,24 @@
       content: "+";
     }
   }
-  table{
+  .page-item{
     display: none;
+    h2{
+      height: 44px;
+      line-height: 44px;
+      border-bottom: 1px @tableBorderColor solid;
+      font-size: 16px;
+      font-weight: normal;
+      margin-bottom: 20px;
+      text-indent: 20px;
+    }
+  }
+  table{
     width: 100%;
     border:1px solid #E2E5EF;
     border-collapse: collapse;/*关键代码*/
-    margin-bottom: 40px;
+    /*margin-bottom: 40px;*/
+    margin: 0 30px 40px 20px;
     thead{
       background: #EFF0F9;
 

+ 48 - 11
src/html/qcScore.html

@@ -181,22 +181,24 @@
             <p class="warning"><span></span><span class="red">支持≥0的数字输入,最多保留小数点后1位~</span></p>
         </div>
     </script>
-    <script type="text/html" id="flawTotalList">
+    <!--<script type="text/html" id="flawTotalList">
         {{if Object.keys(data).length===0}}
             <div class="empty">
-                <img src="../images/empty.png" alt="空"/>
-                <p>暂无数据~</p>
+                <img src="../images/empty1.png" alt="空"/>
+                <p>暂无信息~</p>
             </div>
         {{else}}
-        <table code="缺陷总览">
-            <thead>
+        <div class="page-item" code="缺陷总览">
+            <h2 class="title">${title}</h2>
+            <table>
+                <thead>
                 <tr>
                     <th width="250">来源</th>
                     <th>缺陷详情</th>
                     <th width="150">扣分</th>
                 </tr>
-            </thead>
-            <tbody>
+                </thead>
+                <tbody>
                 {{each(i,val) data}}
                 <tr><td colspan="3" class="slide-up">${i}</td></tr>
                 {{each val}}
@@ -207,12 +209,44 @@
                 </tr>
                 {{/each}}
                 {{/each}}
-            </tbody>
-        </table>
+                </tbody>
+            </table>
+        </div>
+
         {{/if}}
-    </script>
+    </script>-->
     <script type="text/html" id="appointBookTmpl">
-        <table code="${title}">
+        <div class="page-item" code="${title}">
+            <h2 class="title" code="${title}">${title}</h2>
+            {{if !data}}
+            <div class="empty">
+                <img src="../images/empty1.png" alt="空"/>
+                <p>暂无信息~</p>
+            </div>
+            {{else}}
+            {{if title==='缺陷总览'}}
+            <table>
+                <thead>
+                <tr>
+                    <th width="250">来源</th>
+                    <th>缺陷详情</th>
+                    <th width="150">扣分</th>
+                </tr>
+                </thead>
+                <tbody>
+                {{each(i,val) data}}
+                <tr><td colspan="3" class="slide-up">${i}</td></tr>
+                {{each val}}
+                <tr code="${i}">
+                    <td style="text-indent: 14px;">${modelName}</td>
+                    <td>${standardMsg}</td>
+                    <td class="red">${score}</td>
+                </tr>
+                {{/each}}
+                {{/each}}
+                </tbody>
+            </table>
+            {{else}}<table code="${title}">
             <thead>
             <tr>
                 <th width="100" align="center">序号</th>
@@ -228,6 +262,9 @@
             {{/each}}
             </tbody>
         </table>
+            {{/if}}
+            {{/if}}
+        </div>
     </script>
 </head>
 <body>

+ 7 - 5
src/js/qcScore.js

@@ -53,8 +53,8 @@ function initMenu(data){
   $(".page").on("click",function(){
     const title = $(this).attr("code");
     if(title==="缺陷总览"||title==="谈话告知书"||title==="知情同意书"){
-      $(".flaw-table table").hide();
-      $(".flaw-table,.flaw-table table[code="+title+"]").show();
+      $(".flaw-table .page-item").hide();
+      $(".flaw-table,.flaw-table .page-item[code="+title+"]").show();
     }else{
       $(".flaw-table").hide();
     }
@@ -115,9 +115,10 @@ function initContent(data){
   const obj = JSON.parse(data);
   let info=[];
   let hml='',moduleId='';
+  formatSpecPage(obj["谈话告知书"],"谈话告知书");
+  formatSpecPage(obj["知情同意书"],"知情同意书");
   for(let k in obj){
     if(k==="谈话告知书"||k==="知情同意书"){
-      formatSpecPage(obj[k],k);
       continue;
     }
     for(let i in obj[k]){
@@ -152,8 +153,9 @@ function formatInfoData(k,data){
   }
 
 function initList(data){
-  $("#flawTotalList").tmpl({data:data}).appendTo(".flaw-table");
-  $(".flaw-table table[code="+global_activeTab+"]").show();
+  //$("#flawTotalList").tmpl({title:"缺陷总览",data:data}).appendTo(".flaw-table");
+  formatSpecPage(data,"缺陷总览");
+  $(".flaw-table .page-item[code="+global_activeTab+"]").show();
   $(".slide-up").off("click").on("click",function(){
     const name = $(this).text();
     $("tr[code='"+name+"']").slideToggle();

+ 2 - 2
src/js/utils.js

@@ -171,8 +171,8 @@ $(".modal .close").click(function(){
 //计算容器高度
 function setBoxHeight(){
   const ht=window.innerHeight;
-  $(".content-box,.flaw-table").height((ht-75)+'px');
-  $(".content-ht").height((ht-140)+"px");
+  $(".content-box,.flaw-table").height((ht-55)+'px');
+  $(".content-ht").height((ht-120)+"px");
 }
 setBoxHeight();
 $(window).resize(function(){