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.
 
 
 
 
 
 

239 lines
11 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-05-14 10:02
  5. * 描 述:选修课课程信息
  6. */
  7. var weekChina = ["一", "二", "三", "四", "五", "六", "日"];
  8. var refreshGirdData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. //选课开始后无法进行编辑
  14. //learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  15. // if (result.code == 200) {
  16. // } else {
  17. // learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  18. // $('#lr_edit').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_editMajor').on('click', function () {
  34. var keyValue = $('#gridtable').jfGridValue('Id');
  35. if (learun.checkrow(keyValue)) {
  36. learun.layerForm({
  37. id: 'formmajor',
  38. title: '管理选课专业',
  39. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMajor/Index?OLPOEId=' + keyValue,
  40. width: 1000,
  41. height: 700,
  42. btn: null
  43. });
  44. }
  45. });
  46. //设置人数
  47. $('#lr_edit').on('click', function () {
  48. var keyValue = $('#gridtable').jfGridValue('Id');
  49. if (learun.checkrow(keyValue)) {
  50. //选课开始后无法进行编辑
  51. //learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  52. // if (result.code == 200) {
  53. learun.layerForm({
  54. id: 'OpenLessonPlanOfElectiveform',
  55. title: '设置人数',
  56. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/Form?keyValue=' + keyValue,
  57. width: 600,
  58. height: 400,
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. // } else {
  64. // learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  65. // $('#lr_edit').hide();
  66. // }
  67. //});
  68. }
  69. });
  70. //查看学生
  71. $('#lr_view').on('click', function () {
  72. var keyValue = $('#gridtable').jfGridValue('Id');
  73. if (learun.checkrow(keyValue)) {
  74. learun.layerForm({
  75. id: 'form',
  76. title: '查看学生',
  77. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/FinishIndex?OLPEId=' + keyValue,
  78. width: 1000,
  79. height: 700,
  80. btn: null,
  81. end: function () {
  82. refreshGirdData();
  83. }
  84. });
  85. }
  86. });
  87. //审核学生
  88. $('#lr_audit').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('Id');
  90. if (learun.checkrow(keyValue)) {
  91. learun.layerForm({
  92. id: 'form',
  93. title: '审核学生',
  94. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/AuditIndex?OLPEId=' + keyValue,
  95. width: 1000,
  96. height: 700,
  97. btn: null,
  98. end: function () {
  99. refreshGirdData();
  100. }
  101. });
  102. }
  103. });
  104. //查看已审学生(预)
  105. $('#lr_viewPre').on('click', function () {
  106. var keyValue = $('#gridtable').jfGridValue('Id');
  107. if (learun.checkrow(keyValue)) {
  108. learun.layerForm({
  109. id: 'form',
  110. title: '查看学生',
  111. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectivePre/FinishIndex?OLPEId=' + keyValue,
  112. width: 1000,
  113. height: 700,
  114. btn: null,
  115. end: function () {
  116. refreshGirdData();
  117. }
  118. });
  119. }
  120. });
  121. //审核学生(预)
  122. $('#lr_auditPre').on('click', function () {
  123. var keyValue = $('#gridtable').jfGridValue('Id');
  124. if (learun.checkrow(keyValue)) {
  125. learun.layerForm({
  126. id: 'form',
  127. title: '审核学生',
  128. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectivePre/AuditIndex?OLPEId=' + keyValue,
  129. width: 1000,
  130. height: 700,
  131. btn: null,
  132. end: function () {
  133. refreshGirdData();
  134. }
  135. });
  136. }
  137. });
  138. //编辑
  139. $('#lr_modify').on('click', function () {
  140. var keyValue = $('#gridtable').jfGridValue('Id');
  141. if (learun.checkrow(keyValue)) {
  142. learun.layerForm({
  143. id: 'OpenLessonPlanOfElectiveModifyForm',
  144. title: '编辑',
  145. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/ModifyForm?keyValue=' + keyValue,
  146. width: 600,
  147. height: 400,
  148. callBack: function (id) {
  149. return top[id].acceptClick(refreshGirdData);
  150. }
  151. });
  152. }
  153. });
  154. },
  155. // 初始化列表
  156. initGird: function () {
  157. $('#gridtable').lrAuthorizeJfGrid({
  158. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetPageListOfMerge',
  159. headData: [
  160. { label: "学年", name: "AcademicYearNo", width: 45, align: "left" },
  161. { label: "学期", name: "Semester", width: 35, align: "left" },
  162. { label: "课程号", name: "LessonNo", width: 70, align: "left" },
  163. {
  164. label: "课程名称", name: "LessonNo2", width: 170, align: "left",
  165. formatterAsync: function (callback, value, row, op, $cell) {
  166. learun.clientdata.getAsync('custmerData', {
  167. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  168. key: value,
  169. keyId: 'lessonno',
  170. callback: function (_data) {
  171. callback(_data['lessonname']);
  172. }
  173. });
  174. }
  175. },
  176. {
  177. label: "上课节次", name: "LessonSection", width: 100, align: "left",
  178. formatter: function (cellvalue, row) {
  179. if (cellvalue.indexOf(',') == -1)
  180. return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节";
  181. else
  182. return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1, 2) + "、" + cellvalue.slice(4) + "节";
  183. }
  184. },
  185. { label: "上课时间", name: "LessonTime", width: 150, align: "left" },
  186. { label: "学分", name: "StudyScore", width: 50, align: "left" },
  187. { label: "教师号", name: "EmpNo", width: 75, align: "left" },
  188. {
  189. label: "教师姓名", name: "EmpNo2", width: 100, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  193. key: value,
  194. keyId: 'empno',
  195. callback: function (_data) {
  196. callback(_data['empname']);
  197. }
  198. });
  199. }
  200. },
  201. {
  202. label: "教室", name: "ClassRoomNo", width: 60, align: "left",
  203. formatterAsync: function (callback, value, row, op, $cell) {
  204. learun.clientdata.getAsync('custmerData', {
  205. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  206. key: value,
  207. keyId: 'classroomno',
  208. callback: function (_data) {
  209. callback(_data['classroomname']);
  210. }
  211. });
  212. }
  213. },
  214. { label: "人数上限", name: "StuNumMax", width: 60, align: "left" },
  215. { label: "已报人数", name: "StuNumOfApply", width: 60, align: "left" },
  216. { label: "通过人数", name: "StuNum", width: 60, align: "left" },
  217. { label: "已报人数(预)", name: "StuNumOfApplyPre", width: 80, align: "left" },
  218. { label: "通过人数(预)", name: "StuNumPre", width: 80, align: "left" }
  219. ],
  220. mainId: 'Id',
  221. isPage: true,
  222. sidx: 'AcademicYearNo,Semester',
  223. sord: 'desc'
  224. });
  225. page.search();
  226. },
  227. search: function (param) {
  228. param = param || {};
  229. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  230. }
  231. };
  232. refreshGirdData = function () {
  233. page.search();
  234. };
  235. page.init();
  236. }