1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- function CourseProcess_Save() {
- // if (isSubmited) {
- var isError = false;
- var courseProcessTimes = 0;
- var rows = $("#dgCourseProcessList").cmsXDataTable("getRows");
- $.each(rows, function (i, x) {
- if (isNaN(x.Times)) {
- $.messager.alert('系统信息', "学时必须为整数,请检查数据。");
- isError = true;
- return false;
- }
- courseProcessTimes += parseInt(x.Times);
- });
- if (isError) {
- return;
- }
- if (courseProcessTimes > totalTimes) {
- $.messager.alert('系统信息', "学时的总和必须小于或等于总学时,请检查数据。");
- return;
- }
- // }
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: $.SystemGeneral.getUrlParam("educationMissionClassID") }, function (data) {
- if (data.IsSuccess) {
- $(document.forms[0]).submit();
- } else {
- $.messager.alert("系统提示", data.Message);
- return;
- }
- });
- }
- function SetTotalView() {
- var courseProcessTimes = 0;
- var rows = $("#dgCourseProcessList").cmsXDataTable("getRows");
- $.each(rows, function (i, x) {
- courseProcessTimes += parseInt(x.Times);
- });
- $("#totalView").html("学时:" + courseProcessTimes.toString() + " 总学时:" + totalTimes.toString());
- if (courseProcessTimes != totalTimes) {
- $("#totalView").css("color", "#FF0000");
- } else {
- $("#totalView").css("color", "#000000");
- }
- }
- //var selectedRowIndex = null;
- //var selectedRowData = null;
- var trigger = null;
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- function selectClassroom() {
- trigger = $(this);
- var dataRowIndex = parseInt(trigger.parents('tr').attr('xRowIndex'));
- var dataRow = $("#dgCourseProcessList").cmsXDataTable('getRows')[dataRowIndex];
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/GetStudentCount', { educationMissionClassID: dataRow.EducationMissionClassID },
- function (studentCount) {
- var ddlClassroomType = trigger.parents('tr').find('[name*=ClassroomTypeID]');
- if (ddlClassroomType.val() != '-1') {
- $.popupTopWindow('选择教室', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcessClassroomList?MaxSelect=1&MinSeatCount=' + studentCount + '&CollegeID=' + dataRow.CollegeID + '&ClassroomTypeID=' + ddlClassroomType.val() + '&FromMNU=' + mnu, 900, 500, ClassroomSelect_Close, null);
- } else {
- $.popupTopWindow('选择教室', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcessClassroomList?MaxSelect=1&MinSeatCount=' + studentCount + '&CollegeID=' + dataRow.CollegeID + '&FromMNU=' + mnu, 900, 500, ClassroomSelect_Close, null);
- }
- })
- }
- function ClassroomSelect_Close(classroomList) {
- if (!classroomList) return;
- if (classroomList.length == 0) return;
- trigger.triggerbox("setValue", classroomList);
- trigger = null;
- }
- function selectTeacher(rowIndex, rowData) {
- trigger = $(this);
- var dataRowIndex = parseInt(trigger.parents('tr').attr('xRowIndex'));
- var dataRow = $("#dgCourseProcessList").cmsXDataTable('getRows')[dataRowIndex];
- $.popupTopWindow('教师信息', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcessTeacherEdit?MNU=' + mnu + '&CourseProcessID=' + dataRow.CourseProcessID, 770, 420, TeacherSelect_Close);
- }
- function TeacherSelect_Close(teacherList) {
- if (!teacherList) return;
- if (teacherList.length == 0) return;
- trigger.triggerbox("setValue", teacherList);
- trigger = null;
- }
|