123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- var scheduling = new Object();
- var windowID;
- windowID = $.SystemGeneral.getUrlParam("WindowID");
- scheduling = top.$('#' + windowID).data("inputData");
- function Confirm() {
- var weekNumList = $.map($("input[name='WeekNum']:checked"), function (x) { return parseInt($(x).val()); });
- if (weekNumList.length == 0) {
- $.messager.alert('系统信息', "请选择周次。");
- return;
- }
- var weekdayCombo = $("#ddlWeekday");
- var weekday = weekdayCombo.combobox('getValue');
- if (weekday == nonSelect) {
- $.messager.alert('系统信息', "请选择星期。");
- return;
- }
- var weekdayDesc = weekdayCombo.combobox('getText');
- var courseTime = $("#cbgCoursesTime").combogridX('getSelectedRow');
- // if (!courseTime) {
- // $.messager.alert('系统信息', "请选择节次。");
- // return;
- // }
- var classroomExcessiveUseSchedulingID = Guid.NewGuid().ToString();
- if (scheduling) {
- if (scheduling.ClassroomExcessiveUseSchedulingID) {
- classroomExcessiveUseSchedulingID = scheduling.ClassroomExcessiveUseSchedulingID
- }
- }
- top.$("#" + windowID).data("resultData", {
- ClassroomExcessiveUseSchedulingID: classroomExcessiveUseSchedulingID,
- WeekNumList: weekNumList,
- Weekday: weekday,
- WeekdayDesc: weekdayDesc,
- CoursesTimeID: courseTime == null ? null : courseTime.CoursesTimeID,
- StartTimes: courseTime == null ? null : courseTime.StartTimes,
- EndTimes: courseTime == null ? null : courseTime.EndTimes,
- StartHour: courseTime == null ? null : courseTime.StartHour,
- StartMinute: courseTime == null ? null : courseTime.StartMinutes,
- EndHour: courseTime == null ? null : courseTime.EndHour,
- EndMinute: courseTime == null ? null : courseTime.EndMinutes,
- TimeDesc: courseTime == null ? "" : (courseTime.StartTimes.toString() + "-" + courseTime.EndTimes.toString() + "节")
- });
- top.$("#" + windowID).dialog("close");
- }
- function chkWeekNum_LoadSuccess(data) {
- if (scheduling) {
- if (scheduling.WeekNumList) {
- var selectedWeekNumList = $.grep($("input[name='WeekNum']"), function (x) {
- if (scheduling.WeekNumList.contains(parseInt($(x).val()))) {
- return true;
- }
- return false;
- });
- $(selectedWeekNumList).attr("checked", "checked");
- }
- }
- }
- function cbgCoursesTime_LoadSuccess(data) {
- if (scheduling) {
- if (scheduling.CoursesTimeID) {
- $("#cbgCoursesTime").combogridX("setValue", scheduling.CoursesTimeID);
- }
- }
- }
- function ddlWeekday_LoadSuccess(data) {
- if (scheduling) {
- if (scheduling.Weekday) {
- $("#ddlWeekday").combobox("setValue", scheduling.Weekday);
- }
- }
- }
- function BindCourseTime() {
- var jsonString = "";
- var parameterString = "";
- var weekday = $("#ddlWeekday").combobox("getValue");
- var weekNumList = $.map($("input[name='WeekNum']:checked"), function (x) { return parseInt($(x).val()); });
- var weekNumStr = weekNumList.join(',');
- if ((schoolyear != nonSelect && schoolyear != null) && (classroom != nonSelect && classroom != null) && weekNumList.length != 0 && weekday != nonSelect) {
- parameterString += "schoolyearID|*|" + schoolyear + "|@|";
- parameterString += "weekNumList|*|" + weekNumStr + "|@|";
- parameterString += "weekDay|*|" + weekday + "|@|";
- parameterString += "classroomID|*|" + classroom + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#cbgCoursesTime").combogridX("reload", eval(jsonString));
- } else {
- $("#cbgCoursesTime").combogridX("reload");
- }
- }
- }
|