Browse Source

Merge branch 'master' of http://192.168.1.220:10080/raolu/sr-iHealthApp

chenyue 6 years ago
parent
commit
1355873dc0

+ 5 - 5
html/home/html/admin.html

@ -57,26 +57,26 @@
						<div class="clearfix ">
							<ul class="l-qytj-barner">
								<li>
									<div id="zcjmAmount" class="l-qytj-val l-data c-f20 c-17b3ec">30000</div>
									<div id="zcjmAmount" class="l-qytj-val l-data c-f20 c-17b3ec">0</div>
									<div class="l-qytj-name c-f12">注册居民></div>
								</li>
								<li>
									<div id="jmzxlAmount" class="l-qytj-val l-data c-f20 c-17b3ec">102568</div>
									<div id="jmzxlAmount" class="l-qytj-val l-data c-f20 c-17b3ec">0</div>
									<div class="l-qytj-name c-f12">居民咨询量></div>
								</li>
							</ul>
							
							<ul class="l-qytj-barner">
								<li>
									<div id="bdwxAmount" class="l-qytj-val l-data c-f20 c-06bf04">1452</div>
									<div id="jmgzAmount" class="l-qytj-val l-data c-f20 c-06bf04">0</div>
									<div class="l-qytj-name c-f12">居民关注></div>
								</li>
								<li>
									<div id="jkjyAmount" class="l-qytj-val l-data c-f20 c-ffd429">4752</div>
									<div id="jkjyAmount" class="l-qytj-val l-data c-f20 c-ffd429">0</div>
									<div class="l-qytj-name c-f12">健康教育></div>
								</li>
								<li>
									<div id="jkzdAmount" class="l-qytj-val l-data c-f20 c-ffa54b">854</div>
									<div id="jkzdAmount" class="l-qytj-val l-data c-f20 c-ffa54b">0</div>
									<div class="l-qytj-name c-f12">健康指导></div>
								</li>
							</ul>

+ 46 - 25
html/home/js/admin.js

@ -8,22 +8,28 @@ var $docPhoto = $("#doc_photo"),//头像
mui.plusReady(function() {
    plus.nativeUI.showWaiting();
    userRole = JSON.parse(plus.storage.getItem("userRole"));
    
    window.addEventListener("refreshData", function() {
       getJieZhiTime()
    });
    initQiehuanDom();//切换角色事件
    initData();
    getJieZhiTime();
    getAlalysisData();
    bindEvents();
    initScroll();
}); 
/*
 * 初始化处理各个数据
 */
function initData(){
	userRole = JSON.parse(plus.storage.getItem("userRole"));
    area = userRole[0].code;
    
    roleLevel = area == '361100'  ? 4 : area.length==6 ? 3 : 2;
    //保存默认的角色权限信息
    var selectedRole = JSON.stringify(userRole[0]);
    plus.storage.setItem("selectedRole", selectedRole);
    window.addEventListener("refreshData", function() {
       getJieZhiTime()
    });
    //切换角色事件
    initQiehuanDom();
    
    var docInfo = JSON.parse(plus.storage.getItem("docInfo"));
    
    var deptName =docInfo.deptName;
    var jobName=docInfo.jobName;
    var docName = docInfo.name;//姓名
@ -53,12 +59,8 @@ mui.plusReady(function() {
    if(!isMultiRole()){
        checkIdcard(docInfo.idcard);
    }
    
    getJieZhiTime();
    bindEvents();
    $('#wrapper').height($(window).height())
    initScroll();
}); 
	$('#wrapper').height($(window).height());
}
/*
 * 加载数据截止时间
@ -70,6 +72,23 @@ function getJieZhiTime(){
            var date = (res.data && res.data.substring(11,16)) || "";
            $(".jiezhi-time").html(date);
        }
    });
}
/*
 * 获取统计数据
 */
function getAlalysisData(){//level:等级(1 团队,2 科室,3 机构,4 区)此处传3
	sendGet("/statistics/getIndexTotal",{endDate:getDateFromNow(),area:srOrgCode,level:3},function(res){
    },function(res){
        if(res.status==200){
        	var data = res.data;
        	$("#zcjmAmount").html(data.reginNum);
        	$("#jmzxlAmount").html(data.consultNum);
        	$("#jmgzAmount").html(data.concernNum);
        	$("#jkjyAmount").html(data.educateNum);
        	$("#jkzdAmount").html(data.guideNum);
        }
        plus.nativeUI.closeWaiting();
    });
}
@ -262,14 +281,16 @@ function ysty(){
        return;
    }
    var userRole = JSON.parse(plus.storage.getItem("selectedRole"));
    if(roleLevel == 2 || roleLevel == 3 || roleLevel == 4){
        openWebview('../../observer/html/doctors.html', {code: userRole.code});
    }
    if(roleLevel == undefined || roleLevel == null || roleLevel == 1){
        mui.confirm("对不起,您无操作权限","提示",
            ["我知道了"], function(e){
            if(e.index==0) return false;
       });
    }
    openWebview('../../observer/html/doctors.html', {code: userRole.code});
}
//获取当前时间
function getDateFromNow(days) {
	if(!days) {
		return new Date().format("yyyy-MM-dd")
	}
	var now = new Date().getTime()
	var diff = 24 * 3600 * 1000 * days
	return new Date(now + diff).format("yyyy-MM-dd")
}

+ 29 - 7
html/tuandui/css/gongzuobaogao.css

@ -5,13 +5,13 @@
	color: #323232;
	border-width: 1px 0;
	border-style: solid;
	border-color: #ccc;
	border-color: #e1e1e1;
}
.gzbg-tit {
	height: 40px;
	line-height: 40px;
	border-bottom: 1px solid #ccc;
	border-bottom: 1px solid #e1e1e1;
}
.gzbg-tit span {
@ -83,7 +83,7 @@
	height: 80px;
	display: inline-block;
	vertical-align: middle;
	margin-left: 20px;
	margin-left: 25px;
	padding-top: 3px;
}
@ -344,13 +344,13 @@
.jgnph{
	text-align: center;
	position: absolute;
	width: 98%;
	top: 17px;
	width: calc(100% - 40px - 7%);
	top: 5px;
	left: 43px;
	font-size: 0;
}
.jgnph li{
	width: 18%;
	/*width: 14%;*/
	width: 33.3%;
	display: inline-block;
	font-size: 14px;
	vertical-align: middle;
@ -419,3 +419,25 @@
	display: inline-block;
	vertical-align: middle;
}
.mui-loading{
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -16px;
    margin-left: -16px;
}
.lin-sel-group li.active img{
    display: inline-block;
}
.blue-column{
    display: inline-block;
    width: 4px;
    height: 12px;
    background-color: #12b7f5;
}
.fa-angle-right{
    position: absolute;
    right: 10px;
    font-size: 20px;
    color: #999;
}

+ 9 - 3
html/tuandui/html/gongzuobaogao.html

@ -69,9 +69,13 @@
		<!--咨询统计-->
		<ul class="gzbg-echarts">
			<li class="gzbg-tit"><i class="gzbg-icon zxtj-icon"></i><span>咨询统计</span></li>
			<li class="gzbg-con">
			<li class="gzbg-con zxtj">
			    <div class="mui-loading">
                    <div class="mui-spinner">
                    </div>
                </div>
				<div id="zxtjChart" style="height: 148px;width: 100%;"></div>
				<div class="zxtj-info">
				<!--<div class="zxtj-info">
					<div class="mtb5">
                        <span class="zxtj-r" style="background: #17b3ec;"></span>
                        <span class="c-f12 c-666">未回复咨询:&nbsp;&nbsp;</span>
@ -82,7 +86,8 @@
                        <span class="c-f12 c-666">总咨询量:&nbsp;&nbsp;</span>
                        <span id="yhfs" class="div-65smbrq c-f14" style="color: #17b3ec;"></span>
                    </div>
				</div>
				</div>-->
				<div class="c-f12 c-666 c-t-center mt5">总咨询量:<span id="totalCount"></span></div>
			</li>
		</ul>
		
@ -124,5 +129,6 @@
	<script src="../js/init-charts.js" type="text/javascript"></script>
	<script src="../js/get-date.js" type="text/javascript"></script>
	<script src="../js/gzbg-helper.js" type="text/javascript"></script>
	<script src="../js/draw-charts.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/gongzuobaogao.js" type="text/javascript"></script>
</html>

+ 156 - 0
html/tuandui/js/draw-charts.js

@ -0,0 +1,156 @@
function drawPie(el, seriesData, seriesName, colors){
    var myCharts = echarts.init(document.getElementById(el));
    var options = {
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        color: colors,
        series : [
            {
                name: seriesName,
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                label: {
                    formatter: '{b}: {c} ({d}%)'
                },
                data: seriesData,
                hoverAnimation: false
            }
        ]
    };
    document.getElementById(el).removeAttribute("_echarts_instance_");
    myCharts.setOption(options);
}
function drawLine(el, xData, yDatas, color, legend){
    var myCharts = echarts.init(document.getElementById(el));
    var options = {
        tooltip: {
            trigger: 'axis'
        },
        color: color,
        grid: {
            left: '10px',
            right: '25px',
            bottom: '10px',
            top: '10px',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            data: xData,
            boundaryGap: false,
            splitLine:{show: false}
        },
        yAxis: {
            type: 'value',
            splitLine:{show: false}
        },
    };
    var series = [];
    for(i=0; i<yDatas.length; i++){
        var data = yDatas[i];
        series.push({
            name: data.name,
            data: data.data,
            type: 'line'
        })
    }
    options.series = series;
    
    if(legend){
        options.legend = legend;
        options.grid.top = '30px';
    }
    document.getElementById(el).removeAttribute("_echarts_instance_");
    myCharts.setOption(options);
}
function drawBar(el, xData, yData, name, color, formatter){
    var myCharts = echarts.init(document.getElementById(el));
    var options = {
        color: color,
        tooltip : {
            trigger: 'axis',
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            top: '8%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                data : xData,
                splitLine:{show: false},
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis : [{
            type : 'value',
            splitLine:{show: false}
        }],
        series : [{
            name: name,
            type:'bar',
            barWidth: '30%',
            data: yData,
            label: {
                normal: {
                    show: true,
                    position: 'top',
                    formatter: formatter ? formatter : "",
                    textStyle: {
                        color: 'black',
                    }
                }
            }
        }]
    };
    document.getElementById(el).removeAttribute("_echarts_instance_");
    myCharts.setOption(options);
    myCharts.on('click',function(a){
        var name = a.name;
        console.log(name);
        switch(name){
            case "咨询":
                openWebview('tuanduizixunxiangqing.html', {
                    teamCode: teamCode,
                    type: dateType
                })
                break;
            case "随访":
                openWebview('tuanduisuifangxiangqing.html', {
                    teamCode: teamCode,
                    type: dateType
                })
                break;
            case "代预约":
                openWebview('tuanduidaiyuyuexiangqing.html', {
                    teamCode: teamCode,
                    type: dateType
                })
                break;
            case "指导":
                openWebview('tuanduizhidaoxiangqing.html', {
                    teamCode: teamCode,
                    type: dateType
                })
                break;
            case "教育":
                openWebview('tuanduijiaoyuxiangqing.html', {
                    teamCode: teamCode,
                    type: dateType
                })
                break;
            default:
                break;
        }
    });
}

+ 25 - 1
html/tuandui/js/get-date.js

@ -30,7 +30,7 @@
					getDate = this.getDateRange(1);
					break;
				case 6:
					getDate = this.getDateRange(2);
					getDate = this.getDateRangeNew();
					break;
			}
			return getDate;
@ -95,6 +95,30 @@
			}
			return arr;
		},
		getDateRangeNew: function () {//获取本周的所有日期
			var startDate =  new Date(this.nowYear, this.nowMonth, this.nowDay - this.nowDayOfWeek),
				arr = [];
			for (var i = 1; i <= 7; i++) {
				startDate.setDate(startDate.getDate() + 1);
				var d = [];
				d = this.formatDateNew( startDate, i);
				arr.push(d);
			}
			return arr;
		},
		formatDateNew: function ( data, i) {
			var nd = new Date(),
				myMonth = data.getMonth() + 1,
				myDate = data.getDate();
			if (myMonth < 10) {
				myMonth = '0' + myMonth;
			}
			if (myDate < 10) {
				myDate = '0' + myDate;
			}
			
			return myMonth +"-"+ myDate;
		},
		formatDateT: function ( data, i) {
			var nd = new Date(),
				myMonth = data.getMonth() + 1,

+ 14 - 14
html/tuandui/js/gongzuobaogao.js

@ -155,9 +155,9 @@ $(function() {
			me.$qyrs.html(qyrs);//qyrs
			me.$fwrs.html("-");//fwrs
			if(pjmyd==0){
				me.$pjmyd.html("-");//'暂无评分'
				me.$pjmyd.html("暂无评分");
			}else{
				me.$pjmyd.html("-");//pjmyd
				me.$pjmyd.html(pjmyd);
			}
			//咨询统计
			me.$whfs.html(whfs);
@ -185,11 +185,9 @@ $(function() {
		    }
		    if (data[4].status == 200) {
		    	var html = '';
		    	html += '<li>' + (data[4].data[0].consultRK ? ('第' + data[4].data[0].consultRK + '名') : '') + '</li>';
		    	html += '<li>' + (data[4].data[1].followupRK ? ('第' + data[4].data[1].followupRK + '名') : '') + '</li>';
		    	html += '<li>' + (data[4].data[2].reservationRK ? ('第' + data[4].data[2].reservationRK + '名') : '') + '</li>';
		    	html += '<li>' + (data[4].data[3].guidanceRK ? ('第' + data[4].data[3].guidanceRK + '名') : '') + '</li>';
		    	html += '<li>' + (data[4].data[4].articleRK ? ('第' + data[4].data[4].articleRK + '名') : '') + '</li>';
		    	html += '<li>' + (data[4].data[0].consultRK ? ('第' + data[4].data[0].consultRK + '名') : '未上榜') + '</li>';
		    	html += '<li>' + (data[4].data[3].guidanceRK ? ('第' + data[4].data[3].guidanceRK + '名') : '未上榜') + '</li>';
		    	html += '<li>' + (data[4].data[4].articleRK ? ('第' + data[4].data[4].articleRK + '名') : '未上榜') + '</li>';
		    	me.$jgnph.html(html);
		    }
		    if (data[5].status == 200) {
@ -226,11 +224,7 @@ $(function() {
			jgnfw.splice(1,2);//删除随访和代预约的值
			if (me.type === 0) {
				_.map(gzbhqs,function(item,idx){
					if(idx==0){
						gzbhxAxisData.push(parseInt(item.date.substring(5,7))+"月"+item.date.substring(8,10));
					}else{
						gzbhxAxisData.push(parseInt(item.date.substring(8,10)));
					}
					gzbhxAxisData.push(item.date.substring(5,10));
					gzbhSeriesData1.push(item.concernCount);
					gzbhSeriesData2.push(item.cancelCount);
				})
@ -243,16 +237,22 @@ $(function() {
				})
			}
			
			//处理咨询统计
			var unreplay = zxtj.onReyCount, //未回复数
            total = zxtj.totalCount, 
            replay = parseInt(total) - parseInt(unreplay); //已回复咨询数
        	$("#totalCount").text(total);//总咨询数
			Promise.all([
				//咨询统计
				$ic.init({
					el: me.$zxtjChart,
					seriesData: [{
						name: '未回复咨询',
						value: zxtj.onReyCount || zx
						value: unreplay || zx
					}, {
						name: '已回复咨询',
						value: zxtj.totalCount || zx
						value: replay || zx
					}],
					chartsType: 2
				}),

+ 28 - 32
html/tuandui/js/init-charts.js

@ -71,38 +71,25 @@
			//			饼状图
			initBZChartsOptions: function( seriesData, c) {
				var options = {
					tooltip: {
						show: false,
						trigger: 'item',
						formatter: "{a} <br/>{b}: {c}"
					},
					color: c || ['#17b3ec', '#FF774F'],
					calculable: false,
					series: [{
						type: 'pie',
						radius: '65%',
						center: [70, '50%'],
						label: {
							normal: {
								show: false,
								textStyle: {
									color: "#000"
								}
							}
						},
						itemStyle: {
							normal: {
								label: {
									show: false
								},
								labelLine: {
									show: false
								}
							}
						},
						data: seriesData
					}]
				}
			        tooltip : {
			            trigger: 'item',
			            formatter: "{a} <br/>{b} : {c} ({d}%)"
			        },
			        color: c || ['#17b3ec', '#FF774F'],
			        series : [
			            {
//			                name: seriesName,
			                type: 'pie',
			                radius: '55%',
			                center: ['50%', '60%'],
			                label: {
			                    formatter: '{b}: {c} ({d}%)'
			                },
			                data: seriesData,
			                hoverAnimation: false
			            }
			        ]
			    };
				return options;
			},
			//			柱状
@ -139,6 +126,15 @@
					}],
					yAxis: [{
						type: 'value',
						axisLine: {
							show: true
						},
						axisLabel: {
							show: true
						},
						axisTick: {
							show: true
						},
						splitLine: {
							show: false
						}