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.
 
 
 
 
 
 

211 lines
9.5 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-29 11:35
  5. * 描 述:出入库明细记录
  6. */
  7. var refreshGirdData;
  8. var AIId = request("AIId");
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var startTime;
  12. var endTime;
  13. var page = {
  14. init: function () {
  15. page.initGird();
  16. page.bind();
  17. },
  18. bind: function () {
  19. // 时间搜索框
  20. $('#datesearch').lrdate({
  21. dfdata: [
  22. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  25. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  26. ],
  27. // 月
  28. mShow: false,
  29. premShow: false,
  30. // 季度
  31. jShow: false,
  32. prejShow: false,
  33. // 年
  34. ysShow: false,
  35. yxShow: false,
  36. preyShow: false,
  37. yShow: false,
  38. // 默认
  39. dfvalue: '2',
  40. selectfn: function (begin, end) {
  41. startTime = begin;
  42. endTime = end;
  43. page.search();
  44. }
  45. });
  46. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  47. page.search(queryJson);
  48. }, 220, 400);
  49. $('#ACInOrOut').lrDataItemSelect({ code: 'InOrOut' });
  50. $('#ACReasonType').lrDataItemSelect({ code: 'ReasonType' });
  51. //$('#ACCStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' });
  52. $('#AIIStorageId').lrselect({
  53. type: 'tree',
  54. allowSearch: true,
  55. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree',
  56. param: {},
  57. select: function (val) {
  58. var storageId = "";
  59. if (val) {
  60. storageId = val.value;
  61. }
  62. $('#AIIStoragePosition').lrselectRefresh({
  63. url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId,
  64. text: "RCode",
  65. value: "RId", allowSearch: true
  66. });
  67. }
  68. });
  69. //房间
  70. $('#AIIStoragePosition').lrselect({ value: 'RId', text: 'RCode', allowSearch: true });
  71. // 刷新
  72. $('#lr_refresh').on('click', function () {
  73. location.reload();
  74. });
  75. // 新增
  76. $('#lr_add').on('click', function () {
  77. learun.layerForm({
  78. id: 'form',
  79. title: '新增',
  80. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsChangeItem/Form',
  81. width: 600,
  82. height: 400,
  83. callBack: function (id) {
  84. return top[id].acceptClick(refreshGirdData);
  85. }
  86. });
  87. });
  88. // 编辑
  89. $('#lr_edit').on('click', function () {
  90. var keyValue = $('#gridtable').jfGridValue('ACIId');
  91. if (learun.checkrow(keyValue)) {
  92. learun.layerForm({
  93. id: 'form',
  94. title: '编辑',
  95. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsChangeItem/Form?keyValue=' + keyValue,
  96. width: 600,
  97. height: 400,
  98. callBack: function (id) {
  99. return top[id].acceptClick(refreshGirdData);
  100. }
  101. });
  102. }
  103. });
  104. // 删除
  105. $('#lr_delete').on('click', function () {
  106. var keyValue = $('#gridtable').jfGridValue('ACIId');
  107. if (learun.checkrow(keyValue)) {
  108. learun.layerConfirm('是否确认删除该项!', function (res) {
  109. if (res) {
  110. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsChangeItem/DeleteForm', { keyValue: keyValue }, function () {
  111. refreshGirdData();
  112. });
  113. }
  114. });
  115. }
  116. });
  117. },
  118. // 初始化列表
  119. initGird: function () {
  120. $('#gridtable').lrAuthorizeJfGrid({
  121. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsChangeItem/GetPageList',
  122. headData: [
  123. { label: "原库存", name: "ACOldStock", width: 80, align: "left" },
  124. { label: "变动数量", name: "AAmount", width: 80, align: "left" },
  125. { label: "现库存", name: "ACNewStock", width: 80, align: "left" },
  126. { label: "操作时间", name: "ACTime", width: 150, align: "left" },
  127. {
  128. label: "操作人", name: "ACUserId", width: 100, align: "left",
  129. formatterAsync: function (callback, value, row, op, $cell) {
  130. learun.clientdata.getAsync('user', {
  131. key: value,
  132. callback: function (_data) {
  133. if (!_data.name) {
  134. callback(value);
  135. } else {
  136. callback(value);
  137. }
  138. }
  139. });
  140. }
  141. },
  142. {
  143. label: "出入库标志", name: "ACInOrOut", width: 80, align: "left",
  144. formatter: function (cellvalue, row) {
  145. if (cellvalue === true) {
  146. return '<span class=\"label label-success\" >入库</span>';
  147. } else {
  148. return '<span class=\"label label-warning\" >出库</span>';
  149. }
  150. }
  151. },
  152. {
  153. label: "出入库原因", name: "ACReasonType", width: 100, align: "left",
  154. formatterAsync: function (callback, value, row, op, $cell) {
  155. learun.clientdata.getAsync('dataItem', {
  156. key: value,
  157. code: 'ReasonType',
  158. callback: function (_data) {
  159. callback(_data.text);
  160. }
  161. });
  162. }
  163. },
  164. {
  165. label: "楼宇名称", name: "ACCStorageId", width: 150, align: "left",
  166. formatterAsync: function (callback, value, row, op, $cell) {
  167. learun.clientdata.getAsync('custmerData', {
  168. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  169. key: value,
  170. keyId: 'sid',
  171. callback: function (_data) {
  172. callback(_data['sname']);
  173. }
  174. });
  175. }
  176. },
  177. //{ label: "房间号", name: "ACCStoragePosition", width: 150, align: "left" }
  178. {
  179. label: "房间号", name: "AIIStoragePosition", width: 150, align: "left",
  180. formatterAsync: function (callback, value, row, op, $cell) {
  181. learun.clientdata.getAsync('custmerData', {
  182. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_Storage_Room',
  183. key: value,
  184. keyId: 'rid',
  185. callback: function (_data) {
  186. callback(_data['rcode']);
  187. }
  188. });
  189. }
  190. },
  191. ],
  192. mainId: 'ACIId',
  193. isPage: true,
  194. sidx: 'ACTime',
  195. sord: 'desc'
  196. });
  197. },
  198. search: function (param) {
  199. param = param || {};
  200. param.StartTime = startTime;
  201. param.EndTime = endTime;
  202. param.AIId = AIId;
  203. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  204. }
  205. };
  206. refreshGirdData = function () {
  207. page.search();
  208. };
  209. page.init();
  210. }