Classmajor.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgClassmajorList").cmsXDataTable("load", $.getDataGridParams("dgClassmajorList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgClassmajorList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ClassmajorID);
  16. });
  17. return d;
  18. }
  19. //班级复制(批量新增)
  20. function Classmajor_BatchAdd() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/BatchAdd?MNU=" + mnu;
  22. $.popupTopWindow('班级复制', redirectTo, 650, 320, null, null);
  23. }
  24. //新增
  25. function Classmajor_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('班级信息复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Classmajor/CopyAdd?classmajorID=' + d[0] + '&MNU=' + mnu, 720, 480, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('班级信息新增', redirectTo, 720, 480, null, null);
  32. }
  33. }
  34. //修改按钮
  35. function Classmajor_Update() {
  36. var d = validChoose();
  37. if (d == "") {
  38. $.messager.alert("系统提示", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?classmajorID=" + d + "&MNU=" + mnu + "&type=edit";
  46. $.popupTopWindow('班级信息修改', redirectTo, 720, 480, null, null);
  47. }
  48. //查看
  49. function edit(rowindex, rowdata) {
  50. var redirectTo = url + "?classmajorID=" + rowdata.ClassmajorID + "&MNU=" + mnu + "&type=detail";
  51. $.popupTopWindow('班级信息', redirectTo, 720, 480, null, null);
  52. }
  53. //删除
  54. function Classmajor_Delete() {
  55. var d = validChoose().join(',');
  56. if (d == "") {
  57. $.messager.alert("系统提示", "请选择您要删除的信息。");
  58. return;
  59. }
  60. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  61. if (r) {
  62. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Classmajor/Delete', { classmajorIDs: d }, function (data) {
  63. if (data.IsSuccess) {
  64. $.messager.alert("系统提示", data.Message);
  65. $("#dgClassmajorList").cmsXDataTable('load');
  66. } else {
  67. $.messager.alert("系统提示", data.Message);
  68. }
  69. });
  70. }
  71. });
  72. }
  73. //Excel导出
  74. function Classmajor_Export() {
  75. $("#formQuery").submit();
  76. }
  77. //Excel导入
  78. function Classmajor_Import() {
  79. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Classmajor/Import?MNU=' + mnu;
  80. $.popupTopWindow('班级信息导入', redirectTo, 420, 300, reload);
  81. }
  82. //班级信息学生明细
  83. function editStudentCount(rowindex, rowdata) {
  84. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  85. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&classmajorID=" + rowdata.ClassmajorID + "&MNU=" + mnu;
  86. $.popupTopWindow('班级信息学生明细', redirectTo, 850, 540, null, null);
  87. }
  88. //联动查询
  89. function queryCampus(data) {
  90. var campusID = $("#CampusDropdown").combogridX("getValue");
  91. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  92. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  93. queryClass();
  94. }
  95. function queryCollege(data) {
  96. var campusID = $("#CampusDropdown").combogridX("getValue");
  97. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  98. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  99. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  100. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  101. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  102. queryClass();
  103. }
  104. function queryGrade(data) {
  105. queryClass();
  106. }
  107. function queryStandard(data) {
  108. queryClass();
  109. }
  110. function queryGrademajor(data) {
  111. queryClass();
  112. }
  113. function queryClass() {
  114. var jsonString = "";
  115. var parameterString = "";
  116. var campusID = $("#CampusDropdown").combogridX("getValue");
  117. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  118. var gradeID = $("#DictionaryGrade").combogridX("getValue"); //combobox
  119. var standardID = $("#DictionaryStandard").combogridX("getValue");
  120. var educationID = $("#DictionaryEducation").combogridX("getValue");
  121. var learningformID = $("#DictionaryLearningform").combogridX("getValue");
  122. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  123. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  124. if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
  125. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  126. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  127. if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
  128. if (parameterString != "") {
  129. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  130. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  131. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  132. }
  133. else {
  134. $("#DictionaryStandard").combogridX("reload");
  135. $("#GrademajorComboGrid").combogridX("reload");
  136. }
  137. reload();
  138. }