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.

FormMainClass.js 3.3 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-04-26 15:02
  5. * 描 述:学生宿舍管理
  6. */
  7. var acceptClick;
  8. var Dept = request('Dept');
  9. var Class = request('Class');
  10. var keyValue = request('keyValue');
  11. var bootstrap = function ($, learun) {
  12. "use strict";
  13. var page = {
  14. init: function () {
  15. $('.lr-form-wrap').lrscroll();
  16. page.bind();
  17. page.initData();
  18. },
  19. bind: function () {
  20. $('#Class').lrselect({
  21. type: 'multiple',// default,tree,treemultiple,gird,multiple
  22. value: "classno",
  23. text: "classname"
  24. });
  25. $('#Major').lrselect({
  26. value: "majorno",
  27. text: "majorname",
  28. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  29. param: { code: "CdMajorInfo", strWhere: "DeptNo='" + Dept + "'" },
  30. select: function (item) {
  31. if (item) {
  32. $('#Class').lrselectRefresh({
  33. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  34. param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "' order by classno desc" }
  35. });
  36. }
  37. }
  38. });
  39. $('#MainClass').lrselect({
  40. width: '150px',
  41. placeholder: "请选择主班级",
  42. allowSearch: true,
  43. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetClassNo?keyvalue=' + Class,
  44. value: 'ClassNo',
  45. text: 'ClassName'
  46. });
  47. $('#Class').on("click",
  48. function () {
  49. //var data1 = $('#Dept').lrselectGet();
  50. var data2 = $('#Major').lrselectGet();
  51. if (!data2) {
  52. learun.alert.error('请先选择专业');
  53. }
  54. });
  55. },
  56. initData: function () {
  57. if (!!keyValue) {
  58. $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetFormData?keyValue=' + keyValue, function (data) {
  59. for (var id in data) {
  60. if (!!data[id].length && data[id].length > 0) {
  61. $('#' + id).jfGridSet('refreshdata', data[id]);
  62. }
  63. else {
  64. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  65. }
  66. }
  67. });
  68. }
  69. },
  70. };
  71. // 保存数据
  72. acceptClick = function (callBack) {
  73. if (!$('body').lrValidform()) {
  74. return false;
  75. }
  76. var postData = {
  77. strEntity: JSON.stringify($('body').lrGetFormData())
  78. };
  79. $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=2&keyValue=' + keyValue, postData, function (res) {
  80. // 保存成功后才回调
  81. if (!!callBack) {
  82. callBack();
  83. }
  84. });
  85. };
  86. page.init();
  87. }