123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- // if (isUpdate == "edit") {
- // $("#SchoolyearID").attr("IsEnabled", false);
- // $("#WeekNum").attr("IsEnabled", false);
- // $("#Weekday").attr("IsEnabled", false);
- // $("#CoursesTimeID").attr("IsEnabled", false);
- // $("#ClassroomID").attr("IsEnabled", false);
- // $("#EducationMissionClassID").attr("IsEnabled", false);
- // $("#CoursematerialID").attr("IsEnabled", false);
- // }
- })
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgTeacherList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //加载列表
- function reload() {
- $("#dgTeacherList").cmsXDataTable("load", $.getDataGridParams("dgTeacherList"));
- }
- //保存
- function EducationMissionClassCheck_Save() {
- $(document.forms[0]).submit();
- }
- function GetEducationMissionClassBy() {
- var jsonString = "";
- var parameterString = "";
- var schoolyearID = $("#SchoolyearID").combobox("getValue");
- var weekNum = $("#WeekNum").combobox("getValue");
- var weekday = $("#Weekday").combobox("getValue");
- var coursesTimeID = $("#CoursesTimeID").combogridX("getValue");
- var classroomID = $("#ClassroomID").combogridX("getValue");
- if (schoolyearID != nonSelect && weekNum != nonSelect && weekday != nonSelect && (coursesTimeID != nonSelect && coursesTimeID != "") && (classroomID != nonSelect && classroomID != "")) {
- parameterString += "schoolyearID|*|" + schoolyearID + "|@|";
- parameterString += "weekNum|*|" + weekNum + "|@|";
- parameterString += "weekDay|*|" + weekday + "|@|";
- parameterString += "coursesTimeID|*|" + coursesTimeID + "|@|";
- parameterString += "classroomID|*|" + classroomID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#EducationMissionClassID").combogridX("reload", eval(jsonString));
- $("#CoursematerialID").combogridX("reload", eval(jsonString));
- } else {
- $("#EducationMissionClassID").combogridX("reload");
- $("#CoursematerialID").combogridX("reload");
- }
- }
- // if (schoolyearID != nonSelect) parameterString += "schoolyearID|*|" + schoolyearID + "|@|";
- // if (weekNum != nonSelect) parameterString += "weekNum|*|" + weekNum + "|@|";
- // if (weekday != nonSelect) parameterString += "weekDay|*|" + weekday + "|@|";
- // if (coursesTimeID != nonSelect) parameterString += "coursesTimeID|*|" + coursesTimeID + "|@|";
- // if (classroomID != nonSelect) parameterString += "classroomID|*|" + classroomID + "|@|";
- //$("#EducationMissionClassID").combogridX("select", 0);
- }
- function setFirst() {
- var jsonString = "";
- var parameterString = "";
- var schoolyearID = $("#SchoolyearID").combobox("getValue");
- var weekNum = $("#WeekNum").combobox("getValue");
- var weekday = $("#Weekday").combobox("getValue");
- var coursesTimeID = $("#CoursesTimeID").combogridX("getValue");
- var classroomID = $("#ClassroomID").combogridX("getValue");
- if (schoolyearID != nonSelect && weekNum != nonSelect && weekday != nonSelect && (coursesTimeID != nonSelect && coursesTimeID != "") && (classroomID != nonSelect && classroomID != "")) {
- parameterString += "schoolyearID|*|" + schoolyearID + "|@|";
- parameterString += "weekNum|*|" + weekNum + "|@|";
- parameterString += "weekDay|*|" + weekday + "|@|";
- parameterString += "coursesTimeID|*|" + coursesTimeID + "|@|";
- parameterString += "classroomID|*|" + classroomID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClassCheck/GetEducationMissionClass', { QueryParamsDatas: parameterString, page: 0, rows: 10 }, function (data) {
- if (data.rows.length == 0) {
- $("#EducationMissionClassID").combogridX("setValue", "-1");
- $("#CoursematerialID").combogridX("setValue", "-1");
- $("#TeacherName").val("");
- } else {
- $("#EducationMissionClassID").combogridX("select", 0);
- $("#CoursematerialID").combogridX("select", 0);
- }
- });
- } else {
- $("#EducationMissionClassID").combogridX("reload");
- $("#CoursematerialID").combogridX("reload");
- }
- }
- // var ishave = $("#EducationMissionClassID").combogridX("getValue", 0);
- // if (ishave != "-1") {
- // $("#EducationMissionClassID").combogridX("select", 0);
- // $("#CoursematerialID").combogridX("select", 0);
- // } else {
- // $("#TeacherName").val("");
- // }
- }
- function setCoursematerial() {
- $("#CoursematerialID").combogridX("select", 0);
- }
- function GetTeacherName() {
- var jsonString = "";
- var parameterString = "";
- var schoolyearID = $("#SchoolyearID").combobox("getValue");
- var educationID = $("#EducationMissionClassID").combogridX("getValue");
- var weekNum = $("#WeekNum").combobox("getValue");
- var weekday = $("#Weekday").combobox("getValue");
- var coursesTimeID = $("#CoursesTimeID").combogridX("getValue");
- var classroomID = $("#ClassroomID").combogridX("getValue");
- if (schoolyearID != nonSelect && weekNum != nonSelect && weekday != nonSelect && (coursesTimeID != nonSelect && coursesTimeID != "") && (classroomID != nonSelect && classroomID != "") && (educationID != nonSelect && educationID != "")) {
- parameterString += "schoolyearID|*|" + schoolyearID + "|@|";
- parameterString += "weekNum|*|" + weekNum + "|@|";
- parameterString += "weekDay|*|" + weekday + "|@|";
- parameterString += "coursesTimeID|*|" + coursesTimeID + "|@|";
- parameterString += "classroomID|*|" + classroomID + "|@|";
- parameterString += "educationID|*|" + educationID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#CoursematerialID").combogridX("reload", eval(jsonString));
- } else {
- $("#CoursematerialID").combogridX("reload");
- }
- }
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClassCheck/GetTeacherNameByEducationMissionClassID', { QueryParamsDatas: parameterString }, function (data) {
- $("#TeacherName").val(data.Message);
- });
- }
- function EducationMissionClassCheck_AddStaff() {
- $.popupTopWindow('教师信息', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/TeacherSelect?FromMNU=' + mnu, 900, 500, AddTeachers_Confirm);
- }
- function EducationMissionClassCheck_DeleteStaff() {
- var d = validChoose();
- var teacherViewList = $("#dgTeacherList").cmsXDataTable("getRows");
- var i, j;
- var len = teacherViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (teacherViewList[i].UserID == d[j].UserID) {
- teacherViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgTeacherList").cmsXDataTable("loadData", { rows: teacherViewList, total: teacherViewList.length });
- }
- function AddTeachers_Confirm(teacherList) {
- if (!teacherList) return;
- var teacherViewList = $("#dgTeacherList").cmsXDataTable("getRows");
- $.each(teacherList, function (index, value) {
- if ($.grep(teacherViewList, function (row, index) { return value.UserID == row.UserID; }).length == 0) {
- teacherViewList.push({
- UserID: value.UserID,
- LoginID: value.StaffCode,
- Name: value.Name,
- CollegeID: value.CollegeID,
- CollegeName: value.CollegeName,
- BirthDate: value.BirthDate,
- TeacherType: value.TeacherType,
- TeacherTypeName: value.TeacherTypeName,
- IncumbencyState: value.IncumbencyState,
- IncumbencyStateName: value.IncumbencyStateName,
- Title: value.Title,
- TitleName: value.TitleName,
- TeachingMethod: 0, //默認选取的数据为主讲课
- TeachingMethodDesc: null,
- SexName: value.SexName,
- DepartmentName: value.DepartmentName,
- DepartmentID: value.DepartmentID
- });
- }
- });
- $("#dgTeacherList").cmsXDataTable("loadData", { rows: teacherViewList, total: teacherViewList.length });
- }
|