ClassroomReserveBatchAdd.cshtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. @model EMIS.ViewModel.SchedulingManage.SchedulingSettings.ClassroomReserveView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @using EMIS.Utility;
  5. @{
  6. ViewBag.Title = "ClassroomReserveBatchAdd";
  7. //校区
  8. ComboGridOptions cgopCampus = new ComboGridOptions
  9. {
  10. TextField = "Name",
  11. ValueField = "CampusID",
  12. ID = "CampusDropdown",
  13. Name = "CampusDropdown",
  14. OnSelect = "queryCampus",
  15. GridOptions = new DataGridOptions
  16. {
  17. Columns = new List<DataGridColumn>()
  18. {
  19. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CampusCode"), Align=AlignStyle.Center, Width=0.1 },
  20. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CampusName"), Align=AlignStyle.Center, Width=0.12 }
  21. },
  22. IsCheckOnSelect = true,
  23. DataSourceUrl = Url.Content("~/Campus/List"),
  24. IsPagination = true,
  25. IsShowRowNumbers = true,
  26. IsSingleSelect = false,
  27. }
  28. };
  29. //建筑信息
  30. ComboGridOptions cgopBuildings = new ComboGridOptions
  31. {
  32. TextField = "Name",
  33. ValueField = "BuildingsInfoID",
  34. ID = "BuildingsDropdown",
  35. Name = "BuildingsDropdown",
  36. OnSelect = "reload",
  37. GridOptions = new DataGridOptions
  38. {
  39. Columns = new List<DataGridColumn>()
  40. {
  41. new LinkButtonColumn { FieldName="Code", HeaderText="建筑编号", Align=AlignStyle.Center, Width=0.1 },
  42. new BoundFieldColumn { FieldName="Name", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.1 }
  43. },
  44. IsCheckOnSelect = true,
  45. DataSourceUrl = Url.Content("~/Buildings/list"),
  46. IsPagination = true,
  47. IsShowRowNumbers = true,
  48. IsSingleSelect = false
  49. }
  50. };
  51. //教室信息
  52. ComboGridOptions cgopClassroomName = new ComboGridOptions
  53. {
  54. TextField = "Name",
  55. ValueField = "Name",
  56. ID = "ClassroomNameDropdown",
  57. Name = "ClassroomNameDropdown",
  58. OnSelect = "reload",
  59. GridOptions = new DataGridOptions
  60. {
  61. Columns = new List<DataGridColumn>()
  62. {
  63. //new LinkButtonColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
  64. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 }
  65. },
  66. IsCheckOnSelect = true,
  67. DataSourceUrl = Url.Content("~/Classroom/List"),
  68. IsPagination = true,
  69. IsShowRowNumbers = true,
  70. IsSingleSelect = false,
  71. }
  72. };
  73. ////院系所
  74. //ComboGridOptions cgopCollege = new ComboGridOptions
  75. //{
  76. // TextField = "Name",
  77. // ValueField = "CollegeID",
  78. // OnSelect = "reload",
  79. // GridOptions = new DataGridOptions
  80. // {
  81. // Columns = new List<DataGridColumn>()
  82. // {
  83. // //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
  84. // new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.2 }
  85. // },
  86. // IsCheckOnSelect = true,
  87. // //DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  88. // DataSourceUrl = Url.Content("~/College/ListWithoutRange"),
  89. // IsPagination = true,
  90. // IsShowRowNumbers = true,
  91. // IsSingleSelect = false,
  92. // }
  93. //};
  94. }
  95. @section scripts{
  96. <script type="text/javascript">
  97. var nonSelect = "@DropdownList.SELECT_ALL";
  98. //刷新
  99. function reload() {
  100. $("#dgClassroomNoReserveList").cmsXDataTable("load", $.getDataGridParams("dgClassroomNoReserveList"));
  101. }
  102. //获取选中的数据
  103. function validChoose() {
  104. var d = [];
  105. $.each($("#dgClassroomNoReserveList").cmsXDataTable("getSelections"), function (index) {
  106. d.push(this.ClassroomID);
  107. });
  108. return d;
  109. }
  110. //获取选中的数据All
  111. function validChooseAll() {
  112. var d = [];
  113. $.each($("#dgClassroomNoReserveList").cmsXDataTable("getSelections"), function (index) {
  114. d.push(this);
  115. });
  116. return d;
  117. }
  118. //确定生成成功后不关闭弹出页面
  119. function formSuccessReloadNoClose(data) {
  120. if (data.IsSuccess == true) {
  121. reload();
  122. }
  123. $.messager.alert("系统提示", data.Message);
  124. }
  125. //设置列颜色为红色
  126. function SetRedColumn(index, row, value) {
  127. return " <span style=\"color: red;\">" + value + "</span>";
  128. }
  129. //设置相应的行颜色为红色
  130. function SetRedGrid(rowIndex, rowData) {
  131. if (rowData.IsAvailable != true) {
  132. return "color: red;";
  133. } else {
  134. return "";
  135. }
  136. }
  137. //联动查询
  138. function queryCampus(data) {
  139. reload();
  140. }
  141. //确定
  142. function ClassroomReserveBatchAdd_Confirm() {
  143. var d = validChoose();
  144. if (d.length == 0) {
  145. $.messager.alert("系统提示", "请选择您要预留的教室信息。");
  146. return;
  147. }
  148. $("#classroomIDList").val(JSON.stringify(d));
  149. $(document.forms[0]).submit();
  150. }
  151. </script>
  152. }
  153. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  154. @using (Ajax.BeginForm(new AjaxOptions
  155. {
  156. //生成成功后不关闭弹出页面(OnSuccess = "EMISFunction.FormSuccessNoClose")
  157. OnSuccess = "formSuccessReloadNoClose",
  158. OnBegin = "EMISFunction.FormSubmit",
  159. OnComplete = "EMISFunction.FormComplete"
  160. }))
  161. {
  162. <div class="p_SearchTitle">
  163. <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
  164. 查询条件</div>
  165. </div>
  166. @Html.PositionCondition("ClassroomReserveSelect")
  167. <div class="search_keyword">
  168. <div class="search_input">
  169. <ul>
  170. <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("Campus"):</li>
  171. <li class="sv">
  172. @Html.ComboGrid(cgopCampus, new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  173. </li>
  174. <li class="sn" style="padding-left: 5px;">所在建筑:</li>
  175. <li class="sv">
  176. @Html.ComboGrid(cgopBuildings, new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  177. </li>
  178. <li class="sn" style="padding-left: 5px;">教室名称:</li>
  179. <li class="sv">
  180. @Html.ComboGrid(cgopClassroomName, new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  181. </li>
  182. </ul>
  183. <ul>
  184. @*<li class="sn" style="padding-left: 5px;color:red;">@EMIS.Utility.RSL.Get("College"):</li>
  185. <li class="sv">
  186. @Html.ComboGrid(cgopCollege, new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  187. </li>*@
  188. <li class="sn" style="padding-left: 5px;">教室类型:</li>
  189. <li class="sv">
  190. @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.CF_ClassroomType, DropdownListBindType.SelectAll,
  191. new ComboGridOptions
  192. {
  193. ID = "ClassroomTypeDictionary",
  194. Name = "ClassroomTypeDictionary",
  195. OnSelect = "reload"
  196. }, new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  197. </li>
  198. <li class="sn" style="padding-left: 5px;color:red;">多班教学:</li>
  199. <li class="sv">
  200. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  201. {
  202. BindType = DropdownListBindType.SelectAll,
  203. ID = "IsConcurrentUseDropdown",
  204. Name = "IsConcurrentUseDropdown",
  205. OnSelect = "reload"
  206. },
  207. new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  208. </li>
  209. <li class="sn" style="padding-left: 5px;color:red;">是否可用:</li>
  210. <li class="sv">
  211. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  212. {
  213. BindType = DropdownListBindType.SelectAll,
  214. ID = "IsAvailableDropdown",
  215. Name = "IsAvailableDropdown",
  216. OnSelect = "reload"
  217. },
  218. new Dictionary<string, string> { { "data-condition", "dgClassroomNoReserveList" } })
  219. </li>
  220. </ul>
  221. </div>
  222. </div>
  223. <div class="p_title">
  224. <div style="float: left; margin-left: 6px; line-height: 30px; font-size: 12px;">
  225. 教室信息列表
  226. </div>
  227. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("BatchAdd")</div>
  228. </div>
  229. <div class="search_list">
  230. @Html.Hidden("classroomIDList")
  231. <table cellpadding="0" cellspacing="0" id="classroomtable">
  232. <tr>
  233. <td>
  234. @Html.DataGrid(new DataGridOptions
  235. {
  236. Columns = new List<DataGridColumn>()
  237. {
  238. new CheckBoxFieldColumn{ HeaderText="", FieldName="ClassroomID" },
  239. new BoundFieldColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
  240. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 },
  241. new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  242. new BoundFieldColumn { FieldName="RoomUseName", HeaderText="房间用途", Align=AlignStyle.Center, OrderFieldName="RoomUseID", Width=0.05, OverflowLength=5 },
  243. //new BoundFieldColumn { FieldName="FloorLevel", HeaderText="所在楼层", Align=AlignStyle.Center, Width=0.04 },
  244. //new BoundFieldColumn { FieldName="RowCout", HeaderText="行数", Align=AlignStyle.Center, Width=0.02 },
  245. //new BoundFieldColumn { FieldName="ColumnCount", HeaderText="列数", Align=AlignStyle.Center, Width=0.02 },
  246. new BoundFieldColumn { FieldName="Totalseating", HeaderText="总座位数", Align=AlignStyle.Center, Width=0.04 },
  247. new BoundFieldColumn { FieldName="Effectiveseating", HeaderText="有效座位数", Align=AlignStyle.Center, Width=0.05 },
  248. //new BoundFieldColumn { FieldName="Examinationseating", HeaderText="考试座位数", Align=AlignStyle.Center, Width=0.05 },
  249. new BoundFieldColumn { FieldName="BuildingsInfoName", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  250. new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  251. new BoundFieldColumn { FieldName="IsConcurrentUseName", HeaderText="多班教学", Align=AlignStyle.Center, OrderFieldName="IsConcurrentUse", Width=0.04 },
  252. //new BoundFieldColumn { FieldName="IsReserveName", HeaderText="是否预留", Align=AlignStyle.Center, OrderFieldName="IsReserve", Width=0.04 },
  253. new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, OrderFieldName="IsAvailable", Width=0.04, CustomFormatFun="SetRedColumn" }
  254. //new BoundFieldColumn { FieldName="CollegeCode", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.05 },
  255. //new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 }
  256. },
  257. CustomerRowStyleFun = "SetRedGrid",
  258. IsCheckOnSelect = true,
  259. //IsAutoLoad = false,
  260. DataSourceUrl = Url.Content("~/ClassroomReserve/ClassroomNoReserveList"),
  261. ID = "dgClassroomNoReserveList",
  262. IsPagination = true,
  263. IsShowRowNumbers = true,
  264. IsSingleSelect = false
  265. })
  266. </td>
  267. </tr>
  268. </table>
  269. </div>
  270. }
  271. </div>