ClassroomCollegeList.cshtml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. ViewBag.Title = "ClassroomCollegeList";
  5. Guid? classroomID = new Guid(Request["classroomID"]);
  6. //校区
  7. ComboGridOptions cgopCampus = new ComboGridOptions
  8. {
  9. TextField = "Name",
  10. ValueField = "CampusID",
  11. ID = "CampusDropdown",
  12. Name = "CampusDropdown",
  13. OnSelect = "queryCampus",
  14. GridOptions = new DataGridOptions
  15. {
  16. Columns = new List<DataGridColumn>()
  17. {
  18. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CampusCode"), Align=AlignStyle.Center, Width=0.1 },
  19. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CampusName"), Align=AlignStyle.Center, Width=0.12 }
  20. },
  21. IsCheckOnSelect = true,
  22. DataSourceUrl = Url.Content("~/Campus/List"),
  23. IsPagination = true,
  24. IsShowRowNumbers = true,
  25. IsSingleSelect = false,
  26. }
  27. };
  28. //院系所
  29. ComboGridOptions cgopCollege = new ComboGridOptions
  30. {
  31. TextField = "Name",
  32. ValueField = "CollegeID",
  33. ID = "CollegeDropdown",
  34. Name = "CollegeDropdown",
  35. OnSelect = "reload",
  36. GridOptions = new DataGridOptions
  37. {
  38. Columns = new List<DataGridColumn>()
  39. {
  40. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
  41. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.2 }
  42. },
  43. IsCheckOnSelect = true,
  44. //DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  45. DataSourceUrl = Url.Content("~/College/ListWithoutRange"),
  46. IsPagination = true,
  47. IsShowRowNumbers = true,
  48. IsSingleSelect = false,
  49. }
  50. };
  51. }
  52. @section scripts{
  53. <script type="text/javascript">
  54. var nonSelect = "@DropdownList.SELECT_ALL";
  55. //刷新
  56. function reload() {
  57. $("#dgClassroomCollegeList").cmsXDataTable("load", $.getDataGridParams("dgClassroomCollegeList"));
  58. }
  59. //设置列颜色为红色
  60. function SetRedColumn(index, row, value) {
  61. return " <span style=\"color: red;\">" + value + "</span>";
  62. }
  63. //设置相应的行颜色为红色
  64. function SetRedGrid(rowIndex, rowData) {
  65. if (rowData.IsAvailable != true || rowData.IsReserve == true) {
  66. return "color: red;";
  67. }
  68. else {
  69. return "";
  70. }
  71. }
  72. //Excel导出
  73. function ClassroomCollege_Export() {
  74. $("#formQuery").submit();
  75. }
  76. //联动
  77. function queryCampus(data) {
  78. var campusID = $("#CampusDropdown").combogridX("getValue");
  79. if (campusID != nonSelect) {
  80. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@@|'})";
  81. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  82. }
  83. else {
  84. $("#CollegeDropdown").combogridX("reload");
  85. }
  86. reload();
  87. }
  88. </script>
  89. }
  90. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  91. <form id="formQuery" method="post" action="@Url.Content("~/Classroom/Excel_ClassroomCollege?classroomID=" + classroomID)">
  92. @*@Html.PositionCondition("ClassroomCollegeSelect")*@
  93. <div class="search_keyword">
  94. <div class="search_input">
  95. <ul>
  96. <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("Campus"):</li>
  97. <li class="sv">
  98. @Html.ComboGrid(cgopCampus, new Dictionary<string, string> { { "data-condition", "dgClassroomCollegeList" } })
  99. </li>
  100. <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("College"):</li>
  101. <li class="sv">
  102. @Html.ComboGrid(cgopCollege, new Dictionary<string, string> { { "data-condition", "dgClassroomCollegeList" } })
  103. </li>
  104. <li class="sn" style="padding-left: 5px;color:red;">单位类别:</li>
  105. <li class="sv">
  106. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_UnitCategory, new DropdownListOptions()
  107. {
  108. BindType = DropdownListBindType.SelectAll,
  109. ID = "DictionaryUnitCategory",
  110. Name = "DictionaryUnitCategory",
  111. OnSelect = "reload"
  112. }, new Dictionary<string, string> { { "data-condition", "dgClassroomCollegeList" } })
  113. </li>
  114. <li class="sn" style="padding-left: 20px;">
  115. <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="reload();">查询</a>
  116. </li>
  117. </ul>
  118. </div>
  119. </div>
  120. <div class="p_title">
  121. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"></div>
  122. <div style="margin-right: 10px; line-height: 20px; font-size: 12px;">@Html.ContextMenuBar("ScheduleCollege")</div>
  123. </div>
  124. </form>
  125. <div class="search_list">
  126. <table cellpadding="0" cellspacing="0" id="classroomtable">
  127. <tr>
  128. <td>
  129. @Html.DataGrid(new DataGridOptions
  130. {
  131. Columns = new List<DataGridColumn>()
  132. {
  133. new CheckBoxFieldColumn{ HeaderText="", FieldName="ClassroomID" },
  134. new BoundFieldColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
  135. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 },
  136. new BoundFieldColumn { FieldName="BuildingsInfoName", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  137. //new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  138. new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, OrderFieldName="", Width=0.06, OverflowLength=6 },
  139. new BoundFieldColumn { FieldName="RoomUseName", HeaderText="房间用途", Align=AlignStyle.Center, OrderFieldName="RoomUseID", Width=0.05, OverflowLength=5 },
  140. //new BoundFieldColumn { FieldName="FloorLevel", HeaderText="所在楼层", Align=AlignStyle.Center, Width=0.04 },
  141. //new BoundFieldColumn { FieldName="RowCout", HeaderText="行数", Align=AlignStyle.Center, Width=0.02 },
  142. //new BoundFieldColumn { FieldName="ColumnCount", HeaderText="列数", Align=AlignStyle.Center, Width=0.02 },
  143. new BoundFieldColumn { FieldName="Totalseating", HeaderText="总座位数", Align=AlignStyle.Center, Width=0.04 },
  144. //new BoundFieldColumn { FieldName="Effectiveseating", HeaderText="有效座位数", Align=AlignStyle.Center, Width=0.05 },
  145. //new BoundFieldColumn { FieldName="Examinationseating", HeaderText="考试座位数", Align=AlignStyle.Center, Width=0.05 },
  146. new BoundFieldColumn { FieldName="IsConcurrentUseName", HeaderText="可否多班教学", Align=AlignStyle.Center, OrderFieldName="IsConcurrentUse", Width=0.06, CustomFormatFun="SetRedColumn" },
  147. new BoundFieldColumn { FieldName="IsReserveName", HeaderText="是否预留", Align=AlignStyle.Center, OrderFieldName="IsReserve", Width=0.04, CustomFormatFun="SetRedColumn" },
  148. new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, OrderFieldName="IsAvailable", Width=0.04, CustomFormatFun="SetRedColumn" },
  149. //new BoundFieldColumn { FieldName="CollegeCode", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.05, CustomFormatFun="SetRedColumn" },
  150. new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.1, CustomFormatFun="SetRedColumn" },
  151. new BoundFieldColumn { FieldName="CollegeCampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6, CustomFormatFun="SetRedColumn" }
  152. },
  153. CustomerRowStyleFun = "SetRedGrid",
  154. IsPostBack = true,
  155. IsCheckOnSelect = true,
  156. DataSourceUrl = Url.Content("~/Classroom/ClassroomCollegeList?classroomID=" + classroomID),
  157. ID = "dgClassroomCollegeList",
  158. IsPagination = true,
  159. IsShowRowNumbers = true,
  160. IsSingleSelect = false,
  161. })
  162. </td>
  163. </tr>
  164. </table>
  165. </div>
  166. </div>