serviceAlliance_list.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. $(function () {
  2. });
  3. /*
  4. 参数解释:
  5. title 标题
  6. url 请求的url
  7. id 需要操作的数据id
  8. w 弹出层宽度(缺省调默认值)
  9. h 弹出层高度(缺省调默认值)
  10. */
  11. /*管理员-增加*/
  12. function serviceAlliance_add(title,url,w,h){
  13. layer_show(title,pagePath+url,w,h);
  14. }
  15. /*管理员-编辑*/
  16. function slides_edit(title,url,w,h){
  17. layer_show(title,pagePath+url,w,h);
  18. }
  19. /*管理员-详情*/
  20. function slides_info(title,url,w,h){
  21. layer_show(title,pagePath+url,w,h);
  22. }
  23. /*管理员-批量删除*/
  24. function slides_del(){
  25. layer.confirm('确认要删除吗?',function(index){
  26. var chlength=$('#slidesTb tbody').find('input[type="checkbox"]:checked').length;
  27. if(chlength<=0){
  28. alert('请选择删除元素');
  29. return false;
  30. }
  31. var ids='';
  32. $('#slidesTb tbody').find('input[type="checkbox"]:checked').each(function(i,item){
  33. ids=ids+$(this).attr("id")+",";
  34. });
  35. ids=ids.substring(0,ids.length-1);
  36. $.ajax({
  37. url :pagePath+"/government/friendLink/deleteBatch",
  38. type : "put",
  39. data : {'ids':ids},
  40. dataType : "json",
  41. success: function (result) {
  42. if (result.success) {
  43. smileMessage(result.message)
  44. setTime();
  45. } else {
  46. errorMessage(result.message);
  47. }
  48. },
  49. error: function () {
  50. errorMessage('系统错误!');
  51. }
  52. });
  53. });
  54. }
  55. /*管理员-删除*/
  56. function slides_delete(obj, url){
  57. layer.confirm('确认要删除吗?',function(index){
  58. //此处请求后台程序,下方是成功后的前台处理……
  59. $.ajax({
  60. type:"DELETE",
  61. dataType:"json",
  62. url: pagePath+url,
  63. data:{
  64. "timestamp":new Date().getTime()
  65. },
  66. success: function (result) {
  67. if (result.success) {
  68. smileMessage(result.message)
  69. setTime();
  70. } else {
  71. errorMessage(result.message);
  72. }
  73. },
  74. error: function () {
  75. errorMessage('系统错误!');
  76. }
  77. });
  78. });
  79. }
  80. /**
  81. * 禁用|启用
  82. * @param ids
  83. */
  84. function slides_status(urls,isLock){
  85. var msg = "确认要启用吗?";
  86. if(isLock == "true"){
  87. msg = "确认要禁用吗?";
  88. }
  89. var chlength=$('#slidesTb tbody').find('input[type="checkbox"]:checked').length;
  90. if(chlength<=0){
  91. alert('请选择更新元素');
  92. return false;
  93. }
  94. var ids='';
  95. $('#slidesTb tbody').find('input[type="checkbox"]:checked').each(function(i,item){
  96. ids=ids+$(this).attr("id")+",";
  97. });
  98. ids=ids.substring(0,ids.length-1);
  99. layer.confirm(msg,function(index){
  100. //此处请求后台程序,下方是成功后的前台处理……
  101. $.ajax({
  102. type:"Post",
  103. dataType:"json",
  104. url: pagePath+urls,
  105. data:{
  106. "ids":ids,
  107. "isLock":isLock
  108. },
  109. success: function (result) {
  110. if (result.success) {
  111. smileMessage(result.message)
  112. setTime();
  113. } else {
  114. errorMessage(result.message);
  115. }
  116. },
  117. error: function () {
  118. errorMessage('系统错误!');
  119. }
  120. });
  121. });
  122. }