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.

Index.js 6.6 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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: 600,
  27. height: 520,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('ID');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Form?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_delete').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('ID');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/DeleteForm', { keyValue: keyValue }, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. // 启用
  63. $('#lr_enable').on('click', function () {
  64. var keyValue = $('#gridtable').jfGridValue('ID');
  65. if (learun.checkrow(keyValue)) {
  66. learun.layerConfirm('是否确认启用!', function (res) {
  67. if (res) {
  68. learun.postForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Enable', { keyValue: keyValue }, function () {
  69. refreshGirdData();
  70. });
  71. }
  72. });
  73. }
  74. });
  75. },
  76. // 初始化列表
  77. initGird: function () {
  78. $('#gridtable').lrAuthorizeJfGrid({
  79. url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList',
  80. headData: [
  81. { label: "上班时间", name: "WorkTime", width: 100, align: "left" },
  82. //{ label: "签到开始时间", name: "SignInStartTime", width: 100, align: "left" },
  83. //{ label: "签到结束时间", name: "SignInEndTime", width: 100, align: "left" },
  84. { label: "下班时间", name: "CloseTime", width: 100, align: "left" },
  85. //{ label: "签退开始时间", name: "SignOutStartTime", width: 100, align: "left" },
  86. //{ label: "签退结束时间", name: "SignOutEndTime", width: 100, align: "left" },
  87. { label: "打卡次数", name: "ClockTime", width: 100, align: "left" },
  88. { label: "中午签退时间", name: "NoonCloseTime", width: 100, align: "left" },
  89. { label: "中午签退开始时间", name: "SignOutStartTime2", width: 150, align: "left" },
  90. { label: "中午签退结束时间", name: "SignOutEndTime2", width: 150, align: "left" },
  91. { label: "中午签到时间", name: "NoonWorkTime", width: 100, align: "left" },
  92. { label: "中午签到开始时间", name: "SignInStartTime2", width: 150, align: "left" },
  93. { label: "中午签到结束时间", name: "SignInEndTime2", width: 150, align: "left" },
  94. { label: "允许迟到范围(分)", name: "LateOvertime", width: 100, align: "left" },
  95. { label: "允许早退范围(分)", name: "LeaveOverTime", width: 100, align: "left" },
  96. {
  97. label: "未签到,记为", name: "NoSignIn", width: 100, align: "left",
  98. formatterAsync: function (callback, value, row, op, $cell) {
  99. learun.clientdata.getAsync('dataItem', {
  100. key: value,
  101. code: 'ADStatus',
  102. callback: function (_data) {
  103. callback(_data.text);
  104. }
  105. });
  106. }
  107. },
  108. {
  109. label: "未签退,记为", name: "NoSignOut", width: 100, align: "left",
  110. formatterAsync: function (callback, value, row, op, $cell) {
  111. learun.clientdata.getAsync('dataItem', {
  112. key: value,
  113. code: 'ADStatus',
  114. callback: function (_data) {
  115. callback(_data.text);
  116. }
  117. });
  118. }
  119. },
  120. {
  121. label: "是否启用", name: "REnable", width: 100, align: "left", formatter: function (val) {
  122. return val ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  123. }
  124. },
  125. ],
  126. mainId: 'ID',
  127. isPage: true
  128. });
  129. page.search();
  130. },
  131. search: function (param) {
  132. param = param || {};
  133. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  134. }
  135. };
  136. refreshGirdData = function () {
  137. $('#gridtable').jfGridSet('reload');
  138. };
  139. page.init();
  140. }