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.
 
 
 
 
 
 

159 lines
7.5 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-29 11:55
  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. $('#AOITId').lrDataSourceSelect({ code: 'Ass_AssetsType',value: 'atid',text: 'aname' });
  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 + '/AssetManagementSystem/Ass_AssetsOutItemApply/Form',
  30. width: 600,
  31. height: 400,
  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('AOIId');
  40. if (learun.checkrow(keyValue)) {
  41. learun.layerForm({
  42. id: 'form',
  43. title: '编辑',
  44. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/Form?keyValue=' + keyValue,
  45. width: 600,
  46. height: 400,
  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('AOIId');
  56. if (learun.checkrow(keyValue)) {
  57. learun.layerConfirm('是否确认删除该项!', function (res) {
  58. if (res) {
  59. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/DeleteForm', { keyValue: keyValue}, function () {
  60. refreshGirdData();
  61. });
  62. }
  63. });
  64. }
  65. });
  66. },
  67. // 初始化列表
  68. initGird: function () {
  69. $('#gridtable').lrAuthorizeJfGrid({
  70. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/GetPageList',
  71. headData: [
  72. { label: "资产编号", name: "AOICode", width: 100, align: "left"},
  73. { label: "资产名称", name: "AOIName", width: 100, align: "left"},
  74. { label: "资产类别", name: "AOITId", width: 100, align: "left",
  75. formatterAsync: function (callback, value, row, op,$cell) {
  76. learun.clientdata.getAsync('custmerData', {
  77. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_AssetsType',
  78. key: value,
  79. keyId: 'atid',
  80. callback: function (_data) {
  81. callback(_data['aname']);
  82. }
  83. });
  84. }},
  85. { label: "英文名称", name: "AOIEName", width: 100, align: "left"},
  86. { label: "资产型号", name: "AOIModel", width: 100, align: "left"},
  87. { label: "生产厂家", name: "AOIManufacturer", width: 100, align: "left"},
  88. { label: "单价", name: "AOIPrice", width: 100, align: "left"},
  89. { label: "数量", name: "AOIStock", width: 100, align: "left"},
  90. { label: "数量单位", name: "AOIUnit", width: 100, align: "left",
  91. formatterAsync: function (callback, value, row, op,$cell) {
  92. learun.clientdata.getAsync('dataItem', {
  93. key: value,
  94. code: 'sldw',
  95. callback: function (_data) {
  96. callback(_data.text);
  97. }
  98. });
  99. }},
  100. { label: "出库照片", name: "AOIPhoto", width: 100, align: "left"},
  101. { label: "资产描述", name: "AOIContent", width: 100, align: "left"},
  102. { label: "资产规格", name: "AOISpecification", width: 100, align: "left"},
  103. { label: "用途", name: "AOIUse", width: 100, align: "left"},
  104. {
  105. label: "使用人", name: "AOIUsePeople", width: 100, align: "left",
  106. formatterAsync: function (callback, value, row, op, $cell) {
  107. learun.clientdata.getAsync('custmerData', {
  108. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  109. key: value,
  110. keyId: 'f_userid',
  111. callback: function (_data) {
  112. callback(_data['f_realname']);
  113. }
  114. });
  115. }
  116. },
  117. {
  118. label: "原部门", name: "AOIOldDepartment", width: 100, align: "left",
  119. formatterAsync: function (callback, value, row, op, $cell) {
  120. learun.clientdata.getAsync('custmerData', {
  121. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  122. key: value,
  123. keyId: 'name',
  124. callback: function (_data) {
  125. callback(_data['id']);
  126. }
  127. });
  128. }
  129. },
  130. {
  131. label: "原库房", name: "AOIStorageId", width: 100, align: "left",
  132. formatterAsync: function (callback, value, row, op, $cell) {
  133. learun.clientdata.getAsync('custmerData', {
  134. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  135. key: value,
  136. keyId: 'sid',
  137. callback: function (_data) {
  138. callback(_data['sname']);
  139. }
  140. });
  141. }
  142. },
  143. ],
  144. mainId:'AOIId',
  145. isPage: true
  146. });
  147. page.search();
  148. },
  149. search: function (param) {
  150. param = param || {};
  151. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  152. }
  153. };
  154. refreshGirdData = function () {
  155. page.search();
  156. };
  157. page.init();
  158. }