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.
 
 
 
 
 
 

129 lines
5.3 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-04-21 15:42
  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. //年份
  20. $('#IssueYear').lrselect({
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. $('#IssueMonth').lrDataItemSelect({ code: 'MPMonth' });
  27. $('#Department').lrselect({
  28. type: 'tree',
  29. // 展开最大高度
  30. maxHeight: 200,
  31. // 是否允许搜索
  32. allowSearch: true,
  33. // 访问数据接口地址
  34. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  35. });
  36. // 刷新
  37. $('#lr_refresh').on('click', function () {
  38. location.reload();
  39. });
  40. // 新增
  41. $('#lr_add').on('click', function () {
  42. learun.layerForm({
  43. id: 'form',
  44. title: '新增',
  45. url: top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/Form',
  46. width: 600,
  47. height: 400,
  48. callBack: function (id) {
  49. return top[id].acceptClick(refreshGirdData);
  50. }
  51. });
  52. });
  53. // 编辑
  54. $('#lr_edit').on('click', function () {
  55. var keyValue = $('#gridtable').jfGridValue('SalaryID');
  56. if (learun.checkrow(keyValue)) {
  57. learun.layerForm({
  58. id: 'form',
  59. title: '编辑',
  60. url: top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/Form?keyValue=' + keyValue,
  61. width: 600,
  62. height: 400,
  63. callBack: function (id) {
  64. return top[id].acceptClick(refreshGirdData);
  65. }
  66. });
  67. }
  68. });
  69. // 删除
  70. $('#lr_delete').on('click', function () {
  71. var keyValue = $('#gridtable').jfGridValue('SalaryID');
  72. if (learun.checkrow(keyValue)) {
  73. learun.layerConfirm('是否确认删除该项!', function (res) {
  74. if (res) {
  75. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/DeleteForm', { keyValue: keyValue }, function () {
  76. refreshGirdData();
  77. });
  78. }
  79. });
  80. }
  81. });
  82. // 打印
  83. $('#lr_print').on('click', function () {
  84. $('#gridtable').jqprintTable();
  85. });
  86. },
  87. // 初始化列表
  88. initGird: function () {
  89. $('#gridtable').jfGrid({
  90. url: top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/GetPageList',
  91. headData: [
  92. //{ label: "姓名", name: "UserId", width: 100, align: "left" },
  93. {
  94. label: "名称", name: "UserId", width: 100, align: "left",
  95. formatterAsync: function (callback, value, row, op, $cell) {
  96. learun.clientdata.getAsync('custmerData', {
  97. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo',
  98. key: value,
  99. keyId: 'f_userid',
  100. callback: function (_data) {
  101. callback(_data['f_realname']);
  102. }
  103. });
  104. }
  105. },
  106. { label: "应发金额", name: "TotalPayAmount", width: 100, align: "left", statistics: true },
  107. { label: "实发金额", name: "FinalPayAmount", width: 100, align: "left", statistics: true },
  108. { label: "发放月份", name: "IssueMonth", width: 100, align: "left" },
  109. { label: "发放年份", name: "IssueYear", width: 100, align: "left" },
  110. { label: "备注", name: "Remark", width: 100, align: "left" },
  111. ],
  112. mainId: 'SalaryID',
  113. isPage: true,
  114. sidx: 'IssueYear desc,IssueMonth desc'
  115. });
  116. page.search();
  117. },
  118. search: function (param) {
  119. param = param || {};
  120. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  121. }
  122. };
  123. refreshGirdData = function () {
  124. $('#gridtable').jfGridSet('reload');
  125. };
  126. page.init();
  127. }