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.
 
 
 
 
 
 

107 lines
4.2 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-05-05 15:44
  5. * 描 述:宿舍卫生管理
  6. */
  7. var refreshGirdData;
  8. var selectedParent = {};
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 初始化左侧树形数据
  18. $('#dataTree').lrtree({
  19. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/GetTree',
  20. nodeClick: function (item) {
  21. selectedParent.ID = item.value;
  22. selectedParent.hasChildren = item.hasChildren;
  23. selectedParent.textName = item.text;
  24. page.search({ RoomID: item.value });
  25. }
  26. });
  27. // 刷新
  28. $('#lr_refresh').on('click', function () {
  29. location.reload();
  30. });
  31. // 新增
  32. $('#lr_add').on('click', function () {
  33. if (selectedParent.hasChildren || selectedParent.textName.indexOf("室") == -1) {
  34. learun.alert.warning('请选择宿舍评分');
  35. return;
  36. }
  37. learun.layerForm({
  38. id: 'form',
  39. title: '新增',
  40. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/Form?roomID=' + selectedParent.ID,
  41. width: 600,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. });
  48. // 编辑
  49. $('#lr_edit').on('click', function () {
  50. var keyValue = $('#gridtable').jfGridValue('ID');
  51. if (learun.checkrow(keyValue)) {
  52. learun.layerForm({
  53. id: 'form',
  54. title: '编辑',
  55. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/Form?keyValue=' + keyValue,
  56. width: 600,
  57. height: 400,
  58. callBack: function (id) {
  59. return top[id].acceptClick(refreshGirdData);
  60. }
  61. });
  62. }
  63. });
  64. // 删除
  65. $('#lr_delete').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('ID');
  67. if (learun.checkrow(keyValue)) {
  68. learun.layerConfirm('是否确认删除该项!', function (res) {
  69. if (res) {
  70. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Sanitation/DeleteForm', { keyValue: keyValue }, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. // 打印
  78. $('#lr_print').on('click', function () {
  79. $('#gridtable').jqprintTable();
  80. });
  81. },
  82. // 初始化列表
  83. initGird: function () {
  84. $('#gridtable').lrAuthorizeJfGrid({
  85. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/GetPageList',
  86. headData: [
  87. { label: "分数", name: "Grade", width: 100, align: "left" },
  88. { label: "检查者", name: "GradedUser", width: 100, align: "left" },
  89. { label: "日期框", name: "GradedTime", width: 100, align: "left" },
  90. { label: "备注", name: "Remark", width: 100, align: "left" },
  91. ],
  92. mainId: 'ID',
  93. isPage: true
  94. });
  95. //page.search();
  96. },
  97. search: function (param) {
  98. param = param || {};
  99. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  100. }
  101. };
  102. refreshGirdData = function () {
  103. page.search({ RoomID: selectedParent.ID });
  104. };
  105. page.init();
  106. }