$(function () { }); /* 参数解释: title 标题 url 请求的url id 需要操作的数据id w 弹出层宽度(缺省调默认值) h 弹出层高度(缺省调默认值) */ /*管理员-增加*/ function notify_add(title,url,w,h){ var index = layer_show(title,pagePath+url,w,h); layer.full(index); } /*管理员-编辑*/ function notify_edit(title,url,w,h) { var index = layer_show(title, pagePath + url, w, h); layer.full(index); } // 阅读情况 function notify_readDetail(title,url,w,h){ layer_show(title, pagePath + url, w, h); } /*管理员-详情*/ function notify_info(title,url,w,h){ var index = layer_show(title,pagePath+url,w,h); layer.full(index); } /*管理员-批量删除*/ function notify_del(){ layer.confirm('确认要删除吗?',function(index){ var chlength=$('#notifyTb tbody').find('input[type="checkbox"]:checked').length; if(chlength<=0){ alert('请选择删除元素'); return false; } var ids=''; $('#notifyTb tbody').find('input[type="checkbox"]:checked').each(function(i,item){ ids=ids+$(this).attr("id")+","; }); ids=ids.substring(0,ids.length-1); $.ajax({ url :pagePath+"/government/notify/deleteBatch", type : "post", data : {'ids':ids}, dataType : "json", success: function (result) { if (result.success) { smileMessage(result.message) setTime(); } else { errorMessage(result.message); } }, error: function () { errorMessage('系统错误!'); } }); }); } /*管理员-归档*/ function notify_archive(){ var chlength=$('#notifyTb tbody').find('input[type="checkbox"]:checked').length; if(chlength<=0){ sadMessage('请选择归档元素'); return false; } layer.confirm('确认要归档吗?',function(index){ var ids=''; var notify_detail_ids=''; $('#notifyTb tbody').find('input[type="checkbox"]:checked').each(function(i,item){ if($(this).attr("notify_detail_id")!="" && $(this).attr("notify_detail_id")!="0"){ notify_detail_ids+=$(this).attr("notify_detail_id")+","; }else{ ids+=$(this).attr("id")+","; } }); ids=ids.substring(0,ids.length-1); notify_detail_ids=notify_detail_ids.substring(0,notify_detail_ids.length-1); $.ajax({ url :pagePath+"/government/notify/archiveBatch", type : "post", data : { 'ids':ids, 'notify_detail_ids':notify_detail_ids }, dataType : "json", success: function (result) { if (result.success) { smileMessage(result.message) setTime(); } else { errorMessage(result.message); } }, error: function () { errorMessage('系统错误!'); } }); }); }