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.
 
 
 
 
 
 

75 lines
2.8 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-29 11:08
  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. $('#DeptNo').lrDataSourceSelect({
  19. code: 'CdDeptInfo', value: 'deptno', text: 'deptname',
  20. select: function (item) {
  21. if (!!item) {
  22. $('#MajorNo').lrselectRefresh({
  23. url: "/CdMajor/GetListByDeptNo",
  24. param: { DeptNo: item.deptno },
  25. value: 'MajorNo',
  26. text: 'MajorName'
  27. });
  28. }
  29. }
  30. });
  31. $('#MajorNo').lrselect();
  32. $('#Grade').lrselect({
  33. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  34. value: 'value',
  35. text: 'text',
  36. maxHeight: 200
  37. });
  38. $('#ClassDiredctorNo').lrDataSourceSelect({ code: 'teacheruserdata',value: 'f_encode',text: 'f_realname' });
  39. $('#ClassTutorNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' });
  40. $('#IsSeparate').lrDataItemSelect({ code: 'YesOrNoBit' });
  41. $('#ClassType').lrDataItemSelect({ code: 'ClassType' });
  42. },
  43. initData: function () {
  44. if (!!keyValue) {
  45. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetFormData?keyValue=' + keyValue, function (data) {
  46. for (var id in data) {
  47. if (!!data[id].length && data[id].length > 0) {
  48. $('#' + id ).jfGridSet('refreshdata', data[id]);
  49. }
  50. else {
  51. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  52. }
  53. }
  54. });
  55. }
  56. }
  57. };
  58. // 保存数据
  59. acceptClick = function (callBack) {
  60. if (!$('body').lrValidform()) {
  61. return false;
  62. }
  63. var postData = {
  64. strEntity: JSON.stringify($('body').lrGetFormData())
  65. };
  66. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
  67. // 保存成功后才回调
  68. if (!!callBack) {
  69. callBack();
  70. }
  71. });
  72. };
  73. page.init();
  74. }