BatchRepeat.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. });
  6. //新增
  7. function BatchRepeat_Add() {
  8. $.popupTopWindow('选择批量留级的学生', CMS_SystemConfig.VirtualDirectoryPath + "/Common/StudentBatchSelect", 1024, 768, BatchRepeat_Add_Confirm, null);
  9. }
  10. function BatchRepeat_Add_Confirm(studentList) {
  11. if (studentList) {
  12. var ids = $.map(studentList, function (x) { return x.UserID });
  13. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchRepeat/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 BatchRepeat_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 + '/StudentBatchRepeat/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 BatchRepeat_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 + '/StudentBatchRepeat/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 BatchRepeat_Process() {
  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 + '/StudentBatchRepeat/Process', { differentDynamicIDs: ids.join(',') }, function (data) {
  104. $.messager.alert("系统提示", data.Message);
  105. if (data.IsSuccess) {
  106. $("#dgList").cmsXDataTable('load');
  107. }
  108. });
  109. }
  110. });
  111. }
  112. //提交
  113. function BatchRepeat_Approve() {
  114. var selected = $("#dgList").cmsXDataTable("getSelections");
  115. if (selected.length == 0) {
  116. $.messager.alert("系统提示", "请选择您要审核的批量留级信息!");
  117. return;
  118. }
  119. var ids = [];
  120. for (var i = 0; i < selected.length; i++) {
  121. ids.push(selected[i].EntityID);
  122. }
  123. $.messager.confirm("系统提示", "您确定要审核该批量留级信息?", function (r) {
  124. if (r) {
  125. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentBatchRepeat/Approve', { differentDynamicIDs: ids.join(',') }, function (data) {
  126. $.messager.alert("系统提示", data.Message);
  127. if (data.IsSuccess) {
  128. $("#dgList").cmsXDataTable('load');
  129. }
  130. });
  131. }
  132. });
  133. }
  134. function BatchRepeat_Export() {
  135. $("#formQuery").submit();
  136. }
  137. function BatchRepeat_Print() {
  138. var d = [];
  139. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  140. d.push(this.EntityID);
  141. });
  142. var selected = $("#dgList").cmsXDataTable("getSelections");
  143. for (var i = 0; i < selected.length; i++) {
  144. if (selected[i].EntityApprovalStatus == 1) {
  145. $.messager.alert("系统提示", "所选数据中含有未提交的数据,该部分数据将不能进行申请表的生成,请先进行提交!");
  146. return;
  147. }
  148. }
  149. var Attribute = document.getElementsByName("Attribute")[0].value.split("\"Value\":\"")[1].split("\"")[0]; //获取自定义查询的当前字段
  150. var redirectTo = "";
  151. if (d != null) {
  152. d.join(',');
  153. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/DifferentDynamicApply/DifferentDynamicApplyReport?MNU=' + mnu
  154. + "&DifferentDynamicID=" + d
  155. + "&SchoolyearID=" + $("#ddlSchoolYear").combobox("getValue")
  156. + "&CampusID=" + $("#cbgCampus").combogridX("getValue")
  157. + "&CollegeID=" + $("#cbgCollege").combogridX("getValue")
  158. + "&yearID=" + $("#ddlYear").combobox("getValue")
  159. + "&StandardID=" + $("#cbgStandard").combogridX("getValue")
  160. + "&LearningformID=" + $("#ddlLearningform").combobox("getValue")
  161. + "&EducationID=" + $("#ddlEducation").combobox("getValue")
  162. + "&ApprovalStatus=" + $("#ddlStatus").combobox("getValue")
  163. + "&Attribute=" + Attribute
  164. + "&Condition=" + document.getElementsByName("Condition")[0].value + "&Value="
  165. + (document.getElementsByName(Attribute + "_QueryTextBox")[0] != null ? document.getElementsByName(Attribute + "_QueryTextBox")[0].value : document.getElementsByName(Attribute + "_QueryDictionaryDropDownList")[0].value);
  166. }
  167. else {
  168. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/DifferentDynamicApply/DifferentDynamicApplyReport?MNU=' + mnu
  169. + "&SchoolyearID=" + $("#ddlSchoolYear").combobox("getValue")
  170. + "&CampusID=" + $("#cbgCampus").combogridX("getValue")
  171. + "&CollegeID=" + $("#cbgCollege").combogridX("getValue")
  172. + "&yearID=" + $("#ddlYear").combobox("getValue")
  173. + "&StandardID=" + $("#cbgStandard").combogridX("getValue")
  174. + "&LearningformID=" + $("#ddlLearningform").combobox("getValue")
  175. + "&EducationID=" + $("#ddlEducation").combobox("getValue")
  176. + "&ApprovalStatus=" + $("#ddlStatus").combobox("getValue")
  177. + "&Attribute=" + Attribute
  178. + "&Condition=" + document.getElementsByName("Condition")[0].value + "&Value="
  179. + (document.getElementsByName(Attribute + "_QueryTextBox")[0] != null ? document.getElementsByName(Attribute + "_QueryTextBox")[0].value : document.getElementsByName(Attribute + "_QueryDictionaryDropDownList")[0].value);
  180. }
  181. $.popupTopWindow('异动申请表', redirectTo, 1100, 550, null, null);
  182. }