ClassmajorReport.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. var isFirstLoadGrademajor = true;
  2. var isFirstLoadClassmajor = true;
  3. function Report_Search() {
  4. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  5. var collegeID = $("#CollegeDropdown").combobox("getValue");
  6. if (collegeID == -1 || collegeID == "") {
  7. $.messager.alert("系统信息", "请选择院系所");
  8. return;
  9. }
  10. //collegeID = collegeID == -1 ? ":isnull=true" : "=" + collegeID;
  11. collegeID = collegeID == -1 ? "=" : "=" + collegeID;
  12. var gradeID = $("#DictionarySchoolyear").combobox("getValue");
  13. if (gradeID == -1 || gradeID == "") {
  14. $.messager.alert("系统信息", "请选择年级");
  15. return;
  16. }
  17. gradeID = gradeID == -1 ? "" : gradeID;
  18. var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
  19. if (classmajorID == -1 || classmajorID == "")
  20. $.messager.alert("系统信息", "请选择班级");
  21. else {
  22. if (CMS_SystemConfig.ReportType == 1) {
  23. $("#reportContent").attr("src", CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fEducationScheduling%2fClassmajorSchedulingView&ClassmajorID_RAP=" + classmajorID + "&CollegeID_RAP" + collegeID + "&SchoolyearID_RAP=" + schoolYearID + "&Years_RAP=" + gradeID);
  24. }
  25. if (CMS_SystemConfig.ReportType == 2) {
  26. var fileUrl = CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedulingReport/ClassmajorSchedulingPDF?ClassmajorID=" + classmajorID + "&CollegeID" + collegeID + "&SchoolyearID=" + schoolYearID + "&Years=" + gradeID;
  27. $("#reportContent").attr("src", CMS_SystemConfig.VirtualDirectoryPath + "/Scripts/pdf.js/web/viewer.html?file=" + encodeURIComponent(fileUrl));
  28. }
  29. }
  30. }
  31. function QueryCollegeDropdownList(data) {
  32. // if (((data.length && data.length > 0) || data)
  33. // && $("#GrademajorDropdown").length > 0 && $.data($("#GrademajorDropdown")[0], "combobox")) {
  34. // var url = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/BindDropdownListByCollege?bindType=PleaseSelect";
  35. // var collegeID = $("#CollegeDropdown").combobox("getValue");
  36. // if (collegeID != nonSelect) url += "&collegeID=" + collegeID;
  37. // $("#GrademajorDropdown").combobox("reload", url);
  38. // }
  39. $("#DictionaryStandard").combogridX("setValue", "-1");
  40. var collegeID = $("#CollegeDropdown").combogrid("getValue");
  41. if (collegeID != nonSelect) {
  42. var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})";
  43. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  44. }
  45. queryClass();
  46. }
  47. function SelectGrademajorDropdownList() {
  48. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/BindDropdownListByGrademajorID?bindType=PleaseSelect";
  49. var grademajorID = $("#GrademajorDropdown").combobox("getValue");
  50. if (grademajorID != nonSelect) url += "&grademajorID=" + grademajorID;
  51. $("#ClassmajorDropdown").combobox("reload", url); SelectGrademajorDropdownList
  52. }
  53. function QueryGrademajorDropdownList(data) {
  54. if (((data.length && data.length > 0) || data)
  55. && $("#ClassmajorDropdown").length > 0 && $.data($("#ClassmajorDropdown")[0], "combobox")) {
  56. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/BindDropdownListByGrademajorID?bindType=PleaseSelect";
  57. if (isFirstLoadGrademajor) {
  58. isFirstLoadGrademajor = false;
  59. } else {
  60. if (data.length > 0) {
  61. $("#GrademajorDropdown").combobox("setValue", data[0].Value);
  62. } else {
  63. $("#GrademajorDropdown").combobox("clear");
  64. }
  65. }
  66. var grademajorID = $("#GrademajorDropdown").combobox("getValue");
  67. if (grademajorID != nonSelect) url += "&grademajorID=" + grademajorID;
  68. $("#ClassmajorDropdown").combobox("reload", url);
  69. }
  70. }
  71. function QueryClassmajorDropdownList(data) {
  72. if (((data.length && data.length > 0) || data)) {
  73. if (isFirstLoadClassmajor) {
  74. isFirstLoadClassmajor = false;
  75. } else {
  76. if (data.length > 0) {
  77. $("#ClassmajorDropdown").combobox("setValue", data[0].Value);
  78. } else {
  79. $("#ClassmajorDropdown").combobox("clear");
  80. }
  81. }
  82. queryClass();
  83. }
  84. }
  85. function QueryLearningformDropdownList() { }
  86. function SelectClassmajorDropdownList() {
  87. // // var url = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/BindDropdownListByYearOrStandard?bindType=PleaseSelect";
  88. // var jsonString = "({'QueryParamsDatas':'";
  89. // var year = $("#DictionarySchoolyear").combobox("getValue");
  90. // //if (year != nonSelect) url += "&year=" + year;
  91. // if (year != nonSelect) jsonString += "DictionaryGrade|*|" + year + "|@|";
  92. // var standardID = $("#DictionaryStandard").combogridX("getValue");
  93. // //if (standardID != nonSelect) url += "&standardID=" + standardID;
  94. // if (standardID != nonSelect) jsonString += "DictionaryStandard|*|" + standardID + "|@|";
  95. // $("#ClassmajorDropdown").combogridX("reload", eval(jsonString + "'})"));
  96. queryClass();
  97. }
  98. function reload() {
  99. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  100. var collegeID = $("#CollegeDropdown").combobox("getValue");
  101. var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
  102. }
  103. function queryClass() {
  104. var jsonString = "";
  105. var parameterString = "";
  106. //var campusID = $("#CampusDropdown").combogridX("getValue");
  107. var collegeID = $("#CollegeDropdown").combobox("getValue");
  108. //var educationID = $("#Education").combobox("getValue");
  109. var gradeID = $("#DictionarySchoolyear").combobox("getValue");
  110. var standardID = $("#DictionaryStandard").combogridX("getValue");
  111. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  112. //if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  113. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  114. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  115. if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
  116. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  117. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  118. if (parameterString != "") {
  119. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  120. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  121. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  122. } else {
  123. $("#ClassmajorDropdown").combogridX("reload");
  124. $("#DictionaryStandard").combogridX("reload");
  125. }
  126. reload();
  127. }