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

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-22 10:53
  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 + '/EducationalAdministration/CdDept/Form',
  29. width: 600,
  30. height: 400,
  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('DeptId');
  39. if (learun.checkrow(keyValue)) {
  40. if (keyValue.indexOf(',') != -1) {
  41. learun.alert.warning("只能选择一条记录进行编辑!");
  42. return;
  43. }
  44. learun.layerForm({
  45. id: 'form',
  46. title: '编辑',
  47. url: top.$.rootUrl + '/EducationalAdministration/CdDept/Form?keyValue=' + keyValue,
  48. width: 600,
  49. height: 400,
  50. callBack: function (id) {
  51. return top[id].acceptClick(refreshGirdData);
  52. }
  53. });
  54. }
  55. });
  56. // 删除
  57. $('#lr_delete').on('click', function () {
  58. var keyValue = $('#gridtable').jfGridValue('DeptId');
  59. if (learun.checkrow(keyValue)) {
  60. learun.layerConfirm('是否确认删除该项!', function (res) {
  61. if (res) {
  62. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/CdDept/DeleteForm', { keyValue: keyValue }, function () {
  63. refreshGirdData();
  64. });
  65. }
  66. });
  67. }
  68. });
  69. },
  70. // 初始化列表
  71. initGird: function () {
  72. $('#gridtable').lrAuthorizeJfGrid({
  73. url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetPageList',
  74. headData: [
  75. { label: "系部名称", name: "DeptName", width: 100, align: "left" },
  76. { label: "系部编号", name: "DeptNo", width: 100, align: "left" },
  77. {
  78. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  79. formatterAsync: function (callback, value, row, op, $cell) {
  80. learun.clientdata.getAsync('custmerData', {
  81. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  82. key: value,
  83. keyId: 'f_companyid',
  84. callback: function (_data) {
  85. callback(_data['f_fullname']);
  86. }
  87. });
  88. }
  89. },
  90. { label: "名称缩写", name: "DeptShortName", width: 100, align: "left" },
  91. { label: "英文名称", name: "DeptEnBrief", width: 100, align: "left" },
  92. { label: "排序号", name: "DeptSort", width: 100, align: "left" },
  93. { label: "系部负责人", name: "DeptDirector", width: 100, align: "left" },
  94. ],
  95. mainId: 'DeptId',
  96. isMultiselect: true,
  97. isPage: true,
  98. sidx: 'DeptSort',
  99. sord: 'ASC'
  100. });
  101. page.search();
  102. },
  103. search: function (param) {
  104. param = param || {};
  105. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  106. }
  107. };
  108. refreshGirdData = function () {
  109. page.search();
  110. };
  111. page.init();
  112. }