Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

179 wiersze
8.0 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 startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 时间搜索框
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. dfvalue: '3',
  39. selectfn: function (begin, end) {
  40. startTime = begin;
  41. endTime = end;
  42. page.search();
  43. }
  44. });
  45. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  46. page.search(queryJson);
  47. }, 200, 400);
  48. $('#PunishNo').lrDataItemSelect({ code: 'Punishment' });
  49. // 刷新
  50. $('#lr_refresh').on('click', function () {
  51. location.reload();
  52. });
  53. // 新增
  54. $('#lr_add').on('click', function () {
  55. learun.layerForm({
  56. id: 'form',
  57. title: '新增',
  58. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form',
  59. width: 600,
  60. height: 450,
  61. callBack: function (id) {
  62. return top[id].acceptClick(refreshGirdData);
  63. }
  64. });
  65. });
  66. // 编辑
  67. $('#lr_edit').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('Id');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerForm({
  71. id: 'form',
  72. title: '编辑',
  73. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form?keyValue=' + keyValue,
  74. width: 600,
  75. height: 450,
  76. callBack: function (id) {
  77. return top[id].acceptClick(refreshGirdData);
  78. }
  79. });
  80. }
  81. });
  82. // 删除
  83. $('#lr_delete').on('click', function () {
  84. var keyValue = $('#gridtable').jfGridValue('Id');
  85. if (learun.checkrow(keyValue)) {
  86. learun.layerConfirm('是否确认删除该项!', function (res) {
  87. if (res) {
  88. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DeleteForm', { keyValue: keyValue }, function () {
  89. refreshGirdData();
  90. });
  91. }
  92. });
  93. }
  94. });
  95. // 解除处分
  96. $('#lr_cancelPunish').on('click', function () {
  97. var keyValue = $('#gridtable').jfGridValue('Id');
  98. if (learun.checkrow(keyValue)) {
  99. var status = $('#gridtable').jfGridValue('IsCancelPunish');
  100. if (status == true) {
  101. learun.alert.warning("该项已解除处分!");
  102. return false;
  103. }
  104. learun.layerConfirm('是否确认解除处分该项!', function (res) {
  105. if (res) {
  106. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: true }, function () {
  107. refreshGirdData();
  108. });
  109. }
  110. });
  111. }
  112. });
  113. // 取消解除处分
  114. $('#lr_cancelPunishNot').on('click', function () {
  115. var keyValue = $('#gridtable').jfGridValue('Id');
  116. if (learun.checkrow(keyValue)) {
  117. var status = $('#gridtable').jfGridValue('IsCancelPunish');
  118. if (status != true) {
  119. learun.alert.warning("该项未解除处分,无法取消解除!");
  120. return false;
  121. }
  122. learun.layerConfirm('是否确认取消解除处分该项!', function (res) {
  123. if (res) {
  124. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: false }, function () {
  125. refreshGirdData();
  126. });
  127. }
  128. });
  129. }
  130. });
  131. },
  132. // 初始化列表
  133. initGird: function () {
  134. $('#gridtable').lrAuthorizeJfGrid({
  135. url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/GetPageList',
  136. headData: [
  137. { label: "学号", name: "StuNo", width: 200, align: "left" },
  138. { label: "姓名", name: "StuName", width: 200, align: "left" },
  139. {
  140. label: "处分名称", name: "PunishNo", width: 200, align: "left",
  141. formatterAsync: function (callback, value, row, op, $cell) {
  142. learun.clientdata.getAsync('dataItem', {
  143. key: value,
  144. code: 'Punishment',
  145. callback: function (_data) {
  146. callback(_data.text);
  147. }
  148. });
  149. }
  150. },
  151. { label: "处分原因", name: "PunishReason", width: 300, align: "left" },
  152. { label: "处分日期", name: "PunishDate", width: 200, align: "left" },
  153. { label: "处分文号", name: "FileNo", width: 200, align: "left" },
  154. {
  155. label: "是否解除处分", name: "IsCancelPunish", width: 100, align: "left", formatter: function (cellvalue) {
  156. return cellvalue == true ? "是" : "否";
  157. }
  158. },
  159. { label: "解除处分日期", name: "CancelPunishDate", width: 200, align: "left" },
  160. ],
  161. mainId: 'Id',
  162. isPage: true
  163. });
  164. page.search();
  165. },
  166. search: function (param) {
  167. param = param || {};
  168. param.StartTime = startTime;
  169. param.EndTime = endTime;
  170. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  171. }
  172. };
  173. refreshGirdData = function () {
  174. page.search();
  175. };
  176. page.init();
  177. }