StudentEncourage.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. var url = "/StudentEncourage/Edit";
  2. var AuthenizationUrl = "/StudentEncourage/Authenization";
  3. //var UpdateUrl = "/StudentEncourage/Update";
  4. var bathval = "";
  5. var mnu;
  6. //联动查询
  7. function queryStandard(data) {
  8. queryClass();
  9. reload();
  10. }
  11. $(function () {
  12. mnu = $.SystemGeneral.getUrlParam("MNU");
  13. })
  14. function queryCollege(data) {
  15. var campusID = $("#CampusDropdown").combogridX("getValue");
  16. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  17. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  18. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  19. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  20. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  21. // if (campusID != nonSelect) {
  22. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  23. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  24. // }
  25. queryClass();
  26. reload();
  27. }
  28. function reload() {
  29. $("#dgRewardList").cmsXDataTable("load", $.getDataGridParams("dgRewardList"));
  30. }
  31. //新增
  32. function StudentEncourage_Add() {
  33. var redirectTo = url + '?MNU=' + mnu;
  34. $.popupTopWindow('学生奖励新增', redirectTo, 650, 300, null, null);
  35. }
  36. //删除
  37. function StudentEncourage_Delete() {
  38. var selected = $("#dgRewardList").cmsXDataTable("getSelections");
  39. if (selected.length == 0) {
  40. $.messager.alert("系统提示", "请选择您要删除的奖励信息!");
  41. return;
  42. }
  43. var ids = [];
  44. for (var i = 0; i < selected.length; i++) {
  45. if (selected[i].RecordStatusID != 1) {
  46. $.messager.alert("系统提示", "只能删除待处理的奖励信息!");
  47. return;
  48. }
  49. ids.push(selected[i].StudentEncourageID);
  50. }
  51. $.messager.confirm("系统提示", "您确定要删除该奖励申请信息?", function (r) {
  52. if (r) {
  53. $.postWithLoading('/StudentEncourage/Delete', { ids: ids.join(',') }, function (data) {
  54. if (data == "删除成功") {
  55. $.messager.alert("系统提示", "删除成功!");
  56. $("#dgRewardList").cmsXDataTable('load');
  57. } else {
  58. $.messager.alert("系统提示", data);
  59. }
  60. });
  61. }
  62. });
  63. }
  64. //删除
  65. function StudentEncourage_Cancel() {
  66. var selected = $("#dgRewardList").cmsXDataTable("getSelections");
  67. if (selected.length == 0) {
  68. $.messager.alert("系统提示", "请选择您要撤销的奖励信息!");
  69. return;
  70. }
  71. var ids = [];
  72. for (var i = 0; i < selected.length; i++) {
  73. if (selected[i].RecordStatusID != 2) {
  74. $.messager.alert("系统提示", "只能撤销待处理的奖励信息!");
  75. return;
  76. }
  77. ids.push(selected[i].StudentEncourageID);
  78. }
  79. $.messager.confirm("系统提示", "您确定要撤销选择的信息?", function (r) {
  80. if (r) {
  81. $.postWithLoading('/StudentEncourage/Cancel', { StudentEncourageIDs: ids.join(',') }, function (data) {
  82. if (data == "撤销成功。") {
  83. $.messager.alert("系统提示", "撤销成功。");
  84. $("#dgRewardList").cmsXDataTable('load');
  85. } else {
  86. $.messager.alert("系统提示", data);
  87. }
  88. });
  89. }
  90. });
  91. }
  92. //审核
  93. function StudentEncourage_Authenization() {
  94. var selected = $("#dgRewardList").cmsXDataTable("getSelections");
  95. if (selected.length == 0) {
  96. $.messager.alert("系统提示", "请选择您要审核的奖励信息!");
  97. return;
  98. }
  99. var ids = [];
  100. for (var i = 0; i < selected.length; i++) {
  101. if (selected[i].RecordStatusID != 1) {
  102. $.messager.alert("系统提示", "只能审核待处理的奖励信息!");
  103. return;
  104. }
  105. ids.push(selected[i].StudentEncourageID);
  106. }
  107. $.messager.confirm("系统提示", "您确定要审核该奖励申请信息?", function (r) {
  108. if (r) {
  109. $.postWithLoading('/StudentEncourage/Authenization', { ids: ids.join(',') }, function (data) {
  110. if (data == "审核成功") {
  111. $.messager.alert("系统提示", "审核成功!");
  112. $("#dgRewardList").cmsXDataTable('load');
  113. } else {
  114. $.messager.alert("系统提示", data);
  115. }
  116. });
  117. }
  118. });
  119. }
  120. ////审核
  121. //function StudentEncourage_Authenization() {
  122. // var selected = $("#dgRewardList").cmsXDataTable("getSelections");
  123. // if (selected.length == 0) {
  124. // $.messager.alert("系统提示", "请选择您要审核的奖励信息!");
  125. // return;
  126. // }
  127. // if (selected.length>1) {
  128. // $.messager.alert("系统提示", "一次只能审核一条奖励信息!");
  129. // return;
  130. // }
  131. // if (selected[0].RecordStatusID != 1) {
  132. // $.messager.alert("系统提示", "只能审核待处理的奖励信息!");
  133. // return;
  134. // }
  135. // var redirectTo = AuthenizationUrl;
  136. // var a = selected[0].StudentEncourageID;
  137. // if (a) {
  138. // redirectTo = AuthenizationUrl + '?id=' + a;
  139. // }
  140. // redirectTo = redirectTo + '&MNU=' + mnu;
  141. // $.popupTopWindow('学生奖励审核', redirectTo, 800, 300, null, null);
  142. //}
  143. //获取选中的数据
  144. function validChoose() {
  145. var d = [];
  146. $.each($("#dgRewardList").cmsXDataTable("getSelections"), function (index) {
  147. d.push(this.StudentEncourageID);
  148. });
  149. return d;
  150. }
  151. //获取批量修改金额
  152. function validChooseAmount() {
  153. var d = [];
  154. $.each($("#dgRewardList").cmsXDataTable("getSelections"), function (index) {
  155. d.push(this.Amount);
  156. });
  157. return d;
  158. }
  159. //批量修改前判断
  160. SystemBatchModifyControl.OnSubmit = function (a) {
  161. if (document.getElementById("AmountTextBox_div").style.display != "none") {
  162. var Amount = $("#Amount_TextBox").val();
  163. var d = validChooseAmount();
  164. for (var i = 0; i < d.length; i++) {
  165. var time = new String(d[i]);
  166. if (Amount < 0) {
  167. $.messager.alert("系统提示", "输入金额不能为负数");
  168. return false;
  169. }
  170. }
  171. }
  172. }
  173. //查看
  174. function Authenization(rowindex, rowdata) {
  175. var redirectTo = AuthenizationUrl;
  176. redirectTo = AuthenizationUrl + '?id=' + rowdata.StudentEncourageID;
  177. redirectTo = redirectTo + '&MNU=' + mnu+ '&isView=1';
  178. $.popupTopWindow('学生奖励信息', redirectTo, 650, 300, null, null);
  179. }
  180. //修改
  181. function StudentEncourage_Update() {
  182. var selected = $("#dgRewardList").cmsXDataTable("getSelections");
  183. if (selected.length == 0) {
  184. $.messager.alert("系统提示", "请选择您要修改的奖励信息!");
  185. return;
  186. }
  187. if (selected.length > 1) {
  188. $.messager.alert("系统提示", "一次只能修改一条奖励信息!");
  189. return;
  190. }
  191. if (selected[0].RecordStatusID != 1) {
  192. $.messager.alert("系统提示", "只能修改待处理的奖励信息!");
  193. return;
  194. }
  195. var redirectTo = url;
  196. var a = selected[0].StudentEncourageID;
  197. if (a) {
  198. redirectTo = url + '?id=' + a;
  199. }
  200. redirectTo = redirectTo + '&MNU=' + mnu;
  201. $.popupTopWindow('学生奖励修改', redirectTo, 650, 300, null, null);
  202. }
  203. //导出
  204. function StudentEncourage_Export() {
  205. $("#formQuery").submit();
  206. }