TeacherReport.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var isFirstLoadDepartment = true;
  2. var isFirstLoadStaff = true;
  3. function Report_Search() {
  4. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  5. var collegeID = $("#CollegeDropdown").combobox("getValue");
  6. collegeID = collegeID == -1 ? "=" : "=" + collegeID;
  7. var userID = $("#StaffDropdown").combogridX("getValue");
  8. if (userID == -1 || userID == "")
  9. $.messager.alert("系统信息", "请选择教师");
  10. else {
  11. if (CMS_SystemConfig.ReportType == 1) {
  12. $("#reportContent").attr("src", CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fEducationScheduling%2fTeacherSchedulingView&CollegeID_RAP" + collegeID + "&UserID_RAP=" + userID + "&SchoolyearID_RAP=" + schoolYearID);
  13. }
  14. if (CMS_SystemConfig.ReportType == 2) {
  15. var fileUrl = CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedulingReport/TeacherSchedulingPDF?CollegeID=" + collegeID + "&UserID=" + userID + "&SchoolyearID=" + schoolYearID;
  16. $("#reportContent").attr("src", CMS_SystemConfig.VirtualDirectoryPath + "/Scripts/pdf.js/web/viewer.html?file=" + encodeURIComponent(fileUrl));
  17. }
  18. }
  19. }
  20. function QueryCollegeDropdownList(data) {
  21. if (((data.length && data.length > 0) || data)
  22. && $("#DepartmentDropdown").length > 0 && $.data($("#DepartmentDropdown")[0], "combobox")) {
  23. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?bindType=PleaseSelect"; // "/Department/DepartmentDropdownListBanid?bindType=2";
  24. var collegeID = $("#CollegeDropdown").combobox("getValue");
  25. if (collegeID != nonSelect) url += "&collegeID=" + collegeID;
  26. $("#DepartmentDropdown").combobox("reload", url);
  27. }
  28. }
  29. function SelectDepartmentDropdownList() {
  30. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Staff/GetDepartmentStaffDataBind?bindType=PleaseSelect"; //"/Staff/GetDepartmentStaffDataBind?bindType=2";
  31. var departmentID = $("#DepartmentDropdown").combobox("getValue");
  32. if (departmentID != nonSelect) url += "&DepartmentDropdown=" + departmentID;
  33. // $("#StaffDropdown").combobox("reload", url);
  34. var jsonString = "({'QueryParamsDatas':'DepartmentDropdown|*|" + departmentID + "|@|'})";
  35. $("#StaffDropdown").combogridX("reload", eval(jsonString));
  36. }
  37. function QueryDepartmentDropdownList(data) {
  38. if (((data.length && data.length > 0) || data)
  39. && $("#StaffDropdown").length > 0 && $.data($("#StaffDropdown")[0], "combobox")) {
  40. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Staff/DepartmentDropdown?bindType=PleaseSelect"; //"/Staff/DepartmentDropdown?bindType=2";
  41. if (isFirstLoadDepartment) {
  42. isFirstLoadDepartment = false;
  43. } else {
  44. if (data.length > 0) {
  45. $("#DepartmentDropdown").combobox("setValue", data[0].Value);
  46. } else {
  47. $("#DepartmentDropdown").combobox("clear");
  48. }
  49. }
  50. var departmentID = $("#DepartmentDropdown").combobox("getValue");
  51. if (departmentID != nonSelect) url += "&departmentID=" + departmentID;
  52. $("#StaffDropdown").combogridX("reload", url);
  53. }
  54. }
  55. function QueryStaffDropdownList(data) {
  56. if (((data.length && data.length > 0) || data)) {
  57. if (isFirstLoadStaff) {
  58. isFirstLoadStaff = false;
  59. } else {
  60. if (data.length > 0) {
  61. $("#StaffDropdown").combogridX("setValue", data[0].Value, reload);
  62. } else {
  63. $("#StaffDropdown").combogridX("clear");
  64. }
  65. }
  66. }
  67. }
  68. function reload() {
  69. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  70. var collegeID = $("#CollegeDropdown").combobox("getValue");
  71. var userID = $("#StaffDropdown").combogridX("getValue");
  72. }