首页 > Web开发 > 详细

js 导出Excel2

时间:2018-05-25 12:00:37      阅读:173      评论:0      收藏:0      [点我收藏+]

 

 

// 点击导出Excel
$(document).on("click", "button.excel", (res) => {
qqkj.getExcel(res);
});

/**
保单列表
* 导出Excel
* @param callback 回调函数
*/
qqkj.getExcel = function(callback) {
var _this = this;
console.log(_this.getCookie("token"));
$.ajax({
beforeSend: function(request) {
request.setRequestHeader(‘token‘, _this.getCookie("token"))
},
type: "get",
cache: false,
data: ‘‘,
url: _this.url + ‘/uc/admin/policy/export/excel.xls‘,
success: function(data) {
if (data) {
callback(window.open(_this.url + ‘/uc/admin/policy/export/excel.xls?token=‘+_this.getCookie("token"), ‘_blank‘, ‘‘));
} else {
alert("ERROR!");
}
},
error: function(response) {
console.log(response.statusText);
}

})
};

js 导出Excel2

原文:https://www.cnblogs.com/linyongli/p/9087225.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!