GraduationStandard.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGraduationStandardList").cmsXDataTable("load", $.getDataGridParams("dgGraduationStandardList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGraduationStandardList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduationStandardID);
  16. });
  17. return d;
  18. }
  19. //标准生成
  20. function GraduationStandard_Generate() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/Generate?MNU=" + mnu;
  22. $.popupTopWindow('毕业标准生成', redirectTo, 540, 254, null, null);
  23. }
  24. //新增
  25. function GraduationStandard_Add() {
  26. //var d = validChoose();
  27. //if (d.length > 0) {
  28. // $.popupTopWindow('毕业标准复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduationStandard/CopyAdd?graduationStandardID=' + d[0] + '&MNU=' + mnu, 680, 300, null, null);
  29. //} else {
  30. // var redirectTo = url + "?MNU=" + mnu;
  31. // $.popupTopWindow('毕业标准新增', redirectTo, 680, 300, null, null);
  32. //}
  33. //采用以下方式进行新增
  34. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/GraduationStandardBatchAdd" + "?MNU=" + mnu;
  35. $.popupTopWindow('毕业标准新增', redirectTo, 860, 540, reload, null);
  36. }
  37. //修改
  38. function GraduationStandard_Update() {
  39. var d = validChoose();
  40. if (d == "") {
  41. $.messager.alert("系统提示", "请选择您要修改的信息。");
  42. return;
  43. }
  44. if (d.length > 1) {
  45. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  46. return;
  47. }
  48. var redirectTo = url + "?GraduationStandardID=" + d + "&MNU=" + mnu;
  49. $.popupTopWindow('毕业标准修改', redirectTo, 680, 300, null, null);
  50. }
  51. //删除
  52. function GraduationStandard_Delete() {
  53. var d = validChoose().join(',');
  54. if (d == "") {
  55. $.messager.alert("系统提示", "请选择您要删除的信息。");
  56. return;
  57. }
  58. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  59. if (r) {
  60. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GraduationStandard/Delete', { graduationStandardIDs: d }, function (data) {
  61. if (data == "删除成功。") {
  62. $.messager.alert("系统提示", data);
  63. $("#dgGraduationStandardList").cmsXDataTable('load');
  64. } else {
  65. $.messager.alert("系统提示", data);
  66. }
  67. });
  68. }
  69. });
  70. }
  71. //专业计划信息明细
  72. function editSpecialtyPlan(rowindex, rowdata) {
  73. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/SpecialtyPlanList?graduationStandardID=" + rowdata.GraduationStandardID + "&MNU=" + mnu;
  74. $.popupTopWindow('专业计划明细', redirectTo, 985, 540, null, null);
  75. }
  76. //执行计划信息明细
  77. function editExecutablePlan(rowindex, rowdata) {
  78. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/ExecutablePlanList?graduationStandardID=" + rowdata.GraduationStandardID + "&MNU=" + mnu;
  79. $.popupTopWindow('执行计划明细', redirectTo, 985, 540, null, null);
  80. }
  81. //学生信息明细
  82. function editStudentCount(rowindex, rowdata) {
  83. var inschoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  84. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/Detail?inschoolStatus=" + inschoolStatus
  85. + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu;
  86. $.popupTopWindow('年级专业学生明细', redirectTo, 800, 500, null, null);
  87. }
  88. //设置列颜色为红色
  89. function SetRedColumn(index, row, value) {
  90. return " <span style=\"color: red;\">" + value + "</span>";
  91. }
  92. //设置相应的行颜色为红色
  93. function SetRedGrid(rowIndex, rowData) {
  94. if (rowData.StudentCount <= 0) {
  95. return "color: red;";
  96. } else {
  97. return "";
  98. }
  99. }
  100. //Excel导出
  101. function GraduationStandard_Export() {
  102. $("#formQuery").submit();
  103. }
  104. //联动查询
  105. function queryCampus(data) {
  106. var campusID = $("#CampusDropdown").combogridX("getValue");
  107. if (campusID != nonSelect) {
  108. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  109. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  110. }
  111. queryClass();
  112. }
  113. function queryCollege(data) {
  114. var campusID = $("#CampusDropdown").combogridX("getValue");
  115. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  116. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  117. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  118. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  119. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  120. queryClass();
  121. }
  122. function querySchoolyear(data) {
  123. queryClass();
  124. }
  125. function queryStandard(data) {
  126. queryClass();
  127. }
  128. function queryClass() {
  129. var jsonString = "";
  130. var parameterString = "";
  131. var campusID = $("#CampusDropdown").combogridX("getValue");
  132. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  133. var schoolYearID = $("#DictionarySchoolyear").combobox("getValue");
  134. var standardID = $("#DictionaryStandard").combogridX("getValue");
  135. var educationID = $("#DictionaryEducation").combogridX("getValue");
  136. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  137. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  138. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  139. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  140. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  141. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  142. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  143. if (parameterString != "") {
  144. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  145. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  146. }
  147. else {
  148. $("#DictionaryStandard").combogridX("reload");
  149. }
  150. reload();
  151. }