@@ -217,7 +217,16 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 分配宿舍 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormRoom() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
@@ -0,0 +1,26 @@ | |||||
| |||||
@{ | |||||
ViewBag.Title = "FormClass"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<style> | |||||
.div12 { | |||||
padding-left: 5px; | |||||
} | |||||
</style> | |||||
<div class="lr-form-wrap" id="content"> | |||||
@*<div class="col-xs-12 lr-form-item div12"> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">床位</div> | |||||
<input id="Name" readonly="readonly" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">学生</div> | |||||
<div class="Student" id="1"></div> | |||||
</div> | |||||
</div>*@ | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js") | |||||
@@ -0,0 +1,116 @@ | |||||
/* * 版 本 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 += '<div class="col-xs-12 lr-form-item div12">'; | |||||
html += '<div class="col-xs-6 lr-form-item">'; | |||||
html += '<div class="lr-form-item-title">床位</div>'; | |||||
html += '<input id="Name" readonly="readonly" type="text" class="form-control" value="' + | |||||
data[i].Name + | |||||
'" />'; | |||||
html += '</div>'; | |||||
html += '<div class="col-xs-6 lr-form-item" style="padding-right: 20px;">'; | |||||
html += '<div class="lr-form-item-title">学生</div>'; | |||||
html += '<div class="Student" id="' + data[i].ID + '"></div>'; | |||||
html += '</div>'; | |||||
html += '</div>'; | |||||
//$('#' + 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(); | |||||
} |
@@ -62,10 +62,10 @@ var bootstrap = function ($, learun) { | |||||
//}); | //}); | ||||
$('#NoDistribution').lrRadioCheckbox({ | $('#NoDistribution').lrRadioCheckbox({ | ||||
type: 'checkbox', | |||||
type: 'checkbox', | |||||
code: 'NoDistribution' | code: 'NoDistribution' | ||||
}); | }); | ||||
$('#Distribution').lrRadioCheckbox({ | $('#Distribution').lrRadioCheckbox({ | ||||
type: 'checkbox', | type: 'checkbox', | ||||
code: 'NoDistribution' | code: 'NoDistribution' | ||||
@@ -260,13 +260,14 @@ var bootstrap = function ($, learun) { | |||||
if (arr.some(x => x != '4')) { | if (arr.some(x => x != '4')) { | ||||
return learun.alert.warning("只能选择宿舍进行分配!"); | return learun.alert.warning("只能选择宿舍进行分配!"); | ||||
} | } | ||||
var arrDept = Dept.split(','); | |||||
var arrDept = Dept.split(','); | |||||
if (arrDept.some(function (value, index) { | |||||
return value.length === 0; | |||||
})) { | |||||
return learun.alert.warning("选中记录包含未分配系的数据!"); | |||||
} | |||||
if (keyValue.indexOf(',') > 0) { | if (keyValue.indexOf(',') > 0) { | ||||
if (arrDept.some(function(value, index) { | |||||
return value.length == 0; | |||||
})) { | |||||
return learun.alert.warning("选中记录包含未分配专业的数据!"); | |||||
} | |||||
if (arrDept.some(function (value, index) { | if (arrDept.some(function (value, index) { | ||||
return value != arrDept[0]; | return value != arrDept[0]; | ||||
})) { | })) { | ||||
@@ -274,7 +275,7 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
} | } | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'formDept', | |||||
id: 'formClass', | |||||
title: '分配专业班级', | title: '分配专业班级', | ||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormClass?keyValue=' + keyValue + '&Dept=' + arrDept[0], | url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormClass?keyValue=' + keyValue + '&Dept=' + arrDept[0], | ||||
width: 400, | width: 400, | ||||
@@ -284,6 +285,36 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
}); | }); | ||||
//分配宿舍 | |||||
$("#lr_Bed").on("click", function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
var BuildType = $('#gridtable').jfGridValue('BuildType'); | |||||
var Name = $('#gridtable').jfGridValue('Name'); | |||||
var Class = $('#gridtable').jfGridValue('Class'); | |||||
var arr = BuildType.split(','); | |||||
if (arr.some(x => x != '4')) { | |||||
return learun.alert.warning("只能选择宿舍进行分配!"); | |||||
} | |||||
if (keyValue.indexOf(',') != -1) { | |||||
return learun.alert.warning("只能选择一条记录进行分配!"); | |||||
} | |||||
if (Class.length == 0) { | |||||
return learun.alert.warning("请先分配班级!"); | |||||
} | |||||
learun.layerForm({ | |||||
id: 'formRoom', | |||||
title: '分配宿舍--' + Name, | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class, | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
}, | }, | ||||
//初始化左侧树 | //初始化左侧树 | ||||
initTree: function () { | initTree: function () { | ||||
@@ -396,7 +427,8 @@ var bootstrap = function ($, learun) { | |||||
callback(_data['classname']); | callback(_data['classname']); | ||||
} | } | ||||
}); | }); | ||||
} }, | |||||
} | |||||
}, | |||||
{ | { | ||||
label: "寝室类型", name: "RoomType", width: 100, align: "left", | label: "寝室类型", name: "RoomType", width: 100, align: "left", | ||||
formatter: function (value, row) { | formatter: function (value, row) { | ||||
@@ -559,7 +591,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
//console.log(param); | //console.log(param); | ||||
param = param || {}; | param = param || {}; | ||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
@@ -1300,6 +1300,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.js" /> | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClassify.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClassify.js" /> | ||||
@@ -7582,6 +7583,7 @@ | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.cshtml" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||