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.2 KiB

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