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.
 
 
 
 
 
 

169 lines
7.8 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-09-03 14:57
  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/ADR_Restriction/Form',
  26. width: 880,
  27. height: 960,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. //工作日配置
  34. $('#lr_day').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('ID');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'formday',
  39. title: '工作日配置',
  40. url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/FormDay?keyValue=' + keyValue,
  41. width: 600,
  42. height: 520,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 编辑
  50. $('#lr_edit').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('ID');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerForm({
  54. id: 'form',
  55. title: '编辑',
  56. url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Form?keyValue=' + keyValue,
  57. width: 880,
  58. height: 960,
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. }
  64. });
  65. // 删除
  66. $('#lr_delete').on('click', function () {
  67. var keyValue = $('#gridtable').jfGridValue('ID');
  68. if (learun.checkrow(keyValue)) {
  69. learun.layerConfirm('是否确认删除该项!', function (res) {
  70. if (res) {
  71. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/DeleteForm', { keyValue: keyValue }, function () {
  72. refreshGirdData();
  73. });
  74. }
  75. });
  76. }
  77. });
  78. // 启用
  79. $('#lr_enable').on('click', function () {
  80. var keyValue = $('#gridtable').jfGridValue('ID');
  81. if (learun.checkrow(keyValue)) {
  82. learun.layerConfirm('是否确认启用!', function (res) {
  83. if (res) {
  84. learun.postForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Enable', { keyValue: keyValue }, function () {
  85. refreshGirdData();
  86. });
  87. }
  88. });
  89. }
  90. });
  91. },
  92. // 初始化列表
  93. initGird: function () {
  94. $('#gridtable').jfGrid({
  95. url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList',
  96. headData: [
  97. { label: "上班时间", name: "WorkTime", width: 100, align: "left" },
  98. { label: "签到开始时间", name: "SignInStartTime", width: 100, align: "left" },
  99. { label: "签到结束时间", name: "SignInEndTime", width: 100, align: "left" },
  100. { label: "下班时间", name: "CloseTime", width: 100, align: "left" },
  101. { label: "签退开始时间", name: "SignOutStartTime", width: 100, align: "left" },
  102. { label: "签退结束时间", name: "SignOutEndTime", width: 100, align: "left" },
  103. { label: "打卡次数", name: "ClockTime", width: 100, align: "left" },
  104. { label: "中午签退时间", name: "NoonCloseTime", width: 100, align: "left" },
  105. { label: "中午签退开始时间", name: "SignOutStartTime2", width: 150, align: "left" },
  106. { label: "中午签退结束时间", name: "SignOutEndTime2", width: 150, align: "left" },
  107. { label: "中午签到时间", name: "NoonWorkTime", width: 100, align: "left" },
  108. { label: "中午签到开始时间", name: "SignInStartTime2", width: 150, align: "left" },
  109. { label: "中午签到结束时间", name: "SignInEndTime2", width: 150, align: "left" },
  110. { label: "允许迟到范围(分)", name: "LateOvertime", width: 100, align: "left" },
  111. { label: "允许早退范围(分)", name: "LeaveOverTime", width: 100, align: "left" },
  112. {
  113. label: "未签到,记为", name: "NoSignIn", width: 100, align: "left",
  114. formatterAsync: function (callback, value, row, op, $cell) {
  115. learun.clientdata.getAsync('dataItem', {
  116. key: value,
  117. code: 'ADStatus',
  118. callback: function (_data) {
  119. callback(_data.text);
  120. }
  121. });
  122. }
  123. },
  124. {
  125. label: "未签退,记为", name: "NoSignOut", width: 100, align: "left",
  126. formatterAsync: function (callback, value, row, op, $cell) {
  127. learun.clientdata.getAsync('dataItem', {
  128. key: value,
  129. code: 'ADStatus',
  130. callback: function (_data) {
  131. callback(_data.text);
  132. }
  133. });
  134. }
  135. },
  136. {
  137. label: "考勤人员类型", name: "AType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  138. learun.clientdata.getAsync('dataItem', {
  139. key: value,
  140. code: 'AType',
  141. callback: function (_data) {
  142. callback(_data.text);
  143. }
  144. });
  145. }
  146. },
  147. {
  148. label: "是否启用", name: "REnable", width: 100, align: "left", formatter: function (val) {
  149. return val ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  150. }
  151. },
  152. ],
  153. mainId: 'ID',
  154. isPage: true
  155. });
  156. page.search();
  157. },
  158. search: function (param) {
  159. param = param || {};
  160. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  161. }
  162. };
  163. refreshGirdData = function () {
  164. $('#gridtable').jfGridSet('reload');
  165. };
  166. page.init();
  167. }