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.
 
 
 
 
 
 

187 lines
8.8 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-09-10 16:55
  5. * 描 述:选修课课程异动
  6. */
  7. var selectedRow;
  8. var refreshGirdData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 查询
  18. $('#btn_Search').on('click', function () {
  19. var keyword = $('#txt_Keyword').val();
  20. page.search({ keyword: keyword });
  21. });
  22. // 刷新
  23. $('#lr_refresh').on('click', function () {
  24. location.reload();
  25. });
  26. // 新增
  27. $('#lr_add').on('click', function () {
  28. selectedRow = null;
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElectiveChange/Form',
  33. width: 700,
  34. height: 400,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. });
  40. // 编辑
  41. $('#lr_edit').on('click', function () {
  42. var keyValue = $('#gridtable').jfGridValue('Id');
  43. selectedRow = $('#gridtable').jfGridGet('rowdata');
  44. if (learun.checkrow(keyValue)) {
  45. learun.layerForm({
  46. id: 'form',
  47. title: '编辑',
  48. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElectiveChange/Form?keyValue=' + keyValue,
  49. width: 700,
  50. height: 400,
  51. callBack: function (id) {
  52. return top[id].acceptClick(refreshGirdData);
  53. }
  54. });
  55. }
  56. });
  57. // 删除
  58. $('#lr_delete').on('click', function () {
  59. var keyValue = $('#gridtable').jfGridValue('Id');
  60. if (learun.checkrow(keyValue)) {
  61. learun.layerConfirm('是否确认删除该项!', function (res) {
  62. if (res) {
  63. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElectiveChange/DeleteForm', { keyValue: keyValue }, function () {
  64. });
  65. }
  66. });
  67. }
  68. });
  69. },
  70. initGird: function () {
  71. $('#gridtable').lrAuthorizeJfGrid({
  72. url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElectiveChange/GetPageList',
  73. headData: [
  74. //{ label: 'Id', name: 'Id', width: 100, align: "left" },
  75. //{ label: '选修课课程主键', name: 'OLPEId', width: 130, align: "left" },
  76. { label: '原课程编号', name: 'BeforeLessonNo', width: 100, align: "left" },
  77. {
  78. label: '原课程名称', name: 'BeforeLessonNo', width: 150, align: "left",
  79. formatterAsync: function (callback, value, row, op, $cell) {
  80. learun.clientdata.getAsync('custmerData', {
  81. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  82. key: value,
  83. keyId: 'lessonno',
  84. callback: function (_data) {
  85. callback(_data['lessonname']);
  86. }
  87. });
  88. }
  89. },
  90. {
  91. label: '新课程编号', name: 'AfterLessonNo', width: 100, align: "left"
  92. },
  93. {
  94. label: '新课程名称', name: 'AfterLessonNo', width: 150, align: "left",
  95. formatterAsync: function (callback, value, row, op, $cell) {
  96. learun.clientdata.getAsync('custmerData', {
  97. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  98. key: value,
  99. keyId: 'lessonno',
  100. callback: function (_data) {
  101. callback(_data['lessonname']);
  102. }
  103. });
  104. }
  105. },
  106. { label: '原教师编号', name: 'BeforeEmpNo', width: 100, align: "left" },
  107. {
  108. label: '原教师名称', name: 'BeforeEmpNo', width: 100, align: "left",
  109. formatterAsync: function (callback, value, row, op, $cell) {
  110. learun.clientdata.getAsync('custmerData', {
  111. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  112. key: value,
  113. keyId: 'empno',
  114. callback: function (_data) {
  115. callback(_data['empname']);
  116. }
  117. });
  118. }
  119. },
  120. {
  121. label: '新教师编号', name: 'AfterEmpNo', width: 100, align: "left"
  122. },
  123. {
  124. label: '新教师名称', name: 'AfterEmpNo', width: 100, align: "left",
  125. formatterAsync: function (callback, value, row, op, $cell) {
  126. learun.clientdata.getAsync('custmerData', {
  127. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  128. key: value,
  129. keyId: 'empno',
  130. callback: function (_data) {
  131. callback(_data['empname']);
  132. }
  133. });
  134. }
  135. },
  136. { label: '原教室编号', name: 'BeforeClassRoomNo', width: 100, align: "left" },
  137. {
  138. label: '原教室名称', name: 'BeforeClassRoomNo', width: 100, align: "left",
  139. formatterAsync: function (callback, value, row, op, $cell) {
  140. learun.clientdata.getAsync('custmerData', {
  141. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  142. key: value,
  143. keyId: 'classroomno',
  144. callback: function (_data) {
  145. callback(_data['classroomname']);
  146. }
  147. });
  148. }
  149. },
  150. {
  151. label: '新教室编号', name: 'AfterClassRoomNo', width: 100, align: "left"
  152. },
  153. {
  154. label: '新教室名称', name: 'AfterClassRoomNo', width: 100, align: "left",
  155. formatterAsync: function (callback, value, row, op, $cell) {
  156. learun.clientdata.getAsync('custmerData', {
  157. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  158. key: value,
  159. keyId: 'classroomno',
  160. callback: function (_data) {
  161. callback(_data['classroomname']);
  162. }
  163. });
  164. }
  165. },
  166. { label: '创建时间', name: 'CreateTime', width: 130, align: "left" },
  167. { label: '创建用户编号', name: 'CreateUserId', width: 100, align: "left" },
  168. { label: '创建用户名称', name: 'CreateUserName', width: 100, align: "left" },
  169. ],
  170. mainId: 'Id',
  171. isPage: true,
  172. sidx: 'CreateTime',
  173. sord: 'desc'
  174. });
  175. page.search();
  176. },
  177. search: function (param) {
  178. param = param || {};
  179. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  180. }
  181. };
  182. refreshGirdData = function () {
  183. page.search();
  184. };
  185. page.init();
  186. }