$(function(){
$('#showList').hide();
var date=new Date;
var year=date.getFullYear();
$('#YEAR').append( "<option value=\""+year+"\">"+year+"</option>" );
for(var i=1;i<10;i++){
//var c=Number(year)+Number(i);
var d=Number(year)-Number(i);
//$('#YEAR').append( "<option value=\""+c+"\">"+c+"</option>" );
$('#YEAR').append( "<option value=\""+d+"\">"+d+"</option>" );
}
/* $('#YEAR').hover(function(){
location.reload();
}) ; */
$('#YEAR').change(function(){
$('.mainbg').hide();
$('#showList').show();
//年份改变时先将已有数据清0
//表格行数
var rows = document.getElementById("tableList").rows.length;
//表格列数
var cells = document.getElementById("tableList").rows.item(0).cells.length;
for(var m=1;m<=rows;m++){
for(var n=2;n<=cells;n++){
$("#tableList").find("tr").eq(m).find("td").eq(n).html("0.0");
}
}
var id= $("#tableList").find("tr").eq(i-1).find("td").eq(0).text();
$.ajax({
type: "GET",
url: "project.do?actionType=queryByYear",
data:{
year: this.value ,
projectClassId:'0'
},
dataType: "json",
success: function(data){
var html='<table cellSpacing="0" id="table" cellPadding="0" align="center" border="0"><TBODY><tr><th width="18%" ><div align="center">总计</div></th><td width="8%">'+data.nowCountProject+'</td>'+
'<td width="8%">'+data.feeAuthorize+'</td><td width="8%">'+data.incomeFees+'</td></tr><tr><th width="18%"><div align="center">去年同期</div></th><td width="8%">'+data.LastCountProject+'</td><td width="8%">'+
data.LastYearfeeAuthorize+'</td><td width="8%">'+data.LastYearincomeFees+'</td></tr><tr><th width="18%"><div align="center">增长</div></th><td width="8%">'+data.percentageCount+'</td><td width="8%">'+data.percentageAccess+'</td><td width="8%">'+
data.percentageIncome+'</td></tr></TBODY></table>';
$('#show').html(html);
$.each(data.authorizeDataMap, function(key, value){
for(var i=1;i<30;i++){
var id= $("#tableList").find("tr").eq(i-1).find("td").eq(0).text();
if(id==key){
$("#tableList").find("tr").eq(i-1).find("td").eq(2)
.html('<a href="project.do?actionType=init&@projectClassId=0&@checkStatusId=2&@projectTypeId='+id+'">'+value[1]+'</a>');
$("#tableList").find("tr").eq(i-1).find("td").eq(3).html(value[2]);
}
}
});
$.each(data.incomeDataMap, function(key, value){
for(var i=1;i<30;i++){
var id= $("#tableList").find("tr").eq(i-1).find("td").eq(0).text();
if(id==key){
$("#tableList").find("tr").eq(i-1).find("td").eq(4)
.html('<a href="../outlay/outlay.do?actionType=init&@projectClassId=0&@checkStatusId=2&@projectTypeId='+id+'&contract=false">'+value[1]+'</a>');
}
}
});
}
});
});
});