|
@@ -8,22 +8,23 @@ const echarts = require('echarts');
|
|
|
const {post,setCookie,delCookie,getCookie} = require('../js/utils.js');
|
|
|
|
|
|
$(function(){
|
|
|
-// var mySwiper = new Swiper('.swiper-container',{
|
|
|
-// // autoplay : 500,//可选选项,自动滑动
|
|
|
-// loop : true,//可选选项,开启循环
|
|
|
-// slidesPerView : 3,
|
|
|
-// })
|
|
|
+ $(".partTitle p span").html(getCookie("hospital"))
|
|
|
+ setInterval(() => {
|
|
|
+ getTimeDetail()
|
|
|
+ }, 1000);
|
|
|
+ resizeBox()
|
|
|
+ initConsole()//质控列表
|
|
|
+ getBarData()//图标数据获取
|
|
|
+ dateChange()
|
|
|
+ $(window).click(function(){
|
|
|
+ window.parent.userActionHide()
|
|
|
+ })
|
|
|
+})
|
|
|
+function resizeBox(){
|
|
|
$(".partWrap").css({
|
|
|
height:$(window).height()-38+'px'
|
|
|
})
|
|
|
- $(".partTitle p span").html(getCookie("hospital"))
|
|
|
- initConsole()//质控列表
|
|
|
- getBarData()//图标数据获取
|
|
|
- dateChange()
|
|
|
- $(window).click(function(){
|
|
|
- window.parent.userActionHide()
|
|
|
- })
|
|
|
-})
|
|
|
+}
|
|
|
//所有数据切换日期筛选
|
|
|
function dateChange(){
|
|
|
$(".monthYear .mon").click(function(){
|
|
@@ -95,16 +96,52 @@ function getBarData(type){
|
|
|
if(data.code == 0){
|
|
|
let result = data.data
|
|
|
let result1 = data.data['出院人数统计']||[]
|
|
|
- let result2 = data.data['各科室甲级病历占比']||[]
|
|
|
+ personNum(result1)
|
|
|
let result3 = data.data['病历数统计']||[]
|
|
|
+ if(result3.length == 0){
|
|
|
+ result3 = [
|
|
|
+ {
|
|
|
+ "id":null,
|
|
|
+ "name":"累计质控病历数",
|
|
|
+ "totleNum":0,
|
|
|
+ "num":0,
|
|
|
+ "percent":null,
|
|
|
+ "percentStr":null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":null,
|
|
|
+ "name":"甲级病历",
|
|
|
+ "totleNum":10,
|
|
|
+ "num":0,
|
|
|
+ "percent":0,
|
|
|
+ "percentStr":"0.00%"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":null,
|
|
|
+ "name":"乙级病历",
|
|
|
+ "totleNum":10,
|
|
|
+ "num":0,
|
|
|
+ "percent":0,
|
|
|
+ "percentStr":"0.00%"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":null,
|
|
|
+ "name":"丙级病历",
|
|
|
+ "totleNum":10,
|
|
|
+ "num":0,
|
|
|
+ "percent":0,
|
|
|
+ "percentStr":"0.00%"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ setNumDetail(result3)
|
|
|
+ let result2 = data.data['各科室甲级病历占比']||[]
|
|
|
let dataX2=[],dataY2=[];
|
|
|
for(let i = 0;i < result2.length;i++){
|
|
|
dataX2.push(result2[i].deptName)
|
|
|
dataY2.push(result2[i].firstPercent.replace('%',''))
|
|
|
}
|
|
|
- personNum(result1)
|
|
|
lineChart(dataX2,dataY2)
|
|
|
- setNumDetail(result3)
|
|
|
}
|
|
|
})
|
|
|
post('/console/averageStatistics',{//平均住院日,平均住院费用,各科室质控平均分
|
|
@@ -112,15 +149,15 @@ function getBarData(type){
|
|
|
}).then((res)=>{
|
|
|
let data = res.data;
|
|
|
if(data.code == 0){
|
|
|
- let result1 = data.data['平均住院费用']||[]
|
|
|
+ let result1 = data.data['各科室质控平均分']||[]
|
|
|
let result2 = data.data['平均住院日']||[]
|
|
|
let dataX1=[],dataY1=[],dataX2=[],dataY2=[];
|
|
|
for(let i = 0;i < result1.length;i++){
|
|
|
- dataX1.push(result1[i].deptName)
|
|
|
+ dataX1.push(result1[i].name)
|
|
|
dataY1.push(result1[i].averageValue)
|
|
|
}
|
|
|
barChartPay(dataX1,dataY1)
|
|
|
- barChart(result2)
|
|
|
+ barChart(result2,type||1)
|
|
|
}
|
|
|
})
|
|
|
post('/console/resultStatistics',{//各科室缺陷占比,各模块缺陷占比排行,条目缺陷占比
|
|
@@ -154,6 +191,7 @@ function personNum(data){
|
|
|
}
|
|
|
//part02
|
|
|
function setNumDetail(data){
|
|
|
+ // console.log(data,2222222222)
|
|
|
if(data.length == 0)return
|
|
|
let str = ''
|
|
|
for(let i = 0;i < data.length;i++){
|
|
@@ -187,9 +225,9 @@ function setNumDetail(data){
|
|
|
}
|
|
|
$('.bingli').html(str)
|
|
|
}
|
|
|
-
|
|
|
//part02pan
|
|
|
function part02pan(data,dom){
|
|
|
+ // console.log(data,33333)
|
|
|
dom = echarts.init(document.getElementById(dom));
|
|
|
$(window).resize(function(){
|
|
|
dom.resize()
|
|
@@ -295,7 +333,14 @@ function lineChart(dataX,dataY){
|
|
|
textStyle: {
|
|
|
color: '#333'
|
|
|
},
|
|
|
- rotate:'45'
|
|
|
+ rotate:'45',
|
|
|
+ formatter: function (value) {
|
|
|
+ //x轴的文字改为竖版显示
|
|
|
+ if(value.length>7){
|
|
|
+ return value.slice(0,7)+'...'
|
|
|
+ }
|
|
|
+ return value;
|
|
|
+ }
|
|
|
},
|
|
|
axisLine: {//x轴
|
|
|
lineStyle:{
|
|
@@ -345,6 +390,7 @@ function barChartPay(dataX,dataY){
|
|
|
color: ['#3398DB'],
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
+ position: 'right',
|
|
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
type: 'line' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
}
|
|
@@ -366,7 +412,14 @@ function barChartPay(dataX,dataY){
|
|
|
textStyle: {
|
|
|
color: '#333'
|
|
|
},
|
|
|
- rotate:lengthNum>8?30:0
|
|
|
+ rotate:45,
|
|
|
+ formatter: function (value) {
|
|
|
+ //x轴的文字改为竖版显示
|
|
|
+ if(value.length>7){
|
|
|
+ return value.slice(0,7)+'...'
|
|
|
+ }
|
|
|
+ return value;
|
|
|
+ }
|
|
|
},
|
|
|
axisLine: {//x轴
|
|
|
lineStyle:{
|
|
@@ -398,7 +451,7 @@ function barChartPay(dataX,dataY){
|
|
|
|
|
|
],
|
|
|
title:[{
|
|
|
- text: '平均住院费用',
|
|
|
+ text: '分数',
|
|
|
top: 15,
|
|
|
left: 10,
|
|
|
textStyle: {
|
|
@@ -409,9 +462,9 @@ function barChartPay(dataX,dataY){
|
|
|
}],
|
|
|
series: [
|
|
|
{
|
|
|
- name: '平均住院费用',
|
|
|
+ name: '质控平均分',
|
|
|
type: 'bar',
|
|
|
- barWidth: lengthNum<5?'8%':'23%',
|
|
|
+ barWidth: '23%',
|
|
|
data: dataY
|
|
|
}
|
|
|
]
|
|
@@ -419,7 +472,7 @@ function barChartPay(dataX,dataY){
|
|
|
myCharts.setOption(option);
|
|
|
}
|
|
|
//柱状图住院日期
|
|
|
-function barChart(data){
|
|
|
+function barChart(data,type){
|
|
|
var myChart = echarts.init(document.getElementById('barChart'));
|
|
|
$(window).resize(function(){
|
|
|
myChart.resize()
|
|
@@ -511,12 +564,10 @@ function barChart(data){
|
|
|
let data3 = []
|
|
|
for(let i = 0;i < data.length;i++){
|
|
|
dataX.push(data[i].name)
|
|
|
- data1.push(data[i].averageValue)
|
|
|
- data2.push(data[i].lastAverageValue)
|
|
|
- data3.push(data[i].lastYearAverageValue)
|
|
|
+ data1.push(data[i].averageValue)//本月
|
|
|
+ data2.push(data[i].lastAverageValue)//本年
|
|
|
+ data3.push(data[i].lastYearAverageValue)//去年本月
|
|
|
}
|
|
|
-
|
|
|
- console.log(dataX)
|
|
|
option = {
|
|
|
color: ['#5A8EEE', '#FAD336', '#37CBCB'],
|
|
|
tooltip: {
|
|
@@ -546,6 +597,7 @@ function barChart(data){
|
|
|
itemHeight :8,
|
|
|
right:15,
|
|
|
top:15,
|
|
|
+ selectedMode:false,
|
|
|
formatter: function (name) {
|
|
|
return name;
|
|
|
}
|
|
@@ -572,13 +624,20 @@ function barChart(data){
|
|
|
textStyle: {
|
|
|
color: '#333'
|
|
|
},
|
|
|
- rotate:'45'
|
|
|
+ rotate:'45',
|
|
|
+ formatter: function (value) {
|
|
|
+ //x轴的文字改为竖版显示
|
|
|
+ if(value.length>7){
|
|
|
+ return value.slice(0,7)+'...'
|
|
|
+ }
|
|
|
+ return value;
|
|
|
+ }
|
|
|
},
|
|
|
axisLine: {//x轴
|
|
|
lineStyle:{
|
|
|
color:'#AAAAAA'
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
],
|
|
|
yAxis: [
|
|
@@ -599,22 +658,22 @@ function barChart(data){
|
|
|
],
|
|
|
series: [
|
|
|
{
|
|
|
- name: '上月',
|
|
|
+ name: type==1?'上月':'',
|
|
|
type: 'bar',
|
|
|
barGap: 0,
|
|
|
label: labelOption,
|
|
|
barWidth: '15%',
|
|
|
- data: data2
|
|
|
+ data: type==1?data2:[]
|
|
|
},
|
|
|
{
|
|
|
- name: '去年本月',
|
|
|
+ name: type==1?'去年本月':'去年',
|
|
|
type: 'bar',
|
|
|
label: labelOption,
|
|
|
barWidth: '15%',
|
|
|
data: data3
|
|
|
},
|
|
|
{
|
|
|
- name: '本月',
|
|
|
+ name: type==1?'本月':'本年',
|
|
|
type: 'bar',
|
|
|
label: labelOption,
|
|
|
barWidth: '15%',
|
|
@@ -626,7 +685,7 @@ function barChart(data){
|
|
|
}
|
|
|
//空心饼图
|
|
|
function emptyCircle(data){
|
|
|
- console.log(data,1111111111)
|
|
|
+ // console.log(data,1111111111)
|
|
|
var myChart = echarts.init(document.getElementById('emptyCircle'));
|
|
|
$(window).resize(function(){
|
|
|
myChart.resize()
|
|
@@ -729,7 +788,6 @@ function emptyCircleB(data){
|
|
|
let title = '总量';
|
|
|
let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
|
|
|
let echartData = data;
|
|
|
- console.log(data)
|
|
|
let total = 0;
|
|
|
for(let i = 0;i < echartData.length;i++){
|
|
|
total += echartData[i].num
|
|
@@ -759,6 +817,7 @@ function emptyCircleB(data){
|
|
|
}],
|
|
|
tooltip: {
|
|
|
trigger: 'item',
|
|
|
+ position: 'right',
|
|
|
// formatter: '{b} : {c} ({d}%)',
|
|
|
formatter:function(item){
|
|
|
const {name, num, percentStr} = item.data
|
|
@@ -843,7 +902,9 @@ function panDetail(data){
|
|
|
for(let i = 0;i < data.length;i++){
|
|
|
strAll += `
|
|
|
<tr class="explainLi">
|
|
|
- <td class="deptName" title="${data[i].name}"><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</td>
|
|
|
+ <td class="deptName" title="${data[i].name}">
|
|
|
+ <p class="smp"><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
|
|
|
+ </td>
|
|
|
<td class="deptNum">${data[i].num}</td>
|
|
|
<td class="percent">(${data[i].percentStr})</td>
|
|
|
</tr>
|
|
@@ -860,7 +921,9 @@ function panDetailB(data){
|
|
|
for(let i = 0;i < data.length;i++){
|
|
|
strAll += `
|
|
|
<tr class="explainLi">
|
|
|
- <td class="deptName" title="${data[i].name}"><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</td>
|
|
|
+ <td class="deptName" title="${data[i].name}">
|
|
|
+ <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
|
|
|
+ </td>
|
|
|
<td class="deptNum">${data[i].num}</td>
|
|
|
<td class="percent">(${data[i].percentStr})</td>
|
|
|
</tr>
|
|
@@ -870,4 +933,14 @@ function panDetailB(data){
|
|
|
$(".explainPan").css({
|
|
|
marginTop:-($(".explainPan").height()/2-20)+'px'
|
|
|
})
|
|
|
+}
|
|
|
+//时间获取
|
|
|
+function getTimeDetail(){
|
|
|
+ const d = new Date();
|
|
|
+ const days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
|
|
|
+ let sec = d.getSeconds()
|
|
|
+ let min = d.getMinutes()
|
|
|
+ let hour = d.getHours()
|
|
|
+ let str = `${d.getFullYear()}年${d.getMonth()+1}月${d.getDate()}日 / ${days[d.getDay()]} / ${hour>9?hour:'0'+hour}:${min>9?min:'0'+min}:${sec>9?sec:'0'+sec}`
|
|
|
+ $(".dateDetail").html(str)
|
|
|
}
|