瀏覽代碼

6.9发布

luolei 5 年之前
父節點
當前提交
71e8e91b9f
共有 5 個文件被更改,包括 290 次插入61 次删除
  1. 15 2
      src/html/console.html
  2. 2 0
      src/js/api.js
  3. 232 23
      src/js/console.js
  4. 7 12
      src/js/qcList.js
  5. 34 24
      src/js/utils.js

+ 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">

+ 2 - 0
src/js/api.js

@@ -79,6 +79,8 @@ const api = {
     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)
@@ -1292,7 +1501,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)
 
     })
 }

+ 7 - 12
src/js/qcList.js

@@ -604,24 +604,19 @@ $(document).on("click", function(){
 $((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)});
-        }
+        // 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": behosDateEnd,
-            "leaveHosDateStart": behosDateStart,
-            "level": level,
+            "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).then(res =>{
-            downloadExportedData(res.data)
-            
-        }).catch((e) =>{
-            $.alerModal({"message":"导出失败",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
-        })
+        expJson(api.exportQcList,param)
     })
 })($));

+ 34 - 24
src/js/utils.js

@@ -1,7 +1,7 @@
 const qs = require('qs');
 const $ = require("jquery");
 var Utils = require('./rePromise');
-const baseUrl = "http://192.168.3.113:5858"
+const baseUrl = "http://192.168.2.236:5858"
 //页面映射
 const pageMap={
   'YH-KZT':'console.html',
@@ -132,42 +132,52 @@ const expJson = (url,data) =>{
     window.location.href = "../login.html"
   }
   let need = window.location.href.indexOf('localhost')!=-1
-  return new Utils((resolve, reject) => {
     $.ajax({
       method: 'post',
       url: (need?baseUrl:'')+url,
-      async:true,
-      cache: false,
-      contentType: false,
-      processData: false,
+      // async:true,
+      // cache: false,
+      // contentType: false,
+      // processData: false,
       data: JSON.stringify(data),
-      contentType: "application/json; charset=UTF-8",
+      contentType: "application/json; charset=utf-8",
+      // contentType: "application/vnd.ms-excel" ,
       // contentType: "application/vnd.ms-excel;charset=UTF-8",
-      // responseType: 'blob', //必须添加,否则会乱码
+      responseType: 'arraybuffer', //必须添加,否则会乱码
+			// xhrFields: { responseType: "arraybuffer" },
       beforeSend: function (xmlHttp) {
-        xmlHttp.setRequestHeader("If-Modified-Since", "0");
-        xmlHttp.setRequestHeader("Cache-Control", "no-cache");
+        // xmlHttp.setRequestHeader("If-Modified-Since", "0");
+        // xmlHttp.setRequestHeader("Cache-Control", "no-cache");
         xmlHttp.setRequestHeader("Authorization",token?"Bearer "+token:'')
       },
       success: function (res) {
-        resolve({ data: res });
-      },
-      error: function (error) {
-        if(error.status===403||error.status===401){
-          const wd = window.parent.window||window;
-          wd.location.href = "../login.html";
-        }
-        reject(error);
-      },
+        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表示xlsx类型
-  var blob = new Blob([data], {type: 'APPLICATION/OCTET-STREAM;charset=UTF-8'}); //type表示xlsx类型
+  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){
@@ -176,7 +186,7 @@ function downloadExportedData(data, fileName) {
    }else {
       var downloadElement = document.createElement('a');
       downloadElement.href = href;
-      downloadElement.download = fileName; //下载后文件名
+      downloadElement.download = "fileName.xlsx"; //下载后文件名
       document.body.appendChild(downloadElement);
       downloadElement.click(); //点击下载
       document.body.removeChild(downloadElement); //下载完成移除元素