**
对应index.html文件
<a href="javascript:;" class="btn btn-success btn-fiapro btn-disabled disabled" title="{:__('批量审核')}" ><i class="fa fa-trash"></i> {:__('批量审核')}</a>
<a href="javascript:;" class="btn btn-info btn-fifapro btn-disabled disabled" title="{:__('批量反审')}" ><i class="fa fa-trash"></i> {:__('批量反审')}</a>
2.对应js文件
/* 批量审批*/
$(".btn-apro").on('click',function(){
var ids =table.bootstrapTable('getSelections');
console.log(ids);
var checkids = [];
checkids = getIdSelections();
console.log(checkids);
/* Fast.api.open("ykjp/projects/inexamine/checkids?ids="+checkids, "添加", {
callback: function (value) {
console.log(value);
}
}); */
Fast.api.ajax({
type: 'POST',
url:'ykjp/projects/inexamine/checkids?ids='+checkids
}, function (data, ret) {
console.log(data);
location.reload();
}, function (data, ret) {
console.log(data);
location.reload();
});
});
/* 批量反审 */
$(".btn-fapro").on('click',function(){
var ids =table.bootstrapTable('getSelections');
console.log(ids);
var checkids = [];
checkids = getIdSelections();
console.log(checkids);
/* Fast.api.open("ykjp/projects/inexamine/checkids?ids="+checkids, "添加", {
callback: function (value) {
console.log(value);
}
}); */
Fast.api.ajax({
type: 'POST',
url:'ykjp/projects/inexamine/fcheckids?ids='+checkids
}, function (data, ret) {
console.log(data);
location.reload();
}, function (data, ret) {
console.log(data);
location.reload();
});
});
/* 获取选中的id */
function getIdSelections() {
return $.map($("#table").bootstrapTable('getSelections'), function(row) {
return row.id
})
对应 控制器.php文件写方法
public function checkids() {
$lists=$this->request->param('ids');
$ids = explode ( ',',$lists);//转数组
for ($i = 0; $i < count($ids); $i++){
...........
.........
......
....
...
..
.
}
$this->success(null, null, array("result" => "success"));
}