Bläddra i källkod

统计bug及优化

wangjianguo 8 år sedan
förälder
incheckning
74280b27a3

+ 1 - 0
VisualInspection/js/statistics/assess_ranking.js

@@ -112,6 +112,7 @@ function getEmployeeInfosClick(url, param, start_score, end_score) {
             }
         }
         $(".table-tbody").append(strTbody);
+        $("tr:gt(1):odd").css("background","#EFEFEF");
     }, function (error) {
         return "";
     });

+ 3 - 1
VisualInspection/js/statistics/change_attendance.js

@@ -77,7 +77,9 @@ function getFsWorkInfo(){
         $("#ca-a-table").empty();
         if(data.length >0){
             for(var i=0;i< data.length;i++){
-                $("#ca-a-table").append( getTableContent(data[i],i+1));
+                if(data[i].userName != undefined){
+                    $("#ca-a-table").append( getTableContent(data[i],i+1));
+                }
             }
         }
     },function(error){

+ 1 - 0
VisualInspection/js/statistics/personal_data_statistics.js

@@ -219,6 +219,7 @@ $(function(){
             var end_date = $(".div-end input").val()+" 23:00:00";
             var user_id = $("#select-personal").val();
 			// 页面初始化
+			echart();
             initAppealPage(start_date,end_date,user_id);
             init_personal_score_statistics("statistics/one/person/year/info",user_id);
             init_personal_check_type("statistics/one/person/checkedItem/info",user_id,start_date,end_date);

+ 387 - 377
VisualInspection/js/statistics/toll_station_statistics.js

@@ -29,7 +29,7 @@
 		var min_five_back;
 		var min_score;
 		var flag = true;
-		var change_echart = 1;
+		var change_echart = 2;
 $(function(){     
 	setSecond();
     // 显示当前月份
@@ -38,24 +38,21 @@ $(function(){
 	$(".div-button button").click(function(){	
 		var select_month = $(".div-month select").val();
 		var select_station = $(".div-station select").val();
+		// 加载图配置
+		echart();
 		if(flag ==true ){
 			init_tollStation_year_assess("statistics/score/year/info",select_station);
 		}
 		flag = false;
-		// 加载图配置
-		echart();
+		top5_change(select_month,select_station);
 		// 查询图二
 		init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
-        // 查询图三
-		init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station)
         // 查询图四
 		init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
         // 查询图五
 		init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
         // 查询图六
 		init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
-
-		init_backward_rank_assess("statistics/fs/up/five",select_month+'',select_station);
 	});
 
 	// 加载图配置
@@ -462,13 +459,14 @@ $(function(){
 			}else{
 				sec.innerHTML='';	
 			}
-			var select_station = $("#second").val();
-			var select_month = $(".div-month select").val();
-			echart();
 			// 页面初始化
+			var select_month = $(".div-month select").val();
+			var select_station = $("#second").val();
+			echart();	
+			// 进退步top5
+			top5_change(select_month,select_station);
 			init_tollStation_year_assess("statistics/score/year/info",select_station);
 			init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
-			init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station)
 			init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
 			init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
 			init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
@@ -482,26 +480,33 @@ $(function(){
 	 * 进步前5名后退步前五名切换
 	 */
 	$(".view_change").click(function(){
-		    var select_station = $("#second").val();
 			var select_month = $(".div-month select").val();
+		    var select_station = $("#second").val();
+			// 进退步top5
+		    top5_change(select_month,select_station);
+	});	
+    /**
+	 * 进退步top5
+	 * @param {*} select_month 
+	 * @param {*} select_station 
+	 */
+	function top5_change(select_month,select_station){
 		if(change_echart==1){
 			$("#progress span").text("考核退步Top5排行榜");
 			$("#progress-rank-assess").css("display","none");
 			$("#backward-rank-assess").css("display","block");
-			//flag=false;
 			echart_change();	
 			init_backward_rank_assess("statistics/fs/up/five",select_month+'',select_station);
 			change_echart = 2
-			
 		}else if(change_echart==2){
 			$("#progress span").text("考核进步Top5排行榜");
 			$("#progress-rank-assess").css("display","block");
 			$("#backward-rank-assess").css("display","none");
-			
+			echart_change2();
+			init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station);
 			change_echart = 1
 		}
-		
-	});	
+	}
 	
     /**
 	 * 除数为0处理
@@ -525,15 +530,33 @@ $(function(){
 			return (num/num1).toFixed(2);
 		}
 	}
-
+    /**
+	 * 其它图配置
+	 */
 	function echart(){
-        // 路径配置
-        require.config({
+        echart_config(1);
+	}
+    /**
+	 * 进步top5图配置
+	 */
+	function echart_change2(){
+        echart_config(2);
+	}
+    /**
+	 * 退步top5图配置
+	 */
+	function echart_change(){
+        echart_config(3);
+	}
+    /**
+	 * 图配置
+	 */
+	function echart_config(type){
+		require.config({
             paths: {
                 echarts: '/js/lib/echarts/build/dist'
             }
         }); 
-        // 使用
 	    require(
 		[
 			'echarts',
@@ -543,409 +566,396 @@ $(function(){
 			'echarts/chart/pie'
 		],
 			function (ec,theme) {
-					// 基于准备好的dom,初始化echarts图表
+				if(type == 2){
+					rank_assess = ec.init(document.getElementById('progress-rank-assess'));
+				}else if(type ==3 ){
+					rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
+				}else{
 					if(flag){
 						year_assess = ec.init(document.getElementById('tollStation-year-assess'),theme);
 					} 
-						points_assess = ec.init(document.getElementById('tollStation-points-assess'),theme);
-						rank_assess = ec.init(document.getElementById('progress-rank-assess'));
-						score_rank = ec.init(document.getElementById('people-score-rank'));
-						check_type = ec.init(document.getElementById('server-check-type'),theme);
-						people_points = ec.init(document.getElementById('each-people-points'));
-						rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
-			}
-	    ); 
-	}
-
-	function echart_change(){
-        require.config({
-            paths: {
-                echarts: '/js/lib/echarts/build/dist'
-            }
-        }); 
-	    require(
-		[
-			'echarts',
-			'echarts/chart/bar'
-		],
-			function (ec) {
-				rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
+					points_assess = ec.init(document.getElementById('tollStation-points-assess'),theme);
+					score_rank = ec.init(document.getElementById('people-score-rank'));
+					check_type = ec.init(document.getElementById('server-check-type'),theme);
+					people_points = ec.init(document.getElementById('each-people-points'));
+					rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
+				}
 			}
 	    ); 
 	}
-			/**
-			 * 图一
-			 */
-	    	function tollStation_year_assess(){
-			
-				option = {
-					color : [ '#00ced1' ],
-					tooltip : {
-						trigger: 'axis'
-					},
-					legend: {
-						data:['平均分']
-					},
-					toolbox: {
-						show : true,
-					},
-					calculable : true,
-					xAxis : [
-						{
-							type : 'category',
-							boundaryGap : false,
-							data : monthsCH
-						}
-					],
-					yAxis : [
-						{
-							type : 'value',
-							min : min_year ,
-						    max : 1000,
-							axisLabel : {
-								formatter: '{value}'
-							}
-						}
-					],
-					series : [
-						{
-							name:'平均分',
-							type:'line',
-							data:array_year_score,
-							markPoint : {
-								data : [
-									{type : 'max', name: '最大值'},
-									{type : 'min', name: '最小值'}
-								]
-							},
-							markLine : {
-								data : [
-									{type : 'average', name: '平均值'}
-								]
-							}
-						},
-						
-					]
-				};
-						return option;
-		}
-			
-
-        /**
-		 * 图二
-		 */
-		function tollStation_points_assess(){
-			option = {
-				tooltip : {
-					trigger: 'item',
-					formatter:  "收费站考核扣分占比 <br/>{b} : {c}人 ({d}%)"
-				},
-				toolbox: {
-					show : true,
-					feature : {
-					
-						magicType : {
-						
-							type: ['pie', 'funnel'],
-							option: {
-								funnel: {
-									x: '25%',
-									width: '50%',
-									funnelAlign: 'left',
-									max: 1548
-								}
-							}
-						},
-					}
-				},
-				calculable : true,
-				series : [
-					{
-						name:'访问来源',
-						type:'pie',
-						radius : '65%',
-						center: ['50%', '50%'],
-						data:array_points,
-						itemStyle:{ 
-						normal:{ 
-							label:{ 
-								show: true, 
-								formatter: '{b} : {c}人 ({d}%)'  
-							}, 
-							labelLine :{show:true} 
-							} 
-						} 
-					}
-				]
-			};
-                    
-			return option;
-		}
-
-        /**
-		 * 图三 前5名 
-		 */
-		function progress_rank_assess(){
-			option = {
-				color : [ '#00ced1' ],// 条形图颜色
-				tooltip : {
-					trigger: 'axis'
-				},
-				grid:{
-                    width:"80%"
-                },
-				legend: {
-					data:['进步名次']
-				},
-				calculable : true,
-				xAxis : [
-					{
-						type : 'category',
-						data : array_five_name
+	/**
+	 * 图一
+	 */
+	function tollStation_year_assess(){
+	
+		option = {
+			color : [ '#00ced1' ],
+			tooltip : {
+				trigger: 'axis'
+			},
+			legend: {
+				data:['平均分']
+			},
+			toolbox: {
+				show : true,
+			},
+			calculable : true,
+			xAxis : [
+				{
+					type : 'category',
+					boundaryGap : false,
+					data : monthsCH
+				}
+			],
+			yAxis : [
+				{
+					type : 'value',
+					min : min_year ,
+					max : 1000,
+					axisLabel : {
+						formatter: '{value}'
 					}
-				],
-				yAxis : [
-					{
-						type : 'value',
-						min : min_five
+				}
+			],
+			series : [
+				{
+					name:'平均分',
+					type:'line',
+					data:array_year_score,
+					markPoint : {
+						data : [
+							{type : 'max', name: '最大值'},
+							{type : 'min', name: '最小值'}
+						]
+					},
+					markLine : {
+						data : [
+							{type : 'average', name: '平均值'}
+						]
 					}
-				],
-				series : [
-					{
-						name:'进步名次',
-						type:'bar',
-						data: array_five_score,
-					    itemStyle: {
-						normal: {
-							label: {
-								show: true,
-								position: 'insideTop'
-							}
-						}
-					},  						
-					}   
-				]
-			};
-                    		
-					return option;
-	   }
-
-	   /**
-		 * 图三 后5名
-		 */
-		function backward_rank_assess(){
-			option = {
-				color : [ '#00ced1' ],// 条形图颜色
-				tooltip : {
-					trigger: 'axis'
 				},
-				grid:{
-                    width:"80%"
-                },
-				legend: {
-					data:['退步名次']
-				},
-				calculable : true,
-				xAxis : [
-					{
-						type : 'category',
-						data : array_five_name_back
-					}
-				],
-				yAxis : [
-					{
-						type : 'value',
-						min : min_five_back
-					}
-				],
-				series : [
-					{
-						name:'退步名次',
-						type:'bar',
-						data: array_five_score_back,
-					    itemStyle: {
-						normal: {
-							label: {
-								show: true,
-								position: 'insideTop'
-							}
-						}
-					},  						
-					}   
-				]
-			};
-                    		
-					return option;
-	   }
-
+				
+			]
+		};
+				return option;
+}
+	
 
-        /**
-		 * 图四
-		 */
-		function people_score_rank(){
-					option = {
-				color : [ '#00ced1' ],// 条形图颜色
-				tooltip : {
-					trigger: 'axis'
-				},
-				grid:{
-                    width:"88%"
-                },
-				legend: {
-					data:['平均分']
-				},
-				calculable : true,
-				xAxis : [
-					{
-						axisLabel: {  
-						interval:0
-						}  ,
-						type : 'category',
-						data : array_score_order
-					}
-				],
-			
-				yAxis : [
-					{
-						type : 'value',
-						min : min_score ,
-						max : 1000
-					}
-				],
-				series : [
-					{
-						name:'平均分',
-						type:'bar',
-						data: array_score_data,
-					    itemStyle: {
-						normal: {
-							label: {
-								show: true,
-								position: 'insideTop'
+	/**
+	 * 图二
+	 */
+	function tollStation_points_assess(){
+		option = {
+			tooltip : {
+				trigger: 'item',
+				formatter:  "收费站考核扣分占比 <br/>{b} : {c}人 ({d}%)"
+			},
+			toolbox: {
+				show : true,
+				feature : {
+				
+					magicType : {
+					
+						type: ['pie', 'funnel'],
+						option: {
+							funnel: {
+								x: '25%',
+								width: '50%',
+								funnelAlign: 'left',
+								max: 1548
 							}
 						}
 					},
-						markLine : {
-							data : [
-								{type : 'average', name: '平均值'}
-							]
-						}
-					}   
-				]
-			};
-							
-					return option;
 				}
-
-         /**
-		 * 图五
-		 */
-		function server_check_type(){
-			option = {
-				tooltip : {
-					trigger: 'item',
-					formatter:  "温馨服务检查占比 <br/>{b} : {c}分 ({d}%)"
-				},
-				toolbox: {
-					show : true,
-					feature : {
-					
-						magicType : {
-						
-							type: ['pie', 'funnel'],
-							option: {
-								funnel: {
-									x: '25%',
-									width: '50%',
-									funnelAlign: 'left',
-									max: 1548
-								}
-							}
-						},
-					}
-				},
-				calculable : true,
-				series : [
-					{
-						name:'访问来源',
-						type:'pie',
-						radius : '55%',
-						center: ['50%', '50%'],
-						data:array_check_type,
-						itemStyle:{ 
-						normal:{ 
-							label:{ 
-								show: true, 
-								formatter: '{b} : {c}分 ({d}%)'  
-							}, 
-							labelLine :{show:true} 
-							} 
+			},
+			calculable : true,
+			series : [
+				{
+					name:'访问来源',
+					type:'pie',
+					radius : '65%',
+					center: ['50%', '50%'],
+					data:array_points,
+					itemStyle:{ 
+					normal:{ 
+						label:{ 
+							show: true, 
+							formatter: '{b} : {c}人 ({d}%)'  
+						}, 
+						labelLine :{show:true} 
 						} 
+					} 
+				}
+			]
+		};
+				
+		return option;
+	}
+
+	/**
+	 * 图三 前5名 
+	 */
+	function progress_rank_assess(){
+		option = {
+			color : [ '#00ced1' ],// 条形图颜色
+			tooltip : {
+				trigger: 'axis'
+			},
+			grid:{
+				width:"80%"
+			},
+			legend: {
+				data:['进步名次']
+			},
+			calculable : true,
+			xAxis : [
+				{
+					type : 'category',
+					data : array_five_name
+				}
+			],
+			yAxis : [
+				{
+					type : 'value',
+					min : min_five
+				}
+			],
+			series : [
+				{
+					name:'进步名次',
+					type:'bar',
+					data: array_five_score,
+					itemStyle: {
+					normal: {
+						label: {
+							show: true,
+							position: 'insideTop'
+						}
 					}
-				]
-			};
-			return option;
-		}
+				},  						
+				}   
+			]
+		};
+						
+				return option;
+	}
 
-        /**
-		 * 图六 
-		 */
-		function each_people_points(){
-					option = {
+	/**
+	 * 图三 后5名
+	 */
+	function backward_rank_assess(){
+		option = {
+			color : [ '#00ced1' ],// 条形图颜色
 			tooltip : {
 				trigger: 'axis'
 			},
 			grid:{
-                    width:"80%"
-                },
+				width:"80%"
+			},
 			legend: {
-				data:['上月','本月']
+				data:['退步名次']
 			},
 			calculable : true,
 			xAxis : [
 				{
 					type : 'category',
-					data : array_points_name
+					data : array_five_name_back
 				}
 			],
 			yAxis : [
 				{
-					type : 'value'
+					type : 'value',
+					min : min_five_back
 				}
 			],
 			series : [
 				{
-					name:'上月',
+					name:'退步名次',
 					type:'bar',
-					data:array_points_pre,
+					data: array_five_score_back,
 					itemStyle: {
-						normal: {
-							color:'#b3d4fc',
-							label: {
-								show: true,
-								position: 'insideTop'
-							}
+					normal: {
+						label: {
+							show: true,
+							position: 'insideTop'
 						}
-					},
-				},
+					}
+				},  						
+				}   
+			]
+		};
+						
+				return option;
+	}
+
+
+	/**
+	 * 图四
+	 */
+	function people_score_rank(){
+				option = {
+			color : [ '#00ced1' ],// 条形图颜色
+			tooltip : {
+				trigger: 'axis'
+			},
+			grid:{
+				width:"88%"
+			},
+			legend: {
+				data:['平均分']
+			},
+			calculable : true,
+			xAxis : [
+				{
+					axisLabel: {  
+					interval:0
+					}  ,
+					type : 'category',
+					data : array_score_order
+				}
+			],
+		
+			yAxis : [
+				{
+					type : 'value',
+					min : min_score ,
+					max : 1000
+				}
+			],
+			series : [
 				{
-					name:'本月',
+					name:'平均分',
 					type:'bar',
-					data:arrar_points_month,
+					data: array_score_data,
 					itemStyle: {
-						normal: {
-							color:'#ea644a',
-							label: {
-								show: true,
-								position: 'insideTop'
+					normal: {
+						label: {
+							show: true,
+							position: 'insideTop'
+						}
+					}
+				},
+					markLine : {
+						data : [
+							{type : 'average', name: '平均值'}
+						]
+					}
+				}   
+			]
+		};
+						
+				return option;
+			}
+
+		/**
+	 * 图五
+	 */
+	function server_check_type(){
+		option = {
+			tooltip : {
+				trigger: 'item',
+				formatter:  "温馨服务检查占比 <br/>{b} : {c}分 ({d}%)"
+			},
+			toolbox: {
+				show : true,
+				feature : {
+				
+					magicType : {
+					
+						type: ['pie', 'funnel'],
+						option: {
+							funnel: {
+								x: '25%',
+								width: '50%',
+								funnelAlign: 'left',
+								max: 1548
 							}
 						}
 					},
 				}
+			},
+			calculable : true,
+			series : [
+				{
+					name:'访问来源',
+					type:'pie',
+					radius : '55%',
+					center: ['50%', '50%'],
+					data:array_check_type,
+					itemStyle:{ 
+					normal:{ 
+						label:{ 
+							show: true, 
+							formatter: '{b} : {c}分 ({d}%)'  
+						}, 
+						labelLine :{show:true} 
+						} 
+					} 
+				}
 			]
-		};					
-					return option;
+		};
+		return option;
+	}
+
+	/**
+	 * 图六 
+	 */
+	function each_people_points(){
+				option = {
+		tooltip : {
+			trigger: 'axis'
+		},
+		grid:{
+				width:"80%"
+			},
+		legend: {
+			data:['上月','本月']
+		},
+		calculable : true,
+		xAxis : [
+			{
+				type : 'category',
+				data : array_points_name
+			}
+		],
+		yAxis : [
+			{
+				type : 'value'
 			}
+		],
+		series : [
+			{
+				name:'上月',
+				type:'bar',
+				data:array_points_pre,
+				itemStyle: {
+					normal: {
+						color:'#b3d4fc',
+						label: {
+							show: true,
+							position: 'insideTop'
+						}
+					}
+				},
+			},
+			{
+				name:'本月',
+				type:'bar',
+				data:arrar_points_month,
+				itemStyle: {
+					normal: {
+						color:'#ea644a',
+						label: {
+							show: true,
+							position: 'insideTop'
+						}
+					}
+				},
+			}
+		]
+	};					
+				return option;
+		}