You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

279 lines
12 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-04-15 15:03
  5. * 描 述:排考安排课程
  6. */
  7. var refreshGirdData;
  8. //排考记录Id
  9. var EPId = request('EPId');
  10. //安排课程表Id
  11. var EPLId;
  12. var ELCheckMark;
  13. var bootstrap = function ($, learun) {
  14. "use strict";
  15. var page = {
  16. init: function () {
  17. page.initGird();
  18. page.bind();
  19. },
  20. bind: function () {
  21. // 初始化左侧树形数据
  22. $('#dataTree').lrtree({
  23. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetTree?EPId=' + EPId,
  24. nodeClick: function (item) {
  25. //安排课程表ID(Exam_ExamPlanLesson)
  26. EPLId = item.id;
  27. //显示考试时间
  28. page.show(EPLId);
  29. page.search({ EPLId: item.id });
  30. $('#titleinfo').html(item.text);
  31. }
  32. });
  33. // 刷新
  34. $('#lr_refresh').on('click', function () {
  35. location.reload();
  36. });
  37. //设置考试时间
  38. $('#lr_ExamTime').on('click', function () {
  39. if (!!EPLId) {
  40. if (ELCheckMark == 1) {
  41. return learun.alert.warning('该项已审核!');
  42. }
  43. learun.layerForm({
  44. id: 'form',
  45. title: '设置考试时间',
  46. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + EPLId,
  47. width: 600,
  48. height: 400,
  49. callBack: function (id) {
  50. return top[id].acceptClick(refreshGirdData);
  51. }
  52. });
  53. } else {
  54. return learun.alert.warning("请选择考试课程!");
  55. }
  56. });
  57. //审核
  58. $('#lr_check').on('click', function () {
  59. if (!!EPLId) {
  60. if (ELCheckMark == 1) {
  61. return learun.alert.warning('该项已审核!');
  62. }
  63. learun.layerConfirm('是否确认审核!', function (res) {
  64. if (res) {
  65. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 1 }, function () {
  66. refreshGirdData();
  67. });
  68. }
  69. });
  70. } else {
  71. return learun.alert.warning("请选择考试课程!");
  72. }
  73. });
  74. //去审核
  75. $('#lr_nocheck').on('click', function () {
  76. if (!!EPLId) {
  77. learun.layerConfirm('是否确认去审核!', function (res) {
  78. if (res) {
  79. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 0 }, function () {
  80. refreshGirdData();
  81. });
  82. }
  83. });
  84. } else {
  85. return learun.alert.warning("请选择考试课程!");
  86. }
  87. });
  88. //班级 新增
  89. $('#lr_add_Class').on('click', function () {
  90. if (!!EPLId) {
  91. if (ELCheckMark == 1) {
  92. return learun.alert.warning("该项已审核!");
  93. }
  94. learun.layerForm({
  95. id: 'formclass',
  96. title: '新增班级',
  97. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormClass?EPLId=' + EPLId + '&EPId=' + EPId,
  98. width: 850,
  99. height: 500,
  100. callBack: function (id) {
  101. return top[id].acceptClick(refreshGirdData);
  102. }
  103. });
  104. } else {
  105. return learun.alert.warning("请选择考试课程!");
  106. }
  107. });
  108. // 班级删除
  109. $('#lr_delete_Class').on('click', function () {
  110. var keyValue = $('#gridtable_Class').jfGridValue('EPCId');
  111. if (learun.checkrow(keyValue)) {
  112. if (ELCheckMark == 1) {
  113. return learun.alert.warning("该项已审核!");
  114. }
  115. learun.layerConfirm('是否确认删除选中记录!', function (res) {
  116. if (res) {
  117. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteClass', { keyValue: keyValue }, function () {
  118. refreshGirdData();
  119. });
  120. }
  121. });
  122. }
  123. });
  124. //考场 新增
  125. $('#lr_add_Room').on('click', function () {
  126. if (!!EPLId) {
  127. if (ELCheckMark == 1) {
  128. return learun.alert.warning("该项已审核!");
  129. }
  130. learun.layerForm({
  131. id: 'formteacherRoom',
  132. title: '新增考场',
  133. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId,
  134. width: 850,
  135. height: 500,
  136. callBack: function (id) {
  137. return top[id].acceptClick(refreshGirdData);
  138. }
  139. });
  140. } else {
  141. return learun.alert.warning("请选择考试课程!");
  142. }
  143. });
  144. //考场 编辑
  145. $('#lr_edit_Room').on('click', function () {
  146. if (!!EPLId) {
  147. if (ELCheckMark == 1) {
  148. return learun.alert.warning("该项已审核!");
  149. }
  150. var keyValue = $('#gridtable_Room').jfGridValue('EPRId');
  151. if (learun.checkrow(keyValue)) {
  152. learun.layerForm({
  153. id: 'formteacherRoom',
  154. title: '编辑考场',
  155. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId + '&keyValue=' + keyValue,
  156. width: 850,
  157. height: 500,
  158. callBack: function (id) {
  159. return top[id].acceptClick(refreshGirdData);
  160. }
  161. });
  162. }
  163. } else {
  164. return learun.alert.warning("请选择考试课程!");
  165. }
  166. });
  167. // 考场删除
  168. $('#lr_delete_Room').on('click', function () {
  169. var keyValue = $('#gridtable_Room').jfGridValue('EPRId');
  170. if (learun.checkrow(keyValue)) {
  171. if (ELCheckMark == 1) {
  172. return learun.alert.warning("该项已审核!");
  173. }
  174. learun.layerConfirm('是否确认删除选中记录!', function (res) {
  175. if (res) {
  176. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteRoom', { keyValue: keyValue }, function () {
  177. refreshGirdData();
  178. });
  179. }
  180. });
  181. }
  182. });
  183. // 打印
  184. $('#lr_print').on('click', function () {
  185. $('#gridtable').jqprintTable();
  186. });
  187. },
  188. // 初始化列表
  189. initGird: function () {
  190. //班级
  191. $('#gridtable_Class').jfGrid({
  192. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForClass',
  193. headData: [
  194. { label: "班级名称", name: "ClassName", width: 100, align: "left" },
  195. { label: "班级编号", name: "ClassNo", width: 100, align: "left" },
  196. { label: "班级人数", name: "ClassStuNum", width: 100, align: "left" },
  197. ],
  198. mainId: 'EPCId',
  199. //isPage: true,
  200. isMultiselect: true,
  201. });
  202. //考场
  203. $('#gridtable_Room').jfGrid({
  204. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForRoom',
  205. headData: [
  206. { label: "考场名称", name: "ClassroomName", width: 100, align: "left" },
  207. { label: "考场编号", name: "ClassroomNo", width: 100, align: "left" },
  208. { label: "考场座位数", name: "SeatCount", width: 100, align: "left" },
  209. { label: "监考老师编号", name: "EmpNo", width: 100, align: "left" },
  210. { label: "监考老师姓名", name: "EmpName", width: 100, align: "left" },
  211. ],
  212. mainId: 'EPRId',
  213. //isPage: true,
  214. isMultiselect: true,
  215. });
  216. page.search();
  217. },
  218. search: function (param) {
  219. if (!!EPLId) {
  220. param = param || {};
  221. param.EPId = EPId;
  222. $('#gridtable_Class').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  223. $('#gridtable_Room').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  224. }
  225. },
  226. //显示考试时间
  227. show: function () {
  228. if (!!EPLId) {
  229. var res = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormData?keyValue=' + EPLId);
  230. var data = res.data.Exam_ExamPlanLesson;
  231. ELCheckMark = data.ELCheckMark;
  232. if (ELCheckMark == 1) {
  233. $('#checkspan').html('(已审核)');
  234. } else {
  235. $('#checkspan').html('(未审核)');
  236. }
  237. if (!!data.ExamDate) {
  238. $('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd'));
  239. $('#examTime').html(data.ExamTime);
  240. } else {
  241. $('#examDate').html('');
  242. $('#examTime').html('');
  243. //未设置考试时间
  244. learun.layerConfirm('请先设置考试时间!', function (res) {
  245. if (res) {
  246. if (!!EPLId) {
  247. learun.layerForm({
  248. id: 'form',
  249. title: '设置考试时间',
  250. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + EPLId,
  251. width: 600,
  252. height: 400,
  253. callBack: function (id) {
  254. return top[id].acceptClick(refreshGirdData);
  255. }
  256. });
  257. } else {
  258. return learun.alert.warning("请选择考试课程!");
  259. }
  260. }
  261. });
  262. }
  263. }
  264. }
  265. };
  266. refreshGirdData = function () {
  267. if (!!EPLId) {
  268. $('#gridtable_Room').jfGridSet('reload');
  269. $('#gridtable_Class').jfGridSet('reload');
  270. page.show();
  271. }
  272. };
  273. page.init();
  274. }