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.
 
 
 
 
 
 

111 lines
3.8 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-04-26 15:02
  5. * 描 述:学生宿舍管理
  6. */
  7. var refreshGirdData;
  8. var acceptClick;
  9. var selectedParent = {};
  10. var ParentID = request('ParentID');
  11. var bootstrap = function ($, learun) {
  12. "use strict";
  13. var page = {
  14. init: function () {
  15. page.initGird();
  16. page.bind();
  17. },
  18. bind: function () {
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. learun.layerForm({
  26. id: 'form',
  27. title: '新增',
  28. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormBed?ParentID=' + ParentID,
  29. width: 400,
  30. height: 300,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. });
  36. // 编辑
  37. $('#lr_edit').on('click', function () {
  38. var keyValue = $('#gridtable').jfGridValue('ID');
  39. if (learun.checkrow(keyValue)) {
  40. if (keyValue.indexOf(',') != -1) {
  41. learun.alert.warning("只能选择一条记录进行编辑!");
  42. return false;
  43. }
  44. learun.layerForm({
  45. id: 'form',
  46. title: '编辑',
  47. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormBed?keyValue=' + keyValue + '&ParentID=' + ParentID,
  48. width: 400,
  49. height: 300,
  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 + '/LogisticsManagement/Accommodation/DeleteBed', { keyValue: keyValue, ParentID: ParentID }, 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').jfGrid({
  77. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + ParentID,
  78. headData: [
  79. { label: "名称", name: "Name", width: 100, align: "left" },
  80. ],
  81. mainId: 'ID',
  82. isPage: false,
  83. //isMultiselect: true,
  84. //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ',
  85. //sord: 'ASC',
  86. });
  87. page.search();
  88. },
  89. search: function (param) {
  90. param = param || {};
  91. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  92. }
  93. };
  94. refreshGirdData = function () {
  95. page.search();
  96. };
  97. // 保存数据
  98. acceptClick = function (callBack) {
  99. if (!!callBack) {
  100. callBack();
  101. }
  102. };
  103. page.init();
  104. }