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.
 
 
 
 
 
 

126 lines
5.3 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-03-27 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. // 刷新
  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 + '/PersonnelManagement/Sal_SalaryTemplate/Form',
  26. width: 600,
  27. height: 400,
  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('STId');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 400,
  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('STId');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/DeleteForm', { keyValue: keyValue }, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. //启用
  63. $('#lr_enable').on('click', function () {
  64. var keyValue = $('#gridtable').jfGridValue('STId');
  65. if (learun.checkrow(keyValue)) {
  66. learun.layerConfirm('是否确认启用该项!', function (res) {
  67. if (res) {
  68. learun.httpAsync('post', top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/EnableTemplate', { keyValue: keyValue }, function () {
  69. refreshGirdData();
  70. });
  71. }
  72. });
  73. }
  74. });
  75. //模板列编辑
  76. $('#lr_columnset').on('click', function () {
  77. var keyValue = $('#gridtable').jfGridValue('STId');
  78. var enable = $("#gridtable").jfGridValue('F_EnabledMark');
  79. if (learun.checkrow(keyValue)) {
  80. learun.layerFormForPercent({
  81. id: 'columnform',
  82. title: '模板列编辑',
  83. url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplateItem/Index?enable=' + enable + '&keyValue=' + keyValue,
  84. width: '80%',
  85. height: '80%',
  86. btn: null
  87. });
  88. }
  89. });
  90. },
  91. // 初始化列表
  92. initGird: function () {
  93. $('#gridtable').lrAuthorizeJfGrid({
  94. url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/GetPageList',
  95. headData: [
  96. { label: "模板名称", name: "STName", width: 100, align: "left" },
  97. {
  98. label: "是否启用", name: "F_EnabledMark", width: 100, align: "left",
  99. formatter: function (cellvalue) {
  100. return cellvalue == '1' ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  101. }
  102. },
  103. { label: "创建人", name: "F_CreateUserId", width: 100, align: "left" },
  104. { label: "创建时间", name: "F_CreateDate", width: 100, align: "left" },
  105. { label: "创建人名字", name: "F_CreateUserName", width: 100, align: "left" },
  106. { label: "修改时间", name: "F_ModifyDate", width: 100, align: "left" },
  107. { label: "修改人名字", name: "F_ModifyUserName", width: 100, align: "left" },
  108. ],
  109. mainId: 'STId',
  110. isPage: true
  111. });
  112. page.search();
  113. },
  114. search: function (param) {
  115. param = param || {};
  116. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  117. }
  118. };
  119. refreshGirdData = function () {
  120. page.search();
  121. };
  122. page.init();
  123. }