StudentDetail.cshtml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. ViewBag.Title = "Edit";
  5. Guid? RetakePlanID = new Guid(Request["RetakePlanID"]);
  6. }
  7. <style type="text/css">
  8. #studentDetail
  9. {
  10. width: 100%;
  11. border: 0px none;
  12. }
  13. #studentDetail tr
  14. {
  15. min-height: 30px;
  16. }
  17. </style>
  18. @section scripts{
  19. <script type="text/javascript">
  20. var nonSelect = "@DropdownList.SELECT_ALL";
  21. //已开班
  22. var CreatedStatus = "@((int)EMIS.ViewModel.ER_RetakePlanStatus.Generated)";
  23. var mnu = "";
  24. //加载
  25. $(function () {
  26. mnu = $.SystemGeneral.getUrlParam("MNU");
  27. })
  28. //刷新
  29. function reload() {
  30. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  31. }
  32. //获取选中的数据
  33. function validChoose() {
  34. var d = [];
  35. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  36. d.push(this.RetakePlanStudentID);
  37. });
  38. return d;
  39. }
  40. //弹出添加名单页面
  41. function RetakePlan_AddStudent() {
  42. if ('@(Request["Status"])' == CreatedStatus) {
  43. $.messager.alert("系统提示", "已开班状态的信息无法添加。");
  44. return;
  45. }
  46. $.popupTopWindow('添加名单', CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanTask/StudentSelect?FromMNU='
  47. + mnu + "&RetakePlanID=" + '@RetakePlanID', 850, 500, reload);
  48. }
  49. //确定添加名单
  50. function Addstudents_Confirm(studentList) {
  51. if (studentList == null)
  52. return;
  53. var studentViewList = $("#dgStudentList").cmsXDataTable("getRows");
  54. $.each(studentList, function (index, value) {
  55. if ($.grep(studentViewList, function (row, index) { return value.UserID == row.UserID; }).length == 0) {
  56. studentViewList.push({
  57. UserID: value.UserID,
  58. LoginID: value.StaffCode,
  59. UserName: value.UserName,
  60. SexName: value.SexName,
  61. Years: value.Years,
  62. GrademajorName: value.GrademajorName,
  63. ClassmajorName: value.ClassmajorName,
  64. InSchoolStatusName: value.InSchoolStatusName,
  65. StudentStatusName: value.StudentStatusName
  66. });
  67. }
  68. });
  69. $("#dgStudentList").cmsXDataTable("loadData", { rows: studentViewList, total: studentViewList.length });
  70. }
  71. //删除重修计划名单
  72. function RetakePlan_DelStudent() {
  73. var msg = "";
  74. var d = validChoose().join(',');
  75. if (d == "") {
  76. $.messager.alert("系统提示", "请选择您要删除的信息。");
  77. return;
  78. }
  79. if ('@(Request["Status"])' == CreatedStatus) {
  80. $.messager.alert("系统提示", "已开班状态的信息无法删除。");
  81. return;
  82. }
  83. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  84. if (r) {
  85. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanTask/IsExistsApplyStudentByRetakePlanStudentID', { retakePlanStudentIDs: d }, function (data) {
  86. if (data.IsSuccess) {
  87. if (data.Data) {
  88. $.messager.defaults = { ok: "继续删除", cancel: "取消" };
  89. $.messager.confirm("选择提示", "检测到要删除的信息中存在已报名重修的学生名单,是否继续删除?", function (r) {
  90. if (r) {
  91. Delete(d);
  92. }
  93. else {
  94. return;
  95. }
  96. });
  97. $.messager.defaults = { ok: "确定", cancel: "取消" };
  98. }
  99. else {
  100. Delete(d);
  101. }
  102. }
  103. else {
  104. $.messager.alert("系统提示", data.Message);
  105. }
  106. });
  107. }
  108. });
  109. }
  110. //确定删除重修计划名单
  111. function Delete(d) {
  112. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanTask/DeleteStudent', { retakePlanStudentIDs: d }, function (data) {
  113. if (data.IsSuccess = true) {
  114. $("#dgStudentList").cmsXDataTable('load');
  115. }
  116. $.messager.alert("系统提示", data.Message);
  117. });
  118. }
  119. //Excel导出
  120. function RetakePlan_ExportStudent() {
  121. $("#formQuery").submit();
  122. }
  123. </script>
  124. }
  125. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  126. @using (Ajax.BeginForm(new AjaxOptions
  127. {
  128. OnSuccess = "EMISFunction.FormSuccess",
  129. OnBegin = "EMISFunction.FormSubmit",
  130. OnComplete = "EMISFunction.FormComplete"
  131. }))
  132. {
  133. <div class="p_title">
  134. @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  135. 重修计划名单</div>*@
  136. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  137. @Html.ContextMenuBar("StuDetail")</div>
  138. </div>
  139. <div class="search_list">
  140. <table cellpadding="0" cellspacing="0" id="studentDetail">
  141. <tr>
  142. <td>
  143. @Html.DataGrid(new DataGridOptions
  144. {
  145. Columns = new List<DataGridColumn>()
  146. {
  147. new CheckBoxFieldColumn { HeaderText="", FieldName="RetakePlanStudentID" },
  148. new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.1 },
  149. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.04 },
  150. new BoundFieldColumn { FieldName="SexName", HeaderText="性别", Align=AlignStyle.Center, Width=0.02 },
  151. new BoundFieldColumn { FieldName="ClassmajorName", HeaderText="班级名称", Align=AlignStyle.Center, Width=0.12 },
  152. new BoundFieldColumn { FieldName="CourseCode", HeaderText="课程代码", Align=AlignStyle.Center, Width=0.06 },
  153. new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.08 },
  154. new BoundFieldColumn { FieldName="CourseTypeDesc", HeaderText="课程类型", Align=AlignStyle.Center, Width=0.05 },
  155. new BoundFieldColumn { FieldName="CourseCredit", HeaderText="学分", Align=AlignStyle.Center, Width=0.02 },
  156. new BoundFieldColumn { FieldName="InSchoolStatusName", HeaderText="在校状态", Align=AlignStyle.Center, Width=0.04 },
  157. //new BoundFieldColumn { FieldName="SchoolyearNumDesc", HeaderText="开课学年", Align=AlignStyle.Center, Width=0.04 },
  158. new BoundFieldColumn { FieldName="StarttermDesc", HeaderText="开课学期", Align=AlignStyle.Center, Width=0.04 },
  159. new BoundFieldColumn { FieldName="ApplyStatusName", HeaderText="报名状态", Align=AlignStyle.Center, Width=0.04 }
  160. },
  161. PageSize = 30,
  162. IsCheckOnSelect = true,
  163. DataSourceUrl = Url.Content("~/RetakePlanTask/StudentDetail?RetakePlanID=" + RetakePlanID),
  164. IsPostBack = true,
  165. ID = "dgStudentList",
  166. IsPagination = true,
  167. IsShowRowNumbers = true,
  168. IsSingleSelect = false,
  169. MaxHeight = 400
  170. })
  171. </td>
  172. </tr>
  173. </table>
  174. </div>
  175. }
  176. <form id="formQuery" method="post" action="@Url.Content("~/RetakePlanTask/StudentDetail_Excel?RetakePlanID=" + RetakePlanID)">
  177. </form>
  178. </div>