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 4.0 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-02-27 18: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. // 刷新
  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 + '/LogisticsManagement/BC_GreenAndClean/Form',
  26. width: 600,
  27. height: 400,
  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 + '/LogisticsManagement/BC_GreenAndClean/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 400,
  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 + '/LogisticsManagement/BC_GreenAndClean/DeleteForm', { keyValue: keyValue}, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. },
  63. // 初始化列表
  64. initGird: function () {
  65. $('#gridtable').lrAuthorizeJfGrid({
  66. url: top.$.rootUrl + '/LogisticsManagement/BC_GreenAndClean/GetPageList',
  67. headData: [
  68. { label: "区域", name: "Area", width: 100, align: "left"},
  69. { label: "计划时间", name: "PlanTime", width: 100, align: "left"},
  70. { label: "是否完成", name: "IsAllRight", width: 100, align: "left",
  71. formatterAsync: function (callback, value, row, op,$cell) {
  72. learun.clientdata.getAsync('dataItem', {
  73. key: value,
  74. code: 'YesOrNoInt',
  75. callback: function (_data) {
  76. callback(_data.text);
  77. }
  78. });
  79. }},
  80. { label: "参与部门", name: "Department", width: 100, align: "left"},
  81. { label: "创建人", name: "Creater", width: 100, align: "left"},
  82. { label: "创建时间", name: "CreateTime", width: 100, align: "left"},
  83. { label: "备注", name: "Remark", width: 100, align: "left"},
  84. ],
  85. mainId:'ID',
  86. isPage: true
  87. });
  88. page.search();
  89. },
  90. search: function (param) {
  91. param = param || {};
  92. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  93. }
  94. };
  95. refreshGirdData = function () {
  96. page.search();
  97. };
  98. page.init();
  99. }