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.

Index.js 6.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-08-16 17:42
  5. * 描 述:任教管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 300, 400);
  19. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo',value: 'empno',text: 'empname' });
  20. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
  21. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  22. //学年
  23. $('#AcademicYearNo').lrselect({
  24. placeholder: "请选择学年",
  25. allowSearch: true,
  26. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  27. value: 'value',
  28. text: 'text'
  29. });
  30. //学期
  31. $('#Semester').lrselect({
  32. placeholder: "请选择学期",
  33. allowSearch: true,
  34. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  35. value: 'value',
  36. text: 'text'
  37. });
  38. // 刷新
  39. $('#lr_refresh').on('click', function () {
  40. location.reload();
  41. });
  42. // 新增
  43. $('#lr_add').on('click', function () {
  44. learun.layerForm({
  45. id: 'form',
  46. title: '新增',
  47. url: top.$.rootUrl + '/PersonnelManagement/TeachManagement/Form',
  48. width: 600,
  49. height: 400,
  50. callBack: function (id) {
  51. return top[id].acceptClick(refreshGirdData);
  52. }
  53. });
  54. });
  55. // 编辑
  56. $('#lr_edit').on('click', function () {
  57. var keyValue = $('#gridtable').jfGridValue('Id');
  58. if (learun.checkrow(keyValue)) {
  59. learun.layerForm({
  60. id: 'form',
  61. title: '编辑',
  62. url: top.$.rootUrl + '/PersonnelManagement/TeachManagement/Form?keyValue=' + keyValue,
  63. width: 600,
  64. height: 400,
  65. callBack: function (id) {
  66. return top[id].acceptClick(refreshGirdData);
  67. }
  68. });
  69. }
  70. });
  71. // 删除
  72. $('#lr_delete').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('Id');
  74. if (learun.checkrow(keyValue)) {
  75. learun.layerConfirm('是否确认删除该项!', function (res) {
  76. if (res) {
  77. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/TeachManagement/DeleteForm', { keyValue: keyValue}, function () {
  78. refreshGirdData();
  79. });
  80. }
  81. });
  82. }
  83. });
  84. },
  85. // 初始化列表
  86. initGird: function () {
  87. $('#gridtable').lrAuthorizeJfGrid({
  88. url: top.$.rootUrl + '/PersonnelManagement/TeachManagement/GetPageList',
  89. headData: [
  90. { label: "教师姓名", name: "EmpNo", width: 100, align: "left",
  91. formatterAsync: function (callback, value, row, op,$cell) {
  92. learun.clientdata.getAsync('custmerData', {
  93. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  94. key: value,
  95. keyId: 'empno',
  96. callback: function (_data) {
  97. callback(_data['empname']);
  98. }
  99. });
  100. }},
  101. { label: "学年", name: "AcademicYearNo", width: 100, align: "left"},
  102. { label: "学期", name: "Semester", width: 100, align: "left"},
  103. { label: "任课班级", name: "ClassNo", width: 100, align: "left",
  104. formatterAsync: function (callback, value, row, op,$cell) {
  105. learun.clientdata.getAsync('custmerData', {
  106. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  107. key: value,
  108. keyId: 'classno',
  109. callback: function (_data) {
  110. callback(_data['classname']);
  111. }
  112. });
  113. }},
  114. { label: "任教课程", name: "LessonNo", width: 100, align: "left",
  115. formatterAsync: function (callback, value, row, op,$cell) {
  116. learun.clientdata.getAsync('custmerData', {
  117. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  118. key: value,
  119. keyId: 'lessonno',
  120. callback: function (_data) {
  121. callback(_data['lessonname']);
  122. }
  123. });
  124. }},
  125. { label: "课时数", name: "LessonTotal", width: 100, align: "left"},
  126. ],
  127. mainId:'Id',
  128. isPage: true
  129. });
  130. page.search();
  131. },
  132. search: function (param) {
  133. param = param || {};
  134. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  135. }
  136. };
  137. refreshGirdData = function () {
  138. $('#gridtable').jfGridSet('reload');
  139. };
  140. page.init();
  141. }