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.

Form.js 5.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 " },
  55. value: "majorno",
  56. text: "majorname",
  57. maxHeight: 200
  58. });
  59. }
  60. }
  61. })
  62. $("#MajorNo").lrselect({
  63. select: function (item) {
  64. if (item) {
  65. $('#LessonNo').lrselectRefresh({
  66. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=LessonInfo',
  67. param: { strWhere: " 1=1 and CheckMark=1 and teachmajorno='" + item.majorno + "'" },
  68. value: "lessonno",
  69. text: "lessonname",
  70. maxHeight: 200
  71. });
  72. }
  73. }
  74. });
  75. $('#LessonNo').lrselect();
  76. $('#TeachDeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  77. },
  78. initData: function () {
  79. if (!!keyValue) {
  80. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) {
  81. for (var id in data) {
  82. if (!!data[id].length && data[id].length > 0) {
  83. $('#' + id).jfGridSet('refreshdata', data[id]);
  84. }
  85. else {
  86. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  87. }
  88. }
  89. });
  90. }
  91. $('#StuSortNo').val('02');
  92. $('#LessonSortNo').val('2');
  93. $('#CheckStyleNo').val('1');
  94. $('#ScoreRecordStyleNo').val('1');
  95. $('#CheckMark').val('1');
  96. $('#ClassroomType').val('1');
  97. $('#ClassroomPracticeType').val('99');
  98. }
  99. };
  100. // 保存数据
  101. acceptClick = function (callBack) {
  102. if (!$('body').lrValidform()) {
  103. return false;
  104. }
  105. var nName = $("#LessonNo").find(".lr-select-placeholder").text();
  106. var Narray = nName.split("(");
  107. $("#LessonName").val(Narray[0]);
  108. var postData = {
  109. strEntity: JSON.stringify($('body').lrGetFormData())
  110. };
  111. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/SaveForm?keyValue=' + keyValue, postData, function (res) {
  112. // 保存成功后才回调
  113. if (!!callBack) {
  114. callBack();
  115. }
  116. });
  117. };
  118. page.init();
  119. }