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

  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. //console.log(OLPOEId);
  49. if (learun.checkrow(keyValue)) {
  50. learun.layerConfirm('是否确认删除该项!', function (res) {
  51. if (res) {
  52. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMajor/DeleteForm', { keyValue: keyValue, OLPOEId: OLPOEId }, function () {
  53. refreshGirdData();
  54. });
  55. }
  56. });
  57. }
  58. });
  59. },
  60. // 初始化列表
  61. initGird: function () {
  62. $('#gridtablemanagemajor').lrAuthorizeJfGridLei({
  63. url: top.$.rootUrl + '/EducationalAdministration/ElectiveMajor/GetPageList',
  64. headData: [
  65. { label: "专业名称", name: "MajorName", width: 150, align: "left" },
  66. { label: "专业编号", name: "MajorNo", width: 80, align: "left" },
  67. { label: "年级", name: "Grade", width: 80, align: "left" },
  68. { label: "学制", name: "LengthOfSchooling", width: 60, align: "left" },
  69. {
  70. label: "学科门类", name: "SubjectSpeciesNo", width: 100, align: "left",
  71. formatterAsync: function (callback, value, row, op, $cell) {
  72. learun.clientdata.getAsync('dataItem', {
  73. key: value,
  74. code: 'SubjectSpecies',
  75. callback: function (_data) {
  76. callback(_data.text);
  77. }
  78. });
  79. }
  80. },
  81. {
  82. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  83. formatterAsync: function (callback, value, row, op, $cell) {
  84. learun.clientdata.getAsync('custmerData', {
  85. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  86. key: value,
  87. keyId: 'f_companyid',
  88. callback: function (_data) {
  89. callback(_data['f_fullname']);
  90. }
  91. });
  92. }
  93. },
  94. {
  95. label: "系别", name: "DeptNo", width: 100, align: "left",
  96. formatterAsync: function (callback, value, row, op, $cell) {
  97. learun.clientdata.getAsync('custmerData', {
  98. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  99. key: value,
  100. keyId: 'deptno',
  101. callback: function (_data) {
  102. callback(_data['deptname']);
  103. }
  104. });
  105. }
  106. },
  107. {
  108. label: "本专科", name: "GraduateNo", width: 100, align: "left",
  109. formatterAsync: function (callback, value, row, op, $cell) {
  110. learun.clientdata.getAsync('dataItem', {
  111. key: value,
  112. code: 'CollegeType',
  113. callback: function (_data) {
  114. callback(_data.text);
  115. }
  116. });
  117. }
  118. }
  119. ],
  120. mainId: 'ElectiveMajorId',
  121. isMultiselect: true,
  122. isPage: true,
  123. sidx: 'MajorNo',
  124. sord: 'ASC'
  125. });
  126. page.search();
  127. },
  128. search: function (param) {
  129. param = param || {};
  130. param.OLPOEId = OLPOEId;
  131. $('#gridtablemanagemajor').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  132. }
  133. };
  134. refreshGirdData = function () {
  135. page.search();
  136. };
  137. // 保存数据
  138. acceptClick = function (callBack) {
  139. if (!!callBack) {
  140. learun.layerClose(window.name);
  141. callBack();
  142. }
  143. };
  144. page.init();
  145. }