BatchSuspend.js 6.4 KB

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