|
@@ -7,7 +7,7 @@ require("../images/arrow_down.png")
|
|
|
// import 'zrender/lib/svg/svg';
|
|
|
const echarts = require('echarts');
|
|
|
const {post,setCookie,delCookie,getCookie} = require('../js/utils.js');
|
|
|
-let payMoney = [],dayLis = [],dataType = 1;
|
|
|
+let payMoney = [],dayLis = [],dateType = 1,slideType = 1;
|
|
|
$(function(){
|
|
|
if(!hasData('YH-KZT')){
|
|
|
$("body").html('')
|
|
@@ -40,14 +40,16 @@ $(function(){
|
|
|
if(!hasData('FUNC000045')){
|
|
|
return
|
|
|
}
|
|
|
+ slideType = 1
|
|
|
$(".pubEchart .title").html("科室平均住院天数柱状图")
|
|
|
- barChart(dayLis,dataType)
|
|
|
+ barChart(dayLis,dateType)
|
|
|
}else{
|
|
|
if(!hasData('FUNC000046')){
|
|
|
return
|
|
|
}
|
|
|
+ slideType = 2
|
|
|
$(".pubEchart .title").html("科室平均住院花费柱状图")
|
|
|
- barChart(payMoney,dataType)
|
|
|
+ barChart(payMoney,dateType)
|
|
|
}
|
|
|
$(this).parent().slideToggle().prev().find("span").html(str)
|
|
|
})
|
|
@@ -76,7 +78,7 @@ function dateChange(){
|
|
|
color:'#5A8EEE',
|
|
|
backgroundColor:'#fff'
|
|
|
})
|
|
|
- dataType = 1
|
|
|
+ dateType = 1
|
|
|
getBarData(1)
|
|
|
})
|
|
|
$(".monthYear .year").click(function(){
|
|
@@ -87,7 +89,7 @@ function dateChange(){
|
|
|
color:'#5A8EEE',
|
|
|
backgroundColor:'#fff'
|
|
|
})
|
|
|
- dataType = 2
|
|
|
+ dateType = 2
|
|
|
getBarData(2)
|
|
|
})
|
|
|
}
|
|
@@ -132,6 +134,7 @@ function initConsole(result){
|
|
|
}
|
|
|
//获取图表数据
|
|
|
function getBarData(type){
|
|
|
+ console.log(slideType,'797979898')
|
|
|
if(hasData('FUNC000045')){
|
|
|
post('/console/getAverageDayNum',{//平均住院天数
|
|
|
"type": type||1//1月2年
|
|
@@ -140,7 +143,9 @@ function getBarData(type){
|
|
|
if(data.code == 0){
|
|
|
let result2 = data.data['平均住院日']||[]
|
|
|
dayLis = result2
|
|
|
- barChart(result2,type||1)
|
|
|
+ if(slideType == 1){
|
|
|
+ barChart(result2,type||1)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
@@ -154,7 +159,9 @@ function getBarData(type){
|
|
|
if(data.code == 0){
|
|
|
let result3 = data.data['平均住院费用']||[]
|
|
|
payMoney = result3;
|
|
|
- barChart(result2,type||1)
|
|
|
+ if(slideType == 2){
|
|
|
+ barChart(result3,type||1)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
@@ -585,6 +592,7 @@ function barChartPay(dataX,dataY){
|
|
|
}
|
|
|
//柱状图住院日期
|
|
|
function barChart(data,type){
|
|
|
+ // console.log(data,type)
|
|
|
var myChart = echarts.init(document.getElementById('barChart'));
|
|
|
$(window).resize(function(){
|
|
|
myChart.resize()
|
|
@@ -695,7 +703,7 @@ function barChart(data,type){
|
|
|
containLabel: true
|
|
|
},
|
|
|
title:[{
|
|
|
- text: type==1?'天数':'元',
|
|
|
+ text: slideType==1?'天数':'元',
|
|
|
top: 15,
|
|
|
left: 10,
|
|
|
textStyle: {
|