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.
 
 
 
 
 
 

269 lines
13 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. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. //设置人数
  50. $('#lr_edit').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('Id');
  52. if (learun.checkrow(keyValue)) {
  53. //选课开始后无法进行编辑
  54. //learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
  55. // if (result.code == 200) {
  56. learun.layerForm({
  57. id: 'OpenLessonPlanOfElectiveform',
  58. title: '设置人数',
  59. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/Form?keyValue=' + keyValue,
  60. width: 600,
  61. height: 400,
  62. callBack: function (id) {
  63. return top[id].acceptClick(refreshGirdData);
  64. }
  65. });
  66. // } else {
  67. // learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
  68. // $('#lr_edit').hide();
  69. // }
  70. //});
  71. }
  72. });
  73. //查看学生
  74. $('#lr_view').on('click', function () {
  75. var keyValue = $('#gridtable').jfGridValue('Id');
  76. if (learun.checkrow(keyValue)) {
  77. learun.layerForm({
  78. id: 'form',
  79. title: '查看学生',
  80. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/FinishIndex?OLPEId=' + keyValue,
  81. width: 1000,
  82. height: 700,
  83. btn: null,
  84. end: function () {
  85. refreshGirdData();
  86. }
  87. });
  88. }
  89. });
  90. //审核学生
  91. $('#lr_audit').on('click', function () {
  92. var keyValue = $('#gridtable').jfGridValue('Id');
  93. if (learun.checkrow(keyValue)) {
  94. learun.layerForm({
  95. id: 'form',
  96. title: '审核学生',
  97. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/AuditIndex?OLPEId=' + keyValue,
  98. width: 1000,
  99. height: 700,
  100. btn: null,
  101. end: function () {
  102. refreshGirdData();
  103. }
  104. });
  105. }
  106. });
  107. //查看已审学生(预)
  108. $('#lr_viewPre').on('click', function () {
  109. var keyValue = $('#gridtable').jfGridValue('Id');
  110. if (learun.checkrow(keyValue)) {
  111. learun.layerForm({
  112. id: 'form',
  113. title: '查看学生',
  114. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectivePre/FinishIndex?OLPEId=' + keyValue,
  115. width: 1000,
  116. height: 700,
  117. btn: null,
  118. end: function () {
  119. refreshGirdData();
  120. }
  121. });
  122. }
  123. });
  124. //审核学生(预)
  125. $('#lr_auditPre').on('click', function () {
  126. var keyValue = $('#gridtable').jfGridValue('Id');
  127. if (learun.checkrow(keyValue)) {
  128. learun.layerForm({
  129. id: 'form',
  130. title: '审核学生',
  131. url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectivePre/AuditIndex?OLPEId=' + keyValue,
  132. width: 1000,
  133. height: 700,
  134. btn: null,
  135. end: function () {
  136. refreshGirdData();
  137. }
  138. });
  139. }
  140. });
  141. //编辑
  142. $('#lr_modify').on('click', function () {
  143. var keyValue = $('#gridtable').jfGridValue('Id');
  144. if (learun.checkrow(keyValue)) {
  145. learun.layerForm({
  146. id: 'OpenLessonPlanOfElectiveModifyForm',
  147. title: '编辑',
  148. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/ModifyForm?keyValue=' + keyValue,
  149. width: 600,
  150. height: 400,
  151. callBack: function (id) {
  152. return top[id].acceptClick(refreshGirdData);
  153. }
  154. });
  155. }
  156. });
  157. },
  158. // 初始化列表
  159. initGird: function () {
  160. $('#gridtable').lrAuthorizeJfGrid({
  161. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetPageListOfMerge',
  162. headData: [
  163. { label: "学年", name: "AcademicYearNo", width: 45, align: "left" },
  164. { label: "学期", name: "Semester", width: 35, align: "left" },
  165. { label: "课程号", name: "LessonNo", width: 70, align: "left" },
  166. //{
  167. // label: "课程名称", name: "LessonNo2", width: 170, align: "left",
  168. // formatterAsync: function (callback, value, row, op, $cell) {
  169. // learun.clientdata.getAsync('custmerData', {
  170. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  171. // key: value,
  172. // keyId: 'lessonno',
  173. // callback: function (_data) {
  174. // callback(_data['lessonname']);
  175. // }
  176. // });
  177. // }
  178. //},
  179. {
  180. label: "课程名称", name: "LessonName", width: 170, align: "left"
  181. },
  182. {
  183. label: "上课节次", name: "LessonSection", width: 100, align: "left",
  184. formatter: function (cellvalue, row) {
  185. if (cellvalue.indexOf(',') == -1)
  186. return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节";
  187. else {
  188. return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1, 2) + "、" + cellvalue.slice(4) + "节";
  189. }
  190. }
  191. },
  192. { label: "上课时间", name: "LessonTime", width: 150, align: "left" },
  193. { label: "学分", name: "StudyScore", width: 50, align: "left" },
  194. { label: "教师号", name: "EmpNo", width: 75, align: "left" },
  195. {
  196. label: "教师姓名", name: "EmpNo2", width: 100, align: "left",
  197. formatterAsync: function (callback, value, row, op, $cell) {
  198. learun.clientdata.getAsync('custmerData', {
  199. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  200. key: value,
  201. keyId: 'empno',
  202. callback: function (_data) {
  203. callback(_data['empname']);
  204. }
  205. });
  206. }
  207. },
  208. {
  209. label: "教室", name: "ClassRoomNo", width: 60, align: "left",
  210. formatterAsync: function (callback, value, row, op, $cell) {
  211. learun.clientdata.getAsync('custmerData', {
  212. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  213. key: value,
  214. keyId: 'classroomno',
  215. callback: function (_data) {
  216. callback(_data['classroomname']);
  217. }
  218. });
  219. }
  220. },
  221. { label: "人数上限", name: "StuNumMax", width: 60, align: "left" },
  222. { label: "已报人数", name: "StuNumOfApply", width: 60, align: "left" },
  223. { label: "通过人数", name: "StuNum", width: 60, align: "left" },
  224. { label: "已报人数(预)", name: "StuNumOfApplyPre", width: 80, align: "left" },
  225. { label: "通过人数(预)", name: "StuNumPre", width: 80, align: "left" },
  226. {
  227. label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue,row) {
  228. if (!!row.ElectiveMajorList && row.ElectiveMajorList.length > 0) {
  229. return "<span class=\"label label-success\">是</span>";
  230. } else {
  231. return "<span class=\"label label-default\">否</span>";
  232. }
  233. }
  234. },
  235. {
  236. label: "选课专业", name: "ElectiveMajorList", width: 150, align: "left", formatter: function (cellvalue, row) {
  237. var str = "";
  238. if (!!cellvalue && cellvalue.length > 0) {
  239. for (var i = 0; i < cellvalue.length; i++) {
  240. str += cellvalue[i].Grade + "级" + cellvalue[i].MajorName;
  241. if (i != cellvalue.length - 1) {
  242. str += ",";
  243. }
  244. }
  245. }
  246. return str;
  247. }
  248. }
  249. ],
  250. mainId: 'Id',
  251. isPage: true,
  252. sidx: 'AcademicYearNo DESC, Semester DESC, LessonName ASC',
  253. sord: 'desc'
  254. });
  255. page.search();
  256. },
  257. search: function (param) {
  258. param = param || {};
  259. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  260. }
  261. };
  262. refreshGirdData = function () {
  263. page.search();
  264. };
  265. page.init();
  266. }