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 5.9 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-09-11 10:23
  5. * 描 述:资产调拨
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var processId = '';
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 刷新
  18. $('#lr_refresh').on('click', function () {
  19. location.reload();
  20. });
  21. // 新增
  22. $('#lr_add').on('click', function () {
  23. learun.layerForm({
  24. id: 'form',
  25. title: '新增',
  26. url: top.$.rootUrl + '/AssetManagementSystem/Allocation/Form',
  27. width: 600,
  28. height: 400,
  29. callBack: function (id) {
  30. var res = false;
  31. // 验证数据
  32. res = top[id].validForm();
  33. // 保存数据
  34. if (res) {
  35. processId = learun.newGuid();
  36. res = top[id].save(processId, refreshGirdData);
  37. }
  38. return res;
  39. }
  40. });
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. var keyValue = $('#gridtable').jfGridValue('F_RuleId');
  45. if (learun.checkrow(keyValue)) {
  46. learun.layerForm({
  47. id: 'form',
  48. title: '编辑',
  49. url: top.$.rootUrl + '/AssetManagementSystem/Allocation/Form?keyValue=' + keyValue,
  50. width: 600,
  51. height: 400,
  52. callBack: function (id) {
  53. var res = false;
  54. // 验证数据
  55. res = top[id].validForm();
  56. // 保存数据
  57. if (res) {
  58. res = top[id].save('', function () {
  59. page.search();
  60. });
  61. }
  62. return res;
  63. }
  64. });
  65. }
  66. });
  67. // 删除
  68. $('#lr_delete').on('click', function () {
  69. var keyValue = $('#gridtable').jfGridValue('F_RuleId');
  70. if (learun.checkrow(keyValue)) {
  71. learun.layerConfirm('是否确认删除该项!', function (res) {
  72. if (res) {
  73. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Allocation/DeleteForm', { keyValue: keyValue}, function () {
  74. refreshGirdData();
  75. });
  76. }
  77. });
  78. }
  79. });
  80. // 打印
  81. $('#lr_print').on('click', function () {
  82. $('#gridtable').jqprintTable();
  83. });
  84. //  提交审核
  85. $('#lr_refer').on('click', function () {
  86. });
  87. //  查看
  88. $('#lr_view').on('click', function () {
  89. });
  90. },
  91. // 初始化列表
  92. initGird: function () {
  93. $('#gridtable').lrAuthorizeJfGrid({
  94. url: top.$.rootUrl + '/AssetManagementSystem/Allocation/GetPageList',
  95. headData: [
  96. { label: "调出地点", name: "ALLocation", width: 100, align: "left",
  97. formatterAsync: function (callback, value, row, op,$cell) {
  98. learun.clientdata.getAsync('custmerData', {
  99. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  100. key: value,
  101. keyId: 'sid',
  102. callback: function (_data) {
  103. callback(_data['sname']);
  104. }
  105. });
  106. }},
  107. { label: "调入地点", name: "ALLocationIn", width: 100, align: "left",
  108. formatterAsync: function (callback, value, row, op,$cell) {
  109. learun.clientdata.getAsync('custmerData', {
  110. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  111. key: value,
  112. keyId: 'sid',
  113. callback: function (_data) {
  114. callback(_data['sname']);
  115. }
  116. });
  117. }},
  118. { label: "调拨说明", name: "ALRemark", width: 100, align: "left"},
  119. ],
  120. mainId:'F_RuleId',
  121. isPage: true
  122. });
  123. page.search();
  124. },
  125. search: function (param) {
  126. param = param || {};
  127. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  128. }
  129. };
  130. refreshGirdData = function (res, postData) {
  131. if (res.code == 200)
  132. {
  133. // 发起流程
  134. learun.workflowapi.create({
  135. isNew: true,
  136. schemeCode: '',// 填写流程对应模板编号
  137. processId: processId,
  138. processName: '系统表单流程',// 对应流程名称
  139. processLevel: '1',
  140. description: '',
  141. formData: JSON.stringify(postData),
  142. callback: function (res, data) {
  143. }
  144. });
  145. page.search();
  146. }
  147. };
  148. page.init();
  149. }