ClassroomReport.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var isFirstLoadBuilding = true;
  2. function Report_Search() {
  3. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  4. var buildingID = $("#BuildingsDropdown").combogridX("getValue");
  5. buildingID = buildingID == "" ? "=" : "=" + buildingID;
  6. var classroomID = $("#ClassroomDropdown").combogridX("getValue");
  7. if (classroomID == -1 || classroomID == "") {
  8. $.messager.alert("系统信息", "请选择教室");
  9. //$("#ClassroomDropdown").combogridX("reload", eval("({'QueryParamsDatas':'BuildingsDropdown|*|" + $("#BuildingsDropdown").combogridX("getValue") + "|@|'})"));
  10. }
  11. else {
  12. if (CMS_SystemConfig.ReportType == 1) {
  13. $("#reportContent").attr("src", CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fEducationScheduling%2fClassroomSchedulingView&BuildingsInfoID_RAP" + buildingID + "&ClassroomID_RAP=" + classroomID + "&SchoolyearID_RAP=" + schoolYearID);
  14. }
  15. if (CMS_SystemConfig.ReportType == 2) {
  16. var fileUrl = CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedulingReport/ClassroomReportPDF?BuildingsInfoID=" + buildingID + "&ClassroomID=" + classroomID + "&SchoolyearID=" + schoolYearID;
  17. $("#reportContent").attr("src", CMS_SystemConfig.VirtualDirectoryPath + "/Scripts/pdf.js/web/viewer.html?file=" + encodeURIComponent(fileUrl));
  18. }
  19. }
  20. }
  21. function SelectBuildingsDropdownList() {
  22. var buildingID = $("#BuildingsDropdown").combogridX("getValue");
  23. var jsonString = "({'QueryParamsDatas':'BuildingsDropdown|*|" + buildingID + "|@|'})";
  24. $("#ClassroomDropdown").combogridX("reload", eval(jsonString));
  25. // if (buildingID != nonSelect) {
  26. // var jsonString = "({'QueryParamsDatas':'BuildingsDropdown|*|" + buildingID + "|@|'})";
  27. // $("#ClassroomDropdown").combogridX("reload", eval(jsonString));
  28. // }
  29. }
  30. function QueryBuildingsDropdownList(data) {
  31. if (((data.length && data.length > 0) || data)
  32. && $("#ClassroomDropdown").length > 0 && $.data($("#ClassroomDropdown")[0], "combogridX")) {
  33. if (isFirstLoadBuilding) {
  34. var opts = $.data($("#BuildingsDropdown")[0], "combogridX").options;
  35. isFirstLoadBuilding = false;
  36. if (data.rows.length > 0) {
  37. $("#BuildingsDropdown").combogridX("setValue", data.rows[0][opts.valueField]);
  38. }
  39. } else {
  40. }
  41. var buildingID = $("#BuildingsDropdown").combogridX("getValue");
  42. if (buildingID != nonSelect) {
  43. var jsonString = "({'QueryParamsDatas':'BuildingsDropdown|*|" + buildingID + "|@|'})";
  44. $("#ClassroomDropdown").combogridX("reload", eval(jsonString));
  45. }
  46. }
  47. }
  48. function QueryClassroomDropdownList(data) {
  49. if (((data.length && data.length > 0) || data)) {
  50. var opts = $.data($("#ClassroomDropdown")[0], "combogridX").options;
  51. if (data.rows.length > 0) {
  52. $("#ClassroomDropdown").combogridX("setValue", data.rows[0][opts.valueField], reload);
  53. }
  54. }
  55. }
  56. function reload() {
  57. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  58. var buildingID = $("#BuildingsDropdown").combogridX("getValue");
  59. var classroomID = $("#ClassroomDropdown").combogridX("getValue");
  60. }