瀏覽代碼

Merge branch 'exportQcList' into byll

luolei 5 年之前
父節點
當前提交
d69a427945
共有 8 個文件被更改,包括 360 次插入33 次删除
  1. 13 1
      src/css/qcList.less
  2. 2 2
      src/css/reset.less
  3. 15 2
      src/html/console.html
  4. 1 1
      src/html/qcList.html
  5. 4 0
      src/js/api.js
  6. 232 23
      src/js/console.js
  7. 19 2
      src/js/qcList.js
  8. 74 2
      src/js/utils.js

+ 13 - 1
src/css/qcList.less

@@ -168,7 +168,7 @@ table{
     width: 160px;
 }
 
-.filter,.reset{
+.filter,.reset,.export{
     display: inline-block;
     width:60px;
     height:32px;
@@ -183,6 +183,18 @@ table{
     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;

+ 2 - 2
src/css/reset.less

@@ -448,7 +448,7 @@ input:-ms-input-placeholder{  /* Internet Explorer 10-11 */
   }
 }
 .filterclearT {
-  height: 32px !important;
+  height: 324x !important;
   line-height: 32px !important;
   float: left;
   position: relative;
@@ -462,7 +462,7 @@ input:-ms-input-placeholder{  /* Internet Explorer 10-11 */
 .filterclear.abnormalClear {
   display: inline-block;
   width: 60px;
-  height: 32px;
+  height: 34px;
   line-height: 32px;
   background: #fff;
   border-radius: 4px;

+ 15 - 2
src/html/console.html

@@ -97,6 +97,19 @@
           </div>
         </div>
         <div class="pubEchart paymoney">
+          <p class="title"><span>各科室评级病历占比</span> <img src="../images/details.png" alt=""></p>
+          <div class="toggleSlide">
+            <p><span>甲级</span><img src="../images/arrow_down.png" alt=""> </p>
+            <ul>
+              <li class="toggleAverge toggleSlide1" data-str="甲级" data-level="甲" data-type="1">甲级</li>
+              <li class="toggleAverge toggleSlide2" data-str="乙级" data-level="乙" data-type="2">乙级</li>
+              <li class="toggleAverge toggleSlide2" data-str="丙级" data-level="丙" data-type="6">丙级</li>
+            </ul>
+          </div>
+          <div id="barChart" class="barChartPay"></div>
+          <div class="barChartPayEmpty"></div>
+        </div>
+        <!-- <div class="pubEchart paymoney">
           <p class="title"><span>科室平均住院天数柱状图</span> <img src="../images/details.png" alt=""></p>
           <div class="toggleSlide">
             <p><span>平均住院天数</span><img src="../images/arrow_down.png" alt=""> </p>
@@ -107,7 +120,7 @@
           </div>
           <div id="barChart" class="barChartPay"></div>
           <div class="barChartPayEmpty"></div>
-        </div>
+        </div> -->
       </div>
       <div class="part03 fl">
         <p class="partTitlePub clearfix">
@@ -118,7 +131,7 @@
           <div class="barChartLineEmpty"></div>
         </div>
         <div class="circle clearfix">
-          <p class="title">各科室缺陷占比 <img class="detailGo" src="../images/details.png" alt=""></p>
+          <p class="title">单项否决占比 <img class="detailGo" src="../images/details.png" alt=""></p>
           <div class="emptyCircleWrap">
             <div id="emptyCircle" class="emptyCircle"></div>
             <div class="explainPan explainPanT">

+ 1 - 1
src/html/qcList.html

@@ -57,7 +57,7 @@
                 </span>
                
                 <span class="filter">查询</span>
-                <!-- <span class="reset">重置</span> -->
+                <span class="export">导出</span>
                 <span class="filterclear abnormalClear filterclearT">重置</span>
             </div>
             <div class="overAuto">

+ 4 - 0
src/js/api.js

@@ -77,6 +77,10 @@ const api = {
     typeGetById:'/qc/qcType/getById',//根据id返回
     getQcAnnormalMode:'/qc/abnormal/getQcAnnormalMode',//异常修改
     saveAndupdataModel:'/qc/modelHospital/saveAndupdataModel',//异常保存
+    exportQcList:'/qc/behospitalInfo/exportQcresult',//质控评分导出
+    exportQcListDept:'/qc/behospitalInfo/exportQcresultByDept',//质控评分(科室)导出
+    entryRejectPercent:'/console/entryRejectPercent',//单项否决占比
+    qcResultLevelPercent:'/console/qcResultLevelPercent',//各科室甲乙丙级占比
 }
 module.exports = {
     api

+ 232 - 23
src/js/console.js

@@ -8,7 +8,7 @@ require("../images/arrow_down.png")
 const {api} = require('./api.js')
 const echarts = require('echarts');
 const {post,setCookie,delCookie,getCookie,focusMenuItem,picEmptyData} = require('../js/utils.js');
-let payMoney = [],dayLis = [],dateType = 2,slideType = 1,hospital=getCookie("hospital"),deptType="内科",deptId="";
+let payMoney = [],dayLis = [],dateType = 2,slideType = 1,hospital=getCookie("hospital"),deptType="内科",deptId="",level="甲";
 $(function(){
     if(!hasData('YH-KZT')){
         $("body").html('')
@@ -48,20 +48,34 @@ $(function(){
     $(".toggleSlide li").click(function(){
         let str = $(this).attr("data-str"),type = $(this).attr("data-type") 
         if(type == 1){
-            if(!hasData('FUNC000045')){
-                return
-            }
+            // if(!hasData('FUNC000045')){
+            //     return
+            // }
             slideType = 1
-            $(".pubEchart .title span").html("科室平均住院天数柱状图")
-            barChart(dayLis,dateType)
+            level = "甲"
+            getEveryDeptLevel()
+            // $(".pubEchart .title span").html("科室平均住院天数柱状图")
+            // barChart(dayLis,dateType)
             $(this).parent().slideToggle().prev().find("span").html(str)
         }else if(type == 2){
-            if(!hasData('FUNC000046')){
-                return
-            }
+            // if(!hasData('FUNC000046')){
+            //     return
+            // }
             slideType = 2
-            $(".pubEchart .title span").html("科室平均住院花费柱状图")
-            barChart(payMoney,dateType)
+            level = "乙"
+            getEveryDeptLevel()
+            // $(".pubEchart .title span").html("科室平均住院花费柱状图")
+            // barChart(payMoney,dateType)
+            $(this).parent().slideToggle().prev().find("span").html(str)
+        }else if(type == 6){
+            // if(!hasData('FUNC000046')){
+            //     return
+            // }
+            slideType = 6
+            level = "丙"
+            getEveryDeptLevel()
+            // $(".pubEchart .title span").html("科室平均住院花费柱状图")
+            // barChart(payMoney,dateType)
             $(this).parent().slideToggle().prev().find("span").html(str)
         }else if(type == 3){//科室平均分内科
             if(!hasData('FUNC000091')){
@@ -87,6 +101,7 @@ $(function(){
     })
     getDetails()
     getAverageScoreLis()
+    getEveryDeptLevel()
 })
 function getDetails(){
     $(".pubEchartB.paymoney .title").click(function(){
@@ -121,7 +136,7 @@ function getDetails(){
             $(parent.document).find("#contentIframe").attr("src","./dayDetail.html?from=1&dateType="+dateType)
         }
     })
-    $(".defect .partTitlePub").click(function(){//from 1 console / 2  deptConsole
+    $(".defect .partTitlePub").click(function(){    //from 1 console / 2  deptConsole
         focusMenuItem("YH-ZKK-GMKQXZB_XQ");
         $(parent.document).find("#contentIframe").attr("src","./mukuaiControl.html?from=1&dateType="+dateType)
     })
@@ -241,15 +256,16 @@ function getAverageScoreLis(){
         }
     })
 }
-//获取图表数据
-function getBarData(type){
-    if(hasData('FUNC000045')){
-        post(api.getAverageDayNum,{//平均住院天数
-            "type": type||1//1月2年
+//获取各科室病历等级占比
+function getEveryDeptLevel(){
+    if(1){
+        post(api.qcResultLevelPercent,{//各科室病历等级占比
+            "type": dateType||2,//1月2年
+            "level":level
         }).then((res)=>{
             let data = res.data;
             if(data.code == 0){
-                let result2 = data.data['平均住院日']||[]
+                let result2 = data.data||[]
                 dayLis = result2
                 if(slideType == 1){
                     barChart(result2,type||1)
@@ -259,6 +275,25 @@ function getBarData(type){
     }else{
         $(".toggleSlide1").css("opacity",0.5)
     }
+}
+//获取图表数据
+function getBarData(type){
+    // if(hasData('FUNC000045')){
+    //     post(api.getAverageDayNum,{//平均住院天数
+    //         "type": type||1//1月2年
+    //     }).then((res)=>{
+    //         let data = res.data;
+    //         if(data.code == 0){
+    //             let result2 = data.data['平均住院日']||[]
+    //             dayLis = result2
+    //             if(slideType == 1){
+    //                 barChart(result2,type||1)
+    //             }
+    //         }
+    //     })
+    // }else{
+    //     $(".toggleSlide1").css("opacity",0.5)
+    // }
     if(hasData('FUNC000046')){
         post(api.getAverageFee,{//平均住院费用
             "type": type||1//1月2年
@@ -307,6 +342,25 @@ function getBarData(type){
             }
         })
     }
+    if(false){
+        post(api.homePageLevelLimit,{//病案首页
+            "type": type||1//1月2年
+        }).then((res)=>{
+            let data = res.data;
+            if(data.code == 0){
+                let result1 = data.data||[]
+                let dataX1=[],dataY1=[],dataY2=[],dataY3=[]
+                console.log(result1)
+                for(let i = 0;i < result1.length;i++){
+                    dataX1.push(result1[i].deptName)
+                    dataY1.push(result1[i].firstLevelPercentStr.replace('%','')-0)
+                    dataY2.push(result1[i].emptyPercentStr.replace('%','')-0)
+                    dataY3.push(result1[i].errorPercentStr.replace('%','')-0)
+                }
+                lineChartHome(dataX1,dataY1,dataY2,dataY3)
+            }
+        })
+    }
     if(hasData('FUNC000049')){
         post(api.leaveHosCount,{//出院人数统计
             "type": type||1//1月2年
@@ -358,13 +412,28 @@ function getBarData(type){
             }
         })
     }
-    if(hasData('FUNC000053')){
-        post(api.entryByDept,{//各科室缺陷占比
+    // if(hasData('FUNC000053')){
+    //     post(api.entryByDept,{//各科室缺陷占比
+    //         "type": type||1//1月2年
+    //     }).then((res)=>{
+    //         let data = res.data;
+    //         if(data.code == 0){
+    //             let result2 = data.data['各科室缺陷占比']||[]
+    //             for(let i = 0;i < result2.length;i++){
+    //                 result2[i].value = result2[i].num
+    //             }
+    //             emptyCircle(result2)
+    //             panDetail(result2)
+    //         }
+    //     })
+    // }
+    if(1){
+        post(api.entryRejectPercent,{//单项否决
             "type": type||1//1月2年
         }).then((res)=>{
             let data = res.data;
             if(data.code == 0){
-                let result2 = data.data['各科室缺陷占比']||[]
+                let result2 = data.data||[]
                 for(let i = 0;i < result2.length;i++){
                     result2[i].value = result2[i].num
                 }
@@ -490,7 +559,7 @@ function part02pan(data,dom){
     };      
     dom.setOption(option);
 }
-//折现图
+//折现图各科室甲级病历占比(长兴)
 function lineChart(dataX,dataY){
     if(dataX.length==0&&dataY.length==0){
         $(".barChartLine").css("display","none")
@@ -706,6 +775,146 @@ function lineChartSpecial(dataX,dataY){
     };
     myCharts.setOption(option);
 }
+//折线图病案首页
+function lineChartHome(dataX,dataY1,dataY2,dataY3){
+    console.log(dataX,dataY1,dataY2,dataY3)
+    // if(dataX.length==0&&dataY.length==0){
+    //     $(".barChartLine").css("display","none")
+    //     picEmptyData(".barChartLineEmpty")
+    //     return
+    // }else{
+        // $(".barChartLine").css("display","block")
+        // $(".barChartLineEmpty").css("display","none")
+    // }
+    var myCharts = echarts.init(document.getElementById('lineChart'));
+    $(window).resize(function(){
+        myCharts.resize()
+    });
+    option = {
+        color:['#00A1FF','#FF2B92','#3EFFD1'],   
+        title: {
+            text: '百分比',
+            top: 15,
+            left: 10,
+            textStyle: {
+                fontSize: 14,
+                color:'#E9EBEF',
+                fontWeight: 400
+            }
+        },
+        tooltip: {
+            trigger: 'axis',
+            position: 'right',
+            axisPointer: {            // 坐标轴指示器,坐标轴触发有效
+                type: 'line'        // 默认为直线,可选为:'line' | 'shadow'
+            },
+            formatter: function(param) {           
+                return `<div style="color:#fff;">${param[0].name}<br>
+                    <i style="background:#00A1FF;margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>病案首页合格率:${param[0]&&param[0].value}%<br>
+                    <i style="background:#FF2B92;margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>病案首页合格率:${param[1]&&param[1].value}%<br>
+                    <i style="background:#3EFFD1;margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>病案首页合格率:${param[2]&&param[2].value}%<br>
+                </div>`
+            }
+        },
+        // legend: {
+        //     selectedMode :false,
+        //     right:15,
+        //     top:15,
+        //     data: [
+        //         {
+        //             name: '合格率',
+        //             textStyle: {
+        //                 color: '#A5ADBF'
+        //             }
+        //         },
+        //         {
+        //             name: '完整率',
+        //             textStyle: {
+        //                 color: '#A5ADBF'
+        //             }
+        //         },
+        //         {
+        //             name: '完善率',
+        //             textStyle: {
+        //                 color: '#A5ADBF'
+        //             }
+        //         }
+        //     ]
+        // },
+        grid: {
+            left: '3%',
+            right: '4%',
+            bottom: '3%',
+            containLabel: true
+        },
+        xAxis: {
+            type: 'category',
+            boundaryGap: false,
+            data: dataX,
+            axisTick: {
+                alignWithLabel: true
+            },
+            axisLabel: {//x轴刻度
+                textStyle: {
+                    color: '#E9EBEF'
+                },
+                rotate:45,
+                formatter: function (value) {
+                    //x轴的文字改为竖版显示
+                    if(value.length>7){
+                        return value.slice(0,7)+'...'
+                    }
+                    return value;
+                 }
+            },
+            axisLine: {//x轴
+                lineStyle:{
+                    color:'#4A5D8E'
+                }
+            }
+        },
+        yAxis: {
+            type: 'value',
+            axisLine: {//y轴
+                show: false
+            },
+            axisTick: {
+                show: false
+            },
+            axisLabel: {//y轴刻度
+                textStyle: {
+                    color: '#E9EBEF'
+                }
+            },
+            splitLine:{//分割线
+                lineStyle:{
+                    color:'#344876'
+                }
+            }
+        },
+        series: [
+            {
+                name: '合格率',
+                type: 'line',
+                stack: '总量',
+                data: dataY1
+            },
+            {
+                name: '完整率',
+                type: 'line',
+                stack: '总量',
+                data: dataY2
+            },
+            {
+                name: '完善率',
+                type: 'line',
+                stack: '总量',
+                data: dataY3
+            }
+        ]
+    };   
+    myCharts.setOption(option); 
+}
 //柱状图住院费用
 function barChartPay(dataX,dataY){
     // console.log(dataX,dataY,78787878)
@@ -1289,7 +1498,7 @@ function panDetail(data){
         let deptName = $(this).attr("data-dept")
         let deptId = $(this).attr("dept-id")
         focusMenuItem("YH-ZKK-GKSQXZB_XQ");
-        $(parent.document).find("#contentIframe").attr("src","quexianDetailControl.html?shijian"+dateType+"&deptName="+deptName)
+        $(parent.document).find("#contentIframe").attr("src","singleVeto.html?shijian"+dateType+"&qxName="+deptName)
     })
 }
 function panDetailB(data){

+ 19 - 2
src/js/qcList.js

@@ -2,7 +2,7 @@ const $ = require('jquery');
 require("../css/qcList.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew,emptyBox} = require('./utils.js')
+const {post,getCookie,getUrlArgObjectNew,emptyBox,downloadExportedData,expJson} = 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")
@@ -130,6 +130,7 @@ $(".filter").on("click", function(e){
     if(behosDateEnd){
         behosDateEnd = behosDateEnd.replace(/\//g,'-') + ' 23:59:59'
     }
+
     name = nameTemp
     behospitalCode = behospitalCodeTemp
     level = levelTemp==="全部"?"":levelTemp
@@ -600,6 +601,22 @@ $(document).on("click", function(){
     $(".selectLevel .arrow").attr("src",iconDown)
     
 })
-
 $((function($){
+
+    $('.export').click(function(){
+        // if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > 7){
+        //     $.alerModal({"message":"最多只能导出7天",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+        // }
+        const param = {
+            "behospitalCode": behospitalCode,
+            "deptId": deptId,
+            "doctorCode":doctorNum,
+            "doctorName": doctorName,
+            "leaveHosDateEnd": '2020-04-03 00:00:00'||behosDateEnd,
+            "leaveHosDateStart": '2020-04-01 00:00:00'||behosDateStart,
+            "level": 2||level,
+            "name": name
+        }
+        expJson(api.exportQcList,param)
+    })
 })($));

+ 74 - 2
src/js/utils.js

@@ -1,7 +1,7 @@
 const qs = require('qs');
 const $ = require("jquery");
 var Utils = require('./rePromise');
-const baseUrl = "http://192.168.2.241:5858"
+const baseUrl = "http://192.168.2.236:5858"
 //页面映射
 const pageMap={
   'YH-KZT':'console.html',
@@ -125,6 +125,76 @@ const post = function (url, data) {
   });
 }
 
+// 导出
+const expJson = (url,data) =>{
+  const token = getCookie('accessToken')
+  if(!token&&window.location.href.indexOf('login')==-1){
+    window.location.href = "../login.html"
+  }
+  let need = window.location.href.indexOf('localhost')!=-1
+    $.ajax({
+      method: 'post',
+      url: (need?baseUrl:'')+url,
+      // async:true,
+      // cache: false,
+      // contentType: false,
+      // processData: false,
+      data: JSON.stringify(data),
+      contentType: "application/json; charset=utf-8",
+      // contentType: "application/vnd.ms-excel" ,
+      // contentType: "application/vnd.ms-excel;charset=UTF-8",
+      responseType: 'arraybuffer', //必须添加,否则会乱码
+			// xhrFields: { responseType: "arraybuffer" },
+      beforeSend: function (xmlHttp) {
+        // xmlHttp.setRequestHeader("If-Modified-Since", "0");
+        // xmlHttp.setRequestHeader("Cache-Control", "no-cache");
+        xmlHttp.setRequestHeader("Authorization",token?"Bearer "+token:'')
+      },
+      success: function (res) {
+        let data = res
+        var blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}); //type表示xlsx类型
+        // var blob = new Blob([data], {type: 'application/vnd.ms-excel;charset=utf-8'}); //type表示xls类型
+        // var blob = new Blob([data], {type: 'APPLICATION/OCTET-STREAM;charset=UTF-8'}); //type表示xlsx类型
+        var href = window.URL.createObjectURL(blob);//创建下载的链接
+        // 为兼容FF26 (不支持a标签的模拟点击事件)
+         if (navigator.userAgent.indexOf("Firefox") > -1){
+            //window.open(requestUrl);
+            window.location.href = href;
+         }else {
+            var downloadElement = document.createElement('a');
+            downloadElement.href = href;
+            downloadElement.download = "fileName004.xlsx"; //下载后文件名
+            document.body.appendChild(downloadElement);
+            downloadElement.click(); //点击下载
+            document.body.removeChild(downloadElement); //下载完成移除元素
+            window.URL.revokeObjectURL(href);
+         }
+      }
+    });
+}
+
+// 导出
+function downloadExportedData(data, fileName) {
+  var blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}); //type表示xlsx类型
+  // var blob = new Blob([data], {type: 'application/vnd.ms-excel;charset=utf-8'}); //type表示xls类型
+  // var blob = new Blob([data], {type: 'APPLICATION/OCTET-STREAM;charset=UTF-8'}); //type表示xlsx类型
+  var href = window.URL.createObjectURL(blob);//创建下载的链接
+  // 为兼容FF26 (不支持a标签的模拟点击事件)
+   if (navigator.userAgent.indexOf("Firefox") > -1){
+      //window.open(requestUrl);
+      window.location.href = href;
+   }else {
+      var downloadElement = document.createElement('a');
+      downloadElement.href = href;
+      downloadElement.download = "fileName.xlsx"; //下载后文件名
+      document.body.appendChild(downloadElement);
+      downloadElement.click(); //点击下载
+      document.body.removeChild(downloadElement); //下载完成移除元素
+      window.URL.revokeObjectURL(href);
+   }
+  
+}
+
 //判断浏览器是否为Ie8
 const isIe8 = function () {
   var DEFAULT_VERSION = 8.0;
@@ -231,5 +301,7 @@ module.exports = {
   focusMenuItem,
   emptyBox,
   picEmptyData,
-  setTitleTxt
+  setTitleTxt,
+  downloadExportedData,
+  expJson
 };