CollegeClassroomBatchAdd.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. @model EMIS.ViewModel.SchedulingManage.SchedulingSettings.CollegeClassroomView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @using EMIS.Utility;
  5. @{
  6. ViewBag.Title = "CollegeClassroomBatchAdd";
  7. //校区
  8. ComboGridOptions cgopBuildingsInfoCampus = new ComboGridOptions
  9. {
  10. TextField = "Name",
  11. ValueField = "CampusID",
  12. ID = "BuildingsInfoCampusDropdown",
  13. Name = "BuildingsInfoCampusDropdown",
  14. OnSelect = "queryBuildingsInfoCampus",
  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. ID = "CollegeDropdown",
  79. Name = "CollegeDropdown",
  80. OnSelect = "reload",
  81. GridOptions = new DataGridOptions
  82. {
  83. Columns = new List<DataGridColumn>()
  84. {
  85. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
  86. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.2 }
  87. },
  88. IsCheckOnSelect = true,
  89. DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  90. IsPagination = true,
  91. IsShowRowNumbers = true,
  92. IsSingleSelect = false,
  93. }
  94. };
  95. }
  96. @section scripts{
  97. <script type="text/javascript">
  98. var nonSelect = "@DropdownList.SELECT_ALL";
  99. var college = '@EMIS.Utility.RSL.Get("College")';
  100. //刷新
  101. function reload() {
  102. $("#dgCollegeClassroomNoAddList").cmsXDataTable("load", $.getDataGridParams("dgCollegeClassroomNoAddList"));
  103. }
  104. //获取选中的数据
  105. function validChoose() {
  106. var d = [];
  107. $.each($("#dgCollegeClassroomNoAddList").cmsXDataTable("getSelections"), function (index) {
  108. d.push(this.CollegeClassroomID);
  109. });
  110. return d;
  111. }
  112. //获取选中的数据All
  113. function validChooseAll() {
  114. var d = [];
  115. $.each($("#dgCollegeClassroomNoAddList").cmsXDataTable("getSelections"), function (index) {
  116. d.push(this);
  117. });
  118. return d;
  119. }
  120. //确定生成成功后不关闭弹出页面
  121. function formSuccessReloadNoClose(data) {
  122. if (data.IsSuccess == true) {
  123. reload();
  124. }
  125. $.messager.alert("系统提示", data.Message);
  126. }
  127. //设置列颜色为红色
  128. function SetRedColumn(index, row, value) {
  129. return " <span style=\"color: red;\">" + value + "</span>";
  130. }
  131. //设置相应的行颜色为红色
  132. function SetRedGrid(rowIndex, rowData) {
  133. if (rowData.IsAvailable != true || rowData.IsReserve == true) {
  134. return "color: red;";
  135. } else {
  136. return "";
  137. }
  138. }
  139. //联动查询
  140. function queryBuildingsInfoCampus(data) {
  141. reload();
  142. }
  143. //确定
  144. function CollegeClassroomBatchAdd_Confirm() {
  145. var d = validChooseAll();
  146. if (d.length == 0) {
  147. $.messager.alert("系统提示", "请选择您要新增的教室院系信息。");
  148. return;
  149. }
  150. $("#collegeClassroomViewList").val(JSON.stringify(d));
  151. $(document.forms[0]).submit();
  152. }
  153. </script>
  154. }
  155. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  156. @using (Ajax.BeginForm(new AjaxOptions
  157. {
  158. //生成成功后不关闭弹出页面(OnSuccess = "EMISFunction.FormSuccessNoClose")
  159. OnSuccess = "formSuccessReloadNoClose",
  160. OnBegin = "EMISFunction.FormSubmit",
  161. OnComplete = "EMISFunction.FormComplete"
  162. }))
  163. {
  164. <div class="p_SearchTitle">
  165. <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
  166. 查询条件</div>
  167. </div>
  168. @Html.PositionCondition("CollegeClassroomSelect")
  169. <div class="search_keyword">
  170. <div class="search_input">
  171. <ul>
  172. <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("Campus"):</li>
  173. <li class="sv">
  174. @Html.ComboGrid(cgopBuildingsInfoCampus, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  175. </li>
  176. <li class="sn" style="padding-left: 5px;">所在建筑:</li>
  177. <li class="sv">
  178. @Html.ComboGrid(cgopBuildings, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  179. </li>
  180. <li class="sn" style="padding-left: 5px;">教室名称:</li>
  181. <li class="sv">
  182. @Html.ComboGrid(cgopClassroomName, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  183. </li>
  184. <li class="sn" style="padding-left: 5px;">教室类型:</li>
  185. <li class="sv">
  186. @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.CF_ClassroomType, DropdownListBindType.SelectAll,
  187. new ComboGridOptions
  188. {
  189. ID = "ClassroomTypeDictionary",
  190. Name = "ClassroomTypeDictionary",
  191. OnSelect = "reload"
  192. },
  193. new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  194. </li>
  195. </ul>
  196. <ul>
  197. <li class="sn" style="padding-left: 5px;color:red;">多班教学:</li>
  198. <li class="sv">
  199. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  200. {
  201. BindType = DropdownListBindType.SelectAll,
  202. ID = "IsConcurrentUseDropdown",
  203. Name = "IsConcurrentUseDropdown",
  204. OnSelect = "reload"
  205. },
  206. new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  207. </li>
  208. <li class="sn" style="padding-left: 5px;color:red;">是否预留:</li>
  209. <li class="sv">
  210. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  211. {
  212. BindType = DropdownListBindType.SelectAll,
  213. ID = "IsReserveDropdown",
  214. Name = "IsReserveDropdown",
  215. OnSelect = "reload"
  216. },
  217. new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  218. </li>
  219. <li class="sn" style="padding-left: 5px;color:red;">是否可用:</li>
  220. <li class="sv">
  221. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  222. {
  223. BindType = DropdownListBindType.SelectAll,
  224. ID = "IsAvailableDropdown",
  225. Name = "IsAvailableDropdown",
  226. OnSelect = "reload"
  227. },
  228. new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  229. </li>
  230. <li class="sn" style="padding-left: 5px;color:red;">@EMIS.Utility.RSL.Get("College"):</li>
  231. <li class="sv">
  232. @Html.ComboGrid(cgopCollege, new Dictionary<string, string> { { "data-condition", "dgCollegeClassroomNoAddList" } })
  233. </li>
  234. </ul>
  235. </div>
  236. </div>
  237. <div class="p_title">
  238. <div style="float: left; margin-left: 6px; line-height: 30px; font-size: 12px;">
  239. 教室院系列表
  240. </div>
  241. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("BatchAdd")</div>
  242. </div>
  243. <div class="search_list">
  244. @Html.Hidden("collegeClassroomViewList")
  245. <table cellpadding="0" cellspacing="0" id="collegeClassroomtable">
  246. <tr>
  247. <td>
  248. @Html.DataGrid(new DataGridOptions
  249. {
  250. Columns = new List<DataGridColumn>()
  251. {
  252. new CheckBoxFieldColumn{ HeaderText="", FieldName="CollegeClassroomID" },
  253. new BoundFieldColumn { FieldName="ClassroomCode", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.06 },
  254. new BoundFieldColumn { FieldName="ClassroomName", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 },
  255. //new BoundFieldColumn { FieldName="ClassroomCollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6, CustomFormatFun="SetRedColumn" },
  256. new BoundFieldColumn { FieldName="BuildingsInfoName", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  257. //new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.04, OverflowLength=4 },
  258. new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, OrderFieldName="", Width=0.08, OverflowLength=8 },
  259. new BoundFieldColumn { FieldName="RoomUseName", HeaderText="房间用途", Align=AlignStyle.Center, OrderFieldName="RoomUseID", Width=0.05, OverflowLength=5 },
  260. new BoundFieldColumn { FieldName="Totalseating", HeaderText="总座位数", Align=AlignStyle.Center, Width=0.04 },
  261. new BoundFieldColumn { FieldName="Effectiveseating", HeaderText="有效座位数", Align=AlignStyle.Center, Width=0.05 },
  262. new BoundFieldColumn { FieldName="IsConcurrentUseName", HeaderText="多班教学", Align=AlignStyle.Center, OrderFieldName="IsConcurrentUse", Width=0.04 },
  263. new BoundFieldColumn { FieldName="IsReserveName", HeaderText="是否预留", Align=AlignStyle.Center, OrderFieldName="IsReserve", Width=0.04 },
  264. new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, OrderFieldName="IsAvailable", Width=0.04, CustomFormatFun="SetRedColumn" },
  265. //new BoundFieldColumn { FieldName="CollegeNo", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.06 },
  266. new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.1 }
  267. //new BoundFieldColumn { FieldName="UnitCategoryName", HeaderText="单位类别", Align=AlignStyle.Center, OrderFieldName="UnitCategoryID", Width=0.05 },
  268. //new BoundFieldColumn { FieldName="CollegeCampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.04, OverflowLength=4 }
  269. },
  270. CustomerRowStyleFun = "SetRedGrid",
  271. IsCheckOnSelect = true,
  272. //IsAutoLoad = false,
  273. DataSourceUrl = Url.Content("~/CollegeClassroom/CollegeClassroomNoAddList"),
  274. ID = "dgCollegeClassroomNoAddList",
  275. IsPagination = true,
  276. IsShowRowNumbers = true,
  277. IsSingleSelect = false
  278. })
  279. </td>
  280. </tr>
  281. </table>
  282. </div>
  283. }
  284. </div>