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.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-12-31 10:32
  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. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. learun.layerForm({
  26. id: 'form',
  27. title: '新增',
  28. url: top.$.rootUrl + '/PersonnelManagement/PMCadre/Form',
  29. width: 1000,
  30. height: 600,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. });
  36. // 编辑
  37. $('#lr_edit').on('click', function () {
  38. var keyValue = $('#gridtable').jfGridValue('ID');
  39. if (learun.checkrow(keyValue)) {
  40. learun.layerForm({
  41. id: 'form',
  42. title: '编辑',
  43. url: top.$.rootUrl + '/PersonnelManagement/PMCadre/Form?keyValue=' + keyValue,
  44. width: 800,
  45. height: 600,
  46. callBack: function (id) {
  47. return top[id].acceptClick(refreshGirdData);
  48. }
  49. });
  50. }
  51. });
  52. // 删除
  53. $('#lr_delete').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('ID');
  55. if (learun.checkrow(keyValue)) {
  56. learun.layerConfirm('是否确认删除该项!', function (res) {
  57. if (res) {
  58. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/PMCadre/DeleteForm', { keyValue: keyValue}, function () {
  59. refreshGirdData();
  60. });
  61. }
  62. });
  63. }
  64. });
  65. },
  66. // 初始化列表
  67. initGird: function () {
  68. $('#gridtable').lrAuthorizeJfGrid({
  69. url: top.$.rootUrl + '/PersonnelManagement/PMCadre/GetPageList',
  70. headData: [
  71. { label: "代号", name: "Code", width: 100, align: "left"},
  72. { label: "姓名", name: "Name", width: 100, align: "left"},
  73. {
  74. label: "性别", name: "Gender", width: 100, align: "left",
  75. formatterAsync: function (callback, value, row, op, $cell) {
  76. learun.clientdata.getAsync('dataItem', {
  77. key: value,
  78. code: 'usersex',
  79. callback: function (_data) {
  80. callback(_data.text);
  81. }
  82. });
  83. }
  84. },
  85. {
  86. label: "民族", name: "Nation", width: 100, align: "left",
  87. formatterAsync: function (callback, value, row, op, $cell) {
  88. learun.clientdata.getAsync('dataItem', {
  89. key: value,
  90. code: 'National',
  91. callback: function (_data) {
  92. callback(_data.text);
  93. }
  94. });
  95. }
  96. },
  97. { label: "出生年月", name: "Birthday", width: 100, align: "left" },
  98. { label: "身份证号", name: "IDCard", width: 150, align: "left" },
  99. { label: "入党时间", name: "AccessionDate", width: 100, align: "left" },
  100. {
  101. label: "是否在职", name: "IsInJob", width: 100, align: "left",
  102. formatterAsync: function (callback, value, row, op, $cell) {
  103. learun.clientdata.getAsync('dataItem', {
  104. key: value,
  105. code: 'YesOrNoInt',
  106. callback: function (_data) {
  107. callback(_data.text);
  108. }
  109. });
  110. }
  111. },
  112. { label: "参加工作时间", name: "JobDate", width: 100, align: "left" },
  113. ],
  114. mainId:'ID',
  115. isPage: true
  116. });
  117. page.search();
  118. },
  119. search: function (param) {
  120. param = param || {};
  121. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  122. }
  123. };
  124. refreshGirdData = function () {
  125. page.search();
  126. };
  127. page.init();
  128. }