AdjustmentEdit.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. function getNotUseCoursesTime() {
  2. $("#loading").show();
  3. var weekday = $("[name='Weekday']").val();
  4. var toWeekday = $("[comboname='ToWeekday']").combobox('getValue');
  5. var courseTimeID = $("[name='CoursesTimeID']").val();
  6. var weekNum = $("[name='WeekNum']").val();
  7. var toWeekNum = $("[comboname='ToWeekNum']").combobox('getValue');
  8. var fromTeacherID = $("[name='UserID']").val();
  9. var replaceTeacherID = $("#ToUserID").combogridX('getValue');
  10. if (!toWeekNum || toWeekNum == nonSelect) {
  11. $.messager.alert("系统提示", "请选择调整后的周次。");
  12. $("#loading").hide();
  13. return false;
  14. }
  15. var url = CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/GetNotUseCoursesTimeDropDown?bindType=0'
  16. url += '&schoolyearID=' + schoolyearID;
  17. url += '&weekday=' + weekday;
  18. url += '&toWeekday=' + toWeekday;
  19. url += '&courseTimeID=' + courseTimeID;
  20. url += '&weekNum=' + weekNum;
  21. url += '&toWeekNum=' + toWeekNum;
  22. url += '&fromTeacherID=' + fromTeacherID;
  23. if (replaceTeacherID != nonSelect && replaceTeacherID != "") {
  24. url += '&replaceTeacherID=' + replaceTeacherID;
  25. }
  26. url += '&educationMissionClassID=' + educationMissionClassID;
  27. $("[comboname='ToCoursesTimeID']").combobox('clear');
  28. $("[comboname='ToCoursesTimeID']").combobox('reload', url);
  29. }
  30. function getNotUseClassroom(toCoursesTimeID) {
  31. $("#loading").show();
  32. var weekday = $("[name='Weekday']").val();
  33. var toWeekday = $("[comboname='ToWeekday']").combobox('getValue');
  34. var coursesTimeID = $("[name='CoursesTimeID']").val();
  35. var weekNum = $("[name='WeekNum']").val();
  36. var toWeekNum = $("[comboname='ToWeekNum']").combobox('getValue');
  37. var classroomTypeID = $("[comboname='ToClassroomTypeID']").combobox('getValue');
  38. if (!toWeekNum || toWeekNum == nonSelect) {
  39. $.messager.alert("系统提示", "请选择调整后的周次。");
  40. $("#loading").hide();
  41. return false;
  42. }
  43. if (!toCoursesTimeID || typeof toCoursesTimeID != "string") {
  44. toCoursesTimeID = $("[comboname='ToCoursesTimeID']").combobox('getValue');
  45. }
  46. if (toCoursesTimeID == "" || toCoursesTimeID == nonSelect) {
  47. $.messager.alert("系统提示", "请选择调整后的节次。");
  48. $("#loading").hide();
  49. return false;
  50. }
  51. try {
  52. var jsonString = "({'QueryParamsDatas':'";
  53. if (schoolyearID != nonSelect) {
  54. jsonString += "SchoolyearID|*|" + schoolyearID + "|@|";
  55. }
  56. if (weekday != nonSelect) {
  57. jsonString += "Weekday|*|" + weekday + "|@|";
  58. }
  59. if (toWeekday != nonSelect) {
  60. jsonString += "ToWeekday|*|" + toWeekday + "|@|";
  61. }
  62. if (coursesTimeID != nonSelect) {
  63. jsonString += "CoursesTimeID|*|" + coursesTimeID + "|@|";
  64. }
  65. if (toCoursesTimeID != nonSelect) {
  66. jsonString += "ToCoursesTimeID|*|" + toCoursesTimeID + "|@|";
  67. }
  68. if (weekNum != nonSelect) {
  69. jsonString += "WeekNum|*|" + weekNum + "|@|";
  70. }
  71. if (toWeekNum != nonSelect) {
  72. jsonString += "ToWeekNum|*|" + toWeekNum + "|@|";
  73. }
  74. if (classroomTypeID != nonSelect) {
  75. jsonString += "ClassroomTypeID|*|" + classroomTypeID + "|@|";
  76. }
  77. if (educationMissionClassID != nonSelect) {
  78. jsonString += "EducationMissionClassID|*|" + educationMissionClassID + "|@|";
  79. }
  80. jsonString += "'})";
  81. $("[comboname='ToClassroomID']").combogridX("reload", eval(jsonString));
  82. //reload();
  83. } catch (e) { }
  84. }
  85. function clearSelections() {
  86. $("[comboname='ToWeekday']").combobox('setValue', nonSelect);
  87. var url = CMS_SystemConfig.VirtualDirectoryPath + '/SchoolYear/GetFutureWeekListDropdown?bindType=0'
  88. var toWeekNum = $("[comboname='ToWeekNum']").combobox('getValue');
  89. if (toWeekNum && toWeekNum != nonSelect) {
  90. url += "&weekNum=" + toWeekNum;
  91. $("[comboname='ToWeekday']").combobox('clear');
  92. $("[comboname='ToWeekday']").combobox('reload', url);
  93. }
  94. $("[comboname='ToCoursesTimeID']").combobox('clear');
  95. $("[comboname='ToClassroomTypeID']").combobox('setValue', $("[name='ClassroomTypeID']").val());
  96. $("[comboname='ToClassroomID']").combogridX('setValue', nonSelect);
  97. }
  98. function Adjustment_Save() {
  99. var toWeekNum = $("[comboname='ToWeekNum']").combobox('getValue');
  100. if (!toWeekNum || toWeekNum == nonSelect) {
  101. $.messager.alert("系统提示", "请选择调整后的周次。");
  102. $("#loading").hide();
  103. return false;
  104. }
  105. $(document.forms[0]).submit();
  106. }
  107. function commonLoadComplete() {
  108. $("#loading").hide();
  109. }
  110. $.parser.onComplete = function (context) {
  111. if (isEdit) {
  112. getNotUseCoursesTime();
  113. var toCoursesTimeID = $("[comboname='ToCoursesTimeID']").combobox('options').value;
  114. getNotUseClassroom(toCoursesTimeID);
  115. }
  116. };