赞
踩
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" οnclick="exportData()">
<i class="fa fa-download"></i> 导出
</a>
</div>
function exportData() {
table.set();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$.modal.confirm("确认要导出选中的" + rows.length + "条数据吗?", function() {
var data = { "vcNoList": rows.join() };
$.modal.loading("正在导出数据,请稍后...");
$.post(prefix + "/export", data, function(result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。