ajax请求

/***********表格条件查询 action*********/

//提交查询        	

function form_submit(page){
	$('.submit_btn').html("正在查询");
    var report_user=$("#report_user").val();
    var start_time=$("#start_time").val();
    var end_time=$("#end_time").val();
    var options=$("#channel_id option:selected");
    var channel_id=options.val();


    var data=new Object();
    data.report_user=report_user;
    data.start_time=start_time;
    data.end_time=end_time;
    data.page=page;
    data.channel_id=channel_id;
    
	
    var tablehtml="<thead><tr><th>事件号</th><th>上报人姓名</th><th>事件类型</th><th>上报时间</th><th>处理人</th></tr></thead><tbody id='afterhtml'>"
    $.ajax({
        url: requesturl+"/portal/report",
        type: "POST",
        data: JSON.stringify(data),
        datatype:'json',
        contentType : "application/json",
        success:function(result){
        	console.log(result);
            if(result['return_dict']){
                for(i=0;i<result['return_dict']['row'].length;i++){
	                tablehtml+="<tr><td><a target='_blank' href='"+requesturl+"/MailLinkDeal.aspx?Url=&Event_Code="+result['return_dict']['row'][i]['ita_event_code']+"&Type=1'>"+result['return_dict']['row'][i]['ita_event_code']+"</a></td><td>"
	                +result['return_dict']['row'][i]['ita_report_name']+"</td><td>"
	                 +result['return_dict']['row'][i]['ita_channel_name']+"</td><td>"
	                 +result['return_dict']['row'][i]['ita_submit_time']+"</td><td>"
	                +result['return_dict']['row'][i]['ita_solve_user']+"</td>"
	
	                +"</tr>"
	            };
	            tablehtml+="</tbody>";
	            $("#tablehtml").html(tablehtml);
	            var total_page=result['return_dict']['total_page'];
	            var page=result['return_dict']['page'];
	//          var page=
	            console.log(total_page);
	            $.jqPaginator('#pagination', {
	                totalPages: total_page,
	                visiblePages: 5,
	                currentPage: page,
	                onPageChange: function (num, type) {
	                    $('#p1').text('总页数'+total_page +':共' + num+"条");
	                    data.page=num;
	                    afterhtml="";
	                    
	                    $.ajax({
	                    	url: requesturl+"/portal/report",
		                    type: "POST",
		                    data: JSON.stringify(data),
		                    datatype:'json',
		                    contentType : "application/json",
		                    success:function(result){
			                    if(result['return_dict']['row']){
				                    for(i=0;i<result['return_dict']['row'].length;i++){
					                    afterhtml+="<tr><td><a target='_blank' href='"+requesturl+"/MailLinkDeal.aspx?Url=&Event_Code="+result['return_dict']['row'][i]['ita_event_code']+"&Type=1'>"+result['return_dict']['row'][i]['ita_event_code']+"</a></td><td>"
					                    +result['return_dict']['row'][i]['ita_report_name']+"</td><td>"
					                     +result['return_dict']['row'][i]['ita_channel_name']+"</td><td>"
					                     +result['return_dict']['row'][i]['ita_submit_time']+"</td><td>"
					                    +result['return_dict']['row'][i]['ita_solve_user']+"</td>"
					
					                    +"</tr>"
					                    $('.submit_btn').html("提   交");
					                };
			                	}else{
				                	$('.submit_btn').html("提   交");
				                    alert('没有相关数据');
			                	}
			                	document.getElementById("afterhtml").innerHTML=afterhtml;
			            	}
		        		})
	
		            }
		        });
            }else{
            	$('.submit_btn').html("提   交");
                alert('没有相关数据');
            }
        }
    });
}

/***********表格条件查询 end*********/



/***********无条件查询 action*********/

$.ajax({
        type:'GET',
        url:requesturl+'/portal/1',
        dataType:'json',
        success:function(data){
            $("#year_num").html("年处理:"+data['context']['year_data']);
            $("#month_num").html("月处理:"+data['context']['month_data']);
            $("#day_num").html("日处理:"+data['context']['today_data']);
        },
        error:function() {
            alert("请求出错!");
        }
    });

/***********无条件查询 end*********/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值