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.
 
 
 
 
 
 

232 lines
10 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. }, 245, 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. $.get('/Home/GetYearAndSemesteResult', function (ref) {
  34. if (ref.code == "200") {
  35. $('#AcademicYearNo').lrselectSet(ref.data.Item1);
  36. $('#Semester').lrselectSet(ref.data.Item3);
  37. }
  38. }.bind(this), "json");
  39. $('#ESEnabled').lrDataItemSelect({
  40. code: "YesOrNoBit"
  41. });
  42. $('#ESType').lrDataItemSelect({ code: 'StudentType' });
  43. // 刷新
  44. $('#lr_refresh').on('click', function () {
  45. location.reload();
  46. });
  47. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  48. // 新增
  49. $('#lr_add').on('click', function () {
  50. learun.layerForm({
  51. id: 'form',
  52. title: '新增',
  53. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form',
  54. width: 600,
  55. height: 400,
  56. callBack: function (id) {
  57. return top[id].acceptClick(refreshGirdData);
  58. }
  59. });
  60. });
  61. // 编辑
  62. $('#lr_edit').on('click', function () {
  63. var keyValue = $('#gridtable').jfGridValue('ESId');
  64. if (learun.checkrow(keyValue)) {
  65. if (keyValue.indexOf(',') != -1) {
  66. learun.alert.warning("只能选择一条记录进行编辑!");
  67. return false;
  68. }
  69. learun.layerForm({
  70. id: 'form',
  71. title: '编辑',
  72. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form?keyValue=' + keyValue,
  73. width: 600,
  74. height: 400,
  75. callBack: function (id) {
  76. return top[id].acceptClick(refreshGirdData);
  77. }
  78. });
  79. }
  80. });
  81. // 删除
  82. $('#lr_delete').on('click', function () {
  83. var keyValue = $('#gridtable').jfGridValue('ESId');
  84. if (learun.checkrow(keyValue)) {
  85. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  86. if (ESEnabled.indexOf('true') != -1) {
  87. learun.alert.warning("选中记录中包含已启用项目!");
  88. return;
  89. }
  90. learun.layerConfirm('是否确认删除该项!', function (res) {
  91. if (res) {
  92. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/DeleteForm', { keyValue: keyValue }, function () {
  93. refreshGirdData();
  94. });
  95. }
  96. });
  97. }
  98. });
  99. //启用
  100. $('#lr_lock').on('click', function () {
  101. var keyValue = $('#gridtable').jfGridValue('ESId');
  102. if (learun.checkrow(keyValue)) {
  103. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  104. if (ESEnabled.indexOf('true') != -1) {
  105. learun.alert.warning("选中记录中包含已启用项目!");
  106. return;
  107. }
  108. learun.layerConfirm('是否确认启用选中记录!', function (res) {
  109. if (res) {
  110. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 1 }, function () {
  111. refreshGirdData();
  112. });
  113. }
  114. });
  115. }
  116. });
  117. //禁用
  118. $('#lr_unlock').on('click', function () {
  119. var keyValue = $('#gridtable').jfGridValue('ESId');
  120. if (learun.checkrow(keyValue)) {
  121. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  122. if (ESEnabled.indexOf('false') != -1) {
  123. learun.alert.warning("选中记录中包含已停用项目!");
  124. return;
  125. }
  126. learun.layerConfirm('是否确认停用选中记录!', function (res) {
  127. if (res) {
  128. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 0 }, function () {
  129. refreshGirdData();
  130. });
  131. }
  132. });
  133. }
  134. });
  135. // 打印
  136. $('#lr_print').on('click', function () {
  137. $('#gridtable').jqprintTable();
  138. });
  139. // 一键生成
  140. $('#lr_importBy').on('click', function () {
  141. learun.layerForm({
  142. id: 'form_import',
  143. title: '生成考生信息',
  144. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormImport',
  145. width: 500,
  146. height: 300,
  147. btn: ['一键生成', '关闭'],
  148. callBack: function (id) {
  149. return top[id].acceptClick(refreshGirdData);
  150. }
  151. });
  152. });
  153. // 导入
  154. $('#lr_clearBy').on('click', function () {
  155. learun.layerForm({
  156. id: 'form_clear',
  157. title: '按条件清空学生考试信息',
  158. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormClear',
  159. width: 500,
  160. height: 300,
  161. btn: ['确定', '关闭'],
  162. callBack: function (id) {
  163. return top[id].acceptClick(refreshGirdData);
  164. }
  165. });
  166. });
  167. },
  168. // 初始化列表
  169. initGird: function () {
  170. $('#gridtable').jfGrid({
  171. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/GetPageList',
  172. headData: [
  173. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  174. { label: "学期", name: "Semester", width: 100, align: "left" },
  175. {
  176. label: "班级", name: "ClassNo", width: 100, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('custmerData', {
  179. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  180. key: value,
  181. keyId: 'classno',
  182. callback: function (_data) {
  183. callback(_data['classname']);
  184. }
  185. });
  186. }
  187. },
  188. { label: "学生编号", name: "StuNo", width: 100, align: "left" },
  189. { label: "学生姓名", name: "StuName", width: 100, align: "left" },
  190. { label: "年级", name: "Grade", width: 100, align: "left" },
  191. {
  192. label: "考试类型", name: "ESType", width: 100, align: "left",
  193. formatterAsync: function (callback, value, row, op, $cell) {
  194. learun.clientdata.getAsync('dataItem', {
  195. key: value,
  196. code: 'StudentType',
  197. callback: function (_data) {
  198. callback(_data.text);
  199. }
  200. });
  201. }
  202. },
  203. {
  204. label: "是否启用", name: "ESEnabled", width: 100, align: "left",
  205. formatter: function (cellvalue) {
  206. return cellvalue == 1 ? "<span class=\"label label-success\">是</span>" : "<span class=\"label label-default\" >否</span>";
  207. }
  208. },
  209. ],
  210. mainId: 'ESId',
  211. isMultiselect: true,
  212. isPage: true,
  213. sidx: 'AcademicYearNo desc,Semester desc',
  214. sord: 'ASC'
  215. });
  216. page.search();
  217. },
  218. search: function (param) {
  219. param = param || {};
  220. if (IsTwoDept)
  221. param.ImportDeptNo = CurrentDeptNo;
  222. else
  223. param.ImportDeptNo = "0";
  224. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  225. }
  226. };
  227. refreshGirdData = function () {
  228. $('#gridtable').jfGridSet('reload');
  229. };
  230. page.init();
  231. }