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.
 
 
 
 
 
 

111 lines
4.4 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-06-22 10:04
  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. $('#Type').lrDataItemSelect({ code: 'projectType' });
  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 + '/LR_Desktop/CalculateProject/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('Id');
  40. if (learun.checkrow(keyValue)) {
  41. learun.layerForm({
  42. id: 'form',
  43. title: '编辑',
  44. url: top.$.rootUrl + '/LR_Desktop/CalculateProject/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('Id');
  56. if (learun.checkrow(keyValue)) {
  57. learun.layerConfirm('是否确认删除该项!', function (res) {
  58. if (res) {
  59. learun.deleteForm(top.$.rootUrl + '/LR_Desktop/CalculateProject/DeleteForm', { keyValue: keyValue}, function () {
  60. refreshGirdData();
  61. });
  62. }
  63. });
  64. }
  65. });
  66. // 打印
  67. $('#lr_print').on('click', function () {
  68. $('#gridtable').jqprintTable();
  69. });
  70. },
  71. // 初始化列表
  72. initGird: function () {
  73. $('#gridtable').jfGrid({
  74. url: top.$.rootUrl + '/LR_Desktop/CalculateProject/GetPageList',
  75. headData: [
  76. { label: "计算项", name: "Name", width: 150, align: "left"},
  77. { label: "类型", name: "Type", width: 100, align: "left",
  78. formatterAsync: function (callback, value, row, op,$cell) {
  79. learun.clientdata.getAsync('dataItem', {
  80. key: value,
  81. code: 'projectType',
  82. callback: function (_data) {
  83. callback(_data.text);
  84. }
  85. });
  86. }},
  87. { label: "值", name: "Value", width: 100, align: "left"},
  88. { label: "排序", name: "Sort", width: 100, align: "left"},
  89. { label: "是否启用", name: "IsEnable", width: 100, align: "left",
  90. formatter: function (cellvalue) {
  91. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  92. }},
  93. ],
  94. mainId:'Id',
  95. isPage: true,
  96. sidx: 'Sort',
  97. sord: 'ASC',
  98. });
  99. page.search();
  100. },
  101. search: function (param) {
  102. param = param || {};
  103. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  104. }
  105. };
  106. refreshGirdData = function () {
  107. $('#gridtable').jfGridSet('reload');
  108. };
  109. page.init();
  110. }