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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. $('#ExamType').lrDataItemSelect({ code: 'ExamType' });
  78. },
  79. initData: function () {
  80. if (!!keyValue) {
  81. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) {
  82. for (var id in data) {
  83. if (!!data[id].length && data[id].length > 0) {
  84. $('#' + id).jfGridSet('refreshdata', data[id]);
  85. }
  86. else {
  87. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  88. }
  89. }
  90. });
  91. }
  92. $('#StuSortNo').val('02');
  93. $('#LessonSortNo').val('1');
  94. $('#CheckStyleNo').val('1');
  95. $('#ScoreRecordStyleNo').val('1');
  96. $('#CheckMark').val('1');
  97. $('#ClassroomType').val('1');
  98. $('#ClassroomPracticeType').val('99');
  99. }
  100. };
  101. // 保存数据
  102. acceptClick = function (callBack) {
  103. if (!$('body').lrValidform()) {
  104. return false;
  105. }
  106. var nName = $("#LessonNo").find(".lr-select-placeholder").text();
  107. var Narray = nName.split("(");
  108. $("#LessonName").val(Narray[0]);
  109. var postData = {
  110. strEntity: JSON.stringify($('body').lrGetFormData())
  111. };
  112. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/SaveForm?keyValue=' + keyValue, postData, function (res) {
  113. // 保存成功后才回调
  114. if (!!callBack) {
  115. callBack();
  116. }
  117. });
  118. };
  119. page.init();
  120. }