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.
 
 
 
 
 
 

149 lines
6.4 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-09-24 17:38
  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. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. $('#NatureType').lrDataSourceSelect({
  20. code: 'PunishmentSource', value: 'id', text: 'awardname',
  21. });
  22. $('#StuName').lrGirdSelect({
  23. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',
  24. selectWord: 'stuno',
  25. value: 'id',
  26. text: 'name',
  27. headData:
  28. [
  29. { label: "学号", name: "stuno", width: 100, align: "left" },
  30. { label: "姓名", name: "stuname", width: 100, align: "left" },
  31. { label: "班级", name: "classno", width: 100, align: "left" },
  32. ],
  33. select: function (item) {
  34. $("#StuId").val(item.stuno);
  35. $("#StuName").val(item.stuname);
  36. $("#ClassNo").val(item.classno);
  37. }
  38. });
  39. // 刷新
  40. $('#lr_refresh').on('click', function () {
  41. location.reload();
  42. });
  43. // 新增
  44. $('#lr_add').on('click', function () {
  45. learun.layerForm({
  46. id: 'form',
  47. title: '新增',
  48. url: top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/Form',
  49. width: 600,
  50. height: 400,
  51. callBack: function (id) {
  52. return top[id].acceptClick(refreshGirdData);
  53. }
  54. });
  55. });
  56. // 编辑
  57. $('#lr_edit').on('click', function () {
  58. var keyValue = $('#gridtable').jfGridValue('Id');
  59. if (learun.checkrow(keyValue)) {
  60. learun.layerForm({
  61. id: 'form',
  62. title: '编辑',
  63. url: top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/Form?keyValue=' + keyValue,
  64. width: 600,
  65. height: 400,
  66. callBack: function (id) {
  67. return top[id].acceptClick(refreshGirdData);
  68. }
  69. });
  70. }
  71. });
  72. // 删除
  73. $('#lr_delete').on('click', function () {
  74. var keyValue = $('#gridtable').jfGridValue('Id');
  75. if (learun.checkrow(keyValue)) {
  76. learun.layerConfirm('是否确认删除该项!', function (res) {
  77. if (res) {
  78. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/DeleteForm', { keyValue: keyValue }, function () {
  79. refreshGirdData();
  80. });
  81. }
  82. });
  83. }
  84. });
  85. },
  86. // 初始化列表
  87. initGird: function () {
  88. $('#gridtable').lrAuthorizeJfGrid({
  89. url: top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/GetPageList',
  90. headData: [
  91. {
  92. label: "姓名", name: "StuName", width: 200, align: "left",
  93. formatterAsync: function (callback, value, row, op, $cell) {
  94. learun.clientdata.getAsync('custmerData', {
  95. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  96. key: value,
  97. keyId: 'stuno',
  98. callback: function (_data) {
  99. callback(_data['stuname']);
  100. }
  101. });
  102. }
  103. },
  104. { label: "学生学号", name: "StuId", width: 200, align: "left" },
  105. {
  106. label: "班级", name: "ClassNo", width: 200, align: "left",
  107. formatterAsync: function (callback, value, row, op, $cell) {
  108. learun.clientdata.getAsync('custmerData', {
  109. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  110. key: value,
  111. keyId: 'classno',
  112. callback: function (_data) {
  113. callback(_data['classname']);
  114. }
  115. });
  116. }
  117. },
  118. {
  119. label: "惩罚类型", name: "NatureType", width: 200, align: "left",
  120. formatterAsync: function (callback, value, row, op, $cell) {
  121. learun.clientdata.getAsync('custmerData', {
  122. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'PunishmentSource',
  123. key: value,
  124. keyId: 'id',
  125. callback: function (_data) {
  126. callback(_data['awardname']);
  127. }
  128. });
  129. }
  130. },
  131. { label: "惩罚时间", name: "WinningTime", width: 200, align: "left" },
  132. ],
  133. mainId: 'Id',
  134. isMultiselect: true,
  135. isPage: true
  136. });
  137. page.search();
  138. },
  139. search: function (param) {
  140. param = param || {};
  141. param.IsVaild = '1'
  142. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  143. }
  144. };
  145. refreshGirdData = function () {
  146. $('#gridtable').jfGridSet('reload');
  147. };
  148. page.init();
  149. }