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.
 
 
 
 
 
 

100 lines
3.9 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-08-07 14:42
  5. * 描 述:基地岗位管理
  6. */
  7. var refreshGirdData;
  8. var PBID = request('PBID');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 刷新
  18. $('#lr_refresh').on('click', function () {
  19. location.reload();
  20. });
  21. // 新增
  22. $('#lr_add').on('click', function () {
  23. learun.layerForm({
  24. id: 'form',
  25. title: '新增',
  26. url: top.$.rootUrl + '/EducationalAdministration/PBPost/Form?PBID=' + PBID,
  27. width: 600,
  28. height: 400,
  29. callBack: function (id) {
  30. return top[id].acceptClick(refreshGirdData);
  31. }
  32. });
  33. });
  34. // 编辑
  35. $('#lr_edit').on('click', function () {
  36. var keyValue = $('#gridtable').jfGridValue('编号');
  37. if (learun.checkrow(keyValue)) {
  38. learun.layerForm({
  39. id: 'form',
  40. title: '编辑',
  41. url: top.$.rootUrl + '/EducationalAdministration/PBPost/Form?keyValue=' + keyValue,
  42. width: 600,
  43. height: 400,
  44. callBack: function (id) {
  45. return top[id].acceptClick(refreshGirdData);
  46. }
  47. });
  48. }
  49. });
  50. // 删除
  51. $('#lr_delete').on('click', function () {
  52. var keyValue = $('#gridtable').jfGridValue('编号');
  53. if (learun.checkrow(keyValue)) {
  54. learun.layerConfirm('是否确认删除该项!', function (res) {
  55. if (res) {
  56. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PBPost/DeleteForm', { keyValue: keyValue }, function () {
  57. refreshGirdData();
  58. });
  59. }
  60. });
  61. }
  62. });
  63. },
  64. // 初始化列表
  65. initGird: function () {
  66. $('#gridtable').lrAuthorizeJfGrid({
  67. url: top.$.rootUrl + '/EducationalAdministration/PBPost/GetPageList',
  68. headData: [
  69. { label: "岗位名称", name: "Name", width: 100, align: "left" },
  70. { label: "备注", name: "Remark", width: 100, align: "left" },
  71. {
  72. label: "基地名称", name: "PBID", width: 100, align: "left",
  73. formatterAsync: function (callback, value, row, op, $cell) {
  74. learun.clientdata.getAsync('custmerData', {
  75. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'PracticeBase',
  76. key: value,
  77. keyId: 'id',
  78. callback: function (_data) {
  79. callback(_data['name']);
  80. }
  81. });
  82. } },
  83. ],
  84. mainId: '编号',
  85. isPage: true
  86. });
  87. page.search();
  88. },
  89. search: function (param) {
  90. param = param || {};
  91. param.PBID = PBID;
  92. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  93. }
  94. };
  95. refreshGirdData = function () {
  96. page.search();
  97. };
  98. page.init();
  99. }