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.
 
 
 
 
 
 

148 lines
6.6 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-26 16:58
  5. * 描 述:选修合班设置
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. //选课开始后无法进行编辑
  13. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  14. if (result.code == 200) {
  15. } else {
  16. learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  17. $('#lr_add').hide();
  18. $('#lr_delete').hide();
  19. }
  20. });
  21. page.initGird();
  22. page.bind();
  23. },
  24. bind: function () {
  25. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  26. page.search(queryJson);
  27. }, 220, 400);
  28. // 刷新
  29. $('#lr_refresh').on('click', function () {
  30. location.reload();
  31. });
  32. $('#AcademicYearNo').lrselect({
  33. placeholder: "学年",
  34. allowSearch: false,
  35. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  36. value: 'value',
  37. text: 'text'
  38. });
  39. //学期
  40. $('#Semester').lrselect({
  41. placeholder: "学期",
  42. allowSearch: false,
  43. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  44. value: 'value',
  45. text: 'text'
  46. });
  47. $('#LessonName').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  48. // 管理合班
  49. $('#lr_add').on('click', function () {
  50. //选课开始后无法进行编辑
  51. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  52. if (result.code == 200) {
  53. learun.layerForm({
  54. id: 'formmerge',
  55. title: '管理合班',
  56. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/Index',
  57. width: 1200,
  58. height: 600,
  59. btn: null,
  60. end: function () {
  61. refreshGirdData();
  62. }
  63. });
  64. } else {
  65. learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  66. $('#lr_add').hide();
  67. $('#lr_delete').hide();
  68. }
  69. });
  70. });
  71. // 合班明细
  72. $('#lr_viewitem').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('EMId');
  74. var LessonName = $('#gridtable').jfGridValue('LessonName');
  75. var LessonNo = $('#gridtable').jfGridValue('LessonNo');
  76. if (learun.checkrow(keyValue)) {
  77. learun.layerForm({
  78. id: 'formitem',
  79. title: LessonName + '(' + LessonNo + ')合班明细',
  80. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Index?EmId=' + keyValue,
  81. width: 1200,
  82. height: 600,
  83. btn: null
  84. });
  85. }
  86. });
  87. // 取消合班
  88. $('#lr_delete').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('EMId');
  90. if (learun.checkrow(keyValue)) {
  91. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  92. if (result.code == 200) {
  93. learun.layerConfirm('是否确认取消合班!', function (res) {
  94. if (res) {
  95. learun.postForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMerge/DeleteForm', { keyValue: keyValue }, function () {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. } else {
  101. learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  102. $('#lr_add').hide();
  103. $('#lr_delete').hide();
  104. }
  105. });
  106. }
  107. });
  108. },
  109. // 初始化列表
  110. initGird: function () {
  111. $('#gridtable').lrAuthorizeJfGrid({
  112. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMerge/GetPageList',
  113. headData: [
  114. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  115. { label: "学期", name: "Semester", width: 60, align: "left" },
  116. { label: "课程编号", name: "LessonNo", width: 100, align: "left" },
  117. {
  118. label: "课程名称", name: "LessonNo", width: 200, align: "left",
  119. formatterAsync: function (callback, value, row, op, $cell) {
  120. learun.clientdata.getAsync('custmerData', {
  121. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  122. key: value,
  123. keyId: 'lessonno',
  124. callback: function (_data) {
  125. callback(_data['lessonname']);
  126. }
  127. });
  128. }
  129. },
  130. { label: "学分", name: "StudyScore", width: 60, align: "left" }
  131. ],
  132. mainId: 'EMId',
  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. page.search();
  144. };
  145. page.init();
  146. }