|
|
@@ -1,442 +1,497 @@
|
|
|
var year = new Date().getFullYear();
|
|
|
-var months = ['1','2','3','4','5','6','7','8','9','10','11','12'];
|
|
|
-var monthsCH = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
|
|
|
+var months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
|
|
|
+var monthsCH = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
|
|
|
var array_year_score = new Array();
|
|
|
var array_check_type = new Array();
|
|
|
-var user_id = 2424; // 用户假数据
|
|
|
+var user_id = 2424; // 用户假数据
|
|
|
var score_statistics;
|
|
|
var check_type;
|
|
|
var cur_status;
|
|
|
var hide = false;
|
|
|
// 默认初始化日期一个月
|
|
|
-$(".div-start input").val(new Date().getFullYear()+"-"+new Date().getMonth()+"-26");
|
|
|
-$(".div-end input").val(new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-25");
|
|
|
-var start_date = dateChange(new Date($(".div-start input").val()+" 00:00:00"),60*60*1000 ) ;
|
|
|
-var end_date = $(".div-end input").val()+" 23:00:00";
|
|
|
+$(".div-start input").val(new Date().getFullYear() + "-" + new Date().getMonth() + "-26");
|
|
|
+$(".div-end input").val(new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-25");
|
|
|
+var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
|
|
|
+var end_date = $(".div-end input").val() + " 23:00:00";
|
|
|
|
|
|
/**
|
|
|
* 预加载方法
|
|
|
- */
|
|
|
-$(function(){
|
|
|
- setVisit();
|
|
|
-
|
|
|
-//*************************************数据表格******************************************
|
|
|
- function initAppealPage(start_date,end_date,user_id) {
|
|
|
- initQueryParams();
|
|
|
- queryAppeal(start_date,end_date,user_id);
|
|
|
+ */
|
|
|
+$(function() {
|
|
|
+ setVisit();
|
|
|
+
|
|
|
+ //*************************************数据表格******************************************
|
|
|
+ function initAppealPage(start_date, end_date, user_id) {
|
|
|
+ initQueryParams();
|
|
|
+ queryAppeal(start_date, end_date, user_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ function initQueryParams() {
|
|
|
+ //获取页面参数
|
|
|
+ var page_params = $.zui.store.get("page_params");
|
|
|
+ if (page_params && page_params.status) {
|
|
|
+ cur_status = page_params.status;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function queryAppeal(start_date, end_date, user_id) {
|
|
|
+
|
|
|
+ $("#station_name").html($("#select-dept").find("option:selected").text())
|
|
|
+ $("#station_user_name").html($("#select-personal").find("option:selected").text())
|
|
|
+
|
|
|
+
|
|
|
+ //请求数据
|
|
|
+ var data_t = {
|
|
|
+ "start_date": start_date,
|
|
|
+ "end_date": end_date,
|
|
|
+ "user_id": user_id
|
|
|
+ }
|
|
|
+ var url_t = "/statistics/employee/order/detail"
|
|
|
+ post_common_service(url_t, data_t, function(res) {
|
|
|
+
|
|
|
+ var isshow_c = false;
|
|
|
+ var isshow_l = false;
|
|
|
+ if (typeof(res.currentP) != undefined && res.currentP != null) {
|
|
|
+ var p = res.currentP;
|
|
|
+ $("#c_dept_ranking").html(p.fee_station_ranking);
|
|
|
+ $("#c_com_ranking").html(p.company_ranking);
|
|
|
+ $("#c_score_ranking").html(p.check_all_score + p.check_all_m_score);
|
|
|
+ isshow_c = true;
|
|
|
+ }
|
|
|
+ if (typeof(res.lastP) != undefined && res.lastP != null) {
|
|
|
+ var p = res.lastP;
|
|
|
+ $("#l_dept_ranking").html(p.fee_station_ranking);
|
|
|
+ $("#l_com_ranking").html(p.company_ranking);
|
|
|
+ $("#l_score_ranking").html(p.check_all_score + p.check_all_m_score);
|
|
|
+ isshow_l = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isshow_c && isshow_l) {
|
|
|
+ var p_c = res.currentP;
|
|
|
+ var p_l = res.lastP;
|
|
|
+ var dept_r = p_c.fee_station_ranking - p_l.fee_station_ranking;
|
|
|
+ if (dept_r != 0) {
|
|
|
+ $("#c_dept_ranking").html($("#c_dept_ranking").html() + "<i style='margin-left:10px;color:" + (dept_r > 0 ? "red" : "green") + "' class='icon icon-long-arrow-" + (dept_r > 0 ? "down" : "up") + "'>" + Math.abs(dept_r) + "</i>");
|
|
|
+ }
|
|
|
+ var com_r = p_c.company_ranking - p_l.company_ranking;
|
|
|
+ if (com_r != 0) {
|
|
|
+ $("#c_com_ranking").html($("#c_com_ranking").html() + "<i style='margin-left:10px;color:" + (com_r > 0 ? "red" : "green") + "' class='icon icon-long-arrow-" + (com_r > 0 ? "down" : "up") + "'>" + Math.abs(com_r) + "</i>");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }, function(error) {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var data = {
|
|
|
+ "start_date": start_date,
|
|
|
+ "end_date": end_date,
|
|
|
+ "user_id": user_id,
|
|
|
+ "queryType": 0,
|
|
|
+ "score_flag": $(".score-select").val()
|
|
|
+ }
|
|
|
+ if (hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) || hasRole(ROLE_JICHA) || roleContains('STATION')) {
|
|
|
+ hide = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ var cols = [
|
|
|
+ { width: 50, text: '序号', flex: true, colClass: 'text-center', field: 'num' },
|
|
|
+ { width: 100, text: '时间段', flex: true, colClass: 'text-center', field: 'check_task_time_name' },
|
|
|
+ { width: 60, text: '扣分数', flex: true, colClass: 'text-center', field: 'score', nullvalue: '0' },
|
|
|
+ { width: 100, text: '考核类型', flex: true, colClass: 'text-center', sort: 'down', field: 'parent_name' },
|
|
|
+ { width: 100, text: '考核项', flex: true, colClass: 'text-center', sort: 'down', field: 'name' },
|
|
|
+ { width: 100, text: '扣分凭证', type: 'imagedd', flex: true, hide: hide, field: 'pics' },
|
|
|
+ ];
|
|
|
+ if (cur_status == 12 || cur_status == 13) {
|
|
|
+ data.check_status_arr = [12, 13];
|
|
|
+ }
|
|
|
+ $('#personal_data_table').mytable({
|
|
|
+ 'cols': cols,
|
|
|
+ 'url': "/statistics/one/checkedItem/detail/info",
|
|
|
+ 'param': data
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- function initQueryParams() {
|
|
|
- //获取页面参数
|
|
|
- var page_params = $.zui.store.get("page_params");
|
|
|
- if(page_params && page_params.status) {
|
|
|
- cur_status = page_params.status;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function queryAppeal(start_date,end_date,user_id){
|
|
|
-
|
|
|
- var data = {
|
|
|
- "start_date":start_date,
|
|
|
- "end_date":end_date,
|
|
|
- "user_id":user_id,
|
|
|
- "queryType":0,
|
|
|
- "score_flag":$(".score-select").val()
|
|
|
- }
|
|
|
- if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) || hasRole(ROLE_JICHA) || roleContains('STATION')) {
|
|
|
- hide = true;
|
|
|
- }
|
|
|
-
|
|
|
- var cols = [
|
|
|
- {width: 50, text: '序号', flex: true, colClass: 'text-center',field:'num'},
|
|
|
- {width: 100, text: '时间段', flex: true,colClass: 'text-center',field:'check_task_time_name' },
|
|
|
- {width: 60, text: '扣分数', flex: true, colClass: 'text-center',field:'score',nullvalue:'0'},
|
|
|
- {width: 100, text: '考核类型', flex: true, colClass: 'text-center',sort: 'down',field:'parent_name'},
|
|
|
- {width: 100, text: '考核项', flex: true, colClass: 'text-center',sort: 'down',field:'name'},
|
|
|
- {width: 100, text: '扣分凭证', type: 'imagedd', flex: true, hide:hide,field:'pics'},
|
|
|
- ];
|
|
|
- if(cur_status==12 || cur_status==13){
|
|
|
- data.check_status_arr = [12,13];
|
|
|
- }
|
|
|
- $('#personal_data_table').mytable({'cols':cols,
|
|
|
- 'url':"/statistics/one/checkedItem/detail/info",
|
|
|
- 'param':data}
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-//*************************************画图******************************************
|
|
|
-
|
|
|
- // 加载图配置
|
|
|
- echart();
|
|
|
-
|
|
|
- $(".query button").click(function(){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //*************************************画图******************************************
|
|
|
+
|
|
|
+ // 加载图配置
|
|
|
+ echart();
|
|
|
+
|
|
|
+ $(".query button").click(function() {
|
|
|
var user_id = $("#select-personal").val();
|
|
|
- var start_date = dateChange(new Date($(".div-start input").val()+" 00:00:00"),60*60*1000 ) ;
|
|
|
- var end_date = $(".div-end input").val()+" 23:00:00";
|
|
|
- var startStr = start_date.replace(/-/g, '/');
|
|
|
- var endStr = end_date.replace(/-/g, '/');
|
|
|
- var start = new Date(startStr);
|
|
|
- var end = new Date(endStr);
|
|
|
- if(start>end){
|
|
|
- tip("开始时间不能比结束时间大");
|
|
|
- return;
|
|
|
- }
|
|
|
- if($("#select-personal").text()==''){
|
|
|
- tip("请选择收费站");
|
|
|
- return;
|
|
|
- }
|
|
|
- // 查询图一
|
|
|
- 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);
|
|
|
- // 表格
|
|
|
- initAppealPage(start_date,end_date,user_id);
|
|
|
- // 加载图配置
|
|
|
- echart();
|
|
|
- });
|
|
|
+ var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
|
|
|
+ var end_date = $(".div-end input").val() + " 23:00:00";
|
|
|
+ var startStr = start_date.replace(/-/g, '/');
|
|
|
+ var endStr = end_date.replace(/-/g, '/');
|
|
|
+ var start = new Date(startStr);
|
|
|
+ var end = new Date(endStr);
|
|
|
+ if (start > end) {
|
|
|
+ tip("开始时间不能比结束时间大");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ($("#select-personal").text() == '') {
|
|
|
+ tip("请选择收费站");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 查询图一
|
|
|
+ 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);
|
|
|
+ // 表格
|
|
|
+ initAppealPage(start_date, end_date, user_id);
|
|
|
+ // 加载图配置
|
|
|
+ echart();
|
|
|
+ });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化图一
|
|
|
+ * @param {*} url
|
|
|
+ * @param {*} dept_id
|
|
|
+ */
|
|
|
+ function init_personal_score_statistics(url, user_id) {
|
|
|
+ var param = {
|
|
|
+ "start_date": (year - 1) + "-" + new Date().getMonth() + "-25" + " 23:00:00",
|
|
|
+ "end_date": year + "-" + (new Date().getMonth() + 1) + "-25" + " 23:00:00",
|
|
|
+ "user_id": user_id
|
|
|
+ }
|
|
|
+ initRqueset(url, param, 1);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
- * 初始化图一
|
|
|
- * @param {*} url
|
|
|
- * @param {*} dept_id
|
|
|
- */
|
|
|
- function init_personal_score_statistics(url,user_id){
|
|
|
- var param = {
|
|
|
- "start_date":(year-1)+"-"+new Date().getMonth()+"-25"+" 23:00:00",
|
|
|
- "end_date":year+"-"+(new Date().getMonth()+1)+"-25"+" 23:00:00",
|
|
|
- "user_id":user_id
|
|
|
- }
|
|
|
- initRqueset(url,param,1);
|
|
|
- }
|
|
|
-
|
|
|
+ * 初始化图二
|
|
|
+ * @param {*} url
|
|
|
+ * @param {*} dept_id
|
|
|
+ */
|
|
|
+ function init_personal_check_type(url, user_id, start_date, end_date) {
|
|
|
+ var param = {
|
|
|
+ "start_date": start_date,
|
|
|
+ "end_date": end_date,
|
|
|
+ "user_id": user_id
|
|
|
+ }
|
|
|
+ initRqueset(url, param, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 请求
|
|
|
+ * @param {*} url
|
|
|
+ * @param {*} param
|
|
|
+ * @param {*} type
|
|
|
+ */
|
|
|
+ function initRqueset(url, param, type) {
|
|
|
+ post_common_service(url, param, function(data) {
|
|
|
+ data_array(data, type);
|
|
|
+ if (type == 1) {
|
|
|
+ // 画图
|
|
|
+ score_statistics.setOption(personal_score_statistics());
|
|
|
+ } else if (type == 2) {
|
|
|
+ // 画图
|
|
|
+ check_type.setOption(personal_check_type());
|
|
|
+ }
|
|
|
+ }, function(error) {
|
|
|
+ return "";
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 初始化图二
|
|
|
- * @param {*} url
|
|
|
- * @param {*} dept_id
|
|
|
- */
|
|
|
- function init_personal_check_type(url,user_id,start_date,end_date){
|
|
|
- var param = {
|
|
|
- "start_date":start_date,
|
|
|
- "end_date":end_date,
|
|
|
- "user_id":user_id
|
|
|
- }
|
|
|
- initRqueset(url,param,2);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 请求
|
|
|
- * @param {*} url
|
|
|
- * @param {*} param
|
|
|
- * @param {*} type
|
|
|
- */
|
|
|
- function initRqueset(url,param,type){
|
|
|
- post_common_service( url,param,function(data){
|
|
|
- data_array(data,type);
|
|
|
- if(type == 1){
|
|
|
- // 画图
|
|
|
- score_statistics.setOption(personal_score_statistics());
|
|
|
- }else if(type == 2){
|
|
|
- // 画图
|
|
|
- check_type.setOption(personal_check_type());
|
|
|
- }
|
|
|
- },function(error){
|
|
|
- return "" ;
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 数组数据
|
|
|
- * @param {*} data
|
|
|
- * @param {*} type
|
|
|
- */
|
|
|
- function data_array(data,type){
|
|
|
- if(type == 1){
|
|
|
- array_year_score.length = 0;
|
|
|
- months.length = 0;
|
|
|
- if(data.length!=0){
|
|
|
- if(data.length<14){
|
|
|
- for(var i=0;i<14-data.length;i++){
|
|
|
- array_year_score.push(0)
|
|
|
- }
|
|
|
- }
|
|
|
- var month_arr = month_method_2();
|
|
|
- for(var i=0;i<data.length;i++){
|
|
|
- if(month_arr.indexOf(parseInt(data[i].mth))){
|
|
|
- // 指定位置插入值
|
|
|
- array_year_score.splice(month_arr.indexOf(data[i].mth),0,
|
|
|
- (1000-(filter(data[i].all_check_score,data[i].checked_num,0))));
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- array_year_score.length = 0;
|
|
|
- }
|
|
|
- }else if(type == 2){
|
|
|
- array_check_type.length=0;
|
|
|
- if(data.length != 0){
|
|
|
- for(var i=0;i<data.length;i++){
|
|
|
- array_check_type.push({"value": data[i].all_check_score,"name":data[i].name});
|
|
|
- }
|
|
|
- }else{
|
|
|
- array_check_type.length=0;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $("#select-personal").click(function(){
|
|
|
- if($("#select-personal").text()==''){
|
|
|
- tip("请选择收费站");
|
|
|
- return;
|
|
|
- }
|
|
|
- });
|
|
|
- // 收费站下拉框
|
|
|
- var dept;
|
|
|
- if(roleContains("STATION")){
|
|
|
- dept=getCurrentUser().organid;
|
|
|
- }
|
|
|
- var roadManager;
|
|
|
- if(roleContains("ROAD_MANAGER")){
|
|
|
- roadManager=getCurrentUser().organid;
|
|
|
- }
|
|
|
- var feeList = $.zui.store.get("cache_fee_station_list");
|
|
|
- if(roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
|
|
|
- setFeeSelectValueNoAll(feeList,"#select-dept",dept);
|
|
|
- setSecond();
|
|
|
- /**
|
|
|
- * 部门人员下拉框
|
|
|
- */
|
|
|
- function setSecond(){
|
|
|
+ * 数组数据
|
|
|
+ * @param {*} data
|
|
|
+ * @param {*} type
|
|
|
+ */
|
|
|
+ function data_array(data, type) {
|
|
|
+ if (type == 1) {
|
|
|
+ array_year_score.length = 0;
|
|
|
+ months.length = 0;
|
|
|
+ if (data.length != 0) {
|
|
|
+ if (data.length < 14) {
|
|
|
+ for (var i = 0; i < 14 - data.length; i++) {
|
|
|
+ array_year_score.push(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var month_arr = month_method_2();
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (month_arr.indexOf(parseInt(data[i].mth))) {
|
|
|
+ // 指定位置插入值
|
|
|
+ array_year_score.splice(month_arr.indexOf(data[i].mth), 0,
|
|
|
+ (1000 - (filter(data[i].all_check_score, data[i].checked_num, 0))));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ array_year_score.length = 0;
|
|
|
+ }
|
|
|
+ } else if (type == 2) {
|
|
|
+ array_check_type.length = 0;
|
|
|
+ if (data.length != 0) {
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ array_check_type.push({ "value": data[i].all_check_score, "name": data[i].name });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ array_check_type.length = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#select-personal").click(function() {
|
|
|
+ if ($("#select-personal").text() == '') {
|
|
|
+ tip("请选择收费站");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 收费站下拉框
|
|
|
+ var dept;
|
|
|
+ if (roleContains("STATION")) {
|
|
|
+ dept = getCurrentUser().organid;
|
|
|
+ }
|
|
|
+ var roadManager;
|
|
|
+ if (roleContains("ROAD_MANAGER")) {
|
|
|
+ roadManager = getCurrentUser().organid;
|
|
|
+ }
|
|
|
+ var feeList = $.zui.store.get("cache_fee_station_list");
|
|
|
+ if (roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
|
|
|
+ setFeeSelectValueNoAll(feeList, "#select-dept", dept);
|
|
|
+ setSecond();
|
|
|
+ /**
|
|
|
+ * 部门人员下拉框
|
|
|
+ */
|
|
|
+ function setSecond() {
|
|
|
var select_road = $("#select-dept").val();
|
|
|
- var sec = document.getElementById('select-personal');
|
|
|
- var tempStr = ''
|
|
|
- var param = {
|
|
|
- "organid":select_road
|
|
|
- }
|
|
|
- post_common_service("user/getFsUserList",param,function(data){
|
|
|
- if(data.length!=0){
|
|
|
- for(var i=0;i<data.length;i++){
|
|
|
- for(var j=33;j<=53;j++){
|
|
|
- if(select_road==j){
|
|
|
- tempStr += "<option value="+data[i].id+">"+data[i].truename+"</option>";
|
|
|
- }
|
|
|
- }
|
|
|
- sec.innerHTML=tempStr;
|
|
|
- }
|
|
|
- }else{
|
|
|
- sec.innerHTML='';
|
|
|
- }
|
|
|
- // 请求数据
|
|
|
- getInit();
|
|
|
- },function(error){
|
|
|
- return "" ;
|
|
|
- });
|
|
|
+ var sec = document.getElementById('select-personal');
|
|
|
+ var tempStr = ''
|
|
|
+ var param = {
|
|
|
+ "organid": select_road
|
|
|
+ }
|
|
|
+ post_common_service("user/getFsUserList", param, function(data) {
|
|
|
+ if (data.length != 0) {
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ for (var j = 33; j <= 53; j++) {
|
|
|
+ if (select_road == j) {
|
|
|
+ tempStr += "<option value=" + data[i].id + ">" + data[i].truename + "</option>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sec.innerHTML = tempStr;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sec.innerHTML = '';
|
|
|
+ }
|
|
|
+ // 请求数据
|
|
|
+ getInit();
|
|
|
+ }, function(error) {
|
|
|
+ return "";
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- function getInit(){
|
|
|
- var start_date = dateChange(new Date($(".div-start input").val()+" 00:00:00"),60*60*1000 );
|
|
|
- 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);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- $("#select-dept").change(function(){
|
|
|
- setSecond();
|
|
|
- });
|
|
|
-
|
|
|
- $("#select-personal").change(function(){
|
|
|
- getInit();
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 除数为0处理
|
|
|
- * @param {*} num
|
|
|
- * @param {*} num1
|
|
|
- * @param {*} num2
|
|
|
- * @param {*} num4
|
|
|
- */
|
|
|
- function filter(num,num1,num2){
|
|
|
- if(num1 == 0){
|
|
|
- return num2;
|
|
|
- }else{
|
|
|
- return (num/num1).toFixed(2);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function echart(){
|
|
|
+ function getInit() {
|
|
|
+ var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $("#select-dept").change(function() {
|
|
|
+ setSecond();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#select-personal").change(function() {
|
|
|
+ getInit();
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 除数为0处理
|
|
|
+ * @param {*} num
|
|
|
+ * @param {*} num1
|
|
|
+ * @param {*} num2
|
|
|
+ * @param {*} num4
|
|
|
+ */
|
|
|
+ function filter(num, num1, num2) {
|
|
|
+ if (num1 == 0) {
|
|
|
+ return num2;
|
|
|
+ } else {
|
|
|
+ return (num / num1).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function echart() {
|
|
|
// 路径配置
|
|
|
require.config({
|
|
|
paths: {
|
|
|
echarts: '/js/lib/echarts/build/dist'
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
// 使用
|
|
|
- require(
|
|
|
- [
|
|
|
- 'echarts',
|
|
|
- 'echarts/theme/macarons',
|
|
|
- 'echarts/chart/line',
|
|
|
- 'echarts/chart/pie'
|
|
|
- ],
|
|
|
- function (ec,theme) {
|
|
|
- // 基于准备好的dom,初始化echarts图表
|
|
|
- score_statistics = ec.init(document.getElementById('personal-score-statistics'),theme);
|
|
|
- check_type = ec.init(document.getElementById('personal-check-type'),theme);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 图一
|
|
|
- */
|
|
|
- function personal_score_statistics(){
|
|
|
- option = {
|
|
|
- color : [ '#00ced1' ],
|
|
|
- tooltip : {
|
|
|
- trigger: 'axis'
|
|
|
- },
|
|
|
- noDataLoadingOption :{
|
|
|
- text: '暂无数据',
|
|
|
- effect:'bubble',
|
|
|
- effectOption : {
|
|
|
- effect: {
|
|
|
- n: 0 //气泡个数为0
|
|
|
- }
|
|
|
- },
|
|
|
- textStyle: {
|
|
|
- fontSize: 20,
|
|
|
- fontFamily:'cursive',
|
|
|
- fontWeight: 'bold'
|
|
|
+ require(
|
|
|
+ [
|
|
|
+ 'echarts',
|
|
|
+ 'echarts/theme/macarons',
|
|
|
+ 'echarts/chart/line',
|
|
|
+ 'echarts/chart/pie'
|
|
|
+ ],
|
|
|
+ function(ec, theme) {
|
|
|
+ // 基于准备好的dom,初始化echarts图表
|
|
|
+ score_statistics = ec.init(document.getElementById('personal-score-statistics'), theme);
|
|
|
+ check_type = ec.init(document.getElementById('personal-check-type'), theme);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 图一
|
|
|
+ */
|
|
|
+ function personal_score_statistics() {
|
|
|
+ option = {
|
|
|
+ color: ['#00ced1'],
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis'
|
|
|
+ },
|
|
|
+ noDataLoadingOption: {
|
|
|
+ text: '暂无数据',
|
|
|
+ effect: 'bubble',
|
|
|
+ effectOption: {
|
|
|
+ effect: {
|
|
|
+ n: 0 //气泡个数为0
|
|
|
}
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 20,
|
|
|
+ fontFamily: 'cursive',
|
|
|
+ fontWeight: 'bold'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ grid: {
|
|
|
+ width: "75%"
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ data: ['平均分']
|
|
|
+ },
|
|
|
+ toolbox: {
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ calculable: true,
|
|
|
+ xAxis: [{
|
|
|
+ type: 'category',
|
|
|
+ boundaryGap: false,
|
|
|
+ data: month_method_2()
|
|
|
+ }],
|
|
|
+ yAxis: [{
|
|
|
+ type: 'value',
|
|
|
+ min: 700,
|
|
|
+ max: 1000,
|
|
|
+ axisLabel: {
|
|
|
+ formatter: '{value}'
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ series: [{
|
|
|
+ name: '平均分',
|
|
|
+ type: 'line',
|
|
|
+ data: array_year_score,
|
|
|
+ markPoint: {
|
|
|
+ data: [
|
|
|
+ { type: 'max', name: '最大值' },
|
|
|
+ { type: 'min', name: '最小值' }
|
|
|
+ ]
|
|
|
},
|
|
|
- grid:{
|
|
|
- width:"75%"
|
|
|
- },
|
|
|
- legend: {
|
|
|
- data:['平均分']
|
|
|
- },
|
|
|
- toolbox: {
|
|
|
- show : true,
|
|
|
- },
|
|
|
- calculable : true,
|
|
|
- xAxis : [
|
|
|
- {
|
|
|
- type : 'category',
|
|
|
- boundaryGap : false,
|
|
|
- data : month_method_2()
|
|
|
- }
|
|
|
- ],
|
|
|
- yAxis : [
|
|
|
- {
|
|
|
- type : 'value',
|
|
|
- min : 700 ,
|
|
|
- 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 personal_check_type(){
|
|
|
- option = {
|
|
|
- tooltip : {
|
|
|
- trigger: 'item',
|
|
|
- formatter: "个人服务检查问题占比 <br/>{b} : {c}分 ({d}%)"
|
|
|
- },
|
|
|
- noDataLoadingOption :{
|
|
|
- text: '暂无数据',
|
|
|
- effect:'bubble',
|
|
|
- effectOption : {
|
|
|
- effect: {
|
|
|
- n: 0 //气泡个数为0
|
|
|
+ markLine: {
|
|
|
+ data: [
|
|
|
+ { type: 'average', name: '平均值' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ return option;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 图二
|
|
|
+ */
|
|
|
+ function personal_check_type() {
|
|
|
+ option = {
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: "个人服务检查问题占比 <br/>{b} : {c}分 ({d}%)"
|
|
|
+ },
|
|
|
+ noDataLoadingOption: {
|
|
|
+ text: '暂无数据',
|
|
|
+ effect: 'bubble',
|
|
|
+ effectOption: {
|
|
|
+ effect: {
|
|
|
+ n: 0 //气泡个数为0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 20,
|
|
|
+ fontFamily: 'cursive',
|
|
|
+ fontWeight: 'bold'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toolbox: {
|
|
|
+ show: true,
|
|
|
+ feature: {
|
|
|
+
|
|
|
+ magicType: {
|
|
|
+
|
|
|
+ type: ['pie', 'funnel'],
|
|
|
+ option: {
|
|
|
+ funnel: {
|
|
|
+ x: '25%',
|
|
|
+ width: '50%',
|
|
|
+ funnelAlign: 'left',
|
|
|
+ max: 1548
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- textStyle: {
|
|
|
- fontSize: 20,
|
|
|
- fontFamily:'cursive',
|
|
|
- fontWeight: 'bold'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ calculable: true,
|
|
|
+ series: [{
|
|
|
+ name: '访问来源',
|
|
|
+ type: 'pie',
|
|
|
+ radius: '55%',
|
|
|
+ center: ['50%', '50%'],
|
|
|
+ data: array_check_type,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ formatter: '{b} :\n{c}分 ({d}%)'
|
|
|
+ },
|
|
|
+ labelLine: { show: true }
|
|
|
}
|
|
|
- },
|
|
|
- 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} :\n{c}分 ({d}%)'
|
|
|
- },
|
|
|
- labelLine :{show:true}
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- return option;
|
|
|
- }
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ };
|
|
|
+ return option;
|
|
|
+ }
|
|
|
|
|
|
});
|
|
|
-function setVisit(){
|
|
|
- if(roleContains("STATION")){
|
|
|
- $("#select-dept").attr("disabled","disabled");
|
|
|
- }
|
|
|
+
|
|
|
+function setVisit() {
|
|
|
+ if (roleContains("STATION")) {
|
|
|
+ $("#select-dept").attr("disabled", "disabled");
|
|
|
+ }
|
|
|
}
|