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.
 
 
 
 
 
 

109 lines
4.3 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-01-10 23:39
  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. $('#IsUse').lrRadioCheckbox({
  20. type: 'radio',
  21. code: 'YesOrNoBit',
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/PersonnelManagement/PunchLocation/Form',
  33. width: 600,
  34. height: 400,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. });
  40. // 编辑
  41. $('#lr_edit').on('click', function () {
  42. var keyValue = $('#gridtable').jfGridValue('Id');
  43. if (learun.checkrow(keyValue)) {
  44. learun.layerForm({
  45. id: 'form',
  46. title: '编辑',
  47. url: top.$.rootUrl + '/PersonnelManagement/PunchLocation/Form?keyValue=' + keyValue,
  48. width: 600,
  49. height: 400,
  50. callBack: function (id) {
  51. return top[id].acceptClick(refreshGirdData);
  52. }
  53. });
  54. }
  55. });
  56. // 删除
  57. $('#lr_delete').on('click', function () {
  58. var keyValue = $('#gridtable').jfGridValue('Id');
  59. if (learun.checkrow(keyValue)) {
  60. learun.layerConfirm('是否确认删除该项!', function (res) {
  61. if (res) {
  62. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/PunchLocation/DeleteForm', { keyValue: keyValue}, function () {
  63. refreshGirdData();
  64. });
  65. }
  66. });
  67. }
  68. });
  69. // 打印
  70. $('#lr_print').on('click', function () {
  71. $('#gridtable').jqprintTable();
  72. });
  73. },
  74. // 初始化列表
  75. initGird: function () {
  76. $('#gridtable').lrAuthorizeJfGrid({
  77. url: top.$.rootUrl + '/PersonnelManagement/PunchLocation/GetPageList',
  78. headData: [
  79. { label: "地点名称", name: "LocationName", width: 100, align: "left"},
  80. { label: "经度", name: "Longitude", width: 100, align: "left"},
  81. { label: "纬度", name: "Latitude", width: 100, align: "left"},
  82. { label: "半径范围(KM)", name: "Radius", width: 100, align: "left"},
  83. { label: "启用", name: "IsUse", width: 100, align: "left",
  84. formatterAsync: function (callback, value, row, op,$cell) {
  85. learun.clientdata.getAsync('dataItem', {
  86. key: value,
  87. code: 'YesOrNoBit',
  88. callback: function (_data) {
  89. callback(_data.text);
  90. }
  91. });
  92. }},
  93. ],
  94. mainId:'Id',
  95. isPage: true
  96. });
  97. page.search();
  98. },
  99. search: function (param) {
  100. param = param || {};
  101. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  102. }
  103. };
  104. refreshGirdData = function () {
  105. $('#gridtable').jfGridSet('reload');
  106. };
  107. page.init();
  108. }