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.
 
 
 
 
 
 

132 lines
5.9 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. // 管理合班
  33. $('#lr_add').on('click', function () {
  34. //选课开始后无法进行编辑
  35. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  36. if (result.code == 200) {
  37. learun.layerForm({
  38. id: 'formmerge',
  39. title: '管理合班',
  40. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/Index',
  41. width: 1200,
  42. height: 600,
  43. btn: null,
  44. end: function () {
  45. refreshGirdData();
  46. }
  47. });
  48. } else {
  49. learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  50. $('#lr_add').hide();
  51. $('#lr_delete').hide();
  52. }
  53. });
  54. });
  55. // 合班明细
  56. $('#lr_viewitem').on('click', function () {
  57. var keyValue = $('#gridtable').jfGridValue('EMId');
  58. var LessonName = $('#gridtable').jfGridValue('LessonName');
  59. var LessonNo = $('#gridtable').jfGridValue('LessonNo');
  60. if (learun.checkrow(keyValue)) {
  61. learun.layerForm({
  62. id: 'formitem',
  63. title: LessonName + '(' + LessonNo + ')合班明细',
  64. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Index?EmId=' + keyValue,
  65. width: 1200,
  66. height: 600,
  67. btn: null
  68. });
  69. }
  70. });
  71. // 取消合班
  72. $('#lr_delete').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('EMId');
  74. if (learun.checkrow(keyValue)) {
  75. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  76. if (result.code == 200) {
  77. learun.layerConfirm('是否确认取消合班!', function (res) {
  78. if (res) {
  79. learun.postForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMerge/DeleteForm', { keyValue: keyValue }, function () {
  80. refreshGirdData();
  81. });
  82. }
  83. });
  84. } else {
  85. learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  86. $('#lr_add').hide();
  87. $('#lr_delete').hide();
  88. }
  89. });
  90. }
  91. });
  92. },
  93. // 初始化列表
  94. initGird: function () {
  95. $('#gridtable').lrAuthorizeJfGrid({
  96. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMerge/GetPageList',
  97. headData: [
  98. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  99. { label: "学期", name: "Semester", width: 60, align: "left" },
  100. { label: "课程编号", name: "LessonNo", width: 100, align: "left" },
  101. {
  102. label: "课程名称", name: "LessonNo", width: 200, align: "left",
  103. formatterAsync: function (callback, value, row, op, $cell) {
  104. learun.clientdata.getAsync('custmerData', {
  105. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  106. key: value,
  107. keyId: 'lessonno',
  108. callback: function (_data) {
  109. callback(_data['lessonname']);
  110. }
  111. });
  112. }
  113. },
  114. { label: "学分", name: "StudyScore", width: 60, align: "left" }
  115. ],
  116. mainId: 'EMId',
  117. isPage: true
  118. });
  119. page.search();
  120. },
  121. search: function (param) {
  122. param = param || {};
  123. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  124. }
  125. };
  126. refreshGirdData = function () {
  127. page.search();
  128. };
  129. page.init();
  130. }