ExaminationPlanGdss.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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, 560, 300);
  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 = validChoose().join(',')
  84. if (d != "") {
  85. document.getElementById("ExaminationPlanIDs").value = d;
  86. }
  87. else {
  88. document.getElementById("ExaminationPlanIDs").value = "";
  89. }
  90. $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GdssExcel');
  91. $(document.forms[0]).submit();
  92. }
  93. function ExaminationPlan_AdultImport() {
  94. var selectedIDs = validChoose().join(',');
  95. selectedIDs = selectedIDs.toString();
  96. var ExaminationPlanSelect = $.getDataGridParams("dgExaminationPlanList");
  97. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GdssImport?MNU=' + mnu + '&selectedIDs=' + selectedIDs;
  98. $.popupTopWindow('考试安排导入', redirectTo, 400, 300, reload, ExaminationPlanSelect);
  99. }
  100. //排考
  101. function ExaminationPlan_Classroom() {
  102. var d = validChoosedata();
  103. if (d.length == 0) {
  104. $.messager.alert("系统提示", "请选择您要设置的考试计划。");
  105. return;
  106. }
  107. if (d.length > 1) {
  108. $.messager.alert("系统提示", "只能选择单个记录进行设置。");
  109. return;
  110. }
  111. if (d[0].RecordStatus != notSubmitVal) {
  112. $.messager.alert("系统提示", "只能选择未提交的记录进行设置。");
  113. return;
  114. }
  115. $.popupTopWindow('考场设置', url + '?ExaminationPlanID=' + d[0].ExaminationPlanID + '&MNU=' + mnu, 800, 600);
  116. }
  117. function ExaminationPlan_Preview() {
  118. var d = validChoosedata();
  119. if (d.length == 0) {
  120. $.messager.alert("系统提示", "请选择您要预览的考试计划。");
  121. return;
  122. }
  123. if (d.length > 1) {
  124. $.messager.alert("系统提示", "只能选择单个记录进行预览。");
  125. return;
  126. }
  127. var reportUrl = CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fExaminationManage%2fExaminationRoomLayout&ExaminationPlanID_RAP=" + d[0].ExaminationPlanID;
  128. $.popupTopWindowOutsite('考试座位预览', reportUrl, 1000, 650);
  129. }
  130. //考试时间
  131. function ExaminationPlan_SetTime() {
  132. var d = validChoosedata();
  133. if (d.length == 0) {
  134. $.messager.alert("系统提示", "请选择您要修改的考试计划。");
  135. return;
  136. }
  137. $.popupTopWindow('考试时间安排', CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/SetTime?" + '&MNU=' + mnu, 500, 200, ExaminationPlan_SetTime_Confirm);
  138. }
  139. function ExaminationPlan_SetTime_Confirm(timeData) {
  140. if (timeData) {
  141. var d = validChoosedata();
  142. var idList = $.map(d, function (x) { return x.ExaminationPlanID });
  143. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/SetTime',
  144. {
  145. ids: idList.join(','),
  146. examinationDate: timeData.ExaminationDate,
  147. startTime: timeData.StartTime,
  148. endTime: timeData.EndTime
  149. }, function (data) {
  150. if (data.IsSuccess) {
  151. $.messager.alert("系统提示", "设置时间成功。");
  152. $("#dgExaminationPlanList").cmsXDataTable('load');
  153. } else {
  154. $.messager.alert("系统提示", data.Message);
  155. }
  156. });
  157. }
  158. }
  159. //添加学生
  160. function ExaminationPlan_AddStudent() {
  161. var d = validChoose();
  162. var status = ApprovalStatus();
  163. if (d == "") {
  164. $.messager.alert("系统提示", "请选择您要增加学生的信息。");
  165. return;
  166. }
  167. if (d.length > 1) {
  168. $.messager.alert("系统提示", "只能选择单个记录。");
  169. return;
  170. }
  171. if (status == "1" || status == "3" || status == "5") {
  172. var redirectTo = "/FinalExamination/StudentEdit?finalExamination=" + d + "&MNU=" + mnu;
  173. $.popupTopWindow('学生名单', redirectTo, 850, 480, reload);
  174. }
  175. else {
  176. $.messager.alert("系统提示", "该数据已经提交或已审核,不能添加学生!");
  177. return;
  178. }
  179. }
  180. //删除考场安排
  181. function ExaminationPlan_Delete() {
  182. var d = validChoose().join(',');
  183. //var status = validChoosedata().join(',');
  184. if (d == "") {
  185. $.messager.alert("系统提示", "请选择你要删除的信息!");
  186. return;
  187. }
  188. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  189. if (r) {
  190. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Delete', { examinationPlanIDs: d }, function (data) {
  191. if (data == "删除成功") {
  192. $.messager.alert("系统提示", data);
  193. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  194. } else {
  195. $.messager.alert("系统提示", data);
  196. }
  197. });
  198. }
  199. });
  200. }
  201. function ExaminationPlan_Resettting() {
  202. var d = validChoose().join(',');
  203. //var status = validChoosedata().join(',');
  204. if (d == "") {
  205. $.messager.alert("系统提示", "请选择你要重置的信息!");
  206. return;
  207. }
  208. $.messager.confirm("系统提示", "您确定要重置选择的信息?", function (r) {
  209. if (r) {
  210. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Resetting', { examinationPlanIDs: d }, function (data) {
  211. if (data == "重置成功") {
  212. $.messager.alert("系统提示", data);
  213. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  214. } else {
  215. $.messager.alert("系统提示", data);
  216. }
  217. });
  218. }
  219. });
  220. }
  221. function ExaminationPlan_Cancel() {
  222. var d = validChoose().join(',');
  223. //var status = validChoosedata().join(',');
  224. if (d == "") {
  225. $.messager.alert("系统提示", "请选择你要撤销的信息!");
  226. return;
  227. }
  228. $.messager.confirm("系统提示", "您确定要撤销选择的信息?", function (r) {
  229. if (r) {
  230. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Cancel', { examinationPlanIDs: d }, function (data) {
  231. if (data == "撤销成功") {
  232. $.messager.alert("系统提示", data);
  233. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  234. } else {
  235. $.messager.alert("系统提示", data);
  236. }
  237. });
  238. }
  239. });
  240. }
  241. function reload() {
  242. $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList"));
  243. }
  244. function view(rowindex, rowdata) {
  245. $.popupTopWindow('考场详情', url + '?ExaminationPlanID=' + rowdata.ExaminationPlanID + '&MNU=' + mnu + "&isView=1", 800, 600);
  246. }
  247. function viewStudent(rowindex, rowdata) {
  248. $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/ExaminationPlanStudentList?ExaminationPlanID=' + rowdata.ExaminationPlanID + '&MNU=' + mnu + "&isView=1", 800, 600);
  249. }
  250. //获取选中的数据
  251. function validChoosedata() {
  252. var d = [];
  253. $.each($("#dgExaminationPlanList").cmsXDataTable("getSelections"), function (index) {
  254. d.push(this);
  255. });
  256. return d;
  257. }
  258. function validChoose() {
  259. var d = [];
  260. $.each($("#dgExaminationPlanList").cmsXDataTable("getSelections"), function (index) {
  261. d.push(this.ExaminationPlanID);
  262. });
  263. return d;
  264. }
  265. function QueryCampusDropdownList(data) {
  266. $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  267. reload();
  268. }
  269. function ExaminationPlan_Add() {
  270. var d = validChoose();
  271. if (d.length > 0) {
  272. $.popupTopWindow('考试安排复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/CopyAdd?examinationPlanID=' + d[0] + '&MNU=' + mnu, 800, 600, null, null);
  273. } else {
  274. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Add?MNU=' + mnu;
  275. $.popupTopWindow('考试安排新增', redirectTo, 800, 600, null, null);
  276. }
  277. }
  278. function queryClass() {
  279. var jsonString = "";
  280. var parameterString = "";
  281. //var campusID = $("#CampusDropdown").combogridX("getValue");
  282. //var collegeID = $("#ComboGridCollege").combogridX("getValue");
  283. //var educationID = $("#Education").combobox("getValue");
  284. var schoolYearID = $("#DictionaryGrade").combobox("getValue");
  285. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  286. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  287. //if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  288. //if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  289. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  290. if (schoolYearID != nonSelect && schoolYearID != "") parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  291. if (standardID != nonSelect && standardID != "") parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  292. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  293. if (parameterString != "") {
  294. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  295. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  296. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  297. } else {
  298. $("#StandardDictionaryDropDown").combogridX("reload");
  299. $("#ClassmajorDropdown").combogridX("reload");
  300. }
  301. reload();
  302. }