123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- 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, 560, 300);
- }
- function ExaminationPlan_AutoSchedule() {
- var ids = $.map(validChoosedata(), function (x) { return x.ExaminationPlanID; });
- var d = ids.join(',');
- $.messager.confirm("系统提示", "是否对本学期的考试进行排考?", 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) {
- $.post(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 = validChoose().join(',')
- if (d != "") {
- document.getElementById("ExaminationPlanIDs").value = d;
- }
- else {
- document.getElementById("ExaminationPlanIDs").value = "";
- }
- $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GdssExcel');
- $(document.forms[0]).submit();
- }
- function ExaminationPlan_AdultImport() {
- var selectedIDs = validChoose().join(',');
- selectedIDs = selectedIDs.toString();
- var ExaminationPlanSelect = $.getDataGridParams("dgExaminationPlanList");
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/GdssImport?MNU=' + mnu + '&selectedIDs=' + selectedIDs;
- $.popupTopWindow('考试安排导入', redirectTo, 400, 300, reload, 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_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 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 reload() {
- $("#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() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('考试安排复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/CopyAdd?examinationPlanID=' + d[0] + '&MNU=' + mnu, 800, 600, null, null);
- } else {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationPlan/Add?MNU=' + mnu;
- $.popupTopWindow('考试安排新增', redirectTo, 800, 600, null, null);
- }
- }
- function queryClass() {
- var jsonString = "";
- var parameterString = "";
- //var campusID = $("#CampusDropdown").combogridX("getValue");
- //var collegeID = $("#ComboGridCollege").combogridX("getValue");
- //var educationID = $("#Education").combobox("getValue");
- var schoolYearID = $("#DictionaryGrade").combobox("getValue");
- var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
- //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
- //if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
- //if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
- if (schoolYearID != nonSelect && schoolYearID != "") parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
- if (standardID != nonSelect && standardID != "") parameterString += "DictionaryStandard|*|" + standardID + "|@|";
- //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
- $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
- } else {
- $("#StandardDictionaryDropDown").combogridX("reload");
- $("#ClassmajorDropdown").combogridX("reload");
- }
- reload();
- }
|