Browse Source

质控评分个人添加导出功能

luolei 4 years ago
parent
commit
0f203ac273
4 changed files with 84 additions and 4 deletions
  1. 15 2
      src/css/qcListPerson.less
  2. 1 0
      src/html/qcListPerson.html
  3. 3 0
      src/js/api.js
  4. 65 2
      src/js/qcListPerson.js

+ 15 - 2
src/css/qcListPerson.less

@@ -119,7 +119,7 @@ h2{
 }
 .filter-toggler{
     position: absolute;
-    left: 980px;
+    left: 1048px;
     top: 8px;
     color: #777;
     white-space: nowrap;
@@ -217,7 +217,7 @@ h2{
     cursor: default;
 }
 
-.filter,.reset{
+.filter,.reset,.export{
     display: inline-block;
     width:60px;
     height:32px;
@@ -232,6 +232,19 @@ h2{
     float: left;
     margin: 0 0px 22px 0;
 }
+
+.export{
+    height:34px;
+    background: #fff;
+    border-radius: 4px;
+    color: #777;
+    border: 1px solid #777;
+    box-sizing: border-box;
+    cursor: pointer;
+    margin-left: 10px;
+    float: left;
+    top: 0px;
+}
 .arrow{
     position: absolute;
     width: 10px;

+ 1 - 0
src/html/qcListPerson.html

@@ -41,6 +41,7 @@
                 </span>
                 <span class="filter">查询</span>
                 <span class="filterclear abnormalClear filterclearT">重置</span>
+                <span class="export">导出</span>
             </div>
             <a href="javascript:void(0);" class="filter-toggler up" id="filterToggler">展开筛选</a>
             <div class="toggle-item clearfix">

+ 3 - 0
src/js/api.js

@@ -138,6 +138,9 @@ const api = {
     medicalCheckForm:'/console/medicalCheckForm',//稽查表格
     medicalCheckExport:'/console/export/medicalCheckExport',//稽查表导出
     getMedNursePage:'/qc/medNurse/getMedNursePage',//护理信息
+
+    exportQcresultByPerson:'/qc/behospitalInfo/exportQcresultByPerson',//个人质控导出  
+
 }
 module.exports = {
     api

+ 65 - 2
src/js/qcListPerson.js

@@ -2,7 +2,7 @@ const $ = require('jquery');
 require("../css/qcListPerson.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getUrlArgObject,getCookie,getUrlArgObjectNew,emptyBox,initScroll,listenScroll} = require('./utils.js')
+const {post,getUrlArgObject,getCookie,getUrlArgObjectNew,emptyBox,expJson,listenScroll,downloadExportedData,exportTimeLimit} = require('./utils.js')
 require('./../resource/jquery-ui/jquery-ui.min.js');
 require('./../resource/jquery-ui/jquery-ui.min.css');
 const iconCheck= require("./../images/icon_check.png")
@@ -1120,5 +1120,68 @@ $(document).on("click", function(){
     $(".qcSelectCheck .arrow").attr("src",iconDown)
 })
 
+let radioCheck = 1;
 $((function($){
-})($));
+    $('.export').click(function(){
+        const behosDateStartTime = new Date(behosDateStart).getTime()
+        const behosDateEndTime = new Date(behosDateEnd).getTime()
+        if(behosDateStartTime > behosDateEndTime){
+            $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            return
+        }
+        const param = {
+            behospitalCode: behospitalCode,
+            name: name, //条目名
+            level:level,//病历等级
+            deptId: deptId.trim(),
+            asc:data_asc,     //升序
+            desc:data_desc,       //降序
+            doctorName: doctorName,
+            "leaveHosDateStart": isPlacefile==1?behosDateStart:'', //出院日期--开始时间
+            "leaveHosDateEnd": isPlacefile==1?behosDateEnd:'', //出院日期--结束时间
+            "behosDateStart": isPlacefile==1?'':behosDateStart, //出院日期--开始时间
+            "behosDateEnd": isPlacefile==1?'':behosDateEnd, //出院日期--结束时间
+            size: 15,
+            statisticsType:statisticsType,
+            checkStatus: qcCheckStatus?Number(qcCheckStatus):qcCheckStatus, //病历核查状态
+            mrStatus: fpCheckStatus?Number(fpCheckStatus):fpCheckStatus,   //首页核查状态(1:已核查,0:未核查)
+            chName: qcCheckName,   //病历核查人员
+            diagnose: qcCheckMain,   //病历核查人员
+            mrName: fpCheckName,  //首页核查人员
+            chTimeStart: qcCheckDateStart.replace(/\//g,'-'), //病历核查起始时间
+            chTimeEnd: qcCheckDateEnd.replace(/\//g,'-'), //病历核查截止时间
+            mrTimeStart: fpCheckDateStart.replace(/\//g,'-'), //首页核查起始时间
+            mrTimeEnd: fpCheckDateEnd.replace(/\//g,'-'), //首页核查截止时间
+        }
+        $.alerModal({type:"radio",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+        closeRadio()
+        radioSelect()
+        bindSaveColPort(param)
+    })
+})($));
+function closeRadio(){
+    $(".colSetBox .iconClose,.colSetBox .cancalColSet", parent.document ).off("click").on("click",function(){
+        $(".divModal",parent.document).html("")
+    })
+}
+function radioSelect(){
+    $(".selectDate", parent.document).click(function(){
+        $(this).find("input").prop("checked",true)
+        $(this).siblings().find("input").prop("checked",false)
+    })
+}
+function bindSaveColPort(param){
+    $(".savePort", parent.document ).off("click").on("click", function(){
+        radioCheck = $(".selectDate input[type='radio']:checked", parent.document).attr("data-select")
+        let time = radioCheck==2?exportTimeLimit.defectTime:exportTimeLimit.normalTime
+        if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > time){
+            $.alerModal({"message":`最多只能导出${time}天`,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            return
+        }
+        param.radioCheck = radioCheck||1
+        expJson(api.exportQcresultByPerson,param).then(res =>{
+            $(".divModal",parent.document).html("")
+            downloadExportedData(res.data, behosDateStart.slice(0,10).replace(/-/g,"")+"-"+behosDateEnd.slice(0,10).replace(/-/g,"")+"抽查住院病历质量情况.xls")
+        })
+    })
+}