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.
 
 
 
 
 
 

309 lines
14 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-04-14 18:12
  5. * 描 述:考试记录表
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. $('#AcademicYearNo').lrselect({
  20. placeholder: "学年",
  21. allowSearch: false,
  22. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. //学期
  27. $('#Semester').lrselect({
  28. placeholder: "学期",
  29. allowSearch: false,
  30. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  31. value: 'value',
  32. text: 'text'
  33. });
  34. $('#PlanType').lrDataItemSelect({ code: 'StudentType' });
  35. $('#EPRandom').lrDataItemSelect({ code: 'YesOrNoBit' });
  36. $('#EPGenarate').lrDataItemSelect({ code: 'YesOrNoBit' });
  37. // 刷新
  38. $('#lr_refresh').on('click', function () {
  39. location.reload();
  40. });
  41. // 新增
  42. $('#lr_add').on('click', function () {
  43. learun.layerForm({
  44. id: 'form',
  45. title: '新增',
  46. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Form',
  47. width: 600,
  48. height: 400,
  49. callBack: function (id) {
  50. return top[id].acceptClick(refreshGirdData);
  51. }
  52. });
  53. });
  54. // 编辑
  55. $('#lr_edit').on('click', function () {
  56. var keyValue = $('#gridtable').jfGridValue('EPId');
  57. if (learun.checkrow(keyValue)) {
  58. //是否生成
  59. var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
  60. if (EPGenarate == true) {
  61. return learun.alert.warning("已生成排考名单,不可编辑!");
  62. }
  63. learun.layerForm({
  64. id: 'form',
  65. title: '编辑',
  66. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Form?keyValue=' + keyValue,
  67. width: 600,
  68. height: 400,
  69. callBack: function (id) {
  70. return top[id].acceptClick(refreshGirdData);
  71. }
  72. });
  73. }
  74. });
  75. // 删除
  76. $('#lr_delete').on('click', function () {
  77. var keyValue = $('#gridtable').jfGridValue('EPId');
  78. if (learun.checkrow(keyValue)) {
  79. //是否生成
  80. var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
  81. if (EPGenarate == true) {
  82. return learun.alert.warning("已生成排考名单,不可删除!");
  83. }
  84. learun.layerConfirm('是否确认删除该项!', function (res) {
  85. if (res) {
  86. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/DeleteForm', { keyValue: keyValue }, function () {
  87. refreshGirdData();
  88. });
  89. }
  90. });
  91. }
  92. });
  93. // 打印
  94. $('#lr_print').on('click', function () {
  95. $('#gridtable').jqprintTable();
  96. });
  97. //  生成排考名单
  98. $('#lr_generate').on('click', function () {
  99. var keyValue = $('#gridtable').jfGridValue('EPId');
  100. if (learun.checkrow(keyValue)) {
  101. learun.layerConfirm('是否确认生成排考名单!', function (res) {
  102. if (res) {
  103. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Generate', { keyValue: keyValue }, function () {
  104. refreshGirdData();
  105. });
  106. }
  107. });
  108. }
  109. });
  110. //  清除排考名单
  111. $('#lr_cleargenerate').on('click', function () {
  112. var keyValue = $('#gridtable').jfGridValue('EPId');
  113. if (learun.checkrow(keyValue)) {
  114. learun.layerConfirm('是否确认清除排考名单!', function (res) {
  115. if (res) {
  116. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearGenerate', { keyValue: keyValue, type: 1 }, function () {
  117. refreshGirdData();
  118. });
  119. }
  120. });
  121. }
  122. });
  123. //清除排考记录
  124. $('#lr_cleardata').on('click', function () {
  125. var keyValue = $('#gridtable').jfGridValue('EPId');
  126. if (learun.checkrow(keyValue)) {
  127. learun.layerConfirm('是否确认清除所有排考记录!', function (res) {
  128. if (res) {
  129. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearGenerate', { keyValue: keyValue, type: 2 }, function () {
  130. refreshGirdData();
  131. });
  132. }
  133. });
  134. }
  135. });
  136. // 安排时间
  137. $('#lr_examtime').on('click', function () {
  138. var keyValue = $('#gridtable').jfGridValue('EPId');
  139. if (learun.checkrow(keyValue)) {
  140. learun.layerForm({
  141. id: 'formtime',
  142. title: '安排时间',
  143. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/FormTime?keyValue=' + keyValue,
  144. width: 850,
  145. height: 550,
  146. callBack: function (id) {
  147. return top[id].acceptClick(refreshGirdData);
  148. }
  149. });
  150. }
  151. });
  152. //  安排考试
  153. $('#lr_planks').on('click',
  154. function () {
  155. var keyValue = $('#gridtable').jfGridValue('EPId');
  156. var PlanName = $('#gridtable').jfGridValue('PlanName');
  157. if (learun.checkrow(keyValue))
  158. learun.frameTab.open({
  159. F_ModuleId: keyValue,
  160. F_Icon: 'fa magic',
  161. F_FullName: PlanName + '--安排考试',
  162. F_UrlAddress: '/EducationalAdministration/Exam_ExamPlanLesson/Index?EPId=' + keyValue
  163. });
  164. });
  165. //一键安排课程
  166. $('#lr_examlesson').on('click',
  167. function () {
  168. var keyValue = $('#gridtable').jfGridValue('EPId');
  169. if (learun.checkrow(keyValue)) {
  170. learun.layerConfirm('是否确认安排课程!', function (res) {
  171. if (res) {
  172. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanLessonByEPId', { keyValue: keyValue }, function () {
  173. refreshGirdData();
  174. });
  175. }
  176. });
  177. }
  178. });
  179. //一键安排班级
  180. $('#lr_examclass').on('click',
  181. function () {
  182. var keyValue = $('#gridtable').jfGridValue('EPId');
  183. if (learun.checkrow(keyValue)) {
  184. learun.layerConfirm('是否确认安排班级!', function (res) {
  185. if (res) {
  186. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanClassByEPId', { keyValue: keyValue }, function () {
  187. refreshGirdData();
  188. });
  189. }
  190. });
  191. }
  192. });
  193. //一键安排考场
  194. $('#lr_examroom').on('click',
  195. function () {
  196. var keyValue = $('#gridtable').jfGridValue('EPId');
  197. if (learun.checkrow(keyValue)) {
  198. learun.layerConfirm('是否确认安排考场!', function (res) {
  199. if (res) {
  200. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanRoomByEPId', { keyValue: keyValue }, function () {
  201. refreshGirdData();
  202. });
  203. }
  204. });
  205. }
  206. });
  207. //自动生成排考时间
  208. $('#lr_examlessontime').on('click',
  209. function () {
  210. var keyValue = $('#gridtable').jfGridValue('EPId');
  211. if (learun.checkrow(keyValue)) {
  212. learun.layerConfirm('是否确认生成排考时间!', function (res) {
  213. if (res) {
  214. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanLessonTimeByEPId', { keyValue: keyValue }, function () {
  215. refreshGirdData();
  216. });
  217. }
  218. });
  219. }
  220. });
  221. //一键安排监考老师
  222. $('#lr_examteacher').on('click',
  223. function () {
  224. var keyValue = $('#gridtable').jfGridValue('EPId');
  225. if (learun.checkrow(keyValue)) {
  226. learun.layerConfirm('是否确认安排监考老师!', function (res) {
  227. if (res) {
  228. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanTeacherByEPId', { keyValue: keyValue }, function () {
  229. refreshGirdData();
  230. });
  231. }
  232. });
  233. }
  234. });
  235. //老师时间管理
  236. $('#lr_teacherTimeManage').on('click', function () {
  237. learun.layerForm({
  238. id: 'form_teacherTimeManage',
  239. title: '老师时间管理',
  240. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/Index',
  241. width: 1000,
  242. height: 600,
  243. callBack: function (id) {
  244. return top[id].acceptClick(refreshGirdData);
  245. }
  246. });
  247. });
  248. },
  249. // 初始化列表
  250. initGird: function () {
  251. $('#gridtable').lrAuthorizeJfGridLei({
  252. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GetPageList',
  253. headData: [
  254. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  255. { label: "学期", name: "Semester", width: 100, align: "left" },
  256. { label: "排考名称", name: "PlanName", width: 300, align: "left" },
  257. {
  258. label: "排考类型", name: "PlanType", width: 100, align: "left",
  259. formatterAsync: function (callback, value, row, op, $cell) {
  260. learun.clientdata.getAsync('dataItem', {
  261. key: value,
  262. code: 'StudentType',
  263. callback: function (_data) {
  264. callback(_data.text);
  265. }
  266. });
  267. }
  268. },
  269. { label: "排考编号", name: "PlanCode", width: 200, align: "left" },
  270. { label: "排考总人数", name: "EPStuCount", width: 100, align: "left" },
  271. {
  272. label: "是否随机座位", name: "EPRandom", width: 100, align: "left",
  273. formatter: function (cellvalue) {
  274. return cellvalue == true ? "是" : "否";
  275. }
  276. },
  277. {
  278. label: "是否生成", name: "EPGenarate", width: 100, align: "left",
  279. formatter: function (cellvalue) {
  280. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  281. }
  282. },
  283. { label: "排序号", name: "EPOrder", width: 100, align: "left", },
  284. ],
  285. mainId: 'EPId',
  286. isPage: true,
  287. sidx: "EPOrder asc "
  288. });
  289. page.search();
  290. },
  291. search: function (param) {
  292. param = param || {};
  293. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  294. }
  295. };
  296. refreshGirdData = function () {
  297. $('#gridtable').jfGridSet('reload');
  298. };
  299. page.init();
  300. }