25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

134 lines
5.8 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-06-17 14:54
  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. // 刷新
  17. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 新增
  21. $('#lr_add').on('click', function () {
  22. learun.layerForm({
  23. id: 'form',
  24. title: '新增',
  25. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form',
  26. width: 600,
  27. height: 450,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('Id');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 450,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 删除
  50. $('#lr_delete').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('Id');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DeleteForm', { keyValue: keyValue }, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. // 解除处分
  63. $('#lr_cancelPunish').on('click', function () {
  64. var keyValue = $('#gridtable').jfGridValue('Id');
  65. if (learun.checkrow(keyValue)) {
  66. var status = $('#gridtable').jfGridValue('IsCancelPunish');
  67. if (status == true) {
  68. learun.alert.warning("该项已解除处分!");
  69. return false;
  70. }
  71. learun.layerConfirm('是否确认解除处分该项!', function (res) {
  72. if (res) {
  73. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: true }, function () {
  74. refreshGirdData();
  75. });
  76. }
  77. });
  78. }
  79. });
  80. // 取消解除处分
  81. $('#lr_cancelPunishNot').on('click', function () {
  82. var keyValue = $('#gridtable').jfGridValue('Id');
  83. if (learun.checkrow(keyValue)) {
  84. var status = $('#gridtable').jfGridValue('IsCancelPunish');
  85. if (status != true) {
  86. learun.alert.warning("该项未解除处分,无法取消解除!");
  87. return false;
  88. }
  89. learun.layerConfirm('是否确认取消解除处分该项!', function (res) {
  90. if (res) {
  91. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: false }, function () {
  92. refreshGirdData();
  93. });
  94. }
  95. });
  96. }
  97. });
  98. },
  99. // 初始化列表
  100. initGird: function () {
  101. $('#gridtable').lrAuthorizeJfGrid({
  102. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/GetPageList',
  103. headData: [
  104. { label: "学号", name: "StuNo", width: 100, align: "left" },
  105. { label: "姓名", name: "StuName", width: 100, align: "left" },
  106. {
  107. label: "处分名称", name: "PunishName", width: 100, align: "left"
  108. },
  109. { label: "处分原因", name: "PunishReason", width: 100, align: "left" },
  110. { label: "处分日期", name: "PunishDate", width: 100, align: "left" },
  111. { label: "处分文号", name: "FileNo", width: 100, align: "left" },
  112. {
  113. label: "是否解除处分", name: "IsCancelPunish", width: 100, align: "left", formatter: function (cellvalue) {
  114. return cellvalue == true ? "是" : "否";
  115. }
  116. },
  117. { label: "解除处分日期", name: "CancelPunishDate", width: 100, align: "left" },
  118. ],
  119. mainId: 'Id',
  120. isPage: true
  121. });
  122. page.search();
  123. },
  124. search: function (param) {
  125. param = param || {};
  126. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  127. }
  128. };
  129. refreshGirdData = function () {
  130. page.search();
  131. };
  132. page.init();
  133. }