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.
 
 
 
 
 
 

118 lines
4.4 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.04.17
  6. * 描 述:单据编码
  7. */
  8. var refreshGirdData; // 更新数据
  9. var selectedRow;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGrid();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 查询
  19. $('#btn_Search').on('click', function () {
  20. var keyword = $('#txt_Keyword').val();
  21. page.search({ keyword: keyword });
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. selectedRow = null;
  30. learun.layerForm({
  31. id: 'Form',
  32. title: '添加单据编码',
  33. url: top.$.rootUrl + '/LR_SystemModule/CodeRule/Form',
  34. width: 700,
  35. height: 400,
  36. callBack: function (id) {
  37. return top[id].acceptClick(refreshGirdData);
  38. }
  39. });
  40. });
  41. // 编辑
  42. $('#lr_edit').on('click', function () {
  43. selectedRow = $('#gridtable').jfGridGet('rowdata');
  44. var keyValue = $('#gridtable').jfGridValue('F_RuleId');
  45. if (learun.checkrow(keyValue)) {
  46. learun.layerForm({
  47. id: 'Form',
  48. title: '编辑单据编码',
  49. url: top.$.rootUrl + '/LR_SystemModule/CodeRule/Form',
  50. width: 700,
  51. height: 400,
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. // 删除
  59. $('#lr_delete').on('click', function () {
  60. var keyValue = $('#gridtable').jfGridValue('F_RuleId');
  61. if (learun.checkrow(keyValue)) {
  62. learun.layerConfirm('是否确认删除该项!', function (res) {
  63. if (res) {
  64. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/CodeRule/DeleteForm', { keyValue: keyValue }, function () {
  65. refreshGirdData();
  66. });
  67. }
  68. });
  69. }
  70. });
  71. },
  72. initGrid: function () {
  73. $('#gridtable').lrAuthorizeJfGrid({
  74. url: top.$.rootUrl + '/LR_SystemModule/CodeRule/GetPageList',
  75. headData: [
  76. { label: '对象编号', name: 'F_EnCode', width: 150, align: 'left' },
  77. { label: '对象名称', name: 'F_FullName', width: 200, align: 'left' },
  78. {
  79. label: '当前流水号', name: 'F_CurrentNumber', width: 150, align: 'left',
  80. formatter: function (cellvalue) {
  81. if (cellvalue) {
  82. return cellvalue;
  83. } else {
  84. return "<span class=\"label label-danger\">未使用</span>";
  85. }
  86. }
  87. },
  88. { label: '创建用户', name: 'F_CreateUserName', width: 100, align: 'left' },
  89. {
  90. label: '创建时间', name: 'F_CreateDate', width: 130, align: 'left',
  91. formatter: function (cellvalue) {
  92. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm');
  93. }
  94. },
  95. { label: "说明", name: "F_Description", width: 200, align: "left" }
  96. ],
  97. mainId: 'F_RuleId',
  98. reloadSelected: true,
  99. isPage: true
  100. });
  101. page.search();
  102. },
  103. search: function (param) {
  104. $('#gridtable').jfGridSet('reload', param);
  105. }
  106. };
  107. // 保存数据后回调刷新
  108. refreshGirdData = function () {
  109. page.search();
  110. }
  111. page.init();
  112. }