選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

117 行
4.9 KiB

  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 Class = request('Class');
  9. var keyValue = request('keyValue');
  10. var arr = [];
  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. //$('.Student').lrselect({
  21. // value: "stuid",
  22. // text: "stuname",
  23. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  24. // param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
  25. // select: function (item) {
  26. // if (item) {
  27. // console.log(item);
  28. // $.each(arr,
  29. // function(index, value) {
  30. // console.log('arr_index',value);
  31. // console.log('arr_index',value);
  32. // });
  33. // }
  34. // }
  35. //});
  36. },
  37. initData: function () {
  38. if (!!keyValue) {
  39. $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + keyValue, function (data) {
  40. var html = '';
  41. for (var i = 0; i < data.length; i++) {
  42. html += '<div class="col-xs-12 lr-form-item div12">';
  43. html += '<div class="col-xs-6 lr-form-item">';
  44. html += '<div class="lr-form-item-title">床位</div>';
  45. html += '<input id="Name" readonly="readonly" type="text" class="form-control" value="' +
  46. data[i].Name +
  47. '" />';
  48. html += '</div>';
  49. html += '<div class="col-xs-6 lr-form-item" style="padding-right: 20px;">';
  50. html += '<div class="lr-form-item-title">学生</div>';
  51. html += '<div class="Student" id="' + data[i].ID + '"></div>';
  52. html += '</div>';
  53. html += '</div>';
  54. //$('#' + data[i].ID).lrselectRefresh({
  55. // value: "stuid",
  56. // text: "stuname",
  57. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  58. // param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
  59. // select: function (item) {
  60. // if (item) {
  61. // console.log(item);
  62. // $.each(arr,
  63. // function (index, value) {
  64. // console.log('arr_index', value);
  65. // console.log('arr_index', value);
  66. // });
  67. // }
  68. // }
  69. //});
  70. $('#' + data[i].ID).lrselectSet(data[i].StudentID);
  71. arr.push({ ID: data[i].ID, StudentID: data[i].StudentID });
  72. }
  73. $('#content').html(html);
  74. $('.Student').lrselect({
  75. value: "stuid",
  76. text: "stuname",
  77. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  78. param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
  79. select: function (item) {
  80. if (item) {
  81. console.log(item);
  82. $.each(arr,
  83. function (index, value) {
  84. console.log('arr_index', value);
  85. console.log('arr_index', value);
  86. });
  87. }
  88. }
  89. });
  90. });
  91. }
  92. },
  93. };
  94. // 保存数据
  95. acceptClick = function (callBack) {
  96. if (!$('body').lrValidform()) {
  97. return false;
  98. }
  99. var postData = {
  100. strEntity: JSON.stringify($('body').lrGetFormData())
  101. };
  102. $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=2&keyValue=' + keyValue, postData, function (res) {
  103. // 保存成功后才回调
  104. if (!!callBack) {
  105. callBack();
  106. }
  107. });
  108. };
  109. page.init();
  110. }