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.
 
 
 
 
 
 

136 lines
5.6 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-09-24 10:33
  5. * 描 述:AwardAndPunishment
  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. //$('#AwardType').lrDataItemSelect({ code: 'EncouragementDegree' });
  20. $('#NatureType').lrselect({
  21. data: [{ text: "集体", value: "0" }, { text: "个人", value: "1" }],
  22. text: "text",
  23. value: "value"
  24. })
  25. $('#IsValid').lrselect({
  26. data: [{ text: "启用", value: "0" }, { text: "禁用", value: "1" }],
  27. text: "text",
  28. value: "value"
  29. })
  30. // 刷新
  31. $('#lr_refresh').on('click', function () {
  32. location.reload();
  33. });
  34. // 新增
  35. $('#lr_add').on('click', function () {
  36. learun.layerForm({
  37. id: 'form',
  38. title: '新增',
  39. url: top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/Form',
  40. width: 400,
  41. height: 250,
  42. callBack: function (id) {
  43. return top[id].acceptClick(refreshGirdData);
  44. }
  45. });
  46. });
  47. // 编辑
  48. $('#lr_edit').on('click', function () {
  49. var keyValue = $('#gridtable').jfGridValue('Id');
  50. if (learun.checkrow(keyValue)) {
  51. learun.layerForm({
  52. id: 'form',
  53. title: '编辑',
  54. url: top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/Form?keyValue=' + keyValue,
  55. width: 400,
  56. height: 250,
  57. callBack: function (id) {
  58. return top[id].acceptClick(refreshGirdData);
  59. }
  60. });
  61. }
  62. });
  63. // 删除
  64. $('#lr_delete').on('click', function () {
  65. var keyValue = $('#gridtable').jfGridValue('Id');
  66. if (learun.checkrow(keyValue)) {
  67. learun.layerConfirm('是否确认删除该项!', function (res) {
  68. if (res) {
  69. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/DeleteForm', { keyValue: keyValue }, function () {
  70. refreshGirdData();
  71. });
  72. }
  73. });
  74. }
  75. });
  76. //启用
  77. $('#lr_enabled').on('click', function () {
  78. var keyValue = $('#gridtable').jfGridValue('Id');
  79. if (learun.checkrow(keyValue)) {
  80. learun.layerConfirm('是否确认启用选择项!', function (res) {
  81. if (res) {
  82. learun.postForm(top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/EnableDisable', { keyValue: keyValue, status: "0" }, function () {
  83. refreshGirdData();
  84. });
  85. }
  86. });
  87. }
  88. });
  89. //禁用
  90. $('#lr_disabled').on('click', function () {
  91. var keyValue = $('#gridtable').jfGridValue('Id');
  92. if (learun.checkrow(keyValue)) {
  93. learun.layerConfirm('是否确认禁用选择项!', function (res) {
  94. if (res) {
  95. learun.postForm(top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/EnableDisable', { keyValue: keyValue, status: "1" }, function () {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. }
  101. });
  102. },
  103. // 初始化列表
  104. initGird: function () {
  105. $('#gridtable').lrAuthorizeJfGrid({
  106. url: top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/GetPageList',
  107. headData: [
  108. { label: "惩罚名称", name: "AwardName", width: 100, align: "left" },
  109. { label: "惩罚代码", name: "CodePrize", width: 100, align: "left" },
  110. {
  111. label: '状态', name: 'IsValid', width: 100, align: "left",
  112. formatter: function (cellvalue) {
  113. return cellvalue == "0" ? "<span class=\"label label-success\">启用</span>" :
  114. "<span class=\"label label-danger\">禁用</span>";
  115. }
  116. },
  117. ],
  118. mainId: 'Id',
  119. isMultiselect: true,
  120. isPage: true,
  121. sord: 'desc'
  122. });
  123. page.search();
  124. },
  125. search: function (param) {
  126. param = param || {};
  127. param.IsAward = '1'
  128. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  129. }
  130. };
  131. refreshGirdData = function () {
  132. $('#gridtable').jfGridSet('reload');
  133. };
  134. page.init();
  135. }