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.
 
 
 
 
 
 

199 lines
8.5 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-04-12 15:47
  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: true,
  22. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. //学期
  27. $('#Semester').lrselect({
  28. placeholder: "学期",
  29. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  30. value: 'value',
  31. text: 'text'
  32. });
  33. $('#ESType').lrDataItemSelect({ code: 'StudentType' });
  34. // 刷新
  35. $('#lr_refresh').on('click', function () {
  36. location.reload();
  37. });
  38. // 新增
  39. $('#lr_add').on('click', function () {
  40. learun.layerForm({
  41. id: 'form',
  42. title: '新增',
  43. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form',
  44. width: 600,
  45. height: 400,
  46. callBack: function (id) {
  47. return top[id].acceptClick(refreshGirdData);
  48. }
  49. });
  50. });
  51. // 编辑
  52. $('#lr_edit').on('click', function () {
  53. var keyValue = $('#gridtable').jfGridValue('ESId');
  54. if (learun.checkrow(keyValue)) {
  55. if (keyValue.indexOf(',') != -1) {
  56. learun.alert.warning("只能选择一条记录进行编辑!");
  57. return false;
  58. }
  59. learun.layerForm({
  60. id: 'form',
  61. title: '编辑',
  62. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form?keyValue=' + keyValue,
  63. width: 600,
  64. height: 400,
  65. callBack: function (id) {
  66. return top[id].acceptClick(refreshGirdData);
  67. }
  68. });
  69. }
  70. });
  71. // 删除
  72. $('#lr_delete').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('ESId');
  74. if (learun.checkrow(keyValue)) {
  75. learun.layerConfirm('是否确认删除该项!', function (res) {
  76. if (res) {
  77. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/DeleteForm', { keyValue: keyValue }, function () {
  78. refreshGirdData();
  79. });
  80. }
  81. });
  82. }
  83. });
  84. //启用
  85. $('#lr_lock').on('click', function () {
  86. var keyValue = $('#gridtable').jfGridValue('ESId');
  87. if (learun.checkrow(keyValue)) {
  88. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  89. if (ESEnabled.indexOf('true') != -1) {
  90. learun.alert.warning("选中记录中包含已启用项目!");
  91. return;
  92. }
  93. learun.layerConfirm('是否确认启用选中记录!', function (res) {
  94. if (res) {
  95. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 1 }, function () {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. }
  101. });
  102. //禁用
  103. $('#lr_unlock').on('click', function () {
  104. var keyValue = $('#gridtable').jfGridValue('ESId');
  105. if (learun.checkrow(keyValue)) {
  106. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  107. if (ESEnabled.indexOf('false') != -1) {
  108. learun.alert.warning("选中记录中包含已停用项目!");
  109. return;
  110. }
  111. learun.layerConfirm('是否确认停用选中记录!', function (res) {
  112. if (res) {
  113. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 0 }, function () {
  114. refreshGirdData();
  115. });
  116. }
  117. });
  118. }
  119. });
  120. // 打印
  121. $('#lr_print').on('click', function () {
  122. $('#gridtable').jqprintTable();
  123. });
  124. // 一键生成
  125. $('#lr_importBy').on('click', function () {
  126. learun.layerForm({
  127. id: 'form_import',
  128. title: '生成考试信息',
  129. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormImport',
  130. width: 500,
  131. height: 300,
  132. btn: ['一键生成', '关闭'],
  133. callBack: function (id) {
  134. return top[id].acceptClick(refreshGirdData);
  135. }
  136. });
  137. });
  138. // 导入
  139. $('#lr_clearBy').on('click', function () {
  140. learun.layerForm({
  141. id: 'form_clear',
  142. title: '按条件清空学生考试信息',
  143. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormClear',
  144. width: 500,
  145. height: 300,
  146. btn: ['确定', '关闭'],
  147. callBack: function (id) {
  148. return top[id].acceptClick(refreshGirdData);
  149. }
  150. });
  151. });
  152. },
  153. // 初始化列表
  154. initGird: function () {
  155. $('#gridtable').lrAuthorizeJfGrid({
  156. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/GetPageList',
  157. headData: [
  158. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  159. { label: "学期", name: "Semester", width: 100, align: "left" },
  160. { label: "学生学号", name: "StuNo", width: 100, align: "left" },
  161. { label: "学生姓名", name: "StuName", width: 100, align: "left" },
  162. {
  163. label: "考试类型", name: "ESType", width: 100, align: "left",
  164. formatterAsync: function (callback, value, row, op, $cell) {
  165. learun.clientdata.getAsync('dataItem', {
  166. key: value,
  167. code: 'StudentType',
  168. callback: function (_data) {
  169. callback(_data.text);
  170. }
  171. });
  172. }
  173. },
  174. {
  175. label: "是否启用", name: "ESEnabled", width: 100, align: "left",
  176. formatter: function (cellvalue) {
  177. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  178. }
  179. },
  180. ],
  181. mainId: 'ESId',
  182. isMultiselect: true,
  183. isPage: true,
  184. sidx: 'AcademicYearNo desc,Semester desc',
  185. sord: 'ASC'
  186. });
  187. page.search();
  188. },
  189. search: function (param) {
  190. param = param || {};
  191. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  192. }
  193. };
  194. refreshGirdData = function () {
  195. $('#gridtable').jfGridSet('reload');
  196. };
  197. page.init();
  198. }