var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/Classroom"; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='ExaminationClassroom']"); if (customerUrl.attr("value")) { url = CMS_SystemConfig.VirtualDirectoryPath + "/" + customerUrl.attr("value"); } }); function ExaminationPlan_Import() { // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Generate', null, function (result) { // $.messager.alert("系统提示", result.Message); // reload(); // }); $.popupTopWindow('生成计划', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Generate?MNU=' + mnu, 500, 300); } function ExaminationPlan_ImportResit() { $.popupTopWindow('生成补考计划', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GenerateResit?MNU=' + mnu, 400, 200); } function ExaminationPlan_ImportGraduateExam() { $.popupTopWindow('生成毕业清考计划', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GenerateGraduateExam?MNU=' + mnu, 400, 200); } function ExaminationPlan_AutoSchedule() { var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; }); var d = ids.join(','); var message = "是否对本学期的考试进行排考?"; if (ids.length > 0) { message = "是否对选中的考试进行排考?"; } $.messager.confirm("系统提示", message, function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/AutoSchedule', { examinationPlanIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "自动排考成功。"); $("#dgExaminationPlanList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } function ExaminationPlan_Submit() { var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; }); var d = ids.join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要提交的记录。"); return; } $.messager.confirm("系统提示", "您确定要提交该考试计划?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Submit', { examinationPlanIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "提交成功。"); $("#dgExaminationPlanList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } function ExaminationPlan_UnSubmit() { var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; }); var d = ids.join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要撤回的记录。"); return; } $.messager.confirm("系统提示", "您确定要撤回该考试计划?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/UnSubmit', { examinationPlanIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "撤回成功。"); $("#dgExaminationPlanList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } function ExaminationPlan_Export() { $(document.forms[0]).submit(); } function ExaminationPlan_AdultExport() { var d = validChoosedata(); var examinationPlanIDs = $.map(d, function (x) { return x.ExaminationPlanID; }).join(','); $("[name='SelectedID']").val(examinationPlanIDs); $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/AdultExcel'); $(document.forms[0]).submit(); } function ExaminationPlan_AdultImport() { var selectedIDs = validChoose().join(','); selectedIDs = selectedIDs.toString(); var ExaminationPlanSelect = $.getDataGridParams("dgExaminationPlanList"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Import?MNU=' + mnu + '&selectedIDs=' + selectedIDs; $.popupTopWindow('考试安排导入', redirectTo, 400, 300, null, ExaminationPlanSelect); } //排考 function ExaminationPlan_Classroom() { var d = validChoosedata(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要设置的考试计划。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行设置。"); return; } if (d[0].RecordStatus != notSubmitVal) { $.messager.alert("系统提示", "只能选择未提交的记录进行设置。"); return; } $.popupTopWindow('考场设置', url + '?ExaminationPlanID=' + d[0].ExaminationPlanID + '&MNU=' + mnu, 800, 600); } function ExaminationPlan_Preview() { var d = validChoosedata(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要预览的考试计划。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行预览。"); return; } var reportUrl = CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fExaminationManage%2fExaminationRoomLayout&ExaminationPlanID_RAP=" + d[0].ExaminationPlanID; $.popupTopWindowOutsite('考试座位预览', reportUrl, 1000, 650); } //考试时间 function ExaminationPlan_SetTime() { var d = validChoosedata(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的考试计划。"); return; } $.popupTopWindow('考试时间安排', CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/SetTime?" + '&MNU=' + mnu, 500, 200, ExaminationPlan_SetTime_Confirm); } function ExaminationPlan_SetTime_Confirm(timeData) { if (timeData) { var d = validChoosedata(); var idList = $.map(d, function (x) { return x.ExaminationPlanID }); $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/SetTime', { ids: idList.join(','), examinationDate: timeData.ExaminationDate, startTime: timeData.StartTime, endTime: timeData.EndTime }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "设置时间成功。"); $("#dgExaminationPlanList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } } //添加学生 function ExaminationPlan_AddStudent() { var d = validChoose(); var status = ApprovalStatus(); if (d == "") { $.messager.alert("系统提示", "请选择您要增加学生的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录。"); return; } if (status == "1" || status == "3" || status == "5") { var redirectTo = "/FinalExamination/StudentEdit?finalExamination=" + d + "&MNU=" + mnu; $.popupTopWindow('学生名单', redirectTo, 850, 480, reload); } else { $.messager.alert("系统提示", "该数据已经提交或已审核,不能添加学生!"); return; } } function ExaminationPlan_Resettting() { var d = validChoose().join(','); //var status = validChoosedata().join(','); if (d == "") { $.messager.alert("系统提示", "请选择你要重置的信息!"); return; } $.messager.confirm("系统提示", "您确定要重置选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Resetting', { examinationPlanIDs: d }, function (data) { if (data == "重置成功") { $.messager.alert("系统提示", data); $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList")); } else { $.messager.alert("系统提示", data); } }); } }); } function ExaminationPlan_Cancel() { var d = validChoose().join(','); //var status = validChoosedata().join(','); if (d == "") { $.messager.alert("系统提示", "请选择你要撤销的信息!"); return; } $.messager.confirm("系统提示", "您确定要撤销选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Cancel', { examinationPlanIDs: d }, function (data) { if (data == "撤销成功") { $.messager.alert("系统提示", data); $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList")); } else { $.messager.alert("系统提示", data); } }); } }); } //删除考场安排 function ExaminationPlan_Delete() { var d = validChoose().join(','); //var status = validChoosedata().join(','); if (d == "") { $.messager.alert("系统提示", "请选择你要删除的信息!"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Delete', { examinationPlanIDs: d }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", data); $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList")); } else { $.messager.alert("系统提示", data); } }); } }); } function reload() { // var starWeek = $("#StarWeek").val(); // var endWeek = $("#EndWeek").val(); // var re = "/^[0-9]+$/"; // if (starWeek != "" && !(/(^[1-9]\d*$)/.test(starWeek))) { // $.messager.alert("系统提示", "请在开始周次输入整数!"); // return // } // if (endWeek != "" && !(/(^[1-9]\d*$)/.test(endWeek))) { // $.messager.alert("系统提示", "请在结束周次输入整数!"); // return // } $("#dgExaminationPlanList").cmsXDataTable("load", $.getDataGridParams("dgExaminationPlanList")); } function view(rowindex, rowdata) { $.popupTopWindow('考场详情', url + '?ExaminationPlanID=' + rowdata.ExaminationPlanID + '&MNU=' + mnu + "&isView=1", 800, 600); } function viewStudent(rowindex, rowdata) { $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/ExaminationPlanStudentList?ExaminationPlanID=' + rowdata.ExaminationPlanID + '&MNU=' + mnu + "&isView=1", 800, 600); } //获取选中的数据 function validChoosedata() { var d = []; $.each($("#dgExaminationPlanList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } function validChoose() { var d = []; $.each($("#dgExaminationPlanList").cmsXDataTable("getSelections"), function (index) { d.push(this.ExaminationPlanID); }); return d; } function QueryCampusDropdownList(data) { $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + ""); reload(); } function ExaminationPlan_Add() { $.popupTopWindow('新增考试安排', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Add?MNU=' + mnu, 800, 600); }