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.
 
 
 
 
 
 

133 lines
5.5 KiB

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