DepartmentReport.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. var isFirstLoadCollege = true;
  2. var isFirstLoadDepartment = true;
  3. function Report_Search() {
  4. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  5. var collegeID = $("#CollegeDropdown").combobox("getValue");
  6. var departmentID = $("#DepartmentDropdown").combobox("getValue");
  7. var handleModeID = $("#HandleModeDropdown").combobox("getValue");
  8. if (handleModeID == -1 || handleModeID == "") {
  9. handleModeID = "";
  10. }
  11. if (departmentID == -1 || departmentID == "")
  12. $.messager.alert("系统信息", "请选择教研室");
  13. else {
  14. if (CMS_SystemConfig.ReportType == 1) {
  15. $("#reportContent").attr("src", CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fEducationScheduling%2fDepartmentSchedulingView&DepartmentID_RAP=" + departmentID + "&CollegeID_RAP=" + collegeID + "&SchoolyearID_RAP=" + schoolYearID + "&HandleModeID_RAP=" + handleModeID);
  16. }
  17. if (CMS_SystemConfig.ReportType == 2) {
  18. var fileUrl = CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedulingReport/DepartmentSchedulingPDF?DepartmentID=" + departmentID + "&CollegeID=" + collegeID + "&SchoolyearID=" + schoolYearID + "&HandleModeID=" + handleModeID;
  19. $("#reportContent").attr("src", CMS_SystemConfig.VirtualDirectoryPath + "/Scripts/pdf.js/web/viewer.html?file=" + encodeURIComponent(fileUrl));
  20. }
  21. }
  22. }
  23. function QueryCollegeDropdownList(data) {
  24. if (((data.length && data.length > 0) || data)
  25. && $("#DepartmentDropdown").length > 0 && $.data($("#DepartmentDropdown")[0], "combobox")) {
  26. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?bindType=PleaseSelect";
  27. if (isFirstLoadCollege) {
  28. isFirstLoadCollege = false;
  29. } else {
  30. if (data.length > 0) {
  31. $("#DepartmentDropdown").combobox("setValue", data[0].Value);
  32. } else {
  33. $("#DepartmentDropdown").combobox("clear");
  34. }
  35. }
  36. var collegeID = $("#CollegeDropdown").combobox("getValue");
  37. if (collegeID != nonSelect) url += "&collegeID=" + collegeID;
  38. $("#DepartmentDropdown").combobox("reload", url);
  39. }
  40. }
  41. function SelectCollegeDropdownList() {
  42. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?bindType=PleaseSelect";
  43. var collegeID = $("#CollegeDropdown").combobox("getValue");
  44. if (collegeID != nonSelect) url += "&collegeID=" + collegeID;
  45. $("#DepartmentDropdown").combobox("reload", url);
  46. }
  47. function QueryDepartmentDropdownList(data) {
  48. if (((data.length && data.length > 0) || data)) {
  49. if (isFirstLoadDepartment) {
  50. isFirstLoadDepartment = false;
  51. } else {
  52. if (data.length > 0) {
  53. $("#DepartmentDropdown").combobox("setValue", data[0].Value);
  54. } else {
  55. $("#DepartmentDropdown").combobox("clear");
  56. }
  57. }
  58. reload();
  59. }
  60. }
  61. function reload() {
  62. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  63. var collegeID = $("#CollegeDropdown").combobox("getValue");
  64. var departmentID = $("#DepartmentDropdown").combobox("getValue");
  65. }