ClassroomExcessiveUseSchedulingEdit.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. var scheduling = new Object();
  2. var windowID;
  3. windowID = $.SystemGeneral.getUrlParam("WindowID");
  4. scheduling = top.$('#' + windowID).data("inputData");
  5. function Confirm() {
  6. var weekNumList = $.map($("input[name='WeekNum']:checked"), function (x) { return parseInt($(x).val()); });
  7. if (weekNumList.length == 0) {
  8. $.messager.alert('系统信息', "请选择周次。");
  9. return;
  10. }
  11. var weekdayCombo = $("#ddlWeekday");
  12. var weekday = weekdayCombo.combobox('getValue');
  13. if (weekday == nonSelect) {
  14. $.messager.alert('系统信息', "请选择星期。");
  15. return;
  16. }
  17. var weekdayDesc = weekdayCombo.combobox('getText');
  18. var courseTime = $("#cbgCoursesTime").combogridX('getSelectedRow');
  19. // if (!courseTime) {
  20. // $.messager.alert('系统信息', "请选择节次。");
  21. // return;
  22. // }
  23. var classroomExcessiveUseSchedulingID = Guid.NewGuid().ToString();
  24. if (scheduling) {
  25. if (scheduling.ClassroomExcessiveUseSchedulingID) {
  26. classroomExcessiveUseSchedulingID = scheduling.ClassroomExcessiveUseSchedulingID
  27. }
  28. }
  29. top.$("#" + windowID).data("resultData", {
  30. ClassroomExcessiveUseSchedulingID: classroomExcessiveUseSchedulingID,
  31. WeekNumList: weekNumList,
  32. Weekday: weekday,
  33. WeekdayDesc: weekdayDesc,
  34. CoursesTimeID: courseTime == null ? null : courseTime.CoursesTimeID,
  35. StartTimes: courseTime == null ? null : courseTime.StartTimes,
  36. EndTimes: courseTime == null ? null : courseTime.EndTimes,
  37. StartHour: courseTime == null ? null : courseTime.StartHour,
  38. StartMinute: courseTime == null ? null : courseTime.StartMinutes,
  39. EndHour: courseTime == null ? null : courseTime.EndHour,
  40. EndMinute: courseTime == null ? null : courseTime.EndMinutes,
  41. TimeDesc: courseTime == null ? "" : (courseTime.StartTimes.toString() + "-" + courseTime.EndTimes.toString() + "节")
  42. });
  43. top.$("#" + windowID).dialog("close");
  44. }
  45. function chkWeekNum_LoadSuccess(data) {
  46. if (scheduling) {
  47. if (scheduling.WeekNumList) {
  48. var selectedWeekNumList = $.grep($("input[name='WeekNum']"), function (x) {
  49. if (scheduling.WeekNumList.contains(parseInt($(x).val()))) {
  50. return true;
  51. }
  52. return false;
  53. });
  54. $(selectedWeekNumList).attr("checked", "checked");
  55. }
  56. }
  57. }
  58. function cbgCoursesTime_LoadSuccess(data) {
  59. if (scheduling) {
  60. if (scheduling.CoursesTimeID) {
  61. $("#cbgCoursesTime").combogridX("setValue", scheduling.CoursesTimeID);
  62. }
  63. }
  64. }
  65. function ddlWeekday_LoadSuccess(data) {
  66. if (scheduling) {
  67. if (scheduling.Weekday) {
  68. $("#ddlWeekday").combobox("setValue", scheduling.Weekday);
  69. }
  70. }
  71. }
  72. function BindCourseTime() {
  73. var jsonString = "";
  74. var parameterString = "";
  75. var weekday = $("#ddlWeekday").combobox("getValue");
  76. var weekNumList = $.map($("input[name='WeekNum']:checked"), function (x) { return parseInt($(x).val()); });
  77. var weekNumStr = weekNumList.join(',');
  78. if ((schoolyear != nonSelect && schoolyear != null) && (classroom != nonSelect && classroom != null) && weekNumList.length != 0 && weekday != nonSelect) {
  79. parameterString += "schoolyearID|*|" + schoolyear + "|@|";
  80. parameterString += "weekNumList|*|" + weekNumStr + "|@|";
  81. parameterString += "weekDay|*|" + weekday + "|@|";
  82. parameterString += "classroomID|*|" + classroom + "|@|";
  83. if (parameterString != "") {
  84. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  85. $("#cbgCoursesTime").combogridX("reload", eval(jsonString));
  86. } else {
  87. $("#cbgCoursesTime").combogridX("reload");
  88. }
  89. }
  90. }