|
@@ -1,8 +1,6 @@
|
|
|
var year = new Date().getFullYear();
|
|
var year = new Date().getFullYear();
|
|
|
var month = new Date().getMonth();
|
|
var month = new Date().getMonth();
|
|
|
var date = new Date().getDate();
|
|
var date = new Date().getDate();
|
|
|
- var months = ['1','2','3','4','5','6','7','8','9','10','11','12'];
|
|
|
|
|
- var monthsCH = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
|
|
|
|
|
var select_road = $(".div-roadManage select").val();
|
|
var select_road = $(".div-roadManage select").val();
|
|
|
var select_station = $("#second").val();
|
|
var select_station = $("#second").val();
|
|
|
var array_year_score = new Array();
|
|
var array_year_score = new Array();
|
|
@@ -31,9 +29,13 @@
|
|
|
var flag = true;
|
|
var flag = true;
|
|
|
var change_echart = 2;
|
|
var change_echart = 2;
|
|
|
$(function(){
|
|
$(function(){
|
|
|
|
|
+ // 公用方法,根据当前年月动态将13个月push数组
|
|
|
|
|
+ month_method();
|
|
|
|
|
+ // 公用方法,月份下拉框
|
|
|
|
|
+ select_option();
|
|
|
|
|
+ // 回显当前年月份
|
|
|
|
|
+ $(".div-month select").val(initDate);
|
|
|
setSecond();
|
|
setSecond();
|
|
|
- // 显示当前月份
|
|
|
|
|
- $(".div-month select").val(month);
|
|
|
|
|
|
|
|
|
|
$(".div-button button").click(function(){
|
|
$(".div-button button").click(function(){
|
|
|
var select_month = $(".div-month select").val();
|
|
var select_month = $(".div-month select").val();
|
|
@@ -68,8 +70,8 @@ $(function(){
|
|
|
*/
|
|
*/
|
|
|
function init_tollStation_year_assess(url,select_station){
|
|
function init_tollStation_year_assess(url,select_station){
|
|
|
var param = {
|
|
var param = {
|
|
|
- "start_date":(year-1)+"-12-25 23:00:00",
|
|
|
|
|
- "end_date":year+"-12-25 23:00:00",
|
|
|
|
|
|
|
+ "start_date":(year-1)+"-"+new Date().getMonth()+"-"+date+" 23:00:00",
|
|
|
|
|
+ "end_date":year+"-"+new Date().getMonth()+"-"+date+" 23:00:00",
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
"queryType":2
|
|
"queryType":2
|
|
|
}
|
|
}
|
|
@@ -81,11 +83,8 @@ $(function(){
|
|
|
* 初始化图二
|
|
* 初始化图二
|
|
|
*/
|
|
*/
|
|
|
function init_company_points_assess(url,mon,select_station){
|
|
function init_company_points_assess(url,mon,select_station){
|
|
|
- if(mon.length==1){
|
|
|
|
|
- mon = "0" +mon;
|
|
|
|
|
- }
|
|
|
|
|
var param = {
|
|
var param = {
|
|
|
- mth:year + "/" +mon,
|
|
|
|
|
|
|
+ mth:mon,
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
"queryType":2
|
|
"queryType":2
|
|
|
}
|
|
}
|
|
@@ -96,23 +95,21 @@ $(function(){
|
|
|
* 初始化图三 前5名
|
|
* 初始化图三 前5名
|
|
|
*/
|
|
*/
|
|
|
function init_progress_rank_assess(url,mon,select_station){
|
|
function init_progress_rank_assess(url,mon,select_station){
|
|
|
- var yearPre = year;
|
|
|
|
|
- if(mon==1){
|
|
|
|
|
- prev_mth = 12+'';
|
|
|
|
|
- yearPre = yearPre-1;
|
|
|
|
|
|
|
+ var prev_mth;
|
|
|
|
|
+ // 判断当前年月是否为一月
|
|
|
|
|
+ if(parseInt((mon+'').substr(5)) == 1){
|
|
|
|
|
+ prev_mth = ((parseInt((mon+'').substr(0,4)))-1)+"/12";
|
|
|
}else{
|
|
}else{
|
|
|
- var prev_mth = (mon-1)+'';
|
|
|
|
|
- }
|
|
|
|
|
- if(mon.length==1){
|
|
|
|
|
- mon = "0" +mon;
|
|
|
|
|
- }
|
|
|
|
|
- if(prev_mth.length==1){
|
|
|
|
|
- prev_mth = "0" + prev_mth;
|
|
|
|
|
|
|
+ if((parseInt((mon+'').substr(5))+'').length == 1){
|
|
|
|
|
+ prev_mth = (mon+'').substr(0,4) + '/0'+ (parseInt((mon+'').substr(5))-1);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ prev_mth = (mon+'').substr(0,4) + '/'+ (parseInt((mon+'').substr(5))-1);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
var param = {
|
|
var param = {
|
|
|
- "mth":year + "/" + mon,
|
|
|
|
|
|
|
+ "mth": mon,
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
- "prev_mth": yearPre + "/" + prev_mth,
|
|
|
|
|
|
|
+ "prev_mth": prev_mth,
|
|
|
"order_type":0
|
|
"order_type":0
|
|
|
};
|
|
};
|
|
|
initRqueset(url,param,3);
|
|
initRqueset(url,param,3);
|
|
@@ -122,11 +119,8 @@ $(function(){
|
|
|
* 初始化图四
|
|
* 初始化图四
|
|
|
*/
|
|
*/
|
|
|
function init_people_score_rank(url,mon,select_station){
|
|
function init_people_score_rank(url,mon,select_station){
|
|
|
- if(mon.length==1){
|
|
|
|
|
- mon = "0" +mon;
|
|
|
|
|
- }
|
|
|
|
|
var param = {
|
|
var param = {
|
|
|
- mth:year + "/" +mon,
|
|
|
|
|
|
|
+ "mth":mon,
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
"queryType":2,
|
|
"queryType":2,
|
|
|
"order_type":1
|
|
"order_type":1
|
|
@@ -137,12 +131,9 @@ $(function(){
|
|
|
/**
|
|
/**
|
|
|
* 初始化图五
|
|
* 初始化图五
|
|
|
*/
|
|
*/
|
|
|
- function init_server_check_type(url,mon,select_station){
|
|
|
|
|
- if(mon.length==1){
|
|
|
|
|
- mon = "0" +mon;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ function init_server_check_type(url,mon,select_station){
|
|
|
var param = {
|
|
var param = {
|
|
|
- "mth":year + "/" +mon,
|
|
|
|
|
|
|
+ "mth":mon,
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
"queryType":2
|
|
"queryType":2
|
|
|
};
|
|
};
|
|
@@ -154,22 +145,20 @@ $(function(){
|
|
|
* 初始化图六
|
|
* 初始化图六
|
|
|
*/
|
|
*/
|
|
|
function init_each_people_points(url,mon,select_station){
|
|
function init_each_people_points(url,mon,select_station){
|
|
|
- var yearPre = year;
|
|
|
|
|
- if(mon==1){
|
|
|
|
|
- prev_mth = 12+'';
|
|
|
|
|
- yearPre = yearPre-1;
|
|
|
|
|
|
|
+ var prev_mth;
|
|
|
|
|
+ // 判断当前年月是否为一月
|
|
|
|
|
+ if(parseInt((mon+'').substr(5)) == 1){
|
|
|
|
|
+ prev_mth = ((parseInt((mon+'').substr(0,4)))-1)+"/12";
|
|
|
}else{
|
|
}else{
|
|
|
- var prev_mth = (mon-1)+'';
|
|
|
|
|
- }
|
|
|
|
|
- if(mon.length==1){
|
|
|
|
|
- mon = "0" +mon;
|
|
|
|
|
- }
|
|
|
|
|
- if(prev_mth.length==1){
|
|
|
|
|
- prev_mth = "0" + prev_mth;
|
|
|
|
|
|
|
+ if((parseInt((mon+'').substr(5))+'').length == 1){
|
|
|
|
|
+ prev_mth = (mon+'').substr(0,4) + '/0'+ (parseInt((mon+'').substr(5))-1);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ prev_mth = (mon+'').substr(0,4) + '/'+ (parseInt((mon+'').substr(5))-1);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
var param = {
|
|
var param = {
|
|
|
- "mth":year + "/" + mon,
|
|
|
|
|
- "prev_mth": yearPre + "/" + prev_mth,
|
|
|
|
|
|
|
+ "mth":mon,
|
|
|
|
|
+ "prev_mth": prev_mth,
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
"queryType":2
|
|
"queryType":2
|
|
|
};
|
|
};
|
|
@@ -180,23 +169,21 @@ $(function(){
|
|
|
* 图切换后5名
|
|
* 图切换后5名
|
|
|
*/
|
|
*/
|
|
|
function init_backward_rank_assess(url,mon,select_station){
|
|
function init_backward_rank_assess(url,mon,select_station){
|
|
|
- var yearPre = year;
|
|
|
|
|
- if(mon==1){
|
|
|
|
|
- prev_mth = 12+'';
|
|
|
|
|
- yearPre = yearPre-1;
|
|
|
|
|
|
|
+ var prev_mth;
|
|
|
|
|
+ // 判断当前年月是否为一月
|
|
|
|
|
+ if(parseInt((mon+'').substr(5)) == 1){
|
|
|
|
|
+ prev_mth = ((parseInt((mon+'').substr(0,4)))-1)+"/12";
|
|
|
}else{
|
|
}else{
|
|
|
- var prev_mth = (mon-1)+'';
|
|
|
|
|
- }
|
|
|
|
|
- if(mon.length==1){
|
|
|
|
|
- mon = "0" +mon;
|
|
|
|
|
- }
|
|
|
|
|
- if(prev_mth.length==1){
|
|
|
|
|
- prev_mth = "0" + prev_mth;
|
|
|
|
|
|
|
+ if((parseInt((mon+'').substr(5))+'').length == 1){
|
|
|
|
|
+ prev_mth = (mon+'').substr(0,4) + '/0'+ (parseInt((mon+'').substr(5))-1);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ prev_mth = (mon+'').substr(0,4) + '/'+ (parseInt((mon+'').substr(5))-1);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
var param = {
|
|
var param = {
|
|
|
- "mth":year + "/" + mon,
|
|
|
|
|
|
|
+ "mth":mon,
|
|
|
"dept_id":select_station,
|
|
"dept_id":select_station,
|
|
|
- "prev_mth": yearPre + "/" + prev_mth,
|
|
|
|
|
|
|
+ "prev_mth": prev_mth,
|
|
|
"order_type":1
|
|
"order_type":1
|
|
|
};
|
|
};
|
|
|
initRqueset(url,param,7);
|
|
initRqueset(url,param,7);
|
|
@@ -248,19 +235,18 @@ $(function(){
|
|
|
function data_array(data,type){
|
|
function data_array(data,type){
|
|
|
if(type == 1){
|
|
if(type == 1){
|
|
|
array_year_score.length = 0;
|
|
array_year_score.length = 0;
|
|
|
- months.length = 0;
|
|
|
|
|
if(data!='' && data.length!=0){
|
|
if(data!='' && data.length!=0){
|
|
|
- if(data.length<12){
|
|
|
|
|
- for(var i=0;i<12-data.length;i++){
|
|
|
|
|
|
|
+ if(data.length<13){
|
|
|
|
|
+ for(var i=0;i<13-data.length;i++){
|
|
|
// 不足月份补0
|
|
// 不足月份补0
|
|
|
array_year_score.push(0);
|
|
array_year_score.push(0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for(var i=0;i<data.length;i++){
|
|
for(var i=0;i<data.length;i++){
|
|
|
- if(months.indexOf(parseInt(data[i].mth.substr(5)))){
|
|
|
|
|
- // 指定位置插入值
|
|
|
|
|
- array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
|
|
|
|
|
- (1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
|
|
|
|
|
|
|
+ if(months.indexOf(data[i].mth.substr(2))){
|
|
|
|
|
+ // 指定位置插入值
|
|
|
|
|
+ array_year_score.splice(months.indexOf(data[i].mth.substr(2)),0,
|
|
|
|
|
+ (1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
@@ -620,7 +606,7 @@ $(function(){
|
|
|
{
|
|
{
|
|
|
type : 'category',
|
|
type : 'category',
|
|
|
boundaryGap : false,
|
|
boundaryGap : false,
|
|
|
- data : monthsCH
|
|
|
|
|
|
|
+ data : months
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
yAxis : [
|
|
yAxis : [
|