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.
 
 
 
 
 
 

142 lines
6.5 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-05-14 09:49
  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. // 刷新
  17. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 当前学期选修排课数据同步
  21. $('#lr_arrange').on('click', function () {
  22. learun.layerConfirm('是否确认同步数据!', function (res) {
  23. if (res) {
  24. learun.getForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/AsyncArrangeLessonOfElectiveData', function () {
  25. refreshGirdData();
  26. });
  27. }
  28. });
  29. });
  30. //清空当前学期选修排课数据
  31. $('#lr_update').on('click', function () {
  32. learun.layerConfirm('是否确认清空数据!', function (res) {
  33. if (res) {
  34. learun.getForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/AsyncModifyArrangeLessonOfElectiveData', function () {
  35. refreshGirdData();
  36. });
  37. }
  38. });
  39. });
  40. // 按条件清空
  41. $('#emptyByCondition').on('click', function () {
  42. learun.layerForm({
  43. id: 'EmptyByConditionForm',
  44. title: '按条件清空选修排课数据',
  45. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/EmptyByConditionForm',
  46. width: 600,
  47. height: 400,
  48. callBack: function (id) {
  49. return top[id].acceptClick(refreshGirdData);
  50. }
  51. });
  52. });
  53. // 按条件同步
  54. $('#syncByCondition').on('click', function () {
  55. learun.layerForm({
  56. id: 'SyncByConditionForm',
  57. title: '按条件同步选修排课数据',
  58. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/SyncByConditionForm',
  59. width: 600,
  60. height: 400,
  61. callBack: function (id) {
  62. return top[id].acceptClick(refreshGirdData);
  63. }
  64. });
  65. });
  66. },
  67. // 初始化列表
  68. initGird: function () {
  69. $('#gridtable').lrAuthorizeJfGrid({
  70. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/GetPageList',
  71. headData: [
  72. { label: "上课日期", name: "LessonDate", width: 130, align: "left" },
  73. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  74. { label: "学期", name: "Semester", width: 100, align: "left" },
  75. { label: "课程号", name: "LessonNo", width: 100, align: "left" },
  76. {
  77. label: "课程名称", name: "LessonNo", width: 150, align: "left",
  78. formatterAsync: function (callback, value, row, op, $cell) {
  79. learun.clientdata.getAsync('custmerData', {
  80. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  81. key: value,
  82. keyId: 'lessonno',
  83. callback: function (_data) {
  84. callback(_data['lessonname']);
  85. }
  86. });
  87. }
  88. },
  89. { label: "课程类别码", name: "LessonSortNo", width: 100, align: "left" },
  90. { label: "上课节次(如 11 代表星期一第一节课)", name: "LessonSection", width: 220, align: "left" },
  91. { label: "上课时间", name: "LessonTime", width: 100, align: "left" },
  92. { label: "学分", name: "StudyScore", width: 100, align: "left" },
  93. { label: "教师号", name: "EmpNo", width: 100, align: "left" },
  94. {
  95. label: "教师姓名", name: "EmpNo", width: 100, align: "left",
  96. formatterAsync: function (callback, value, row, op, $cell) {
  97. learun.clientdata.getAsync('custmerData', {
  98. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  99. key: value,
  100. keyId: 'empno',
  101. callback: function (_data) {
  102. callback(_data['empname']);
  103. }
  104. });
  105. }
  106. },
  107. { label: "教室号", name: "ClassRoomNo", width: 100, align: "left" },
  108. {
  109. label: "教室名称", name: "ClassRoomNo", width: 100, align: "left",
  110. formatterAsync: function (callback, value, row, op, $cell) {
  111. learun.clientdata.getAsync('custmerData', {
  112. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  113. key: value,
  114. keyId: 'classroomno',
  115. callback: function (_data) {
  116. callback(_data['classroomname']);
  117. }
  118. });
  119. }
  120. },
  121. ],
  122. mainId: 'Id',
  123. isPage: true,
  124. sidx: 'PaiKeId,LessonDate',
  125. sord: 'asc'
  126. });
  127. page.search();
  128. },
  129. search: function (param) {
  130. param = param || {};
  131. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  132. }
  133. };
  134. refreshGirdData = function () {
  135. page.search();
  136. };
  137. page.init();
  138. }