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.
 
 
 
 
 
 

150 lines
6.2 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. //$('#StorageId').lrselect({
  17. // type: 'tree',
  18. // allowSearch: true,
  19. // url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree',
  20. // param: {},
  21. // select: function (val) {
  22. // console.log(val);
  23. // var storageId = "";
  24. // if (val) {
  25. // storageId = val.value;
  26. // }
  27. // $('#RCode').lrselectRefresh({
  28. // url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId,
  29. // text: "RCode",
  30. // value: "RId"
  31. // });
  32. // }
  33. //});
  34. ////房间
  35. //$('#RCode').lrselect({ value: 'RId', text: 'RCode' });
  36. $('#REnabled').lrDataItemSelect({ code: 'YesOrNoBit' });
  37. // 初始化左侧树形数据
  38. $('#dataTree').lrtree({
  39. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree',
  40. nodeClick: function (item) {
  41. page.search({ StorageId: item.value });
  42. }
  43. });
  44. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  45. page.search(queryJson);
  46. }, 220, 400);
  47. // 刷新
  48. $('#lr_refresh').on('click', function () {
  49. location.reload();
  50. });
  51. // 新增
  52. $('#lr_add').on('click', function () {
  53. learun.layerForm({
  54. id: 'form',
  55. title: '新增',
  56. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/Form',
  57. width: 600,
  58. height: 400,
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. });
  64. // 编辑
  65. $('#lr_edit').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('RId');
  67. if (learun.checkrow(keyValue)) {
  68. learun.layerForm({
  69. id: 'form',
  70. title: '编辑',
  71. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/Form?keyValue=' + keyValue,
  72. width: 600,
  73. height: 400,
  74. callBack: function (id) {
  75. return top[id].acceptClick(refreshGirdData);
  76. }
  77. });
  78. }
  79. });
  80. // 删除
  81. $('#lr_delete').on('click', function () {
  82. var keyValue = $('#gridtable').jfGridValue('RId');
  83. if (learun.checkrow(keyValue)) {
  84. learun.layerConfirm('是否确认删除该项!', function (res) {
  85. if (res) {
  86. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/DeleteForm', { keyValue: keyValue}, function () {
  87. refreshGirdData();
  88. });
  89. }
  90. });
  91. }
  92. });
  93. // 打印
  94. $('#lr_print').on('click', function () {
  95. $('#gridtable').jqprintTable();
  96. });
  97. },
  98. // 初始化列表
  99. initGird: function () {
  100. $('#gridtable').lrAuthorizeJfGrid({
  101. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetPageList',
  102. headData: [
  103. //{ label: "名称", name: "RName", width: 100, align: "left"},
  104. { label: "房间号", name: "RCode", width: 100, align: "left"},
  105. { label: "房间功能", name: "RFunction", width: 100, align: "left"},
  106. { label: "房间面积", name: "RArea", width: 100, align: "left" },
  107. {
  108. label: "房间状态", name: "REnabled", width: 100, align: "left",
  109. formatterAsync: function (callback, value, row, op, $cell) {
  110. learun.clientdata.getAsync('dataItem', {
  111. key: value,
  112. code: 'RoomState',
  113. callback: function (_data) {
  114. callback(_data.text);
  115. }
  116. });
  117. }
  118. },
  119. { label: "楼宇名称", name: "StorageId", width: 100, align: "left",
  120. formatterAsync: function (callback, value, row, op,$cell) {
  121. learun.clientdata.getAsync('custmerData', {
  122. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  123. key: value,
  124. keyId: 'sid',
  125. callback: function (_data) {
  126. callback(_data['sname']);
  127. }
  128. });
  129. }
  130. },
  131. ],
  132. mainId:'RId',
  133. isPage: true,
  134. sidx: 'RCode',
  135. sord: 'ASC'
  136. });
  137. page.search();
  138. },
  139. search: function (param) {
  140. param = param || {};
  141. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  142. }
  143. };
  144. refreshGirdData = function () {
  145. $('#gridtable').jfGridSet('reload');
  146. };
  147. page.init();
  148. }