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.
 
 
 
 
 
 

89 lines
3.7 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. $('#AfterLessonNo').lrselect({
  19. allowSearch: true,
  20. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=LessonInfo',
  21. param: { strWhere: "1=1 AND LessonSortNo='2' order by LessonNo " },
  22. value: "lessonno",
  23. text: "lessonname"
  24. });
  25. $('#AfterEmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  26. $('#AfterClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' });
  27. },
  28. initData: function () {
  29. if (!!keyValue) {
  30. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetFormData?keyValue=' + keyValue, function (data) {
  31. for (var id in data) {
  32. if (!!data[id].length && data[id].length > 0) {
  33. $('#' + id).jfGridSet('refreshdata', data[id]);
  34. }
  35. else {
  36. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  37. }
  38. //课程名称
  39. learun.clientdata.getAsync('custmerData', {
  40. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  41. key: $('#LessonNo').val(),
  42. keyId: 'lessonno',
  43. callback: function (_data) {
  44. $('#LessonName').val(_data['lessonname']);
  45. }
  46. });
  47. //教师姓名
  48. learun.clientdata.getAsync('custmerData', {
  49. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  50. key: $('#EmpNo').val(),
  51. keyId: 'empno',
  52. callback: function (_data) {
  53. $('#EmpName').val(_data['empname']);
  54. }
  55. });
  56. //教室名称
  57. learun.clientdata.getAsync('custmerData', {
  58. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  59. key: $('#ClassRoomNo').val(),
  60. keyId: 'classroomno',
  61. callback: function (_data) {
  62. $('#ClassRoomName').val(_data['classroomname']);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. }
  69. };
  70. // 保存数据
  71. acceptClick = function (callBack) {
  72. if (!$('body').lrValidform()) {
  73. return false;
  74. }
  75. var postData = {
  76. strEntity: JSON.stringify($('body').lrGetFormData())
  77. };
  78. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/SaveModifyForm?keyValue=' + keyValue, postData, function (res) {
  79. // 保存成功后才回调
  80. if (!!callBack) {
  81. callBack();
  82. }
  83. });
  84. };
  85. page.init();
  86. }