You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.8 KiB
HTML

2 years ago
<div class="modal fade delModal" id="delModal" tabindex="-1" role="dialog" aria-labelledby="delModalLabel" aria-hidden="true">
<div style="display:table;width:100%;height:100%;">
<div style="display:table-cell;vertical-align:middle;">
<div class="modal-dialog" style="width:400px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="myModalLabel">
删除
</h4>
</div>
<div class="modal-body">
<div id="delInfo">
是否删除?此操作删除后不可恢复,请你慎重操作!
</div>
</div>
<div class="modal-footer" style="text-align: center;">
<button type="button" data-ids="" data-temp="{$model}" class="btn btn_primary btn_primary1 jsprimary" data-dismiss="modal">确定</button>
<button type="button" class="btn btn_default jscancel" data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function() {
$('.jsubd').on('click',function() {
var ids = $(this).data("ga-id");
$('.delModal .jsprimary').attr('data-ids','').attr('data-ids',ids);
});
$('.jsallubd').on('click',function() {
var val = [];
$(this).closest('.matter_right').find('table').find('input[name="ids[]"]:not([class=checkall]):checked:enabled').each(function(){
val.push(parseInt($(this).val()));
});
if("" == val){
layer.msg("请先选择要删除的数据");
return false;
}
$('.delModal .jsprimary').attr('data-ids','').attr('data-ids',val.join(','));
});
$('.jsprimary').on('click',function(){
var that = $(this),ids = that.attr('data-ids');
if (that.hasClass('disabled')) {return false;}
that.addClass('disabled');
toastr.options.positionClass = 'toast-center-center';
toastr.options.timeOut = 1000;
$.ajax({
type:'post',dataType:'json',url:'{:U($Think.CONTROLLER_NAME."/del")}',data:{ids:ids,model:that.attr('data-temp')},success:function(data){
if (parseInt(data.status)==1) {
$('.jscancel').click();
layer.msg(data.info);
setTimeout(function(){
window.location.reload();
},1300);
}else {
that.removeClass('disabled');
$('.jscancel').click();
layer.msg(data.info);
}
},error:function(){
that.removeClass('disabled');
$('.jscancel').click();
toastr.error("服务器故障,稍候再试...");
}
});
return false;
});
});
</script>