layui自带的导出,是导出当前页的数据,以下方法是导出所有数据
导出
//导出
function excl_rep() {
var SH=$("#type").val();//汇总分类
var SER = $("#ser_row").val(),
ONETYPE = $("#type_one").val(),//一级分类
TWOTYPE = $('#type_two').val();//二级分类
var BRAND=$('#type_p').val();
var url = "{:U('home/goods/brand_goods_img_excl')}" + "&ser=" + SER +'&type_h='+SH+ "&type_one=" + ONETYPE + "&type_two=" + TWOTYPE+"&brand="+BRAND ;
//console.log(url);
window.open(url);
}
调用的是PHP(TP3)写的接口:
function brand_goods_img_excl(){
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=品牌商品上图.xls