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.
 
 
 
 
 
 

99 lines
4.2 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.indexOf('公共') != -1) {
  44. $("#TeachMajorNo").removeAttr("isvalid");
  45. $("#TeachMajorNo").removeAttr("NotNull");
  46. } else {
  47. $("#TeachMajorNo").attr("isvalid", "yes");
  48. $("#TeachMajorNo").attr("checkexpession", "NotNull");
  49. }
  50. }
  51. }
  52. });
  53. $('#HaveBeforeLesson').lrDataItemSelect({ code: 'YesOrNoBit' });
  54. $('#BeforeLesson').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  55. $('#WhoStudy').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  56. $('#LessonSortNo').lrDataSourceSelect({ code: 'CdLessonSort', value: 'lessonsortno', text: 'lessonsortname' });
  57. $('#LessonSortDetailNo').lrDataSourceSelect({ code: 'CdLessonSortDetail', value: 'lessonsortdetailno', text: 'lessonsortdetailname' });
  58. //内容编辑器
  59. ue = UE.getEditor('editor');
  60. },
  61. initData: function () {
  62. if (!!keyValue) {
  63. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/GetFormData?keyValue=' + keyValue, function (data) {
  64. for (var id in data) {
  65. if (!!data[id].length && data[id].length > 0) {
  66. $('#' + id).jfGridSet('refreshdata', data[id]);
  67. }
  68. else {
  69. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  70. }
  71. ue.ready(function () {
  72. ue.setContent(data[id].Introduction);
  73. });
  74. }
  75. });
  76. }
  77. }
  78. };
  79. // 保存数据
  80. acceptClick = function (callBack) {
  81. if (!$('body').lrValidform()) {
  82. return false;
  83. }
  84. var postData = $('body').lrGetFormData();
  85. postData["Introduction"] = ue.getContent(null, null, true);
  86. var postDatas = {
  87. strEntity: JSON.stringify(postData)
  88. };
  89. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  90. // 保存成功后才回调
  91. if (!!callBack) {
  92. callBack();
  93. }
  94. });
  95. };
  96. page.init();
  97. }