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.
 
 
 
 
 
 

121 lines
4.9 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-10-26 11:05
  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. }, 220, 400);
  19. $('#AcademicYearNo').lrselect({
  20. placeholder: "学年",
  21. allowSearch: false,
  22. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. //学期
  27. $('#Semester').lrselect({
  28. placeholder: "学期",
  29. allowSearch: false,
  30. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  31. value: 'value',
  32. text: 'text'
  33. });
  34. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' });
  35. // 刷新
  36. $('#lr_refresh').on('click', function () {
  37. location.reload();
  38. });
  39. // 新增
  40. $('#lr_add').on('click', function () {
  41. learun.layerForm({
  42. id: 'form',
  43. title: '新增',
  44. url: top.$.rootUrl + '/EducationalAdministration/OLPElectiveStuSelectCount/Form',
  45. width: 600,
  46. height: 400,
  47. callBack: function (id) {
  48. return top[id].acceptClick(refreshGirdData);
  49. }
  50. });
  51. });
  52. // 编辑
  53. $('#lr_edit').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('Id');
  55. if (learun.checkrow(keyValue)) {
  56. learun.layerForm({
  57. id: 'form',
  58. title: '编辑',
  59. url: top.$.rootUrl + '/EducationalAdministration/OLPElectiveStuSelectCount/Form?keyValue=' + keyValue,
  60. width: 600,
  61. height: 400,
  62. callBack: function (id) {
  63. return top[id].acceptClick(refreshGirdData);
  64. }
  65. });
  66. }
  67. });
  68. // 删除
  69. $('#lr_delete').on('click', function () {
  70. var keyValue = $('#gridtable').jfGridValue('Id');
  71. if (learun.checkrow(keyValue)) {
  72. learun.layerConfirm('是否确认删除该项!', function (res) {
  73. if (res) {
  74. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OLPElectiveStuSelectCount/DeleteForm', { keyValue: keyValue}, function () {
  75. refreshGirdData();
  76. });
  77. }
  78. });
  79. }
  80. });
  81. // 打印
  82. $('#lr_print').on('click', function () {
  83. $('#gridtable').jqprintTable();
  84. });
  85. },
  86. // 初始化列表
  87. initGird: function () {
  88. $('#gridtable').lrAuthorizeJfGrid({
  89. url: top.$.rootUrl + '/EducationalAdministration/OLPElectiveStuSelectCount/GetPageList',
  90. headData: [
  91. { label: "学年", name: "AcademicYearNo", width: 100, align: "left"},
  92. { label: "学期", name: "Semester", width: 100, align: "left"},
  93. { label: "系部", name: "DeptNo", width: 100, align: "left",
  94. formatterAsync: function (callback, value, row, op,$cell) {
  95. learun.clientdata.getAsync('custmerData', {
  96. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  97. key: value,
  98. keyId: 'deptno',
  99. callback: function (_data) {
  100. callback(_data['deptname']);
  101. }
  102. });
  103. }},
  104. { label: "选课次数上限", name: "SelectMaxCount", width: 100, align: "left"},
  105. ],
  106. mainId:'Id',
  107. isPage: true
  108. });
  109. page.search();
  110. },
  111. search: function (param) {
  112. param = param || {};
  113. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  114. }
  115. };
  116. refreshGirdData = function () {
  117. $('#gridtable').jfGridSet('reload');
  118. };
  119. page.init();
  120. }