阅读背景:

前台将查询条件传入后台,查询数据库,选择保存路径,然后导出excel

来源:互联网 

JS代码

exportExcel = function (type) {
	var obj=JSON.stringify($("#searchForm").serializeJSON());
	$.ajax({
        //这里是公共方法的衔接
        url: "exportExcelController/submitExcelData.action",
        type: "post",
        dataType: "json",
        data:"obj="+obj,
        success: function (data) {
            if (data&&data.code=="1") {
                 //这里是每一个JavaBean对应的掌握层方法
                 window.location.href = "dogController/export.action";
                //我们这里缺乏导出胜利的提醒,有须要的自行想方法添加                         
            } else {
            	$.messager.show({
					title:"提醒",
					msg:"导出失败~",
					timeout:3000,
					showType:"slide"
				});
            }
        },
        error: function (err) {
        	$.messager.show({
				title:"提醒",
				msg:"导出失败~",
				timeout:3000,
				showType:"slide"
			});
        }
    });                
	 
	
};exportExcel = function (type) {
	var ob



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: