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.
 
 
 
 
 
 

152 lines
6.3 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-03-27 17:43
  5. * 描 述:工资条模板列管理
  6. */
  7. var refreshGirdData;
  8. var stid = request('keyValue');
  9. var enable = request('enable');
  10. console.log(enable);
  11. var bootstrap = function ($, learun) {
  12. "use strict";
  13. var page = {
  14. init: function () {
  15. page.initGird();
  16. page.bind();
  17. },
  18. bind: function () {
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. if (enable == 1) {
  26. learun.alert.warning('此模板已经启用,不能编辑');
  27. return;
  28. }
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplateItem/Form?stid=' + stid,
  33. width: 600,
  34. height: 400,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. });
  40. // 编辑
  41. $('#lr_edit').on('click', function () {
  42. if (enable == 1) {
  43. learun.alert.warning('此模板已经启用,不能编辑');
  44. return;
  45. }
  46. var keyValue = $('#gridtable').jfGridValue('STIId');
  47. if (learun.checkrow(keyValue)) {
  48. learun.layerForm({
  49. id: 'form',
  50. title: '编辑',
  51. url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplateItem/Form?stid=' + stid + '&&keyValue=' + keyValue,
  52. width: 600,
  53. height: 400,
  54. callBack: function (id) {
  55. return top[id].acceptClick(refreshGirdData);
  56. }
  57. });
  58. }
  59. });
  60. // 删除
  61. $('#lr_delete').on('click', function () {
  62. if (enable == 1) {
  63. learun.alert.warning('此模板已经启用,不能编辑');
  64. return;
  65. }
  66. var keyValue = $('#gridtable').jfGridValue('STIId');
  67. if (learun.checkrow(keyValue)) {
  68. learun.layerConfirm('是否确认删除该项!', function (res) {
  69. if (res) {
  70. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplateItem/DeleteForm', { keyValue: keyValue }, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. },
  78. // 初始化列表
  79. initGird: function () {
  80. $('#gridtable').lrAuthorizeJfGrid({
  81. url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplateItem/GetPageList',
  82. headData: [
  83. {
  84. label: "模板名称", name: "STId", width: 100, align: "left",
  85. formatterAsync: function (callback, value, row, op, $cell) {
  86. learun.clientdata.getAsync('custmerData',
  87. {
  88. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Sal_SalaryTemplate',
  89. key: value,
  90. keyId: 'stid',
  91. callback: function (_data) {
  92. callback(_data['stname']);
  93. }
  94. });
  95. }
  96. },
  97. { label: "显示列名", name: "STIName", width: 100, align: "left" },
  98. {
  99. label: "是否列表显示", name: "STIShowGrid", width: 100, align: "left",
  100. formatterAsync: function (callback, value, row, op, $cell) {
  101. learun.clientdata.getAsync('dataItem', {
  102. key: value,
  103. code: 'YesOrNoBit',
  104. callback: function (_data) {
  105. callback(_data.text);
  106. }
  107. });
  108. }
  109. },
  110. {
  111. label: "增加减少(是为增)", name: "STIAdd", width: 100, align: "left",
  112. formatterAsync: function (callback, value, row, op, $cell) {
  113. learun.clientdata.getAsync('dataItem', {
  114. key: value,
  115. code: 'YesOrNoBit',
  116. callback: function (_data) {
  117. callback(_data.text);
  118. }
  119. });
  120. }
  121. },
  122. {
  123. label: "是否参与计算", name: "STIParticipation", width: 100, align: "left",
  124. formatterAsync: function (callback, value, row, op, $cell) {
  125. learun.clientdata.getAsync('dataItem', {
  126. key: value,
  127. code: 'YesOrNoBit',
  128. callback: function (_data) {
  129. callback(_data.text);
  130. }
  131. });
  132. }
  133. },
  134. { label: "排序号", name: "STIOrder", width: 100, align: "left" },
  135. ],
  136. mainId: 'STIId',
  137. isPage: true
  138. });
  139. page.search();
  140. },
  141. search: function (param) {
  142. param = param || {};
  143. param.STId = stid;
  144. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  145. }
  146. };
  147. refreshGirdData = function () {
  148. page.search();
  149. };
  150. page.init();
  151. }