DepartmentScheduling.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var isFirstLoadDepartment = true;
  2. var isPageLoad = true;
  3. var requestDepartmentID;
  4. //加载
  5. $(function () {
  6. requestDepartmentID = $.SystemGeneral.getUrlParam("departmentID");
  7. })
  8. function QueryCollegeDropdownList(data) {
  9. if (((data.length && data.length > 0) || data)
  10. && $("#DepartmentDropdown").length > 0 && $.data($("#DepartmentDropdown")[0], "combobox")) {
  11. var collegeID = $("#CollegeDropdown").combobox("getValue");
  12. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?bindType=2&collegeID=" + collegeID;
  13. $("#DepartmentDropdown").combobox("reload", url);
  14. }
  15. }
  16. function QueryDepartmentDropdownList(data) {
  17. if (((data.length && data.length > 0) || data)) {
  18. if (isFirstLoadDepartment) {
  19. isFirstLoadDepartment = false;
  20. } else if (isPageLoad) {
  21. $("#DepartmentDropdown").combobox("setValue", requestDepartmentID);
  22. }
  23. reload();
  24. }
  25. }
  26. function reload() {
  27. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  28. var departmentID = $("#DepartmentDropdown").combobox("getValue");
  29. var handleModes = $.map($("[name='chkHandleMode']:checked"), function (x) { return $(x).val() }).join(',');
  30. var grid = $("#dgEducationSchedulingClassList");
  31. currentItem = null;
  32. currentCell = null;
  33. if (grid.length == 0) return;
  34. var allSetting = $.data(grid[0], "cmsXDataTable");
  35. if (!allSetting) return;
  36. if (departmentID == "") return;
  37. //加载左边列表
  38. allSetting.options.url = CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedule/GetDepartmentEducationSchedulingClass?departmentID=" + departmentID + "&schoolyearID=" + schoolYearID + "&handleModes=" + handleModes;
  39. $.data(grid, "cmsXDataTable", allSetting);
  40. grid.cmsXDataTable("load", null);
  41. isPageLoad = false;
  42. }
  43. function loadScheduleData() {
  44. var schoolYearID = $("#SchoolYearDropdown").combobox("getValue");
  45. var departmentID = $("#DepartmentDropdown").combobox("getValue");
  46. var handleModes = $.map($("[name='chkHandleMode']:checked"), function(x) { return $(x).val() }).join(',');
  47. $("#loading").show();
  48. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/GetDepartmentSchedule', { schoolyearID: schoolYearID, departmentID: departmentID, handleModes: handleModes },
  49. function (schedulingData) {
  50. getCoursesTimeList(schedulingData);
  51. $("#loading").hide();
  52. });
  53. }