BatchQuit.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. });
  6. //新增
  7. function BatchQuit_Add() {
  8. $.popupTopWindow('选择批量退学的学生', CMS_SystemConfig.VirtualDirectoryPath + "/Common/StudentBatchSelect", 1024, 768, BatchQuit_Add_Confirm, null);
  9. }
  10. function BatchQuit_Add_Confirm(studentList) {
  11. if (studentList) {
  12. var ids = $.map(studentList, function (x) { return x.UserID });
  13. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchQuit/BatchAdd', { studentIDs: ids.join(',') }, function (data) {
  14. $.messager.alert("系统提示", data.Message);
  15. if (data.IsSuccess) {
  16. $("#dgList").cmsXDataTable('load');
  17. }
  18. });
  19. }
  20. }
  21. //联动查询
  22. function queryStandard(data) {
  23. reload();
  24. }
  25. function queryCollege(data) {
  26. var campusID = $("#cbgCampus").combogridX("getValue");
  27. var collegeID = $("#cbgCollege").combogridX("getValue");
  28. var collegeJsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  29. $("#cbgCollege").combogridX("reload", eval(collegeJsonString));
  30. var standardJsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  31. standardJsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  32. $("#cbgStandard").combogridX("reload", eval(standardJsonString));
  33. reload();
  34. }
  35. function reload() {
  36. $("#dgList").cmsXDataTable("load", $.getDataGridParams("dgList"));
  37. }
  38. //获取选中的数据
  39. function validChoose() {
  40. var d = [];
  41. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  42. d.push(this.EntityID);
  43. });
  44. return d;
  45. }
  46. //删除
  47. function BatchQuit_Delete() {
  48. var selected = $("#dgList").cmsXDataTable("getSelections");
  49. if (selected.length == 0) {
  50. $.messager.alert("系统提示", "请选择您要删除的批量退学信息!");
  51. return;
  52. }
  53. var ids = [];
  54. for (var i = 0; i < selected.length; i++) {
  55. ids.push(selected[i].EntityID);
  56. }
  57. $.messager.confirm("系统提示", "您确定要删除该批量退学信息?", function (r) {
  58. if (r) {
  59. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchQuit/Delete', { differentDynamicIDs: ids.join(',') }, function (data) {
  60. $.messager.alert("系统提示", data.Message);
  61. if (data.IsSuccess) {
  62. $("#dgList").cmsXDataTable('load');
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //提交
  69. function BatchQuit_Submit() {
  70. var selected = $("#dgList").cmsXDataTable("getSelections");
  71. if (selected.length == 0) {
  72. $.messager.alert("系统提示", "请选择您要提交的批量退学信息!");
  73. return;
  74. }
  75. var ids = [];
  76. for (var i = 0; i < selected.length; i++) {
  77. ids.push(selected[i].EntityID);
  78. }
  79. $.messager.confirm("系统提示", "您确定要提交该批量退学信息?提交后将无法删除,是否确定?", function (r) {
  80. if (r) {
  81. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchQuit/Submit', { differentDynamicIDs: ids.join(',') }, function (data) {
  82. $.messager.alert("系统提示", data.Message);
  83. if (data.IsSuccess) {
  84. $("#dgList").cmsXDataTable('load');
  85. }
  86. });
  87. }
  88. });
  89. }
  90. //提交
  91. function BatchQuit_Approve() {
  92. var selected = $("#dgList").cmsXDataTable("getSelections");
  93. if (selected.length == 0) {
  94. $.messager.alert("系统提示", "请选择您要审核的批量退学信息!");
  95. return;
  96. }
  97. var ids = [];
  98. for (var i = 0; i < selected.length; i++) {
  99. ids.push(selected[i].EntityID);
  100. }
  101. $.messager.confirm("系统提示", "您确定要审核该批量退学信息?", function (r) {
  102. if (r) {
  103. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchQuit/Approve', { differentDynamicIDs: ids.join(',') }, function (data) {
  104. $.messager.alert("系统提示", data.Message);
  105. if (data.IsSuccess) {
  106. $("#dgList").cmsXDataTable('load');
  107. }
  108. });
  109. }
  110. });
  111. }
  112. function BatchQuit_Export() {
  113. $("#formQuery").submit();
  114. }
  115. function BatchQuit_Print() {
  116. var d = [];
  117. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  118. d.push(this.EntityID);
  119. });
  120. var selected = $("#dgList").cmsXDataTable("getSelections");
  121. for (var i = 0; i < selected.length; i++) {
  122. if (selected[i].EntityApprovalStatus == 1) {
  123. $.messager.alert("系统提示", "所选数据中含有未提交的数据,该部分数据将不能进行申请表的生成,请先进行提交!");
  124. return;
  125. }
  126. }
  127. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchQuit/DifferentDynamicBatchQuitReport?MNU=' + mnu;
  128. var DifferentDynamicID = d.join(',');
  129. var SchoolyearID = $("#ddlSchoolYear").combobox("getValue");
  130. var CollegeID = $("#cbgCollege").combogridX("getValue");
  131. var yearID = $("#ddlYear").combobox("getValue");
  132. var StandardID = $("#cbgStandard").combogridX("getValue");
  133. var LearningformID = $("#ddlLearningform").combobox("getValue");
  134. var EducationID = $("#ddlEducation").combobox("getValue");
  135. var LearnSystem = null;
  136. var ClassmajorID = null;
  137. var DifferentDynamicType = null;
  138. var ApprovalStatus = $("#ddlStatus").combobox("getValue");
  139. $.popupTopWindow('批量退学表', redirectTo, 750, 650, null,
  140. {
  141. SchoolyearID: SchoolyearID,
  142. CollegeID: CollegeID,
  143. yearID: yearID,
  144. StandardID: StandardID,
  145. LearningformID: LearningformID,
  146. EducationID: EducationID,
  147. LearnSystem: LearnSystem,
  148. ClassmajorID: ClassmajorID,
  149. DifferentDynamicType: DifferentDynamicType,
  150. ApprovalStatus: ApprovalStatus,
  151. DifferentDynamicID: DifferentDynamicID
  152. });
  153. }