/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-04-26 15:02
* 描 述:学生宿舍管理
*/
var acceptClick;
var Class = request('Class');
var keyValue = request('keyValue');
var arr = [];
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
//$('.Student').lrselect({
// value: "stuid",
// text: "stuname",
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
// param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
// select: function (item) {
// if (item) {
// console.log(item);
// $.each(arr,
// function(index, value) {
// console.log('arr_index',value);
// console.log('arr_index',value);
// });
// }
// }
//});
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + keyValue, function (data) {
var html = '';
for (var i = 0; i < data.length; i++) {
html += '
';
//$('#' + data[i].ID).lrselectRefresh({
// value: "stuid",
// text: "stuname",
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
// param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
// select: function (item) {
// if (item) {
// console.log(item);
// $.each(arr,
// function (index, value) {
// console.log('arr_index', value);
// console.log('arr_index', value);
// });
// }
// }
//});
$('#' + data[i].ID).lrselectSet(data[i].StudentID);
arr.push({ ID: data[i].ID, StudentID: data[i].StudentID });
}
$('#content').html(html);
$('.Student').lrselect({
value: "stuid",
text: "stuname",
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
select: function (item) {
if (item) {
console.log(item);
$.each(arr,
function (index, value) {
console.log('arr_index', value);
console.log('arr_index', value);
});
}
}
});
});
}
},
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};
$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=2&keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}