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.
 
 
 
 
 
 

148 lines
6.6 KiB

  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').jfGrid({
  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. {
  94. label: "系部负责人", name: "DeptDirector", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  95. learun.clientdata.getAsync('custmerData', {
  96. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  97. key: value,
  98. keyId: 'f_encode',
  99. callback: function (_data) {
  100. callback(_data['f_realname']);
  101. }
  102. });
  103. }
  104. },
  105. {
  106. label: "心理负责人", name: "DeptpSychology", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  107. learun.clientdata.getAsync('custmerData', {
  108. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  109. key: value,
  110. keyId: 'f_encode',
  111. callback: function (_data) {
  112. callback(_data['f_realname']);
  113. }
  114. });
  115. }
  116. },
  117. {
  118. label: "资助审核人", name: "DeptSubsidizer", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  119. learun.clientdata.getAsync('custmerData', {
  120. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  121. key: value,
  122. keyId: 'f_encode',
  123. callback: function (_data) {
  124. callback(_data['f_realname']);
  125. }
  126. });
  127. }
  128. },
  129. ],
  130. mainId: 'DeptId',
  131. isMultiselect: true,
  132. isPage: true,
  133. sidx: 'DeptSort',
  134. sord: 'ASC'
  135. });
  136. page.search();
  137. },
  138. search: function (param) {
  139. param = param || {};
  140. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  141. }
  142. };
  143. refreshGirdData = function () {
  144. page.search();
  145. };
  146. page.init();
  147. }