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.
 
 
 
 
 
 

114 lines
4.8 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-11-29 11:43
  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. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  19. $('#AcademicYearNo').lrselect({
  20. placeholder: "请选择学年",
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. $('#LessonSortDetailNo').lrDataSourceSelect({ code: 'CdLessonSortDetail', value: 'lessonsortdetailno', text: 'lessonsortdetailname' });
  27. //年级
  28. $('#Grade').lrselect({
  29. placeholder: "请选择年级",
  30. allowSearch: true,
  31. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData',
  32. value: 'value',
  33. text: 'text'
  34. });
  35. $('#Semester').lrDataItemSelect({ code: 'Semester' });
  36. $('#DeptNo').lrselect({
  37. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  38. value: 'deptno',
  39. text: 'deptname',
  40. maxHeight: 200,
  41. select: function (item) {
  42. var NDeptNo = $("#DeptNo").lrselectGet();
  43. if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) {
  44. $('#MajorNo').lrselectRefresh({
  45. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  46. param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" },
  47. value: "majorno",
  48. text: "majorname",
  49. maxHeight: 200
  50. });
  51. } else {
  52. $('#MajorNo').lrselectRefresh({
  53. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  54. param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " },
  55. value: "majorno",
  56. text: "majorname",
  57. maxHeight: 200
  58. });
  59. }
  60. }
  61. })
  62. $("#MajorNo").lrselect();
  63. $('#LessonNo').lrselect({
  64. placeholder: "请选择课程",
  65. allowSearch: true,
  66. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
  67. value: 'value',
  68. text: 'text'
  69. });
  70. $('#TeachDeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  71. },
  72. initData: function () {
  73. if (!!keyValue) {
  74. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) {
  75. for (var id in data) {
  76. if (!!data[id].length && data[id].length > 0) {
  77. $('#' + id).jfGridSet('refreshdata', data[id]);
  78. }
  79. else {
  80. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  81. }
  82. }
  83. });
  84. }
  85. $('#StuSortNo').val('02');
  86. $('#LessonSortNo').val('2');
  87. $('#CheckStyleNo').val('1');
  88. $('#ScoreRecordStyleNo').val('1');
  89. $('#CheckMark').val('1');
  90. $('#ClassroomType').val('1');
  91. $('#ClassroomPracticeType').val('99');
  92. }
  93. };
  94. // 保存数据
  95. acceptClick = function (callBack) {
  96. if (!$('body').lrValidform()) {
  97. return false;
  98. }
  99. var nName = $("#LessonNo").find(".lr-select-placeholder").text();
  100. var Narray= nName.split("(");
  101. $("#LessonName").val(Narray[0]);
  102. var postData = {
  103. strEntity: JSON.stringify($('body').lrGetFormData())
  104. };
  105. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/SaveForm?keyValue=' + keyValue, postData, function (res) {
  106. // 保存成功后才回调
  107. if (!!callBack) {
  108. callBack();
  109. }
  110. });
  111. };
  112. page.init();
  113. }