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.
 
 
 
 
 
 

120 lines
4.9 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-05-11 14:32
  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. $('#dataTree').lrtree({
  18. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree',
  19. nodeClick: function (item) {
  20. page.search({ StorageId: item.value });
  21. }
  22. });
  23. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  24. page.search(queryJson);
  25. }, 220, 400);
  26. // 刷新
  27. $('#lr_refresh').on('click', function () {
  28. location.reload();
  29. });
  30. // 新增
  31. $('#lr_add').on('click', function () {
  32. learun.layerForm({
  33. id: 'form',
  34. title: '新增',
  35. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/Form',
  36. width: 600,
  37. height: 400,
  38. callBack: function (id) {
  39. return top[id].acceptClick(refreshGirdData);
  40. }
  41. });
  42. });
  43. // 编辑
  44. $('#lr_edit').on('click', function () {
  45. var keyValue = $('#gridtable').jfGridValue('RId');
  46. if (learun.checkrow(keyValue)) {
  47. learun.layerForm({
  48. id: 'form',
  49. title: '编辑',
  50. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/Form?keyValue=' + keyValue,
  51. width: 600,
  52. height: 400,
  53. callBack: function (id) {
  54. return top[id].acceptClick(refreshGirdData);
  55. }
  56. });
  57. }
  58. });
  59. // 删除
  60. $('#lr_delete').on('click', function () {
  61. var keyValue = $('#gridtable').jfGridValue('RId');
  62. if (learun.checkrow(keyValue)) {
  63. learun.layerConfirm('是否确认删除该项!', function (res) {
  64. if (res) {
  65. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/DeleteForm', { keyValue: keyValue}, function () {
  66. refreshGirdData();
  67. });
  68. }
  69. });
  70. }
  71. });
  72. // 打印
  73. $('#lr_print').on('click', function () {
  74. $('#gridtable').jqprintTable();
  75. });
  76. },
  77. // 初始化列表
  78. initGird: function () {
  79. $('#gridtable').lrAuthorizeJfGrid({
  80. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetPageList',
  81. headData: [
  82. { label: "名称", name: "RName", width: 100, align: "left"},
  83. { label: "房间号", name: "RCode", width: 100, align: "left"},
  84. { label: "房间功能", name: "RFunction", width: 100, align: "left"},
  85. { label: "面积", name: "RArea", width: 100, align: "left" },
  86. { label: "楼宇名称", name: "StorageId", width: 100, align: "left",
  87. formatterAsync: function (callback, value, row, op,$cell) {
  88. learun.clientdata.getAsync('custmerData', {
  89. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  90. key: value,
  91. keyId: 'sid',
  92. callback: function (_data) {
  93. callback(_data['sname']);
  94. }
  95. });
  96. }
  97. },
  98. {
  99. label: "是否启用", name: "REnabled", width: 100, align: "left",
  100. formatter: function (cellvalue) {
  101. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  102. }
  103. },
  104. ],
  105. mainId:'RId',
  106. isPage: true
  107. });
  108. page.search();
  109. },
  110. search: function (param) {
  111. param = param || {};
  112. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  113. }
  114. };
  115. refreshGirdData = function () {
  116. $('#gridtable').jfGridSet('reload');
  117. };
  118. page.init();
  119. }