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.
 
 
 
 
 
 

102 lines
4.1 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-06-18 10:08
  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/StuEncourgement/Form',
  26. width: 600,
  27. height: 500,
  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/StuEncourgement/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 500,
  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/StuEncourgement/DeleteForm', { keyValue: keyValue }, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. },
  63. // 初始化列表
  64. initGird: function () {
  65. $('#gridtable').lrAuthorizeJfGrid({
  66. url: top.$.rootUrl + '/EducationalAdministration/StuEncourgement/GetPageList',
  67. headData: [
  68. { label: "学号", name: "StuNo", width: 100, align: "left" },
  69. { label: "姓名", name: "StuName", width: 100, align: "left" },
  70. { label: "奖励名称", name: "EncourgeName", width: 200, align: "left" },
  71. {
  72. label: "奖励类型", name: "AwardType", width: 100, align: "left",
  73. formatterAsync: function (callback, value, row, op, $cell) {
  74. learun.clientdata.getAsync('dataItem', {
  75. key: value,
  76. code: 'TLMAwardType',
  77. callback: function (_data) {
  78. callback(_data.text);
  79. }
  80. });
  81. }
  82. },
  83. { label: "奖励原因", name: "Reason", width: 200, align: "left" },
  84. { label: "奖励金额", name: "Fee", width: 100, align: "left" },
  85. { label: "奖励日期", name: "EncourgeDate", width: 100, align: "left" },
  86. ],
  87. mainId: 'ID',
  88. isPage: true
  89. });
  90. page.search();
  91. },
  92. search: function (param) {
  93. param = param || {};
  94. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  95. }
  96. };
  97. refreshGirdData = function () {
  98. page.search();
  99. };
  100. page.init();
  101. }