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 2.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-05-29 14:28
  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. $('#AcademicYearNo').lrselect({
  19. placeholder: "学年",
  20. allowSearch: false,
  21. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  22. value: 'value',
  23. text: 'text'
  24. });
  25. //学期
  26. $('#Semester').lrselect({
  27. placeholder: "学期",
  28. allowSearch: false,
  29. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  30. value: 'value',
  31. text: 'text'
  32. });
  33. },
  34. initData: function () {
  35. if (!!keyValue) {
  36. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/GetFormData?keyValue=' + keyValue, function (data) {
  37. for (var id in data) {
  38. if (!!data[id].length && data[id].length > 0) {
  39. $('#' + id ).jfGridSet('refreshdata', data[id]);
  40. }
  41. else {
  42. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  43. }
  44. }
  45. });
  46. }
  47. }
  48. };
  49. // 保存数据
  50. acceptClick = function (callBack) {
  51. if (!$('body').lrValidform()) {
  52. return false;
  53. }
  54. var postData = {
  55. strEntity: JSON.stringify($('body').lrGetFormData())
  56. };
  57. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/SaveForm?keyValue=' + keyValue, postData, function (res) {
  58. // 保存成功后才回调
  59. if (!!callBack) {
  60. callBack();
  61. }
  62. });
  63. };
  64. page.init();
  65. }