activity_review.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. $(".pass").click(function () {
  2. var id = this.id;
  3. var remain = $("#remain").text();
  4. var quota = $("#quota").text();
  5. remain = parseInt(remain, 10)
  6. if (isNaN(remain)) remain = 0
  7. quota = parseInt(quota, 10)
  8. if (isNaN(quota)) quota = 0
  9. if (remain <= 0 && quota != 0) {
  10. layer.confirm('当前活动名额已满,是否继续通过报名人员?', function (index) {
  11. $.ajax({
  12. url: pagePath + "/government/activity/updateReviewState",
  13. type: "post",
  14. data: {
  15. 'id': id,
  16. 'state': '1 ',
  17. 'message': ''
  18. },
  19. dataType: "json",
  20. success: function (result) {
  21. if (result.success) {
  22. smileMessage(result.message);
  23. setTime();
  24. } else {
  25. errorMessage(result.message);
  26. }
  27. },
  28. error: function () {
  29. errorMessage('系统错误!');
  30. }
  31. });
  32. })
  33. } else {
  34. layer.confirm('确认通过吗?', function (index) {
  35. $.ajax({
  36. url: pagePath + "/government/activity/updateReviewState",
  37. type: "post",
  38. data: {
  39. 'id': id,
  40. 'state': '1 ',
  41. 'message': ''
  42. },
  43. dataType: "json",
  44. success: function (result) {
  45. if (result.success) {
  46. smileMessage(result.message);
  47. setTime();
  48. } else {
  49. errorMessage(result.message);
  50. }
  51. },
  52. error: function () {
  53. errorMessage('系统错误!');
  54. }
  55. });
  56. })
  57. }
  58. })
  59. $(".reject").click(function () {
  60. var id = this.id;
  61. layer_show("审核驳回", pagePath + '/government/activity/reject/' + id, 800, 600);
  62. })
  63. $(".passBatch").click(function () {
  64. var ids = '';
  65. $("input:checkbox[class='checkbox']:checked").each(function (i) {
  66. var val = $(this).val();
  67. ids += val + ',';
  68. });
  69. ids = ids.substr(0,ids.length-1)
  70. if (ids.length <= 0) {
  71. errorMessage("请选择数据!");
  72. return;
  73. }
  74. var remain = $("#remain").html();
  75. var quota = $("#quota").html();
  76. remain = parseInt(remain, 10)
  77. if (isNaN(remain)) remain = 0
  78. quota = parseInt(quota, 10)
  79. if (isNaN(quota)) quota = 0
  80. var idlist = ids.split(",")
  81. if (remain < idlist.length && quota != 0) {
  82. layer.confirm('当前活动名额已满,是否继续通过报名人员?', function (index) {
  83. $.ajax({
  84. url: pagePath + "/government/activity/updateReviewStateBatch",
  85. type: "post",
  86. data: {
  87. 'ids': ids,
  88. 'state': '1 ',
  89. 'message': ''
  90. },
  91. dataType: "json",
  92. success: function (result) {
  93. if (result.success) {
  94. smileMessage(result.message);
  95. setTime();
  96. } else {
  97. errorMessage(result.message);
  98. }
  99. },
  100. error: function () {
  101. errorMessage('系统错误!');
  102. }
  103. });
  104. })
  105. } else {
  106. layer.confirm('确认通过吗?', function (index) {
  107. $.ajax({
  108. url: pagePath + "/government/activity/updateReviewStateBatch",
  109. type: "post",
  110. data: {
  111. 'ids': ids,
  112. 'state': '1 ',
  113. 'message': ''
  114. },
  115. dataType: "json",
  116. success: function (result) {
  117. if (result.success) {
  118. smileMessage(result.message);
  119. setTime();
  120. } else {
  121. errorMessage(result.message);
  122. }
  123. },
  124. error: function () {
  125. errorMessage('系统错误!');
  126. }
  127. })
  128. });
  129. }
  130. })
  131. $(".rejectBatch").click(function () {
  132. var ids = '';
  133. $("input:checkbox[type='checkbox']:checked").each(function () {
  134. if ($(this).val() !== "on"){
  135. var val = $(this).val();
  136. ids += val + ',';
  137. }
  138. });
  139. if (ids.length <= 0) {
  140. errorMessage("请选择数据!");
  141. return;
  142. }
  143. console.log(ids);
  144. layer_show("审核驳回", pagePath + '/government/activity/reject/' + ids, 800, 600);
  145. });