Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

208 lignes
9.2 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-29 11:22
  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/Ass_AssetsInfo/GetTree',
  19. nodeClick: function (item) {
  20. page.search({ ATId: item.value });
  21. }
  22. });
  23. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  24. page.search(queryJson);
  25. }, 220, 400);
  26. $('#ATId').lrDataSourceSelect({ code: 'Ass_AssetsType', value: 'atid', text: 'aname' });
  27. // 刷新
  28. $('#lr_refresh').on('click', function () {
  29. location.reload();
  30. });
  31. // 新增
  32. $('#lr_add').on('click', function () {
  33. learun.layerForm({
  34. id: 'form',
  35. title: '新增',
  36. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/Form',
  37. width: 860,
  38. height: 600,
  39. callBack: function (id) {
  40. return top[id].acceptClick(refreshGirdData);
  41. }
  42. });
  43. });
  44. // 编辑
  45. $('#lr_edit').on('click', function () {
  46. var keyValue = $('#gridtable').jfGridValue('AId');
  47. if (learun.checkrow(keyValue)) {
  48. learun.layerConfirm('警告!编辑资产信息将导致资产出入记录被清空请确认!', function (res) {
  49. if (res) {
  50. learun.layerForm({
  51. id: 'form',
  52. title: '编辑',
  53. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/Form?keyValue=' + keyValue,
  54. width: 860,
  55. height: 600,
  56. callBack: function (id) {
  57. return top[id].acceptClick(refreshGirdData);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. });
  64. //资产明细
  65. $('#lr_detail').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('AId');
  67. if (learun.checkrow(keyValue)) {
  68. learun.layerForm({
  69. id: 'form',
  70. title: '资产明细',
  71. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/Index?AId=' + keyValue,
  72. width: 1100,
  73. height: 700,
  74. btn: null,
  75. end: function () {
  76. refreshGirdData();
  77. }
  78. });
  79. }
  80. });
  81. //整理资产数据
  82. $("#lr_arrangement").on('click',
  83. function() {
  84. learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/ArrangementAss',
  85. {},
  86. function(res) {
  87. refreshGirdData();
  88. });
  89. });
  90. // 删除
  91. $('#lr_delete').on('click', function () {
  92. var keyValue = $('#gridtable').jfGridValue('AId');
  93. if (learun.checkrow(keyValue)) {
  94. learun.layerConfirm('是否确认删除该项!', function (res) {
  95. if (res) {
  96. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/DeleteForm', { keyValue: keyValue }, function () {
  97. refreshGirdData();
  98. });
  99. }
  100. });
  101. }
  102. });
  103. },
  104. // 初始化列表
  105. initGird: function () {
  106. $('#gridtable').lrAuthorizeJfGrid({
  107. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetPageList',
  108. headData: [
  109. { label: "资产编号", name: "ACode", width: 200, align: "left" },
  110. { label: "资产名称", name: "AName", width: 200, align: "left" },
  111. {
  112. label: "资产分类", name: "ATId", width: 100, align: "left",
  113. formatterAsync: function (callback, value, row, op, $cell) {
  114. learun.clientdata.getAsync('custmerData', {
  115. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_AssetsType',
  116. key: value,
  117. keyId: 'atid',
  118. callback: function (_data) {
  119. callback(_data['aname']);
  120. }
  121. });
  122. }
  123. },
  124. {
  125. label: "资产属性", name: "AAssType", width: 100, align: "left",
  126. formatterAsync: function (callback, value, row, op, $cell) {
  127. learun.clientdata.getAsync('dataItem', {
  128. key: value,
  129. code: 'AssType',
  130. callback: function (_data) {
  131. callback(_data.text);
  132. }
  133. });
  134. }
  135. },
  136. { label: "英文名称", name: "AEName", width: 150, align: "left" },
  137. { label: "单价", name: "APrice", width: 100, align: "left" },
  138. { label: "库存", name: "AStock", width: 100, align: "left" },
  139. {
  140. label: "数量单位", name: "AUnit", width: 80, align: "left",
  141. formatterAsync: function (callback, value, row, op, $cell) {
  142. learun.clientdata.getAsync('dataItem', {
  143. key: value,
  144. code: 'sldw',
  145. callback: function (_data) {
  146. callback(_data.text);
  147. }
  148. });
  149. }
  150. },
  151. {
  152. label: "生成明细", name: "HasDetail", width: 100, align: "left",
  153. formatter: function (cellvalue) {
  154. return (cellvalue === true || cellvalue === "true") ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  155. }
  156. },
  157. { label: "规格型号", name: "AModel", width: 150, align: "left" },
  158. { label: "生产厂家", name: "AManufacturer", width: 150, align: "left" },
  159. {
  160. label: "资产来源", name: "ASource", width: 100, align: "left",
  161. formatterAsync: function (callback, value, row, op, $cell) {
  162. learun.clientdata.getAsync('dataItem', {
  163. key: value,
  164. code: 'zcly',
  165. callback: function (_data) {
  166. callback(_data.text);
  167. }
  168. });
  169. }
  170. },
  171. {
  172. label: '供应商', name: 'ASupplierId', width: 100, align: 'left', formatterAsync: function (callback, value, row, op, $cell) {
  173. learun.clientdata.getAsync('custmerData', {
  174. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData',
  175. key: value,
  176. keyId: 'sid',
  177. callback: function (_data) {
  178. callback(_data['sname']);
  179. }
  180. });
  181. }
  182. },
  183. { label: "资产排序", name: "AOrder", width: 100, align: "left" },
  184. { label: "资产品牌", name: "ASpecification", width: 100, align: "left" },
  185. { label: "用途", name: "AUse", width: 100, align: "left" },
  186. ],
  187. mainId: 'AId',
  188. isPage: true,
  189. sidx: 'AOrder'
  190. });
  191. page.search();
  192. },
  193. search: function (param) {
  194. param = param || {};
  195. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  196. }
  197. };
  198. refreshGirdData = function () {
  199. page.search();
  200. };
  201. page.init();
  202. }