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.
 
 
 
 
 
 

70 lines
2.6 KiB

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