Explorar el Código

Merge branch 'test' of http://192.168.2.236:10080/zhouna/AIPlatform into test

luolei hace 5 años
padre
commit
7008b36969

+ 80 - 0
src/css/index.less

@@ -213,6 +213,79 @@
     cursor: pointer;
   }
 }
+.itemMsgBox{
+  .itemMsgContent{
+    position: fixed;
+    left: 50%;
+    top: 50%;
+    width: 500px;
+    height:468px;
+    margin: -234px 0 0 -250px;
+    background: #fff;
+    border-radius:4px;
+  }
+  .itemMsgTitle{
+    position: relative;
+    height: 40px;
+    padding: 0 0 0 20px;
+    line-height: 40px;
+    border-bottom: 1px solid #E2E5EF;
+    font-size: 14px;
+    color: #1E1E1E;
+  }
+  .iconClose{
+    width: 40px;
+    position: absolute;
+    right: 0;
+  }
+  .itemMsgContentBox{
+    margin: 20px 0 0 0;
+  }
+  .itemMsgInfoBox{
+    line-height: 40px;
+    margin: 0 0 10px 0;
+  }
+  .itemInfoRight{
+    display: inline-block;
+    width: 300px;
+    input{
+      width: 280px;
+      box-sizing: border-box;
+      border:  1px solid #E2E5EF;
+      height: 40px;
+      line-height: 40px;
+      border-radius: 2px;
+      padding: 0 10px;
+    }
+  }
+  .itemMsgLab{
+    display: inline-block;
+    width: 150px;
+    text-align: right;
+    color: #777;
+  }
+  .switchImg{
+    position: relative;
+    top: 2px;
+    width: 30px;
+}
+  .confirmEditBox{
+    position: relative;
+    text-align: center;
+    top: 30px;
+  }
+  .confirmEdit{
+    display: inline-block;
+    color: #fff;
+    width:80px;
+    height:36px;
+    line-height: 36px;
+    text-align: center;
+    background:rgba(90,142,238,1);
+    border-radius:4px;
+    cursor: pointer;
+  }
+}
 .mask {
   position: fixed;
   width: 100%;
@@ -221,4 +294,11 @@
   opacity: 0.5;
   left: 0;
   top: 0;
+}
+.loadingImg{
+  position: fixed;
+  left: 50%;
+  top: 50%;
+  width: 60px;
+  margin: -30px 0 0 -30px;
 }

+ 42 - 5
src/css/itemManager.less

@@ -21,7 +21,7 @@ table{
     th,td{
         height: 40px;
         box-sizing: border-box;
-        padding: 0 30px;
+        padding: 0 10px;
         border:1px solid #E2E5EF;
         border-collapse: collapse;
     }
@@ -63,8 +63,12 @@ table{
         cursor: pointer;
     }
 }
+.switchImg{
+    width: 30px;
+}
 .selectModuleType,.moduleItemInp,.selectUsed, .selectReject{
     display: inline-block;
+    position: relative;
     width:160px;
     padding: 0 10px;
     height:40px;
@@ -73,6 +77,12 @@ table{
     box-sizing: border-box;
     cursor: pointer;
 }
+.arrow{
+    position: absolute;
+    width: 10px;
+    top: 16px;
+    right: 10px;
+}
 .moduleItemInp{
     cursor: default;
     outline: none;
@@ -99,9 +109,12 @@ table{
     color: #fff;
     text-align: center;
     line-height: 36px;
+    position: relative;
+    top: -2px;
 }
 .editItem{
-   color: #5A8EEE
+   color: #5A8EEE;
+   cursor: pointer;
 }
 
 .ellipsis{
@@ -109,15 +122,39 @@ table{
     text-overflow:ellipsis;
     white-space: nowrap;
 }
-
+.textCenter{
+    text-align: center;
+}
+.totalSum{
+    font-size:12px;
+    line-height:17px;
+    color: #777777;
+    margin-right: 20px;
+}
 
 .pagination{
-    margin: 35px 0 0 0;
+    margin: 35px 0 0 0  ;
     text-align: right;
 }
 .activePage{
     color: #5A8EEE;
 }
-.pageNum, .more{
+.pageNum,.prePage,.nextPage, .more{
+    display: inline-block;
+    width: 20px;
+    cursor: pointer;
     margin: 0 20px 0 0;
+    text-align: center;
+}
+.prePage,.nextPage{
+    img{
+        position: relative;
+        top: -2px   ;
+    }
+}
+ .more{
+    cursor: not-allowed;
+}
+.arrowPage{
+    width: 6px;
 }

+ 113 - 5
src/css/qcList.less

@@ -7,11 +7,13 @@ h2{
     font-weight: 600;
     border-bottom: 1px solid #E2E5EF;
 }
+.main-body{
+    margin: 20px 40px;
+}
 table{
-    width: 1080px;
+     width: 100%;
     border:1px solid #E2E5EF;
     border-collapse: collapse;
-    margin: 40px 0 0 20px;
     thead{
         background: #EFF0F9;
        
@@ -19,31 +21,137 @@ table{
     th,td{
         height: 40px;
         box-sizing: border-box;
-        padding: 0 30px;
+        padding: 0 10px;
         border:1px solid #E2E5EF;
         border-collapse: collapse;
     }
     .moduleNumber{
         text-align: center;
     }
+    .scoreOperaItem{
+        width: 50px;
+        cursor: pointer;
+    }
     
 }
+.tabFoot{
+    height: 50px;
+    border: 1px solid #E2E5EF;
+    border-top: none;
+    box-sizing: border-box;
+    margin-right: 1px;
+}
+.scoreOpera{
+    height: 50px;
+    line-height: 50px;
+    margin: 0 20px 0 17px;
+    cursor: pointer;
+    img{
+        margin: 0 10px 0 0;
+    }
+}
+
+.recordScoreOperaBtn{
+    cursor: pointer;
+    color: #5A8EEE;
+}
+.recordScoreBtn{
+    cursor: pointer;
+    display: inline-block;
+    width:68px;
+    height:30px;
+    line-height: 30px;
+    text-align: center;
+    border-radius:4px;
+    box-sizing: border-box;
+    border: 1px solid #5A8EEE;
+    color: #5A8EEE;
+}
+.filterBox{
+    margin: 0 0 20px 0;
+}
 .filterItem{
     position: relative;
     display: inline-block;
     margin-right: 20px;
+    height: 40px;
+    line-height: 40px;
+    input{
+        width:120px;
+        height:40px;
+        border-radius:4px;
+        border: 1px solid #E2E5EF;
+        outline: none;
+        margin-right: 10px;
+        padding: 0 10px;
+    }
+}
+.filter{
+    display: inline-block;
+    width:60px;
+    height:36px;
+    background:#5A8EEE;
+    border-radius:4px;
+    color: #fff;
+    text-align: center;
+    line-height: 36px;
+    position: relative;
+    top: -2px;
+}
+.iconCheck{
+    width: 14px;
+}
+.datapickerBox{
+    position: relative;
+    display: inline-block;
+    width: 150px;
+    height: 40px;
+    top: 10px;
+    input{
+        position: absolute;
+    }
+}
+.iconCalen{
+    position: absolute;
+    width: 15px;
+    top: 15px;
+    right: 20px;
+}
+.textCenter{
+    text-align: center;
+}
+.patientNameSpan{
+    color: #5A8EEE;
+    cursor: pointer;
 }
 
 
 
 .pagination{
-    margin: 0 0 0 30px;
+    margin: 35px 0 0 0  ;
+    text-align: right;
 }
 .activePage{
     color: #5A8EEE;
 }
-.pageNum, .more{
+.pageNum,.prePage,.nextPage, .more{
+    display: inline-block;
+    width: 20px;
+    cursor: pointer;
     margin: 0 20px 0 0;
+    text-align: center;
+}
+.prePage,.nextPage{
+    img{
+        position: relative;
+        top: -2px;
+    }
+}
+ .more{
+    cursor: not-allowed;
+}
+.arrowPage{
+    width: 6px;
 }
 
 

+ 2 - 2
src/html/index.html

@@ -30,7 +30,7 @@
               <a class="setting" id="userName" href="javascript:void(0);">***</a>
               <ul class="userAction">
                   <li id="changeWord">修改密码</li>
-                  <li><a class="login-out" href="./login.html">退出</a></li>
+                  <li><a class="login-out" href="./login.html">退出id</a></li>
               </ul>
           </div>
       </div>
@@ -38,7 +38,7 @@
           <div class="menu fl">
               <ul></ul>
               <div class="copy-right">©杭州朗通信息技术有限公司</div></div>
-          <div class="main">
+          <div class="main" id="mainBox">
               <iframe src="./console.html" frameborder="0" id="contentIframe"></iframe>
           </div>
       </div>

+ 3 - 3
src/html/itemManager.html

@@ -16,7 +16,7 @@
             <div class="filterBox">
                 <span class="filterItem typeFilter">
                     <span>类别名称:</span>
-                    <span class="selectModuleType">全部</span>
+                    <span class="selectModuleType">全部 </span>
                     <ul class="moduleTypeList filterDropList"></ul>
                 </span>
                 <span class="filterItem">
@@ -52,9 +52,9 @@
                     <th class="moduleItemName">质控条目名称</th>
                     <th class="moduleTipsMsg">提示信息</th>
                     <th class="moduleScore">分值</th>
-                    <th class="moduleReject">单项否决等级</th>
+                    <th class="moduleReject">单项否决</th>
                     <th class="moduleUsed">启用</th>
-                    <th class="moduleOpera">操作</th>
+                    <th class="moduleOpera" style="width: 65px;">操作</th>
                 </thead>
                 <tbody>
     

+ 45 - 34
src/html/qcList.html

@@ -11,41 +11,52 @@
 
 <body>
     <div class="container">
-        病历质控评分
-        <div class="filterBox">
-            <span class="filterItem typeFilter">
-                <span>输入搜索:</span>
-                <input class="moduleItemInp" type="text" placeholder="请输入病案号">
-                <input class="patientNameInp" type="text" placeholder="请输入病人姓名">
-            </span>
-            <span class="filterItem">
-                <span>出院日期</span>
-                <input type="text" id="datepicker">
-            </span>
-            
-            <span class="filter">查询</span>
-        </div>
-        <table>
-            <thead>
-                <th class="scoreOpera" data-selectAll=false>未选择</th>
-                <th class="beHospitalId">病历号</th>
-                <th class="patientNo">病案号</th>
-                <th class="patientName">病人姓名</th>
-                <th class="patientSex">性别</th>
-                <th class="patientage">年龄</th>
-                <th class="bedNum">床号</th>
-                <th class="inHospitalDate">入院日期</th>
-                <th class="outHospitalDate">出院日期</th>
-                <th class="doctorName">主治医生</th>
-                <th class="deptName">科室</th>
-                <th class="recordLevel">病历等级</th>
-                <th class="recordScore">病历得分</th>
-                <th class="scoreTime">评分时间</th>
-            </thead>
-            <tbody>
+        <h2>病历质控评分</h2>
+        <div class="main-body">
+            <div class="filterBox">
+                <span class="filterItem typeFilter">
+                    <span>输入搜索:</span>
+                    <input class="patientNumInp" type="text" placeholder="请输入病案号">
+                    <input class="patientNameInp" type="text" placeholder="请输入病人姓名">
+                </span>
+                <span class="filterItem">
+                    <span>出院日期</span>
+                    <span class="datapickerBox"><input type="text" id="datepicker" autocomplete="off" /></span> -
+                    <span class="datapickerBox"><input type="text" id="datepicker2"  autocomplete="off" /></span>
+                </span>
+                
+                <span class="filter">查询</span>
+            </div>
+            <table>
+                <thead>
+                    <th class="textCenter" ></th>
+                    <th class="beHospitalId textCenter">病历号</th>
+                    <th class="patientNo textCenter">病案号</th>
+                    <th class="patientName textCenter">病人姓名</th>
+                    <th class="patientSex textCenter">性别</th>
+                    <th class="patientage textCenter">年龄</th>
+                    <th class="bedNum textCenter">床号</th>
+                    <th class="inHospitalDate textCenter">入院日期</th>
+                    <th class="outHospitalDate textCenter">出院日期</th>
+                    <th class="doctorName textCenter">主治医生</th>
+                    <th class="deptName textCenter">科室</th>
+                    <th class="recordLevel textCenter">病历等级</th>
+                    <th class="recordScore textCenter">病历得分</th>
+                    <th class="scoreTime textCenter">评分时间</th>
+                    <th class="recordScoreOpera textCenter">操作</th>
+                </thead>
+                <tbody>
+    
+                </tbody>
+            </table>
+            <div class="tabFoot">
+                <span class="scoreOpera" data-selectAll=false><img class="iconCheck" src="" alt="checkbox">全选</span>
+                <span class="recordScoreBtn">评分</span>
+            </div>
 
-            </tbody>
-        </table>
+            <div class="pagination"></div>
+        </div>
+        
     </div>
 </body>
 

BIN
src/images/arrow_down.png


BIN
src/images/arrow_left.png


BIN
src/images/arrow_right.png


BIN
src/images/arrow_up.png


BIN
src/images/btn_close.png


BIN
src/images/btn_open.png


BIN
src/images/icon_calen_blue.png


BIN
src/images/icon_calen_grey.png


BIN
src/images/icon_check.png


BIN
src/images/icon_unchecked.png


+ 55 - 22
src/js/itemManager.js

@@ -3,9 +3,16 @@ require("../css/itemManager.less");
 require('./../resource/jquery-ui/jquery-ui.min.js');
 const {api} = require('./api.js')
 const {post} = require('./utils.js')
-const switchIconOpen = require("./../images/icon4.png")
-const switchIconClose = require("./../images/icon5.png")
+const switchIconOpen = require("./../images/btn_open.png")
+const switchIconClose = require("./../images/btn_close.png")
+const iconDown= require("./../images/arrow_down.png")
+const iconUp = require("./../images/arrow_up.png")
+const arrowLeft= require("./../images/arrow_left.png")
+const arrowRight = require("./../images/arrow_right.png")
 let casesId="", name="", isReject ="", isUsed =""
+$(".selectModuleType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
+$(".selectReject").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
+$(".selectUsed").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 
 //获取表格数据
 function getTabData(activePage){
@@ -44,11 +51,15 @@ $('.selectModuleType').on("click", function(e){
     e.stopPropagation()
     $(".rejectList ").css("display","none")
     $(".usedList ").css("display", "none")
+    $(".selectReject .arrow").attr("src",iconDown)
+    $(".selectUsed .arrow").attr("src",iconDown)
     const showList =  $(".moduleTypeList ").css("display")
     if(showList == "none" ||!showList){
         $(".moduleTypeList ").css("display","block")
+        $(".selectModuleType .arrow").attr("src",iconUp)
     }else{
         $(".moduleTypeList ").css("display", "none")
+        $(".selectModuleType .arrow").attr("src",iconDown)
     }
 })
     
@@ -56,22 +67,30 @@ $('.selectReject').on("click", function(e){
     e.stopPropagation()
     $(".moduleTypeList ").css("display", "none")
     $(".usedList ").css("display", "none")
+    $(".selectModuleType .arrow").attr("src",iconDown)
+    $(".selectUsed .arrow").attr("src",iconDown)
     const showList =  $(".rejectList ").css("display")
     if(showList == "none" ||!showList){
         $(".rejectList ").css("display","block")
+        $(".selectUsed .arrow").attr("src",iconUp)
     }else{
         $(".rejectList ").css("display", "none")
+        $(".selectUsed .arrow").attr("src",iconDown)
     }
 })
 $('.selectUsed').on("click", function(e){
     e.stopPropagation()
     $(".moduleTypeList ").css("display", "none")
     $(".rejectList ").css("display","none")
+    $(".selectModuleType .arrow").attr("src",iconDown)
+    $(".selectReject .arrow").attr("src",iconDown)
     const showList =  $(".usedList ").css("display")
     if(showList == "none" ||!showList){
         $(".usedList ").css("display","block")
+        $(".selectUsed .arrow").attr("src",iconUp)
     }else{
         $(".usedList ").css("display", "none")
+        $(".selectUsed .arrow").attr("src",iconDown)
     }
 })
 bindRejectSelect()
@@ -84,13 +103,13 @@ function renderTab(data,activePage){
         const item = data[i]
         str += `
             <tr data-id=${item.id} data-index=${i}>
-                <td>${(activePage-1)*10 + i+1}</td>
+                <td  class="textCenter">${(activePage-1)*10 + i+1}</td>
                 <td>${item.casesName}</td>
                 <td>${item.name}</td>
                 <td>${item.msg}</td>
-                <td>${item.score}</td>
-                <td>${item.isReject == '1' ? `<img src=${switchIconOpen} />`:`<img src=${switchIconClose} />`}</td>
-                <td>${item.isUsed == '1' ? `<img src=${switchIconOpen} />`:`<img src=${switchIconClose} />`}</td>
+                <td  class="textCenter">${item.score}</td>
+                <td  class="textCenter">${item.isReject == '1' ? `<img class="switchImg" src=${switchIconOpen} />`:`<img class="switchImg" src=${switchIconClose} />`}</td>
+                <td class="textCenter">${item.isUsed == '1' ? `<img class="switchImg" src=${switchIconOpen} />`:`<img class="switchImg" src=${switchIconClose} />`}</td>
                 <td class="editItem">修改</td>
             </tr>
         `
@@ -114,37 +133,48 @@ function editItem(item,activePage){
     const str = `
         <div class="itemMsgBox">
             <div class="mask"></div>
-            <div><span>提示信息:</span> <input class="itemTipMsg" value=${itemCpoy.msg} /></div>
-            <div><span>分值:</span> <input class="itemScore"  type="number" value=${itemCpoy.score} /></div>
-            <div><span>单项否决</span><span class="itemReject">${itemCpoy.isReject}</span></div>
-            <div><span>启用</span><span class="itemUsed">${itemCpoy.isUsed}</span></div>
-            <div class="confirmEdit">确定</div>
+            <div class="itemMsgContent">
+                <p class="itemMsgTitle">修改 <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></p>
+                <div class="itemMsgContentBox">
+                    <div class="itemMsgInfoBox"><span class="itemMsgLab">模块类别:</span> <span class="itemInfoRight">${itemCpoy.casesName}</span></div>
+                    <div class="itemMsgInfoBox"><span class="itemMsgLab">质控条目名称:</span> <span class="itemInfoRight"> ${itemCpoy.name}</span></div>
+                    <div class="itemMsgInfoBox"><span class="itemMsgLab">提示信息:</span> <span class="itemInfoRight"> <input class="itemTipMsg" value=${itemCpoy.msg} /></span></div>
+                    <div class="itemMsgInfoBox"><span class="itemMsgLab">分值:</span> <span class="itemInfoRight"> <input class="itemScore"  type="number" value=${itemCpoy.score} /></span></div>
+                    <div class="itemMsgInfoBox"><span class="itemMsgLab">单项否决:</span><span class="itemInfoRight itemReject">${item.isReject == '1' ? `<img class="switchImg" src=${switchIconOpen} />`:`<img class="switchImg" src=${switchIconClose} />`}</span></div>
+                    <div class="itemMsgInfoBox"><span class="itemMsgLab">启用:</span><span class=" temInfoRight itemUsed">${item.isUsed == '1' ? `<img class="switchImg" src=${switchIconOpen} />`:`<img class="switchImg" src=${switchIconClose} />`}</span></div>
+                </div>
+                
+                <div class="confirmEditBox"><span class="confirmEdit">保存</span></div>
+            </div>
         </div>
        
     `
-    $('.pop-box').html(str)
-    $(".itemTipMsg").on("input", function(e){
+    $("#mainBox", parent.document).append(str)
+    $("#mainBox .itemMsgBox .iconClose", parent.document).on("click", function(e){
+        $("#mainBox .itemMsgBox", parent.document).remove()
+    })
+    $("#mainBox .itemMsgBox .itemTipMsg", parent.document).on("input", function(e){
         const val = $(this).val()
         itemCpoy.msg = val
     })
-    $(".itemScore").on("input", function(e){
+    $("#mainBox .itemMsgBox .itemScore", parent.document).on("input", function(e){
         const val = $(this).val()
         itemCpoy.score = val
     })
-    $(".itemReject").on("click", function(e){
+    $("#mainBox .itemMsgBox .itemReject", parent.document).on("click", function(e){
         itemCpoy.isReject = itemCpoy.isReject == 1 ? 0 : 1
-        $('.pop-box').remove()
+        $('#mainBox .itemMsgBox', parent.document).remove()
         editItem(itemCpoy,activePage)
     })
-    $(".itemUsed").on("click", function(e){
+    $("#mainBox .itemMsgBox .itemUsed", parent.document).on("click", function(e){
         itemCpoy.isUsed = itemCpoy.isUsed == 1 ? 0 : 1
-        $('.pop-box').remove()
+        $('#mainBox .itemMsgBox', parent.document).remove()
         editItem(itemCpoy,activePage)
     })
     
-    $(".confirmEdit").on("click", function(){
+    $("#mainBox .itemMsgBox .confirmEdit", parent.document).on("click", function(){
         saveEdit(itemCpoy,activePage)
-        $('.pop-box').remove()
+        $('#mainBox .itemMsgBox', parent.document).remove()
     })
    
     
@@ -228,7 +258,7 @@ function bindUsedSelect(){
 
 //分页渲染
 function renderPagination(totalPage,activePage,totalNum){
-    let str = `<span class="totalNum">共${totalPage}页/${totalNum}条数据</span><span class="prePage">前一页</span>`
+    let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
     if(totalPage <= 6){
         for(let i = 1; i <= totalPage; i++){
             str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
@@ -259,7 +289,7 @@ function renderPagination(totalPage,activePage,totalNum){
         }
        
     }
-    str += `<span class="nextPage">后一页</span>`
+    str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
     $('.pagination').html(str)
     $('.page' + activePage).addClass('activePage')
     $(".pageNum").on("click", function(e){
@@ -290,4 +320,7 @@ $(document).on("click", function(){
     $(".moduleTypeList ").css("display", "none")
     $(".rejectList ").css("display","none")
     $(".usedList ").css("display", "none")
+    $(".selectModuleType .arrow").attr("src",iconDown)
+    $(".selectReject .arrow").attr("src",iconDown)
+    $(".selectUsed .arrow").attr("src",iconDown)
 })

+ 0 - 3
src/js/moduleManager.js

@@ -12,7 +12,6 @@ const {post} = require('./utils.js')
 let data = {}
 function getTabData(){
     post(api.getQcCases).then(res =>{
-        console.log('ress', res)
         if(res.data.code == '0'){
             data = res.data.data
             renderTab()
@@ -108,7 +107,6 @@ let msgBox =`<div class="moduleMsgBox">
     </div>`
 
 $('.saveModule').on("click", function(){
-    console.log('data', data)
     const sum =  $('.totalSum').html()
     if(sum != 100){
         $("#mainBox", parent.document).append(msgBox)
@@ -138,7 +136,6 @@ function saveModify(){
         })
     }
     post(api.saveQcCases, {qcCasesSaveVOList}).then(res =>{
-        console.log('ress', res)
         if(res.data.code == '0'){
             getTabData()
         }else{}

+ 204 - 33
src/js/qcList.js

@@ -1,34 +1,65 @@
 const $ = require('jquery');
 require("../css/qcList.less");
-// require("./../resource/My97DatePicker/WdatePicker.js")
-// require("./../resource/My97DatePicker/skin/WdatePicker.css")
+
 const {api} = require('./api.js')
 const {post} = require('./utils.js')
 require('./../resource/jquery-ui/jquery-ui.min.js');
 require('./../resource/jquery-ui/jquery-ui.min.css');
-require('./../resource/layui/css/layui.css');
+const iconCheck= require("./../images/icon_check.png")
+const iconUnCheck = require("./../images/icon_unchecked.png")
+const  iconCalenBlue= require("./../images/icon_calen_blue.png")
+const  iconCalenGrey= require("./../images/icon_calen_grey.png")
+const iconDown= require("./../images/arrow_down.png")
+const iconUp = require("./../images/arrow_up.png")
+const loadingImg = require("./../images/loading.gif")
+const arrowLeft= require("./../images/arrow_left.png")
+const arrowRight = require("./../images/arrow_right.png")
 
-let tabList
+let tabList = [], name = "", fileCode="", leaveHosDateStart="", leaveHosDateEnd="", scoreSum = 0
 
-function getTabData(){
+$('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
+$('.iconCalen').on("mouseenter", function(e){
+    $(this).attr("src", iconCalenBlue)
+})
+$('.iconCalen').on("mouseleave", function(e){
+    $(this).attr("src", iconCalenGrey)
+})
+$('.iconCalen').on("click", function(e){
+    $(this).parent().find("input").focus()
+})
+function getTabData(activePage){
     const param = {
-        fileCode: "",
-        name: "", //条目名
-        behosDateStart: "", //1-单项否决 0-非
-        leaveHosDateEnd: "" //0-未启用 1-启用
+        current:activePage,
+        fileCode: fileCode,
+        name: name, //条目名
+        leaveHosDateStart: leaveHosDateStart, //1-单项否决 0-非
+        leaveHosDateEnd: leaveHosDateEnd //0-未启用 1-启用
     }
     post(api.qcList,param).then(res =>{
-        console.log('ress', res)
         if(res.data.code == '0'){
             tabList = res.data.data.records
+            const totalPage = res.data.data.pages
+            const totalNum = res.data.data.total
             renderTab(tabList)
+            renderPagination(totalPage,activePage,totalNum)
+            if(totalPage > 1){
+                renderPagination(totalPage,activePage,totalNum)
+            } else{
+                $('.pagination').html("")
+            }
         }else{}
     }).catch((e) =>{
     
     })
 }
 
-getTabData()
+getTabData(1)
+
+$(".filter").on("click", function(e){
+    leaveHosDateStart = $("#datepicker").val().trim()
+    leaveHosDateEnd = $("#datepicker2").val().trim()
+    getTabData(1)
+})
 function renderTab(data){
     let str = ``
     let hasSelectAll = true
@@ -39,48 +70,71 @@ function renderTab(data){
         }
         str += `
             <tr  data-index=${i}>
-                <td class="scoreOperaItem">${item.hasSelect ? '选择':'未选择'}</td>
-                <td>${item.behospitalCode}</td>
-                <td>${item.fileCode}</td>
-                <td>${item.name}</td>
-                <td>${item.sex}</td>
-                <td>${item.age}</td>
-                <td>${item.bedCode}</td>
-                <td>${item.behospitalDate}</td>
-                <td>${item.leaveHospitalDate}</td>
-                <td>${item.doctorName}</td>
-                <td>${item.behDeptName}</td>
-                <td>${item.level}</td>
-                <td>${item.scoreRes}</td>
-                <td>${item.gradeTime}</td>
+                <td class="scoreOperaItem textCenter">${item.hasSelect ? `<img class="iconCheck" src=${iconCheck} />`:`<img class="iconCheck" src=${iconUnCheck} />`}</td>
+                <td >${item.behospitalCode || ""}</td>
+                <td>${item.fileCode || ""}</td>
+                <td  class="textCenter"><span  data-index=${i} class="patientNameSpan">${item.name || ""}<span></td>
+                <td  class="textCenter">${item.sex || ""}</td>
+                <td  class="textCenter">${item.age || ""}</td>
+                <td  class="textCenter">${item.bedCode || ""}</td>
+                <td  class="textCenter">${item.behospitalDate&&item.behospitalDate.slice(0,10)}</td>
+                <td  class="textCenter">${item.leaveHospitalDate&&item.leaveHospitalDate.slice(0,10)}</td>
+                <td  class="textCenter">${item.doctorName || ""}</td>
+                <td  class="textCenter">${item.behDeptName || ""}</td>
+                <td  class="textCenter">${item.level || ""}</td>
+                <td  class="textCenter">${item.scoreRes || ""}</td>
+                <td  class="textCenter">${item.gradeTime&&item.gradeTime.slice(0,10) || ""}</td>
+                <td  class="recordScoreOperaBtn textCenter">评分</td>
             </tr>
         `
     }
+    if(data.length === 0){
+        hasSelectAll = false
+    }
     if(hasSelectAll){
-        $('.scoreOpera').html("选择")
+        $('.scoreOpera img').attr("src" ,iconCheck)
         $('.scoreOpera').attr("data-selectall",true)
     }else{
-        $('.scoreOpera').html("未选择")
+        $('.scoreOpera img').attr("src" ,iconUnCheck)
         $('.scoreOpera').attr("data-selectall",false)
     }
     $('tbody').html(str)
     bindScoreOperaItem()
+    bindRecordScoreOper()
+    bindScoreDetail()
+}
+
+function scoreDetail(id){
+    window.open(`./qcScore.html?id=${id}`)
 }
+function bindScoreDetail(){
+    $('.patientNameSpan').on('click',function(e){
+        const index = $(this).attr("data-index")
+        const id = tabList[index].behospitalCode
+        scoreDetail(id)
+    })
+}
+
 //全选绑定
 bindOperaAll()
 function bindScoreOperaItem(){
     $(".scoreOperaItem").on("click",  function(e){
         const index = $(this).parent().attr("data-index")
-        console.log(index)
         tabList[index].hasSelect = tabList[index].hasSelect ? false:true
         renderTab(tabList)
     })
 }
-
+function bindRecordScoreOper(){
+    $(".recordScoreOperaBtn").on("click",  function(e){
+        const index = $(this).parent().attr("data-index")
+        const behospitalCode = tabList[index].behospitalCode
+        loading()
+        recordScore(behospitalCode,1)
+    })
+}
 function bindOperaAll(){
     $('.scoreOpera').on("click", function(e){
         const hasSelectAll = $('.scoreOpera').attr("data-selectall")
-        console.log('hasSelectAll',hasSelectAll)
         if(hasSelectAll == 'true'){
 
             for(let i = 0; i < tabList.length; i++){
@@ -94,20 +148,62 @@ function bindOperaAll(){
         renderTab(tabList)
     })
 }
-
-function recordScore(behospitalCode){
+function loading(){
+    const str = `
+    <div class="loadingBox">
+            <div class="mask"></div>
+            <img class="loadingImg" src=${loadingImg}  alt="loading" />
+        </div>
+    `
+    $("#mainBox", parent.document).append(str)
+}
+function hideLoading(){
+    $("#mainBox .loadingBox", parent.document).remove()
+}
+$('.recordScoreBtn').on("click",function(e){
+    let scoreList = []
+    for(let i = 0; i <tabList.length; i++){
+        if(tabList[i].hasSelect){
+            scoreList.push(tabList[i].behospitalCode)
+        }
+    }
+    if(scoreList.length === 0){
+        return
+    } else{
+        loading()
+        for(let j = 0; j < scoreList.length; j++){
+            recordScore(scoreList[j],scoreList.length)
+        }
+    }
+})
+function recordScore(behospitalCode,totalNum){
     const param = {
         behospitalCode: behospitalCode
     }
     post(api.recordScore,param).then(res =>{
         if(res.data.code == '0'){
+            scoreSum++
+            if(scoreSum === totalNum){
+                hideLoading()
+                scoreSum = 0
+                const activePage = $(".activePage").attr('data-page') || 1
+
+                getTabData(activePage)
+            }
       
         }else{}
     }).catch((e) =>{
     
     })
 }
-
+$(".patientNumInp").on("input", function(e){
+    const val = $(this).val().trim()
+    fileCode = val
+})
+$(".patientNameInp").on("input", function(e){
+    const val = $(this).val().trim()
+    name = val
+})
 
 $(function() {
     $.datepicker.regional['zh-CN'] = {
@@ -148,7 +244,82 @@ $(function() {
         changeYear: true,
         dateFormat:"yy/mm/dd"
     });
+    $( "#datepicker2" ).datepicker({
+        changeMonth: true,
+        changeYear: true,
+        dateFormat:"yy/mm/dd"
+    });
 });
 
+//分页渲染
+function renderPagination(totalPage,activePage,totalNum){
+    let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
+    if(totalPage <= 6){
+        for(let i = 1; i <= totalPage; i++){
+          
+            str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
+        }
+    }else{
+        if(activePage <= 3){ //选中页数小于4
+            for(let i = 1; i <= 4; i++){
+                str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
+            }
+            str += `<span class="more" >...</span>`
+        str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
+
+        } else if(activePage > totalPage -3){
+            str += `<span class="pageNum page1" data-page=1>1</span>`
+            str += `<span class="more" >...</span>`
+            str += `<span class="pageNum ${'page'+(totalPage-3)}" data-page=${totalPage -3}>${totalPage -3}</span>`
+            str += `<span class="pageNum ${'page'+(totalPage-2)}" data-page=${totalPage -2}>${totalPage -2}</span>`
+            str += `<span class="pageNum ${'page'+(totalPage-1)}" data-page=${totalPage -1}>${totalPage -1}</span>`
+            str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
+        } else {
+            str += `<span class="pageNum page1" data-page=1>1</span>`
+            str += `<span class="more" >...</span>`
+            str += `<span class="pageNum ${'page'+(activePage -1)}" data-page=${activePage -1}>${activePage -1}</span>`
+            str += `<span class="pageNum ${'page'+activePage}" data-page=${activePage}>${activePage}</span>`
+            str += `<span class="pageNum ${'page'+(activePage +1)}" data-page=${activePage +1}>${activePage +1}</span>`
+            str += `<span class="more" >...</span>`
+            str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
+        }
+       
+    }
+    str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
+    $('.pagination').html(str)
+    $('.page' + activePage).addClass('activePage')
+    $(".pageNum").on("click", function(e){
+        const activePageNow = Number($(this).attr('data-page'))
+        getTabData(activePageNow)
+        // renderPagination(totalPage,activePageNow,totalNum)
+    })
+    $(".prePage").on("click", function(e){
+        let activePageNow = Number($(".activePage").attr('data-page'))
+        if(activePageNow > 1){
+            activePageNow--
+            getTabData(activePageNow)
+            // renderPagination(totalPage,activePageNow,totalNum)
+        }
+    })
+    $(".nextPage").on("click", function(e){
+        let activePageNow = Number($(".activePage").attr('data-page'))
+        if(activePageNow < totalPage){
+            activePageNow++
+            getTabData(activePageNow)
+            // renderPagination(totalPage,activePageNow,totalNum)
+        }
+    })
+    
+}
+
+$(document).on("click", function(){
+    $(".moduleTypeList ").css("display", "none")
+    $(".rejectList ").css("display","none")
+    $(".usedList ").css("display", "none")
+    $(".selectModuleType .arrow").attr("src",iconDown)
+    $(".selectReject .arrow").attr("src",iconDown)
+    $(".selectUsed .arrow").attr("src",iconDown)
+})
+
 $((function($){
 })($));