Grademajor.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGrademajorList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGrademajorList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GrademajorID);
  16. });
  17. return d;
  18. }
  19. //(年级专业复制)批量新增
  20. function Grademajor_BatchAdd() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/BatchAdd?MNU=" + mnu;
  22. $.popupTopWindow('年级专业复制', redirectTo, 700, 320, null, null);
  23. }
  24. //新增
  25. function Grademajor_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('年级专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/CopyAdd?grademajorID=' + d[0] + '&MNU=' + mnu, 700, 420, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('年级专业新增', redirectTo, 700, 420, null, null);
  32. }
  33. }
  34. //修改按钮
  35. function Grademajor_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 + "?grademajorID=" + d + "&MNU=" + mnu + "&type=edit";
  46. $.popupTopWindow('年级专业修改', redirectTo, 700, 420, null, null);
  47. }
  48. //查看
  49. function edit(rowindex, rowdata) {
  50. var redirectTo = url + "?grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu + "&type=detail";
  51. $.popupTopWindow('年级专业信息', redirectTo, 700, 420, null, null);
  52. }
  53. //批量修改(重写)
  54. SystemBatchModifyControl.OnSubmit = function () {
  55. //年级
  56. if (document.getElementById("GradeIDDictionaryDropDownList_div").style.display != "none") {
  57. var r = false;
  58. var d = validChoose().join(',');
  59. var gradeID = $("#GradeID_DictionaryDropDownList").combobox("getValue");
  60. var semesterID = null;
  61. if (d == "") {
  62. return;
  63. }
  64. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, gradeID: gradeID, semesterID: semesterID }, function (data) {
  65. if (data.IsSuccess) {
  66. $.messager.alert("系统提示", data.Message);
  67. $("#dgGrademajorList").cmsXDataTable('load');
  68. }
  69. else {
  70. return true;
  71. }
  72. });
  73. return r;
  74. }
  75. //学期
  76. else if (document.getElementById("SemesterIDDictionaryDropDownList_div").style.display != "none") {
  77. var r = false;
  78. var d = validChoose().join(',');
  79. var gradeID = null;
  80. var semesterID = $("#SemesterID_DictionaryDropDownList").combobox("getValue");
  81. if (d == "") {
  82. return;
  83. }
  84. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, gradeID: gradeID, semesterID: semesterID }, function (data) {
  85. if (data.IsSuccess) {
  86. $.messager.alert("系统提示", data.Message);
  87. $("#dgGrademajorList").cmsXDataTable('load');
  88. }
  89. else {
  90. return true;
  91. }
  92. });
  93. return r;
  94. }
  95. }
  96. //删除
  97. function Grademajor_Delete() {
  98. var d = validChoose().join(',');
  99. if (d == "") {
  100. $.messager.alert("系统提示", "请选择您要删除的信息。");
  101. return;
  102. }
  103. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  104. if (r) {
  105. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/Delete', { grademajorIDs: d }, function (data) {
  106. if (data.IsSuccess) {
  107. $.messager.alert("系统提示", data.Message);
  108. $("#dgGrademajorList").cmsXDataTable('load');
  109. } else {
  110. $.messager.alert("系统提示", data.Message);
  111. }
  112. });
  113. }
  114. });
  115. }
  116. //Excel导出
  117. function Grademajor_Export() {
  118. $("#formQuery").submit();
  119. }
  120. //Excel导入
  121. function Grademajor_Import() {
  122. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/Import?MNU=' + mnu;
  123. $.popupTopWindow('年级专业信息导入', redirectTo, 420, 300, reload);
  124. }
  125. //年级专业对应的班级明细
  126. function editClassmajorCount(rowindex, rowdata) {
  127. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  128. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/ClassmajorList?inSchoolStatus=" + inSchoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu;
  129. $.popupTopWindow('年级专业班级明细', redirectTo, 850, 540, null, null);
  130. }
  131. //年级专业学生明细
  132. function editStudentCount(rowindex, rowdata) {
  133. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  134. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu;
  135. $.popupTopWindow('年级专业学生明细', redirectTo, 850, 540, null, null);
  136. }
  137. //联动查询
  138. function queryCampus(data) {
  139. var campusID = $("#CampusDropdown").combogridX("getValue");
  140. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  141. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  142. queryClass();
  143. }
  144. function queryCollege(data) {
  145. var campusID = $("#CampusDropdown").combogridX("getValue");
  146. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  147. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  148. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  149. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  150. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  151. queryClass();
  152. }
  153. function queryStandard(data) {
  154. queryClass();
  155. }
  156. function queryClass() {
  157. var jsonString = "";
  158. var parameterString = "";
  159. var campusID = $("#CampusDropdown").combogridX("getValue");
  160. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  161. var standardID = $("#DictionaryStandard").combogridX("getValue");
  162. var educationID = $("#DictionaryEducation").combogridX("getValue");
  163. var learningformID = $("#DictionaryLearningform").combogridX("getValue");
  164. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  165. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  166. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  167. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  168. if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
  169. if (parameterString != "") {
  170. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  171. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  172. }
  173. else {
  174. $("#DictionaryStandard").combogridX("reload");
  175. }
  176. reload();
  177. }