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

4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-29 16:50
  5. * 描 述:选课专业
  6. */
  7. var refreshGirdData;
  8. var acceptClick;
  9. var OLPOEId = request("OLPOEId");
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 220, 400);
  21. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  22. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  23. $('#Grade').lrselect({
  24. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  25. value: 'value',
  26. text: 'text',
  27. });
  28. // 刷新
  29. $('#lr_refresh').on('click', function () {
  30. location.reload();
  31. });
  32. // 添加专业
  33. $('#lr_add').on('click', function () {
  34. learun.layerForm({
  35. id: 'formadd',
  36. title: '添加专业',
  37. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/IndexOfElective?OLPOEId=' + OLPOEId,
  38. width: 1000,
  39. height: 700,
  40. callBack: function (id) {
  41. return top[id].acceptClick(refreshGirdData);
  42. }
  43. });
  44. });
  45. // 删除
  46. $('#lr_delete').on('click', function () {
  47. var keyValue = $('#gridtablemanagemajor').jfGridValue('ElectiveMajorId');
  48. if (learun.checkrow(keyValue)) {
  49. learun.layerConfirm('是否确认删除该项!', function (res) {
  50. if (res) {
  51. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMajor/DeleteForm', { keyValue: keyValue }, function () {
  52. refreshGirdData();
  53. });
  54. }
  55. });
  56. }
  57. });
  58. },
  59. // 初始化列表
  60. initGird: function () {
  61. $('#gridtablemanagemajor').lrAuthorizeJfGridLei({
  62. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMajor/GetPageList',
  63. headData: [
  64. { label: "专业名称", name: "MajorName", width: 150, align: "left" },
  65. { label: "专业编号", name: "MajorNo", width: 80, align: "left" },
  66. { label: "年级", name: "Grade", width: 80, align: "left" },
  67. { label: "学制", name: "LengthOfSchooling", width: 60, align: "left" },
  68. {
  69. label: "学科门类", name: "SubjectSpeciesNo", width: 100, align: "left",
  70. formatterAsync: function (callback, value, row, op, $cell) {
  71. learun.clientdata.getAsync('dataItem', {
  72. key: value,
  73. code: 'SubjectSpecies',
  74. callback: function (_data) {
  75. callback(_data.text);
  76. }
  77. });
  78. }
  79. },
  80. {
  81. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  82. formatterAsync: function (callback, value, row, op, $cell) {
  83. learun.clientdata.getAsync('custmerData', {
  84. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  85. key: value,
  86. keyId: 'f_companyid',
  87. callback: function (_data) {
  88. callback(_data['f_fullname']);
  89. }
  90. });
  91. }
  92. },
  93. {
  94. label: "系别", name: "DeptNo", width: 100, align: "left",
  95. formatterAsync: function (callback, value, row, op, $cell) {
  96. learun.clientdata.getAsync('custmerData', {
  97. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  98. key: value,
  99. keyId: 'deptno',
  100. callback: function (_data) {
  101. callback(_data['deptname']);
  102. }
  103. });
  104. }
  105. },
  106. {
  107. label: "本专科", name: "GraduateNo", width: 100, align: "left",
  108. formatterAsync: function (callback, value, row, op, $cell) {
  109. learun.clientdata.getAsync('dataItem', {
  110. key: value,
  111. code: 'CollegeType',
  112. callback: function (_data) {
  113. callback(_data.text);
  114. }
  115. });
  116. }
  117. }
  118. ],
  119. mainId: 'ElectiveMajorId',
  120. isMultiselect: true,
  121. isPage: true,
  122. sidx: 'MajorNo',
  123. sord: 'ASC'
  124. });
  125. page.search();
  126. },
  127. search: function (param) {
  128. param = param || {};
  129. param.OLPOEId = OLPOEId;
  130. $('#gridtablemanagemajor').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  131. }
  132. };
  133. refreshGirdData = function () {
  134. page.search();
  135. };
  136. // 保存数据
  137. acceptClick = function (callBack) {
  138. if (!!callBack) {
  139. learun.layerClose(window.name);
  140. callBack();
  141. }
  142. };
  143. page.init();
  144. }