123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- @model EMIS.ViewModel.SchedulingManage.SchedulingSettings.CollegeClassroomView
- @using EMIS.Web.Controls;
- @using Bowin.Web.Controls.Mvc;
- @using EMIS.Utility;
- @{
- ViewBag.Title = "CollegeClassroomBatchAdd";
- //校区
- ComboGridOptions cgopBuildingsInfoCampus = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "CampusID",
- ID = "BuildingsInfoCampusDropdown",
- Name = "BuildingsInfoCampusDropdown",
- OnSelect = "queryBuildingsInfoCampus",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CampusCode"), Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CampusName"), Align=AlignStyle.Center, Width=0.12 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Campus/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- }
- };
- //建筑信息
- ComboGridOptions cgopBuildings = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "BuildingsInfoID",
- ID = "BuildingsDropdown",
- Name = "BuildingsDropdown",
- OnSelect = "reload",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new LinkButtonColumn { FieldName="Code", HeaderText="建筑编号", Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.1 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Buildings/list"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- //教室信息
- ComboGridOptions cgopClassroomName = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "Name",
- ID = "ClassroomNameDropdown",
- Name = "ClassroomNameDropdown",
- OnSelect = "reload",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- //new LinkButtonColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Classroom/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- }
- };
-
- //院系所
- ComboGridOptions cgopCollege = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "CollegeID",
- ID = "CollegeDropdown",
- Name = "CollegeDropdown",
- OnSelect = "reload",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.2 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- }
- };
- }
- @section scripts{
- <script type="text/javascript">
- var nonSelect = "@DropdownList.SELECT_ALL";
- var college = '@EMIS.Utility.RSL.Get("College")';
- //刷新
- function reload() {
- $("#dgCollegeClassroomNoAddList").cmsXDataTable("load", $.getDataGridParams("dgCollegeClassroomNoAddList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgCollegeClassroomNoAddList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.CollegeClassroomID);
- });
- return d;
- }
- //获取选中的数据All
- function validChooseAll() {
- var d = [];
- $.each($("#dgCollegeClassroomNoAddList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //确定生成成功后不关闭弹出页面
- function formSuccessReloadNoClose(data) {
- if (data.IsSuccess == true) {
- reload();
- }
- $.messager.alert("系统提示", data.Message);
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //设置相应的行颜色为红色
- function SetRedGrid(rowIndex, rowData) {
- if (rowData.IsAvailable != true || rowData.IsReserve == true) {
- return "color: red;";
- } else {
- return "";
- }
- }
- //联动查询
- function queryBuildingsInfoCampus(data) {
- reload();
- }
- //确定
- function CollegeClassroomBatchAdd_Confirm() {
- var d = validChooseAll();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要新增的教室院系信息。");
- return;
- }
- $("#collegeClassroomViewList").val(JSON.stringify(d));
- $(document.forms[0]).submit();
- }
- </script>
- }
- <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
- @using (Ajax.BeginForm(new AjaxOptions
- {
- //生成成功后不关闭弹出页面(OnSuccess = "EMISFunction.FormSuccessNoClose")
- OnSuccess = "formSuccessReloadNoClose",
- OnBegin = "EMISFunction.FormSubmit",
- OnComplete = "EMISFunction.FormComplete"
- }))
- {
- <div class="p_SearchTitle">
- <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
- 查询条件</div>
- </div>
- @Html.PositionCondition("CollegeClassroomSelect")
- <div class="search_keyword">
- <div class="search_input">
- <ul>
- <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("Campus"):</li>
- <li class="sv">
- @Html.ComboGrid(cgopBuildingsInfoCampus, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- <li class="sn" style="padding-left: 5px;">所在建筑:</li>
- <li class="sv">
- @Html.ComboGrid(cgopBuildings, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- <li class="sn" style="padding-left: 5px;">教室名称:</li>
- <li class="sv">
- @Html.ComboGrid(cgopClassroomName, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- <li class="sn" style="padding-left: 5px;">教室类型:</li>
- <li class="sv">
- @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.CF_ClassroomType, DropdownListBindType.SelectAll,
- new ComboGridOptions
- {
- ID = "ClassroomTypeDictionary",
- Name = "ClassroomTypeDictionary",
- OnSelect = "reload"
- },
- new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- </ul>
- <ul>
- <li class="sn" style="padding-left: 5px;color:red;">多班教学:</li>
- <li class="sv">
- @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
- {
- BindType = DropdownListBindType.SelectAll,
- ID = "IsConcurrentUseDropdown",
- Name = "IsConcurrentUseDropdown",
- OnSelect = "reload"
- },
- new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- <li class="sn" style="padding-left: 5px;color:red;">是否预留:</li>
- <li class="sv">
- @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
- {
- BindType = DropdownListBindType.SelectAll,
- ID = "IsReserveDropdown",
- Name = "IsReserveDropdown",
- OnSelect = "reload"
- },
- new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- <li class="sn" style="padding-left: 5px;color:red;">是否可用:</li>
- <li class="sv">
- @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
- {
- BindType = DropdownListBindType.SelectAll,
- ID = "IsAvailableDropdown",
- Name = "IsAvailableDropdown",
- OnSelect = "reload"
- },
- new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- <li class="sn" style="padding-left: 5px;color:red;">@EMIS.Utility.RSL.Get("College"):</li>
- <li class="sv">
- @Html.ComboGrid(cgopCollege, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
- </li>
- </ul>
- </div>
- </div>
- <div class="p_title">
- <div style="float: left; margin-left: 6px; line-height: 30px; font-size: 12px;">
- 教室院系列表
- </div>
- <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("BatchAdd")</div>
- </div>
- <div class="search_list">
- @Html.Hidden("collegeClassroomViewList")
- <table cellpadding="0" cellspacing="0" id="collegeClassroomtable">
- <tr>
- <td>
- @Html.DataGrid(new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new CheckBoxFieldColumn{ HeaderText="", FieldName="CollegeClassroomID" },
- new BoundFieldColumn { FieldName="ClassroomCode", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.06 },
- new BoundFieldColumn { FieldName="ClassroomName", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 },
- //new BoundFieldColumn { FieldName="ClassroomCollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6, CustomFormatFun="SetRedColumn" },
- new BoundFieldColumn { FieldName="BuildingsInfoName", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
- //new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.04, OverflowLength=4 },
- new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, OrderFieldName="", Width=0.08, OverflowLength=8 },
- new BoundFieldColumn { FieldName="RoomUseName", HeaderText="房间用途", Align=AlignStyle.Center, OrderFieldName="RoomUseID", Width=0.05, OverflowLength=5 },
- new BoundFieldColumn { FieldName="Totalseating", HeaderText="总座位数", Align=AlignStyle.Center, Width=0.04 },
- new BoundFieldColumn { FieldName="Effectiveseating", HeaderText="有效座位数", Align=AlignStyle.Center, Width=0.05 },
- new BoundFieldColumn { FieldName="IsConcurrentUseName", HeaderText="多班教学", Align=AlignStyle.Center, OrderFieldName="IsConcurrentUse", Width=0.04 },
- new BoundFieldColumn { FieldName="IsReserveName", HeaderText="是否预留", Align=AlignStyle.Center, OrderFieldName="IsReserve", Width=0.04 },
- new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, OrderFieldName="IsAvailable", Width=0.04, CustomFormatFun="SetRedColumn" },
- //new BoundFieldColumn { FieldName="CollegeNo", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.06 },
- new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.1 }
- //new BoundFieldColumn { FieldName="UnitCategoryName", HeaderText="单位类别", Align=AlignStyle.Center, OrderFieldName="UnitCategoryID", Width=0.05 },
- //new BoundFieldColumn { FieldName="CollegeCampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.04, OverflowLength=4 }
- },
- CustomerRowStyleFun = "SetRedGrid",
- IsCheckOnSelect = true,
- //IsAutoLoad = false,
- DataSourceUrl = Url.Content("~/CollegeClassroom/CollegeClassroomNoAddList"),
- ID = "dgCollegeClassroomNoAddList",
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- })
- </td>
- </tr>
- </table>
- </div>
- }
- </div>
|