$(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>');
}
}
});
}
});
});
});
相关文章
- 深度学习模型训练提高GPU利用率的几个想法
- 以下程序的功能是从键盘输入的一串字符中统计数字字符的个数,用换行符结束循环,利用for循环明确循环次数。引入#include库,使用strlen函数明确数字字符个数。例:abv123d45输出5
- 利用hf-mirror镜像+linux命令行下载数据集
- 哈希算法:如何利用哈希算法解决实际问题?
- 利用window.navigator.userAgent判断当前是否微信内置浏览器
- C#中 利用OpenCvSharp 实现bitmap 和mat的格式相互转换
- PHP+JQUEY+AJAX实现分页
- VLAN实验5:利用三层交换机实现VLAN间路由
- kkpager的改进,Ajax数据变化但是页码不变的有关问题
- VLAN实验5(在ensp上利用三层交换机实现VLAN间路由)