Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

134 Zeilen
5.6 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-09-17 11:30
  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/StuInfoSemster/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('StuId');
  43. selectedRow = $('#gridtable').jfGridGet('rowdata');
  44. if (learun.checkrow(keyValue)) {
  45. learun.layerForm({
  46. id: 'form',
  47. title: '编辑',
  48. url: top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/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('StuId');
  60. if (learun.checkrow(keyValue)) {
  61. learun.layerConfirm('是否确认删除该项!', function (res) {
  62. if (res) {
  63. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/DeleteForm', { keyValue: keyValue }, function () {
  64. });
  65. }
  66. });
  67. }
  68. });
  69. //注册
  70. $('#lr_zhuce').on('click', function () {
  71. var keyValue = $('#gridtable').jfGridValue('StuId');
  72. console.log(keyValue)
  73. if (learun.checkrow(keyValue)) {
  74. learun.layerConfirm('是否确认注册该项!', function (res) {
  75. if (res) {
  76. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/Zhuce', { keyValue: keyValue, status: "1" }, function () {
  77. refreshGirdData();
  78. });
  79. }
  80. });
  81. }
  82. });
  83. //取消注册
  84. $('#lr_cancel').on('click', function () {
  85. var keyValue = $('#gridtable').jfGridValue('StuId');
  86. if (learun.checkrow(keyValue)) {
  87. learun.layerConfirm('是否确认取消注册该项!', function (res) {
  88. if (res) {
  89. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/Zhuce', { keyValue: keyValue, status: "0" }, function () {
  90. refreshGirdData();
  91. });
  92. }
  93. });
  94. }
  95. });
  96. },
  97. initGird: function () {
  98. $('#gridtable').lrAuthorizeJfGrid({
  99. url: top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/GetPageList',
  100. headData: [
  101. { label: '学号', name: 'StuNo', width: 200, align: "left" },
  102. { label: '姓名', name: 'StuName', width: 200, align: "left" },
  103. { label: '专业', name: 'MajorNo', width: 200, align: "left" },
  104. { label: '班级', name: 'ClassNo', width: 200, align: "left" },
  105. { label: '学年', name: 'AcademicYearNo', width: 200, align: "left" },
  106. { label: '学期', name: 'Semester', width: 200, align: "left" },
  107. {
  108. label: '注册状态', name: 'Status', width: 100, align: "left",
  109. formatter: function (cellvalue) {
  110. return cellvalue == "1" ? "<span class=\"label label-success\">已注册</span>"
  111. : "<span class=\"label label-danger\">未注册</span>";
  112. }
  113. },
  114. { label: '注册时间', name: 'TIME', width: 200, align: "left" },
  115. ],
  116. mainId: 'StuId',
  117. isMultiselect: true,//复选框
  118. isPage: true
  119. });
  120. page.search();
  121. },
  122. search: function (param) {
  123. param = param || {};
  124. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  125. }
  126. };
  127. refreshGirdData = function () {
  128. $('#gridtable').jfGridSet('reload');
  129. };
  130. page.init();
  131. }