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.
 
 
 
 
 
 

164 lines
7.4 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2024-09-11 10:51
  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. $('#Acceptor').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  20. $('#UsePeople').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  21. $('#Status').lrDataItemSelect({ code: 'NewAssState' });
  22. // 刷新
  23. $('#lr_refresh').on('click', function () {
  24. location.reload();
  25. });
  26. // 新增
  27. $('#lr_add').on('click', function () {
  28. learun.layerForm({
  29. id: 'form',
  30. title: '新增',
  31. url: top.$.rootUrl + '/EducationalAdministration/FixedAssets/Form',
  32. width: 600,
  33. height: 500,
  34. callBack: function (id) {
  35. return top[id].acceptClick(refreshGirdData);
  36. }
  37. });
  38. });
  39. // 编辑
  40. $('#lr_edit').on('click', function () {
  41. var keyValue = $('#gridtable').jfGridValue('ID');
  42. if (learun.checkrow(keyValue)) {
  43. learun.layerForm({
  44. id: 'form',
  45. title: '编辑',
  46. url: top.$.rootUrl + '/EducationalAdministration/FixedAssets/Form?keyValue=' + keyValue,
  47. width: 600,
  48. height: 500,
  49. callBack: function (id) {
  50. return top[id].acceptClick(refreshGirdData);
  51. }
  52. });
  53. }
  54. });
  55. // 删除
  56. $('#lr_delete').on('click', function () {
  57. var keyValue = $('#gridtable').jfGridValue('ID');
  58. if (learun.checkrow(keyValue)) {
  59. learun.layerConfirm('是否确认删除该项!', function (res) {
  60. if (res) {
  61. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FixedAssets/DeleteForm', { keyValue: keyValue }, function () {
  62. refreshGirdData();
  63. });
  64. }
  65. });
  66. }
  67. });
  68. // 打印
  69. $('#lr_print').on('click', function () {
  70. $('#gridtable').jqprintTable();
  71. });
  72. },
  73. // 初始化列表
  74. initGird: function () {
  75. $('#gridtable').lrAuthorizeJfGrid({
  76. url: top.$.rootUrl + '/EducationalAdministration/FixedAssets/GetPageList',
  77. headData: [
  78. { label: "资产名称", name: "AssetsName", width: 200, align: "left" },
  79. { label: "生产厂家", name: "Manufacturer", width: 120, align: "left" },
  80. { label: "品牌", name: "Brand", width: 120, align: "left" },
  81. {
  82. label: "单位", name: "Unit", width: 100, align: "left",
  83. formatterAsync: function (callback, value, row, op, $cell) {
  84. learun.clientdata.getAsync('dataItem', {
  85. key: value,
  86. code: 'sldw',
  87. callback: function (_data) {
  88. callback(_data.text);
  89. }
  90. });
  91. }
  92. },
  93. { label: "数量", name: "Nuantity", width: 100, align: "left" },
  94. { label: "价值(元)", name: "Cost", width: 100, align: "left" },
  95. { label: "存放地址", name: "Address", width: 300, align: "left" },
  96. {
  97. label: "验收人", name: "Acceptor", width: 120, align: "left",
  98. formatterAsync: function (callback, value, row, op, $cell) {
  99. learun.clientdata.getAsync('custmerData', {
  100. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  101. key: value,
  102. keyId: 'empno',
  103. callback: function (_data) {
  104. callback(_data['empname']);
  105. }
  106. });
  107. }
  108. },
  109. {
  110. label: "使用管理人", name: "UsePeople", width: 120, align: "left",
  111. formatterAsync: function (callback, value, row, op, $cell) {
  112. learun.clientdata.getAsync('custmerData', {
  113. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  114. key: value,
  115. keyId: 'empno',
  116. callback: function (_data) {
  117. callback(_data['empname']);
  118. }
  119. });
  120. }
  121. },
  122. {
  123. label: "登记人", name: "Registrant", width: 120, align: "left",
  124. formatterAsync: function (callback, value, row, op, $cell) {
  125. learun.clientdata.getAsync('custmerData', {
  126. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  127. key: value,
  128. keyId: 'empno',
  129. callback: function (_data) {
  130. callback(_data['empname']);
  131. }
  132. });
  133. }
  134. },
  135. {
  136. label: "使用状态", name: "Status", width: 100, align: "left",
  137. formatterAsync: function (callback, value, row, op, $cell) {
  138. learun.clientdata.getAsync('dataItem', {
  139. key: value,
  140. code: 'NewAssState',
  141. callback: function (_data) {
  142. callback(_data.text);
  143. }
  144. });
  145. }
  146. },
  147. { label: "备注", name: "Remark", width: 200, align: "left" },
  148. ],
  149. mainId: 'ID',
  150. isPage: true
  151. });
  152. page.search();
  153. },
  154. search: function (param) {
  155. param = param || {};
  156. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  157. }
  158. };
  159. refreshGirdData = function () {
  160. $('#gridtable').jfGridSet('reload');
  161. };
  162. page.init();
  163. }