Przeglądaj źródła

操作弹窗、样式

zhouna 5 lat temu
rodzic
commit
0fedd6cfe0
5 zmienionych plików z 112 dodań i 25 usunięć
  1. 34 1
      src/css/qcScore.less
  2. 8 6
      src/css/reset.less
  3. 20 5
      src/html/qcScore.html
  4. 48 11
      src/js/qcScore.js
  5. 2 2
      src/js/utils.js

+ 34 - 1
src/css/qcScore.less

@@ -5,16 +5,19 @@
 .patient-info{
   height: 50px;
   line-height: 50px;
-  text-indent: 50px;
+  margin-top: 10px;
+  text-align: center;
   span{
     margin-right: 40px;
   }
 }
 .sub-menu{
+  position: relative;
   width: @menuWt;
   height: 100%;
   float: left;
   overflow-y: auto;
+  border-right: 1px @frameBdColor solid;
   .active{
     color: @activeColor;
     background: @activeBg;
@@ -51,6 +54,16 @@
     text-indent: 15px;
     cursor: pointer;
   }
+  .copy-right{
+    position: fixed;
+    bottom: 0px;
+    width: @menuWt+(-18px);
+    text-align: center;
+    font-size:12px;
+    color: #aaa;
+    background: #fff;
+    padding: 10px 0 20px;
+  }
 }
 .tab-container{
   margin-left: 310px;
@@ -121,6 +134,7 @@
       overflow-y: auto;
     }
     .flaw-item{
+      display: none;
       margin: 0 20px 10px 30px ;
       border-bottom:1px #E2E5EF solid;
       padding-bottom: 10px;
@@ -132,4 +146,23 @@
   .oper{
     float: right;
   }
+}
+.edit-box{
+  p{
+    margin-bottom: 10px;
+  }
+  input{
+    border:1px @borderColor solid;
+    width: 300px;
+    height: 38px;
+    text-indent: 10px;
+    line-height: 38px;
+    border-radius:2px;
+  }
+  span{
+    display: inline-block;
+    width: 70px;
+    margin-right: 20px;
+    text-align: right;
+  }
 }

+ 8 - 6
src/css/reset.less

@@ -97,6 +97,7 @@ textarea {
 @activeColor:#5A8EEE;   /*菜单项选中颜色*/
 @activeBg:#EEF4FF;   /*菜单项选中背景*/
 @borderColor:#E2E5EF; /**边框颜色**/
+@frameBdColor:#F0F0F0;/***框架边框颜色**/
 @warnColor:#FF4D4F;  /**重点红色**/
 
 /****弹窗样式*****/
@@ -117,9 +118,10 @@ textarea {
     position: absolute;
     top:50%;
     left: 50%;
-    width: 400px;
-    height: 255px;
-    margin-top:-125px;
+    /*width: 400px;
+    height: 255px;*/
+    padding-bottom: 30px;
+    margin-top:-180px;
     margin-left: -200px;
     background: #fff;
     border-radius:4px;
@@ -136,12 +138,12 @@ textarea {
     }
   }
   .modal-body{
-    padding:15px;
+    padding: 30px 65px 40px;
   }
   .modal-footer{
-    position: absolute;
+    /*position: absolute;
     bottom: 20px;
-    width: 100%;
+    width: 100%;*/
     height: 50px;
     line-height: 50px;
     text-align: center;

+ 20 - 5
src/html/qcScore.html

@@ -42,10 +42,14 @@
         </div>
     </script>
     <script type="text/html" id="flawTmpl">
-        <div class="flaw-item">
+        <div class="flaw-item" code="${modelName}">
             <div class="title">${msg}</div>
-            <div class="opers" code="${casesEntryId}">
+            <div class="opers">
+                {{if score===0}}
+                <span class="red">warn</span>
+                {{else}}
                 <span class="red">-${score}</span>
+                {{/if}}
                 <div class="oper">
                     <a class="edit-flaw blue" code="${id}" href="javascript:void(0);">修改</a>
                     <a class="del-flaw red" code="${id}" href="javascript:void(0);">删除</a>
@@ -53,17 +57,28 @@
             </div>
         </div>
     </script>
+    <script type="text/html" id="editTmpl">
+        <div class="edit-box">
+            <p><span>质控条目: </span><input disabled type="text" value="${msg}" /></p>
+            <!--<p><span>模块名称: </span><input type="text" value="${modelName}" /></p>-->
+            <p><span>提示信息: </span><input type="text" value="${msg}" /></p>
+            <p><span>质控分数: </span> <input type="text" value="${score}" /></p>
+        </div>
+    </script>
 </head>
 <body>
     <div class="patient-info" id="patientInfo"></div>
     <div class="main-part clearfix">
-        <div class="sub-menu"><ul id="subMenu"></ul></div>
+        <div class="sub-menu">
+            <ul id="subMenu"></ul>
+            <div class="copy-right">©杭州朗通信息技术有限公司</div>
+        </div>
         <div class="tab-container clearfix">
             <div class="content-box fl" id="contentInfo"></div>
             <div class="operation fr" id="flaws">
                 <div class="flaw-title">
                     <span>缺陷详情</span>
-                    <a href="javascript:void(0);">+ 新增</a>
+                    <!--<a href="javascript:void(0);">+ 新增</a>-->
                 </div>
                 <div class="flaw-box content-ht"></div>
             </div>
@@ -77,7 +92,7 @@
                 <a class="close" href="javascript:void(0);">×</a>
             </div>
             <div class="modal-body">
-                <p>确定要删除该评分记录吗?</p>
+                <!--<p>确定要删除该评分记录吗?</p>-->
             </div>
             <div class="modal-footer">
                 <a class="confirm" href="javascript:void(0);">确定</a>

+ 48 - 11
src/js/qcScore.js

@@ -7,8 +7,8 @@ $(function(){
   getSubMenu();
   initScoreItem();
   getRecordDetail();
-});
 
+  let global_flawData = {};    //缺陷数据
 function initMenu(data){
   //菜单数据填充
   $("#subMenuTmpl").tmpl(data).appendTo("#subMenu");
@@ -27,8 +27,9 @@ function initMenu(data){
     $(".sub-menu .active").removeClass('active');
     $(this).addClass("active");
     //显示对应内容
-    $(".content-item").hide();
-    $(".content-item[code="+$(this).attr("code")+"]").show();
+    const code=$(this).attr("code");
+    $(".content-item,.flaw-item").hide();
+    $(".content-item[code="+code+"],.flaw-item[code="+code+"]").show();
   });
 }
 
@@ -54,6 +55,7 @@ function getRecordDetail(){
       initPatientInfo(info);
       initContent(result.pageData,activeTab);
       initScoreItem(msg);
+      global_flawData=msg;
     }
   });
 }
@@ -65,12 +67,10 @@ function initPatientInfo(data){
 //显示病例模块明细
 function initContent(data){
   const obj = JSON.parse(data);
-  let i=0;
   for(let k in obj){
-    $("#contentTmpl").tmpl({title:k,info:obj[k],code:i}).appendTo("#contentInfo");
-    i++;
+    $("#contentTmpl").tmpl({title:k,info:obj[k]}).appendTo("#contentInfo");
   }
-  //console.log(obj)
+  console.log(obj)
 }
 
 //评分项数据填充
@@ -79,16 +79,53 @@ function initScoreItem(data){
   for(let k in data){
     $("#flawTmpl").tmpl(data[k]).appendTo("#flaws .flaw-box");
   }
+
   $(".flaw-item .oper a").click(function () {
-    $("#delModal").show();
+    const activeTab=$(".sub-menu .page.active").attr("code");
+    const i = $(".flaw-item[code="+activeTab+"]").index($(this).parents(".flaw-item"));
+    const code=$(this).attr("code");
+    const isEdit = $(this).is(".edit-flaw");
+    showModal(isEdit?'0':'1',code,i);
   })
 }
-
+//删除评分项
 function delScore(id){
-  post(api.getRecordDetail,{'id':id}).then(function(res){
+  post(api.delScore,{'id':id}).then(function(res){
+    if(res.data.code==='0'){
+      const data = res.data.data;
+
+    }
+  });
+}
+//修改评分项
+function editScore(){
+  const param={};
+  post(api.editScore,param).then(function(res){
     if(res.data.code==='0'){
       const data = res.data.data;
 
     }
   });
-}
+}
+
+function showModal(flag,code,i){
+  $("#delModal .modal-body").html("");
+  $("#delModal").show();
+  $("#delModal .confirm").off("click");
+  const activeTab=$(".sub-menu .page.active").attr("code");
+  if(flag==='0'){   //修改
+    const info = global_flawData[activeTab][i];
+    $("#delModal .title").text("修改评分");
+    $("#editTmpl").tmpl(info).appendTo("#delModal .modal-body");
+    $("#delModal .confirm").click(function(){
+      editScore(code);
+    });
+  }else{
+    $("#delModal .title").text("删除评分");
+    $("#delModal .modal-body").html('<p>确定要删除该评分记录吗?</p>');
+    $("#delModal .confirm").click(function(){
+      delScore(code);
+    });
+  }
+}
+});

+ 2 - 2
src/js/utils.js

@@ -135,8 +135,8 @@ $(".modal .close").click(function(){
 //计算容器高度
 function setBoxHeight(){
   const ht=window.innerHeight;
-  $(".main-part").height((ht-50)+'px');
-  $(".content-ht").height((ht-116)+"px");
+  $(".main-part").height((ht-60)+'px');
+  $(".content-ht").height((ht-126)+"px");
 }
 setBoxHeight();
 $(window).resize(function(){