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.
 
 
 
 
 
 

111 lines
4.6 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-05-14 10:02
  5. * 描 述:选修课课程信息
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. $('.lr-form-wrap').lrscroll();
  14. page.bind();
  15. page.initData();
  16. },
  17. bind: function () {
  18. $('#AcademicYearNo').lrselect({
  19. placeholder: "学年",
  20. allowSearch: false,
  21. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  22. value: 'value',
  23. text: 'text'
  24. });
  25. //学期
  26. $('#Semester').lrselect({
  27. placeholder: "学期",
  28. allowSearch: false,
  29. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  30. value: 'value',
  31. text: 'text'
  32. });
  33. //$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  34. $('#LessonNo').lrselect({
  35. placeholder: "课程",
  36. allowSearch: true,
  37. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo&strWhere=' + 'lessonsortno=2',
  38. value: 'lessonno',
  39. text: 'lessonname'
  40. });
  41. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  42. $('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' });
  43. },
  44. initData: function () {
  45. if (!!keyValue) {
  46. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetFormData?keyValue=' + keyValue, function (data) {
  47. for (var id in data) {
  48. if (!!data[id].length && data[id].length > 0) {
  49. $('#' + id).jfGridSet('refreshdata', data[id]);
  50. }
  51. else {
  52. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  53. }
  54. //课程名称
  55. learun.clientdata.getAsync('custmerData', {
  56. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  57. key: $('#LessonNo').val(),
  58. keyId: 'lessonno',
  59. callback: function (_data) {
  60. $('#LessonName').val(_data['lessonname']);
  61. }
  62. });
  63. //教师姓名
  64. learun.clientdata.getAsync('custmerData', {
  65. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  66. key: $('#EmpNo').val(),
  67. keyId: 'empno',
  68. callback: function (_data) {
  69. $('#EmpName').val(_data['empname']);
  70. }
  71. });
  72. //教室名称
  73. learun.clientdata.getAsync('custmerData', {
  74. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  75. key: $('#ClassRoomNo').val(),
  76. keyId: 'classroomno',
  77. callback: function (_data) {
  78. $('#ClassRoomName').val(_data['classroomname']);
  79. }
  80. });
  81. }
  82. });
  83. }
  84. }
  85. };
  86. // 保存数据
  87. acceptClick = function (callBack) {
  88. if (!$('body').lrValidform()) {
  89. return false;
  90. }
  91. var strEntity = $('body').lrGetFormData();
  92. strEntity.LessonName = $('#LessonNo').lrselectGetText();
  93. strEntity.EmpName = $('#EmpNo').lrselectGetText();
  94. strEntity.ClassRoomName = $('#ClassRoomNo').lrselectGetText();
  95. var postData = {
  96. strEntity: JSON.stringify(strEntity)
  97. };
  98. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/AddForm?keyValue=' + keyValue, postData, function (res) {
  99. // 保存成功后才回调
  100. if (!!callBack) {
  101. callBack();
  102. }
  103. });
  104. };
  105. page.init();
  106. }