作者 董瑞恩
1 个管道 的构建 通过 耗费 2 秒

interface

... ... @@ -190,7 +190,9 @@ class AdminEquipmentController extends AdminBaseController{
//批量导出
public function batch_export(){
//$ids=$this->request->param('ids');
$ids=$this->request->param('ids');
dump($ids);
exit();
$data= Db::name('equipment')->select();
// 导出Exl
vendor("VENDOR_PATH/phpoffice/phpexcel/Classes/PHPExcel");
... ...
... ... @@ -40,7 +40,10 @@
<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
onclick="batch_add()">批量新增
</button>
<a class="btn btn-primary btn-sm" href="{:url('AdminEquipment/batch_export')}">批量导出</a>
<button class="btn btn-primary btn-sm" type="button" id="batch_export">
批量导出
</button>
<!--<a class="btn btn-primary btn-sm" href="{:url('AdminEquipment/batch_export')}">批量导出</a>-->
</div>
<table class="table table-hover table-bordered table-list">
<thead>
... ... @@ -200,6 +203,28 @@
}
});
}
$('#batch_export').click(function () {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
window.location.href="{:url('AdminEquipment/batch_export')}?ids="+ids;
});
function reloadPage(win) {
win.location.reload();
}
... ...