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.
 
 
 
 
 
 

101 lines
4.3 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-24 17:03
  5. * 描 述:课程信息管理
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var ue;
  12. var page = {
  13. init: function () {
  14. $('.lr-form-wrap').lrscroll();
  15. page.bind();
  16. page.initData();
  17. },
  18. bind: function () {
  19. $('#F_SchoolId').lrDataSourceSelect({
  20. code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) {
  21. if (!!item) {
  22. $('#TeachDeptNo').lrselectRefresh({
  23. url: "/CdDept/GetListBySchoolId",
  24. param: { F_SchoolId: item.f_companyid },
  25. value: 'DeptNo',
  26. text: 'DeptName'
  27. });
  28. } else {
  29. $('#TeachDeptNo').lrselectRefresh({
  30. url: "",
  31. data: []
  32. });
  33. }
  34. }
  35. });
  36. $('#TeachDeptNo').lrselect({
  37. value: 'deptno', text: 'deptname'
  38. });
  39. $('#TeachMajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  40. $('#LessonTypeId').lrDataSourceSelect({
  41. code: 'CdLessonType', value: 'ltid', text: 'lessontypename', select: function (item) {
  42. if (item != null && item != undefined) {
  43. if (item.lessontypename === "公开课") {
  44. $("#TeachMajorNo").removeAttr("isvalid");
  45. $("#TeachMajorNo").removeAttr("NotNull");
  46. } else {
  47. $("#TeachMajorNo").removeAttr("isvalid");
  48. $("#TeachMajorNo").removeAttr("NotNull");
  49. //$("#TeachMajorNo").attr("isvalid", "yes");
  50. //$("#TeachMajorNo").attr("checkexpession", "NotNull");
  51. }
  52. }
  53. }
  54. });
  55. $('#HaveBeforeLesson').lrDataItemSelect({ code: 'YesOrNoBit' });
  56. $('#BeforeLesson').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  57. $('#WhoStudy').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  58. $('#LessonSortNo').lrDataSourceSelect({ code: 'CdLessonSort', value: 'lessonsortno', text: 'lessonsortname' });
  59. $('#LessonSortDetailNo').lrDataSourceSelect({ code: 'CdLessonSortDetail', value: 'lessonsortdetailno', text: 'lessonsortdetailname' });
  60. //内容编辑器
  61. ue = UE.getEditor('editor');
  62. },
  63. initData: function () {
  64. if (!!keyValue) {
  65. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/GetFormData?keyValue=' + keyValue, function (data) {
  66. for (var id in data) {
  67. if (!!data[id].length && data[id].length > 0) {
  68. $('#' + id).jfGridSet('refreshdata', data[id]);
  69. }
  70. else {
  71. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  72. }
  73. ue.ready(function () {
  74. ue.setContent(data[id].Introduction);
  75. });
  76. }
  77. });
  78. }
  79. }
  80. };
  81. // 保存数据
  82. acceptClick = function (callBack) {
  83. if (!$('body').lrValidform()) {
  84. return false;
  85. }
  86. var postData = $('body').lrGetFormData();
  87. postData["Introduction"] = ue.getContent(null, null, true);
  88. var postDatas = {
  89. strEntity: JSON.stringify(postData)
  90. };
  91. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  92. // 保存成功后才回调
  93. if (!!callBack) {
  94. callBack();
  95. }
  96. });
  97. };
  98. page.init();
  99. }