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.
 
 
 
 
 
 

134 lines
5.6 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-11-19 16:03
  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. $("#Status").lrDataItemSelect({ code: 'EnableStatus' });
  20. // 刷新
  21. $('#lr_refresh').on('click', function () {
  22. location.reload();
  23. });
  24. // 新增
  25. $('#lr_add').on('click', function () {
  26. learun.layerForm({
  27. id: 'form',
  28. title: '新增',
  29. url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/Form',
  30. width: 800,
  31. height: 600,
  32. callBack: function (id) {
  33. return top[id].acceptClick(refreshGirdData);
  34. }
  35. });
  36. });
  37. // 编辑
  38. $('#lr_edit').on('click', function () {
  39. var keyValue = $('#gridtable').jfGridValue('ID');
  40. if (learun.checkrow(keyValue)) {
  41. learun.layerForm({
  42. id: 'form',
  43. title: '编辑',
  44. url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/Form?keyValue=' + keyValue,
  45. width: 800,
  46. height: 600,
  47. callBack: function (id) {
  48. return top[id].acceptClick(refreshGirdData);
  49. }
  50. });
  51. }
  52. });
  53. // 删除
  54. $('#lr_delete').on('click', function () {
  55. var keyValue = $('#gridtable').jfGridValue('ID');
  56. if (learun.checkrow(keyValue)) {
  57. learun.layerConfirm('是否确认删除该项!', function (res) {
  58. if (res) {
  59. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/DeleteForm', { keyValue: keyValue }, function () {
  60. refreshGirdData();
  61. });
  62. }
  63. });
  64. }
  65. });
  66. // 启用
  67. $('#lr_enable').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('ID');
  69. if (learun.checkrow(keyValue)) {
  70. var Status = $('#gridtable').jfGridValue('Status');
  71. if (Status == "1") {
  72. learun.alert.warning("当前项已启用!");
  73. return false;
  74. }
  75. learun.layerConfirm('是否确认启用该项!', function (res) {
  76. if (res) {
  77. learun.postForm(top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/DoEnable', { keyValue: keyValue, status: "1" }, function () {
  78. refreshGirdData();
  79. });
  80. }
  81. });
  82. }
  83. });
  84. // 禁用
  85. $('#lr_disable').on('click', function () {
  86. var keyValue = $('#gridtable').jfGridValue('ID');
  87. if (learun.checkrow(keyValue)) {
  88. var Status = $('#gridtable').jfGridValue('Status');
  89. if (Status != "1") {
  90. learun.alert.warning("当前项未启用!");
  91. return false;
  92. }
  93. learun.layerConfirm('是否确认禁用该项!', function (res) {
  94. if (res) {
  95. learun.postForm(top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/DoEnable', { keyValue: keyValue, status: "0" }, function () {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. }
  101. });
  102. },
  103. // 初始化列表
  104. initGird: function () {
  105. $('#gridtable').lrAuthorizeJfGrid({
  106. url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/GetPageList',
  107. headData: [
  108. { label: "场地名称", name: "Name", width: 200, align: "left" },
  109. { label: "地点", name: "Address", width: 200, align: "left" },
  110. {
  111. label: "状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue) {
  112. return cellvalue == 1 ? "启用" : "禁用";
  113. }
  114. },
  115. { label: "可容纳人数", name: "Scale", width: 100, align: "left" },
  116. { label: "添加时间", name: "CreateTime", width: 100, align: "left" },
  117. ],
  118. mainId: 'ID',
  119. isPage: true,
  120. sidx: 'CreateTime desc'
  121. });
  122. page.search();
  123. },
  124. search: function (param) {
  125. param = param || {};
  126. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  127. }
  128. };
  129. refreshGirdData = function () {
  130. page.search();
  131. };
  132. page.init();
  133. }