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.
 
 
 
 
 
 

135 lines
5.5 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-03-27 17:52
  5. * 描 述:工资记录表
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 时间搜索框
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. dfvalue: '1',
  39. selectfn: function (begin, end) {
  40. startTime = begin;
  41. endTime = end;
  42. page.search();
  43. }
  44. });
  45. // 刷新
  46. $('#lr_refresh').on('click', function () {
  47. location.reload();
  48. });
  49. // 编辑
  50. $('#lr_edit').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('USId');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerFormForPercent({
  54. id: 'form',
  55. title: '编辑',
  56. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/Form?keyValue=' + keyValue,
  57. width: "80%",
  58. height: "80%",
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. }
  64. });
  65. // 查看
  66. $('#lr_view').on('click', function () {
  67. var keyValue = $('#gridtable').jfGridValue('USId');
  68. if (learun.checkrow(keyValue)) {
  69. learun.layerFormForPercent({
  70. id: 'form',
  71. title: '查看',
  72. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/FormView?keyValue=' + keyValue,
  73. width: "80%",
  74. height: "80%",
  75. btn:null,
  76. callBack: function (id) {
  77. return top[id].acceptClick(refreshGirdData);
  78. }
  79. });
  80. }
  81. });
  82. },
  83. // 初始化列表
  84. initGird: function () {
  85. learun.httpSync('get', top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/GetEnableTemplateInfo', {}, function (res) {
  86. var itemList = res;
  87. console.log(res);
  88. var headData = [
  89. {
  90. label: "人员", name: "F_UserId", width: 100, align: "left",
  91. formatterAsync: function (callback, value, row, op, $cell) {
  92. learun.clientdata.getAsync('user', {
  93. key: value,
  94. callback: function (_data) {
  95. callback(_data.name);
  96. }
  97. });
  98. }
  99. },
  100. ];
  101. if (res) {
  102. $.each(res.ItemList, function (i, item) {
  103. var itemDetail = { label: item.STIName, name: item.STIId, width: 100, align: "left" };
  104. headData.push(itemDetail);
  105. })
  106. }
  107. headData.push({ label: "时间", name: "USDate", width: 100, align: "left" });
  108. headData.push({ label: "应发合计", name: "STAll", width: 100, align: "left" });
  109. headData.push({ label: "实发合计", name: "STActual", width: 100, align: "left" });
  110. $('#gridtable').jfGrid({
  111. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/GetPageList',
  112. headData: headData,
  113. mainId: 'USId',
  114. isPage: true
  115. });
  116. page.search();
  117. })
  118. },
  119. search: function (param) {
  120. var loginInfo = top.learun.clientdata.get(['userinfo']);
  121. param = param || {};
  122. param.F_UserId = loginInfo.userId;
  123. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  124. }
  125. };
  126. refreshGirdData = function () {
  127. page.search();
  128. };
  129. page.init();
  130. }