ExaminationPlanDGLG.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/Classroom";
  2. var mnu;
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='ExaminationClassroom']");
  6. if (customerUrl.attr("value")) {
  7. url = CMS_SystemConfig.VirtualDirectoryPath + "/" + customerUrl.attr("value");
  8. }
  9. });
  10. function ExaminationPlan_Import() {
  11. // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Generate', null, function (result) {
  12. // $.messager.alert("系统提示", result.Message);
  13. // reload();
  14. // });
  15. $.popupTopWindow('生成计划', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Generate?MNU=' + mnu, 500, 300);
  16. }
  17. function ExaminationPlan_ImportResit() {
  18. $.popupTopWindow('生成补考计划', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GenerateResit?MNU=' + mnu, 400, 200);
  19. }
  20. function ExaminationPlan_ImportGraduateExam() {
  21. $.popupTopWindow('生成毕业清考计划', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GenerateGraduateExam?MNU=' + mnu, 400, 200);
  22. }
  23. function ExaminationPlan_AutoSchedule() {
  24. var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; });
  25. var d = ids.join(',');
  26. $.messager.confirm("系统提示", "是否对本学期的考试进行排考?", function (r) {
  27. if (r) {
  28. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/AutoSchedule', { examinationPlanIDs: d }, function (data) {
  29. if (data.IsSuccess) {
  30. $.messager.alert("系统提示", "自动排考成功。");
  31. $("#dgExaminationPlanList").cmsXDataTable('load');
  32. } else {
  33. $.messager.alert("系统提示", data.Message);
  34. }
  35. });
  36. }
  37. });
  38. }
  39. function ExaminationPlan_Submit() {
  40. var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; });
  41. var d = ids.join(',');
  42. if (d == "") {
  43. $.messager.alert("系统提示", "请选择您要提交的记录。");
  44. return;
  45. }
  46. $.messager.confirm("系统提示", "您确定要提交该考试计划?", function (r) {
  47. if (r) {
  48. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Submit', { examinationPlanIDs: d }, function (data) {
  49. if (data.IsSuccess) {
  50. $.messager.alert("系统提示", "提交成功。");
  51. $("#dgExaminationPlanList").cmsXDataTable('load');
  52. } else {
  53. $.messager.alert("系统提示", data.Message);
  54. }
  55. });
  56. }
  57. });
  58. }
  59. function ExaminationPlan_UnSubmit() {
  60. var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; });
  61. var d = ids.join(',');
  62. if (d == "") {
  63. $.messager.alert("系统提示", "请选择您要撤回的记录。");
  64. return;
  65. }
  66. $.messager.confirm("系统提示", "您确定要撤回该考试计划?", function (r) {
  67. if (r) {
  68. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/UnSubmit', { examinationPlanIDs: d }, function (data) {
  69. if (data.IsSuccess) {
  70. $.messager.alert("系统提示", "撤回成功。");
  71. $("#dgExaminationPlanList").cmsXDataTable('load');
  72. } else {
  73. $.messager.alert("系统提示", data.Message);
  74. }
  75. });
  76. }
  77. });
  78. }
  79. function ExaminationPlan_Export() {
  80. $(document.forms[0]).submit();
  81. }
  82. function ExaminationPlan_AdultExport() {
  83. var d = validChoosedata();
  84. var examinationPlanIDs = $.map(d, function (x) { return x.ExaminationPlanID; }).join(',');
  85. $("[name='SelectedID']").val(examinationPlanIDs);
  86. $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/AdultExcel');
  87. $(document.forms[0]).submit();
  88. }
  89. function ExaminationPlan_AdultImport() {
  90. var selectedIDs = validChoose().join(',');
  91. selectedIDs = selectedIDs.toString();
  92. var ExaminationPlanSelect = $.getDataGridParams("dgExaminationPlanList");
  93. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Import?MNU=' + mnu + '&selectedIDs=' + selectedIDs;
  94. $.popupTopWindow('考试安排导入', redirectTo, 400, 300, reload, ExaminationPlanSelect);
  95. }
  96. //排考
  97. function ExaminationPlan_Classroom() {
  98. var d = validChoosedata();
  99. if (d.length == 0) {
  100. $.messager.alert("系统提示", "请选择您要设置的考试计划。");
  101. return;
  102. }
  103. if (d.length > 1) {
  104. $.messager.alert("系统提示", "只能选择单个记录进行设置。");
  105. return;
  106. }
  107. if (d[0].RecordStatus != notSubmitVal) {
  108. $.messager.alert("系统提示", "只能选择未提交的记录进行设置。");
  109. return;
  110. }
  111. $.popupTopWindow('考场设置', url + '?ExaminationPlanID=' + d[0].ExaminationPlanID + '&MNU=' + mnu, 800, 600);
  112. }
  113. function ExaminationPlan_Preview() {
  114. var d = validChoosedata();
  115. if (d.length == 0) {
  116. $.messager.alert("系统提示", "请选择您要预览的考试计划。");
  117. return;
  118. }
  119. if (d.length > 1) {
  120. $.messager.alert("系统提示", "只能选择单个记录进行预览。");
  121. return;
  122. }
  123. var reportUrl = CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fExaminationManage%2fExaminationRoomLayout&ExaminationPlanID_RAP=" + d[0].ExaminationPlanID;
  124. $.popupTopWindowOutsite('考试座位预览', reportUrl, 1000, 650);
  125. }
  126. //考试时间
  127. function ExaminationPlan_SetTime() {
  128. var d = validChoosedata();
  129. if (d.length == 0) {
  130. $.messager.alert("系统提示", "请选择您要修改的考试计划。");
  131. return;
  132. }
  133. $.popupTopWindow('考试时间安排', CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/SetTime?" + '&MNU=' + mnu, 500, 200, ExaminationPlan_SetTime_Confirm);
  134. }
  135. function ExaminationPlan_SetTime_Confirm(timeData) {
  136. if (timeData) {
  137. var d = validChoosedata();
  138. var idList = $.map(d, function (x) { return x.ExaminationPlanID });
  139. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/SetTime',
  140. {
  141. ids: idList.join(','),
  142. examinationDate: timeData.ExaminationDate,
  143. startTime: timeData.StartTime,
  144. endTime: timeData.EndTime
  145. }, function (data) {
  146. if (data.IsSuccess) {
  147. $.messager.alert("系统提示", "设置时间成功。");
  148. $("#dgExaminationPlanList").cmsXDataTable('load');
  149. } else {
  150. $.messager.alert("系统提示", data.Message);
  151. }
  152. });
  153. }
  154. }
  155. //添加学生
  156. function ExaminationPlan_AddStudent() {
  157. var d = validChoose();
  158. var status = ApprovalStatus();
  159. if (d == "") {
  160. $.messager.alert("系统提示", "请选择您要增加学生的信息。");
  161. return;
  162. }
  163. if (d.length > 1) {
  164. $.messager.alert("系统提示", "只能选择单个记录。");
  165. return;
  166. }
  167. if (status == "1" || status == "3" || status == "5") {
  168. var redirectTo = "/FinalExamination/StudentEdit?finalExamination=" + d + "&MNU=" + mnu;
  169. $.popupTopWindow('学生名单', redirectTo, 850, 480, reload);
  170. }
  171. else {
  172. $.messager.alert("系统提示", "该数据已经提交或已审核,不能添加学生!");
  173. return;
  174. }
  175. }
  176. //删除考场安排
  177. function ExaminationPlan_Delete() {
  178. var d = validChoose().join(',');
  179. //var status = validChoosedata().join(',');
  180. if (d == "") {
  181. $.messager.alert("系统提示", "请选择你要删除的信息!");
  182. return;
  183. }
  184. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  185. if (r) {
  186. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Delete', { examinationPlanIDs: d }, function (data) {
  187. if (data == "删除成功") {
  188. $.messager.alert("系统提示", data);
  189. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  190. } else {
  191. $.messager.alert("系统提示", data);
  192. }
  193. });
  194. }
  195. });
  196. }
  197. function ExaminationPlan_Resettting() {
  198. var d = validChoose().join(',');
  199. //var status = validChoosedata().join(',');
  200. if (d == "") {
  201. $.messager.alert("系统提示", "请选择你要重置的信息!");
  202. return;
  203. }
  204. $.messager.confirm("系统提示", "您确定要重置选择的信息?", function (r) {
  205. if (r) {
  206. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Resetting', { examinationPlanIDs: d }, function (data) {
  207. if (data == "重置成功") {
  208. $.messager.alert("系统提示", data);
  209. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  210. } else {
  211. $.messager.alert("系统提示", data);
  212. }
  213. });
  214. }
  215. });
  216. }
  217. function ExaminationPlan_Cancel() {
  218. var d = validChoose().join(',');
  219. //var status = validChoosedata().join(',');
  220. if (d == "") {
  221. $.messager.alert("系统提示", "请选择你要撤销的信息!");
  222. return;
  223. }
  224. $.messager.confirm("系统提示", "您确定要撤销选择的信息?", function (r) {
  225. if (r) {
  226. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Cancel', { examinationPlanIDs: d }, function (data) {
  227. if (data == "撤销成功") {
  228. $.messager.alert("系统提示", data);
  229. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  230. } else {
  231. $.messager.alert("系统提示", data);
  232. }
  233. });
  234. }
  235. });
  236. }
  237. function reload() {
  238. var starWeek = $("#StarWeek").val();
  239. var endWeek = $("#EndWeek").val();
  240. var re = "/^[0-9]+$/";
  241. if (starWeek != "" && !(/(^[1-9]\d*$)/.test(starWeek))) {
  242. $.messager.alert("系统提示", "请在开始周次输入整数!");
  243. return
  244. }
  245. if (endWeek != "" && !(/(^[1-9]\d*$)/.test(endWeek))) {
  246. $.messager.alert("系统提示", "请在结束周次输入整数!");
  247. return
  248. }
  249. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  250. }
  251. function view(rowindex, rowdata) {
  252. $.popupTopWindow('考场详情', url + '?ExaminationPlanID=' + rowdata.ExaminationPlanID + '&MNU=' + mnu + "&isView=1", 800, 600);
  253. }
  254. function viewStudent(rowindex, rowdata) {
  255. $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/ExaminationPlanStudentList?ExaminationPlanID=' + rowdata.ExaminationPlanID + '&MNU=' + mnu + "&isView=1", 800, 600);
  256. }
  257. //获取选中的数据
  258. function validChoosedata() {
  259. var d = [];
  260. $.each($("#dgExaminationPlanList").cmsXDataTable("getSelections"), function (index) {
  261. d.push(this);
  262. });
  263. return d;
  264. }
  265. function validChoose() {
  266. var d = [];
  267. $.each($("#dgExaminationPlanList").cmsXDataTable("getSelections"), function (index) {
  268. d.push(this.ExaminationPlanID);
  269. });
  270. return d;
  271. }
  272. function QueryCampusDropdownList(data) {
  273. $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  274. reload();
  275. }
  276. function ExaminationPlan_Add() {
  277. $.popupTopWindow('新增考试安排', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Add?MNU=' + mnu, 800, 600);
  278. }