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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-11-07 12:26
  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. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 新增
  21. $('#lr_add').on('click', function () {
  22. learun.layerForm({
  23. id: 'form',
  24. title: '新增',
  25. url: top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/Form',
  26. width: 600,
  27. height: 400,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('Id');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 删除
  50. $('#lr_delete').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('Id');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/DeleteForm', { keyValue: keyValue}, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. // 打印
  63. $('#lr_print').on('click', function () {
  64. $('#gridtable').jqprintTable();
  65. });
  66. },
  67. // 初始化列表
  68. initGird: function () {
  69. $('#gridtable').lrAuthorizeJfGrid({
  70. url: top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/GetPageList',
  71. headData: [
  72. { label: "项目内容", name: "ProjectContent", width: 100, align: "left"},
  73. { label: "数量", name: "Number", width: 100, align: "left" },
  74. {
  75. label: '单位', name: 'Unit', width: 150, align: 'left',
  76. formatterAsync: function (callback, value, row, op, $cell) {
  77. learun.clientdata.getAsync('dataItem', {
  78. key: value,
  79. code: 'sldw',
  80. callback: function (_data) {
  81. callback(_data.text);
  82. }
  83. });
  84. }
  85. },
  86. {
  87. label: "单价(元)", name: "Price", width: 100, align: "left", formatter: function (cellvalue) {
  88. return cellvalue != null && cellvalue != "" && cellvalue != undefined ? cellvalue.toFixed(2) : "0.00";
  89. }
  90. },
  91. {
  92. label: "金额(元)", name: "Amount", width: 100, align: "left", formatter: function (cellvalue) {
  93. return cellvalue != null && cellvalue != "" && cellvalue != undefined ? cellvalue.toFixed(2) : "0.00";
  94. }
  95. },
  96. ],
  97. mainId:'Id',
  98. isPage: true
  99. });
  100. page.search();
  101. },
  102. search: function (param) {
  103. param = param || {};
  104. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  105. }
  106. };
  107. refreshGirdData = function () {
  108. $('#gridtable').jfGridSet('reload');
  109. };
  110. page.init();
  111. }