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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-12-17 14:29
  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. $('#AcademicYearNo').lrselect({
  21. placeholder: "请选择学年",
  22. allowSearch: true,
  23. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  24. value: 'value',
  25. text: 'text'
  26. });
  27. //学期
  28. $('#Semester').lrselect({
  29. placeholder: "请选择学年",
  30. allowSearch: true,
  31. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  32. value: 'value',
  33. text: 'text'
  34. });
  35. $('#DeptNo').lrDataSourceSelect({
  36. code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (item) {
  37. if (item) {
  38. $('#MajorNo').lrselectRefresh({
  39. allowSearch: true,
  40. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  41. param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1" }
  42. });
  43. } else {
  44. $('#MajorNo').lrselectRefresh({
  45. allowSearch: true,
  46. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  47. param: { strWhere: "CheckMark=1" }
  48. });
  49. }
  50. }
  51. });
  52. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  53. // 刷新
  54. $('#lr_refresh').on('click', function () {
  55. location.reload();
  56. });
  57. // 新增
  58. $('#lr_add').on('click', function () {
  59. learun.layerForm({
  60. id: 'form',
  61. title: '新增',
  62. url: top.$.rootUrl + '/EducationalAdministration/EATalentTrain/Form',
  63. width: 800,
  64. height: 600,
  65. callBack: function (id) {
  66. return top[id].acceptClick(refreshGirdData);
  67. }
  68. });
  69. });
  70. // 编辑
  71. $('#lr_edit').on('click', function () {
  72. var keyValue = $('#gridtable').jfGridValue('Id');
  73. if (learun.checkrow(keyValue)) {
  74. learun.layerForm({
  75. id: 'form',
  76. title: '编辑',
  77. url: top.$.rootUrl + '/EducationalAdministration/EATalentTrain/Form?keyValue=' + keyValue,
  78. width: 800,
  79. height: 600,
  80. callBack: function (id) {
  81. return top[id].acceptClick(refreshGirdData);
  82. }
  83. });
  84. }
  85. });
  86. // 删除
  87. $('#lr_delete').on('click', function () {
  88. var keyValue = $('#gridtable').jfGridValue('Id');
  89. if (learun.checkrow(keyValue)) {
  90. learun.layerConfirm('是否确认删除该项!', function (res) {
  91. if (res) {
  92. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/EATalentTrain/DeleteForm', { keyValue: keyValue }, function () {
  93. refreshGirdData();
  94. });
  95. }
  96. });
  97. }
  98. });
  99. },
  100. // 初始化列表
  101. initGird: function () {
  102. $('#gridtable').lrAuthorizeJfGrid({
  103. url: top.$.rootUrl + '/EducationalAdministration/EATalentTrain/GetPageList',
  104. headData: [
  105. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  106. { label: "学期", name: "Semester", width: 100, align: "left" },
  107. {
  108. label: "系部", name: "DeptNo", width: 100, align: "left",
  109. formatterAsync: function (callback, value, row, op, $cell) {
  110. learun.clientdata.getAsync('custmerData', {
  111. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  112. key: value,
  113. keyId: 'deptno',
  114. callback: function (_data) {
  115. callback(_data['deptname']);
  116. }
  117. });
  118. }
  119. },
  120. {
  121. label: "专业", name: "MajorNo", width: 100, align: "left",
  122. formatterAsync: function (callback, value, row, op, $cell) {
  123. learun.clientdata.getAsync('custmerData', {
  124. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  125. key: value,
  126. keyId: 'majorno',
  127. callback: function (_data) {
  128. callback(_data['majorname']);
  129. }
  130. });
  131. }
  132. },
  133. { label: "入学要求", name: "EntranceRequire", width: 150, align: "left" },
  134. { label: "修业年限", name: "YearLimit", width: 100, align: "left" },
  135. ],
  136. mainId: 'Id',
  137. isPage: true
  138. });
  139. page.search();
  140. },
  141. search: function (param) {
  142. param = param || {};
  143. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  144. }
  145. };
  146. refreshGirdData = function () {
  147. $('#gridtable').jfGridSet('reload');
  148. };
  149. page.init();
  150. }