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.
 
 
 
 
 
 

178 lines
7.3 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. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  46. page.search(queryJson);
  47. }, 220, 400);
  48. $('#F_UserId').lrUserSelect(0);
  49. // 刷新
  50. $('#lr_refresh').on('click', function () {
  51. location.reload();
  52. });
  53. // 新增
  54. $('#lr_add').on('click', function () {
  55. learun.layerFormForPercent({
  56. id: 'form',
  57. title: '新增',
  58. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/Form',
  59. width: "80%",
  60. height: "80%",
  61. callBack: function (id) {
  62. return top[id].acceptClick(refreshGirdData);
  63. }
  64. });
  65. });
  66. // 编辑
  67. $('#lr_edit').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('USId');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerFormForPercent({
  71. id: 'form',
  72. title: '编辑',
  73. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/Form?keyValue=' + keyValue,
  74. width: "80%",
  75. height: "80%",
  76. callBack: function (id) {
  77. return top[id].acceptClick(refreshGirdData);
  78. }
  79. });
  80. }
  81. });
  82. $('#lr_import').on('click',
  83. function() {
  84. learun.layerForm({
  85. id: 'form',
  86. title: '导入',
  87. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/ImportForm',
  88. width: 400,
  89. height: 300,
  90. callBack: function(id) {
  91. return top[id].acceptClick(refreshGirdData);
  92. }
  93. });
  94. });
  95. //查看
  96. $('#lr_view').on('click', function () {
  97. var keyValue = $('#gridtable').jfGridValue('USId');
  98. if (learun.checkrow(keyValue)) {
  99. learun.layerFormForPercent({
  100. id: 'form',
  101. title: '详情',
  102. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/FormView?keyValue=' + keyValue,
  103. width: "80%",
  104. height: "80%",
  105. btn:null,
  106. callBack: function (id) {
  107. return top[id].acceptClick(refreshGirdData);
  108. }
  109. });
  110. }
  111. });
  112. // 删除
  113. $('#lr_delete').on('click', function () {
  114. var keyValue = $('#gridtable').jfGridValue('USId');
  115. if (learun.checkrow(keyValue)) {
  116. learun.layerConfirm('是否确认删除该项!', function (res) {
  117. if (res) {
  118. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/DeleteForm', { keyValue: keyValue }, function () {
  119. refreshGirdData();
  120. });
  121. }
  122. });
  123. }
  124. });
  125. },
  126. // 初始化列表
  127. initGird: function () {
  128. learun.httpSync('get', top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/GetEnableTemplateInfo', {}, function (res) {
  129. var itemList = res;
  130. console.log(res);
  131. var headData = [
  132. {
  133. label: "人员", name: "F_UserId", width: 100, align: "left",
  134. formatterAsync: function (callback, value, row, op, $cell) {
  135. learun.clientdata.getAsyncReal('user', {
  136. key: value,
  137. callback: function (_data) {
  138. callback(_data.name);
  139. }
  140. });
  141. }
  142. },
  143. ];
  144. if (res) {
  145. $.each(res.ItemList, function (i, item) {
  146. var itemDetail = { label: item.STIName, name: item.STIId, width: 100, align: "left" };
  147. headData.push(itemDetail);
  148. })
  149. }
  150. headData.push({ label: "时间", name: "USDate", width: 100, align: "left" });
  151. headData.push({ label: "应发合计", name: "STAll", width: 100, align: "left" });
  152. headData.push({ label: "实发合计", name: "STActual", width: 100, align: "left" });
  153. $('#gridtable').jfGrid({
  154. url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/GetPageList',
  155. headData: headData,
  156. mainId: 'USId',
  157. isPage: true
  158. });
  159. page.search();
  160. })
  161. },
  162. search: function (param) {
  163. param = param || {};
  164. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  165. }
  166. };
  167. refreshGirdData = function () {
  168. page.search();
  169. };
  170. page.init();
  171. }