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.
 
 
 
 
 
 

143 lines
6.0 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-06-13 15:41
  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. // 刷新
  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_ExamTeacherTime/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('Id');
  54. if (learun.checkrow(keyValue)) {
  55. learun.layerForm({
  56. id: 'form',
  57. title: '编辑',
  58. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/Form?keyValue=' + keyValue,
  59. width: 600,
  60. height: 400,
  61. callBack: function (id) {
  62. return top[id].acceptClick(refreshGirdData);
  63. }
  64. });
  65. }
  66. });
  67. // 删除
  68. $('#lr_delete').on('click', function () {
  69. var keyValue = $('#gridtable').jfGridValue('Id');
  70. if (learun.checkrow(keyValue)) {
  71. learun.layerConfirm('是否确认删除该项!', function (res) {
  72. if (res) {
  73. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/DeleteForm', { keyValue: keyValue }, function () {
  74. refreshGirdData();
  75. });
  76. }
  77. });
  78. }
  79. });
  80. // 打印
  81. $('#lr_print').on('click', function () {
  82. $('#gridtable').jqprintTable();
  83. });
  84. },
  85. // 初始化列表
  86. initGird: function () {
  87. $('#gridtable').jfGrid({
  88. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/GetPageList',
  89. headData: [
  90. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  91. { label: "学期", name: "Semester", width: 100, align: "left" },
  92. {
  93. label: "时间段", name: "ExamTimeStart", width: 300, align: "left",
  94. formatter: function (value, row) {
  95. return value + " - " + row.ExamTimeEnd;
  96. }
  97. },
  98. {
  99. label: "不能监考的老师", name: "EmpNo", width: 100, align: "left",
  100. formatterAsync: function (callback, value, row, op, $cell) {
  101. if (value.indexOf(',') != -1) {
  102. var name = '';
  103. var attr = value.split(',');
  104. for (var i = 0; i < attr.length; i++) {
  105. learun.clientdata.getAsync('custmerData', {
  106. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  107. key: attr[i],
  108. keyId: 'empno',
  109. callback: function (_data) {
  110. name += _data['empname'] + ",";
  111. }
  112. });
  113. }
  114. callback(name.substring(0, name.length - 1));
  115. } else {
  116. learun.clientdata.getAsync('custmerData', {
  117. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  118. key: value,
  119. keyId: 'empno',
  120. callback: function (_data) {
  121. callback(_data['empname']);
  122. }
  123. });
  124. }
  125. }
  126. },
  127. ],
  128. mainId: 'Id',
  129. isPage: true
  130. });
  131. page.search();
  132. },
  133. search: function (param) {
  134. param = param || {};
  135. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  136. }
  137. };
  138. refreshGirdData = function () {
  139. $('#gridtable').jfGridSet('reload');
  140. };
  141. page.init();
  142. }