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

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-12-31 10:25
  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. $('#dataTree').lrtree({
  18. url: top.$.rootUrl + '/PersonnelManagement/PMOrganization/GetTree',
  19. nodeClick: function (item) {
  20. page.search({ Name: item.value });
  21. }
  22. });
  23. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  24. page.search(queryJson);
  25. }, 220, 400);
  26. // 刷新
  27. $('#lr_refresh').on('click', function () {
  28. location.reload();
  29. });
  30. // 新增
  31. $('#lr_add').on('click', function () {
  32. learun.layerForm({
  33. id: 'form',
  34. title: '新增',
  35. url: top.$.rootUrl + '/PersonnelManagement/PMOrganization/Form',
  36. width: 600,
  37. height: 400,
  38. callBack: function (id) {
  39. return top[id].acceptClick(refreshGirdData);
  40. }
  41. });
  42. });
  43. // 编辑
  44. $('#lr_edit').on('click', function () {
  45. var keyValue = $('#gridtable').jfGridValue('ID');
  46. if (learun.checkrow(keyValue)) {
  47. learun.layerForm({
  48. id: 'form',
  49. title: '编辑',
  50. url: top.$.rootUrl + '/PersonnelManagement/PMOrganization/Form?keyValue=' + keyValue,
  51. width: 600,
  52. height: 400,
  53. callBack: function (id) {
  54. return top[id].acceptClick(refreshGirdData);
  55. }
  56. });
  57. }
  58. });
  59. // 删除
  60. $('#lr_delete').on('click', function () {
  61. var keyValue = $('#gridtable').jfGridValue('ID');
  62. if (learun.checkrow(keyValue)) {
  63. learun.layerConfirm('是否确认删除该项!', function (res) {
  64. if (res) {
  65. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/PMOrganization/DeleteForm', { keyValue: keyValue}, function () {
  66. refreshGirdData();
  67. });
  68. }
  69. });
  70. }
  71. });
  72. },
  73. // 初始化列表
  74. initGird: function () {
  75. $('#gridtable').lrAuthorizeJfGrid({
  76. url: top.$.rootUrl + '/PersonnelManagement/PMOrganization/GetPageList',
  77. headData: [
  78. { label: "名称", name: "Name", width: 100, align: "left"},
  79. { label: "代号", name: "Code", width: 100, align: "left"},
  80. { label: "备注", name: "Remark", width: 100, align: "left"},
  81. ],
  82. mainId:'ID',
  83. isPage: true
  84. });
  85. page.search();
  86. },
  87. search: function (param) {
  88. param = param || {};
  89. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  90. }
  91. };
  92. refreshGirdData = function () {
  93. page.search();
  94. };
  95. page.init();
  96. }