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.

Index.js 6.5 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-29 11:41
  5. * 描 述:出入库单查询
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 时间搜索框
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { 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') } },
  23. { 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') } },
  24. { 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') } }
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. dfvalue: '1',
  39. selectfn: function (begin, end) {
  40. startTime = begin;
  41. endTime = end;
  42. page.search();
  43. }
  44. });
  45. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  46. page.search(queryJson);
  47. }, 220, 400);
  48. $('#ACInOrOut').lrDataItemSelect({ code: 'InOrOut' });
  49. // 刷新
  50. $('#lr_refresh').on('click', function () {
  51. location.reload();
  52. });
  53. $('#lr_view').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('ACDetailId');
  55. if (learun.checkrow(keyValue)) {
  56. var ACInOrOut = $('#gridtable').jfGridValue('ACInOrOut');
  57. if (ACInOrOut === true) {
  58. learun.layerForm({
  59. id: 'formAss_AssetsInfoApply',
  60. title: '查看入库申请',
  61. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/FormView?keyValue=' + keyValue,
  62. width: 1000,
  63. height: 600,
  64. btn: null
  65. });
  66. } else {
  67. learun.layerForm({
  68. id: 'formAss_AssetsInfoApply',
  69. title: '查看出库申请',
  70. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/FormView?keyValue=' + keyValue,
  71. width: 1000,
  72. height: 600,
  73. btn: null
  74. });
  75. }
  76. }
  77. });
  78. },
  79. // 初始化列表
  80. initGird: function () {
  81. $('#gridtable').lrAuthorizeJfGrid({
  82. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsChange/GetPageList',
  83. headData: [
  84. { label: "出入库单流水号", name: "ACCode", width: 200, align: "left" },
  85. { label: "出入库总价", name: "ACPrice", width: 100, align: "left" },
  86. {
  87. label: "出入库原因", name: "ACReasonType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  88. learun.clientdata.getAsync('dataItem', {
  89. key: value,
  90. code: 'ReasonType',
  91. callback: function (_data) {
  92. callback(_data.text);
  93. }
  94. });
  95. }
  96. },
  97. {
  98. label: "部门", name: "ACDepartment", width: 100, align: "left",
  99. formatterAsync: function (callback, value, row, op, $cell) {
  100. learun.clientdata.getAsync('department', {
  101. key: value,
  102. callback: function (_data) {
  103. callback(_data.name);
  104. }
  105. });
  106. }
  107. },
  108. { label: "操作时间", name: "ACTime", width: 150, align: "left" },
  109. {
  110. label: "操作人", name: "ACUserId", width: 100, align: "left",
  111. formatterAsync: function (callback, value, row, op, $cell) {
  112. learun.clientdata.getAsync('user', {
  113. key: value,
  114. callback: function (_data) {
  115. callback(_data.name);
  116. }
  117. });
  118. }
  119. },
  120. {
  121. label: "出入库标志", name: "ACInOrOut", width: 100, align: "left",
  122. formatter: function (cellvalue, row) {
  123. if (cellvalue === true) {
  124. return '<span class=\"label label-success\">入库</span>';
  125. } else {
  126. return '<span class=\"label label-warning\">出库</span>';
  127. }
  128. }
  129. }
  130. ],
  131. mainId: 'ACId',
  132. isPage: true
  133. });
  134. },
  135. search: function (param) {
  136. param = param || {};
  137. param.StartTime = startTime;
  138. param.EndTime = endTime;
  139. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  140. }
  141. };
  142. refreshGirdData = function () {
  143. page.search();
  144. };
  145. page.init();
  146. }