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.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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, index) {
  72. if (res) {
  73. learun.layerForm({
  74. id: 'form',
  75. title: '解除处分',
  76. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/CancelForm?keyValue=' + keyValue,
  77. width: 600,
  78. height: 450,
  79. callBack: function (id) {
  80. return top[id].acceptClick(refreshGirdData);
  81. }
  82. });
  83. }
  84. });
  85. }
  86. });
  87. // 取消解除处分
  88. $('#lr_cancelPunishNot').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('Id');
  90. if (learun.checkrow(keyValue)) {
  91. var status = $('#gridtable').jfGridValue('IsCancelPunish');
  92. if (status != true) {
  93. learun.alert.warning("该项未解除处分,无法取消解除!");
  94. return false;
  95. }
  96. learun.layerConfirm('是否确认取消解除处分该项!', function (res) {
  97. if (res) {
  98. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: false, File: null }, function () {
  99. refreshGirdData();
  100. });
  101. }
  102. });
  103. }
  104. });
  105. },
  106. // 初始化列表
  107. initGird: function () {
  108. $('#gridtable').lrAuthorizeJfGrid({
  109. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/GetPageList',
  110. headData: [
  111. { label: "学号", name: "StuNo", width: 100, align: "left" },
  112. { label: "姓名", name: "StuName", width: 100, align: "left" },
  113. { label: "处分名称", name: "PunishName", width: 100, align: "left" },
  114. { label: "处分原因", name: "PunishReason", width: 100, align: "left" },
  115. { label: "处分日期", name: "PunishDate", width: 100, align: "left" },
  116. { label: "处分文号", name: "FileNo", width: 100, align: "left" },
  117. {
  118. label: "是否解除处分", name: "IsCancelPunish", width: 100, align: "left", formatter: function (cellvalue) {
  119. return cellvalue == true ? "是" : "否";
  120. }
  121. },
  122. { label: "解除文号", name: "CancelFileNo", width: 100, align: "left" },
  123. { label: "解除处分日期", name: "CancelPunishDate", width: 100, align: "left" },
  124. ],
  125. mainId: 'Id',
  126. isPage: true
  127. });
  128. page.search();
  129. },
  130. search: function (param) {
  131. param = param || {};
  132. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  133. }
  134. };
  135. refreshGirdData = function () {
  136. page.search();
  137. };
  138. page.init();
  139. }