批删
const _token=”{{csrf_token()}}”;
$(“.all”).click(function(){
$(‘.al’).prop(‘checked’,$(‘.all’).prop(‘checked’))
})
//批量删除
function deleteAll(){
layer.confirm(‘确认要删除吗?’, {
btn: [‘确认删除’, ‘思考一下’]
},()=>{
let ids = $(‘input[name=”id[]”]:checked’);
let id=[];
$.each(ids,(key,val)=>{
id.push(val.value);
});
if(id.length>0){
$.ajax({
url:”{{route(‘admin.good.delAll’)}}”,
data:{id,_token},
type:’get’
}).then(ret =>{
if (ret.status == 0){
layer.msg(ret.msg,{time:200,icon:1},()=>{
location.reload();
})
}
})
}
});
}
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: