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.

Index.js 6.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. if (name.indexOf(',') != -1) {
  112. callback(name.substring(0, name.length - 1));
  113. } else {
  114. callback(name);
  115. }
  116. }
  117. });
  118. }
  119. } else {
  120. learun.clientdata.getAsync('custmerData', {
  121. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  122. key: value,
  123. keyId: 'empno',
  124. callback: function (_data) {
  125. callback(_data['empname']);
  126. }
  127. });
  128. }
  129. }
  130. },
  131. ],
  132. mainId: 'Id',
  133. isPage: true
  134. });
  135. page.search();
  136. },
  137. search: function (param) {
  138. param = param || {};
  139. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  140. }
  141. };
  142. refreshGirdData = function () {
  143. $('#gridtable').jfGridSet('reload');
  144. };
  145. page.init();
  146. }