BatchAdd.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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 = "BatchAdd";
  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. IsPagination = true,
  89. IsShowRowNumbers = true,
  90. IsSingleSelect = false,
  91. }
  92. };
  93. }
  94. @section scripts{
  95. <script type="text/javascript">
  96. var nonSelect = "@DropdownList.SELECT_ALL";
  97. var college = '@EMIS.Utility.RSL.Get("College")';
  98. //刷新
  99. function reload() {
  100. $("#dgClassroomNoAddList").cmsXDataTable("load", $.getDataGridParams("dgClassroomNoAddList"));
  101. }
  102. //获取选中的数据
  103. function validChoose() {
  104. var d = [];
  105. $.each($("#dgClassroomNoAddList").cmsXDataTable("getSelections"), function (index) {
  106. d.push(this.ClassroomID);
  107. });
  108. return d;
  109. }
  110. //获取选中的数据All
  111. function validChooseAll() {
  112. var d = [];
  113. $.each($("#dgClassroomNoAddList").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 || rowData.IsReserve == true) {
  132. return "color: red;";
  133. } else {
  134. return "";
  135. }
  136. }
  137. //联动查询
  138. function queryCampus(data) {
  139. reload();
  140. }
  141. //确定
  142. function CollegeClassroomBatchAdd_Confirm() {
  143. var collegeID = $("#CollegeID").combogridX("getValue");
  144. if (collegeID == "" || collegeID == "-1" || collegeID == null) {
  145. $.messager.alert("系统提示", "请选择您要新增的" + college + "。");
  146. return;
  147. }
  148. var d = validChoose();
  149. if (d.length == 0) {
  150. $.messager.alert("系统提示", "请选择您要新增的教室信息。");
  151. return;
  152. }
  153. $("#classroomIDList").val(JSON.stringify(d));
  154. $(document.forms[0]).submit();
  155. }
  156. </script>
  157. }
  158. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  159. @using (Ajax.BeginForm(new AjaxOptions
  160. {
  161. //生成成功后不关闭弹出页面(OnSuccess = "EMISFunction.FormSuccessNoClose")
  162. OnSuccess = "formSuccessReloadNoClose",
  163. OnBegin = "EMISFunction.FormSubmit",
  164. OnComplete = "EMISFunction.FormComplete"
  165. }))
  166. {
  167. <div class="p_SearchTitle">
  168. <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
  169. 查询条件</div>
  170. </div>
  171. @Html.PositionCondition("ClassroomSelect")
  172. <div class="search_keyword">
  173. <div class="search_input">
  174. <ul>
  175. <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("Campus"):</li>
  176. <li class="sv">
  177. @Html.ComboGrid(cgopCampus, new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  178. </li>
  179. <li class="sn" style="padding-left: 5px;">所在建筑:</li>
  180. <li class="sv">
  181. @Html.ComboGrid(cgopBuildings, new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  182. </li>
  183. <li class="sn" style="padding-left: 5px;">教室名称:</li>
  184. <li class="sv">
  185. @Html.ComboGrid(cgopClassroomName, new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  186. </li>
  187. <li class="sn" style="padding-left: 5px;">教室类型:</li>
  188. <li class="sv">
  189. @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.CF_ClassroomType, DropdownListBindType.SelectAll,
  190. new ComboGridOptions
  191. {
  192. ID = "ClassroomTypeDictionary",
  193. Name = "ClassroomTypeDictionary",
  194. OnSelect = "reload"
  195. },
  196. new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  197. </li>
  198. </ul>
  199. <ul>
  200. <li class="sn" style="padding-left: 5px;color:red;">多班教学:</li>
  201. <li class="sv">
  202. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  203. {
  204. BindType = DropdownListBindType.SelectAll,
  205. ID = "IsConcurrentUseDropdown",
  206. Name = "IsConcurrentUseDropdown",
  207. OnSelect = "reload"
  208. },
  209. new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  210. </li>
  211. <li class="sn" style="padding-left: 5px;color:red;">是否预留:</li>
  212. <li class="sv">
  213. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  214. {
  215. BindType = DropdownListBindType.SelectAll,
  216. ID = "IsReserveDropdown",
  217. Name = "IsReserveDropdown",
  218. OnSelect = "reload"
  219. },
  220. new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  221. </li>
  222. <li class="sn" style="padding-left: 5px;color:red;">是否可用:</li>
  223. <li class="sv">
  224. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  225. {
  226. BindType = DropdownListBindType.SelectAll,
  227. ID = "IsAvailableDropdown",
  228. Name = "IsAvailableDropdown",
  229. OnSelect = "reload"
  230. },
  231. new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  232. </li>
  233. <li class="sn" style="padding-left: 5px;color:red;">@EMIS.Utility.RSL.Get("College"):</li>
  234. <li class="sv">
  235. @Html.ComboGridFor(x => x.CollegeID, cgopCollege, new Dictionary<string, string> { { "data-condition", "dgClassroomNoAddList" } })
  236. </li>
  237. </ul>
  238. </div>
  239. </div>
  240. <div class="p_title">
  241. <div style="float: left; margin-left: 6px; line-height: 30px; font-size: 12px;">
  242. 教室信息列表
  243. </div>
  244. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("BatchAdd")</div>
  245. </div>
  246. <div class="search_list">
  247. @Html.Hidden("classroomIDList")
  248. <table cellpadding="0" cellspacing="0" id="classroomtable">
  249. <tr>
  250. <td>
  251. @Html.DataGrid(new DataGridOptions
  252. {
  253. Columns = new List<DataGridColumn>()
  254. {
  255. new CheckBoxFieldColumn{ HeaderText="", FieldName="ClassroomID" },
  256. new BoundFieldColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
  257. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 },
  258. new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  259. new BoundFieldColumn { FieldName="RoomUseName", HeaderText="房间用途", Align=AlignStyle.Center, OrderFieldName="RoomUseID", Width=0.05, OverflowLength=5 },
  260. //new BoundFieldColumn { FieldName="FloorLevel", HeaderText="所在楼层", Align=AlignStyle.Center, Width=0.04 },
  261. //new BoundFieldColumn { FieldName="RowCout", HeaderText="行数", Align=AlignStyle.Center, Width=0.02 },
  262. //new BoundFieldColumn { FieldName="ColumnCount", HeaderText="列数", Align=AlignStyle.Center, Width=0.02 },
  263. new BoundFieldColumn { FieldName="Totalseating", HeaderText="总座位数", Align=AlignStyle.Center, Width=0.04 },
  264. new BoundFieldColumn { FieldName="Effectiveseating", HeaderText="有效座位数", Align=AlignStyle.Center, Width=0.05 },
  265. //new BoundFieldColumn { FieldName="Examinationseating", HeaderText="考试座位数", Align=AlignStyle.Center, Width=0.05 },
  266. new BoundFieldColumn { FieldName="BuildingsInfoName", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  267. new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  268. new BoundFieldColumn { FieldName="IsConcurrentUseName", HeaderText="多班教学", Align=AlignStyle.Center, OrderFieldName="IsConcurrentUse", Width=0.04 },
  269. new BoundFieldColumn { FieldName="IsReserveName", HeaderText="是否预留", Align=AlignStyle.Center, OrderFieldName="IsReserve", Width=0.04 },
  270. new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, OrderFieldName="IsAvailable", Width=0.04, CustomFormatFun="SetRedColumn" }
  271. //new BoundFieldColumn { FieldName="CollegeCode", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.05 },
  272. //new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 }
  273. },
  274. CustomerRowStyleFun = "SetRedGrid",
  275. IsCheckOnSelect = true,
  276. //IsAutoLoad = false,
  277. DataSourceUrl = Url.Content("~/CollegeClassroom/ClassroomNoAddList"),
  278. ID = "dgClassroomNoAddList",
  279. IsPagination = true,
  280. IsShowRowNumbers = true,
  281. IsSingleSelect = false
  282. })
  283. </td>
  284. </tr>
  285. </table>
  286. </div>
  287. }
  288. </div>