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.
 
 
 
 
 
 

124 lines
5.2 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-26 17:03
  5. * 描 述:选修课合班明细
  6. */
  7. var weekChina = ["一", "二", "三", "四", "五", "六", "日"];
  8. var refreshGirdData;
  9. var EmId = request("EmId");
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 刷新
  19. $('#lr_refresh').on('click', function () {
  20. location.reload();
  21. });
  22. // 新增
  23. $('#lr_add').on('click', function () {
  24. learun.layerForm({
  25. id: 'form',
  26. title: '新增',
  27. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Form',
  28. width: 600,
  29. height: 400,
  30. callBack: function (id) {
  31. return top[id].acceptClick(refreshGirdData);
  32. }
  33. });
  34. });
  35. // 编辑
  36. $('#lr_edit').on('click', function () {
  37. var keyValue = $('#gridtable').jfGridValue('EMIId');
  38. if (learun.checkrow(keyValue)) {
  39. learun.layerForm({
  40. id: 'form',
  41. title: '编辑',
  42. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Form?keyValue=' + keyValue,
  43. width: 600,
  44. height: 400,
  45. callBack: function (id) {
  46. return top[id].acceptClick(refreshGirdData);
  47. }
  48. });
  49. }
  50. });
  51. // 删除
  52. $('#lr_delete').on('click', function () {
  53. var keyValue = $('#gridtable').jfGridValue('EMIId');
  54. if (learun.checkrow(keyValue)) {
  55. learun.layerConfirm('是否确认删除该项!', function (res) {
  56. if (res) {
  57. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/DeleteForm', { keyValue: keyValue}, function () {
  58. refreshGirdData();
  59. });
  60. }
  61. });
  62. }
  63. });
  64. },
  65. // 初始化列表
  66. initGird: function () {
  67. $('#gridtable').lrAuthorizeJfGridLei({
  68. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/GetPageList',
  69. headData: [
  70. {
  71. label: "上课节次", name: "LessonSection", width: 100, align: "left",
  72. formatter: function (cellvalue, row) {
  73. return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节";
  74. }
  75. },
  76. { label: "上课时间", name: "LessonTime", width: 100, align: "left"},
  77. { label: "教师编号", name: "EmpNo", width: 100, align: "left"},
  78. {
  79. label: "教师名称", name: "EmpNo", width: 100, align: "left",
  80. formatterAsync: function (callback, value, row, op, $cell) {
  81. learun.clientdata.getAsync('custmerData', {
  82. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  83. key: value,
  84. keyId: 'empno',
  85. callback: function (_data) {
  86. callback(_data['empname']);
  87. }
  88. });
  89. }
  90. },
  91. { label: "教室编号", name: "ClassRoomNo", width: 100, align: "left"},
  92. {
  93. label: "教室名称", name: "ClassRoomName", width: 100, align: "left",
  94. formatterAsync: function (callback, value, row, op, $cell) {
  95. learun.clientdata.getAsync('custmerData', {
  96. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  97. key: row.ClassRoomNo,
  98. keyId: 'classroomno',
  99. callback: function (_data) {
  100. callback(_data['classroomname']);
  101. }
  102. });
  103. }
  104. },
  105. ],
  106. mainId:'EMIId',
  107. isPage: true,
  108. sidx: 'LessonSection',
  109. sord: 'asc'
  110. });
  111. page.search();
  112. },
  113. search: function (param) {
  114. param = param || {};
  115. param.EmId = EmId;
  116. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  117. }
  118. };
  119. refreshGirdData = function () {
  120. page.search();
  121. };
  122. page.init();
  123. }