var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function reload() { $("#dgExaminationSuspensionList").cmsXDataTable("load", $.getDataGridParams("dgExaminationSuspensionList")); } //缓考名单导出 function ExaminationSuspension_Export() { $("#formQuery").submit(); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgExaminationSuspensionList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //获取选中的数据 function validChooseID() { var d = []; $.each($("#dgExaminationSuspensionList").cmsXDataTable("getSelections"), function (index) { d.push(this.ExaminationSuspensionID); }); return d; } function ExaminationSuspension_Add() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/TeacherEdit" + "?MNU=" + mnu; $.popupTopWindow('缓考申请', redirectTo, 600, 250, null, null); } function ExaminationSuspension_Edit() { var id = validChooseID(); if (id.length == 0) { $.messager.alert("系统提示", "请选择您要修改的缓考申请!"); return; } if (id.length > 1) { $.messager.alert("系统提示", "只能选择一条缓考申请修改!"); return; } var d = validChoose(); var recordstatus = d[0].RecordStatus; if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) { $.messager.alert("系统提示", "所选的缓考申请有部分已经提交,无法修改。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/TeacherEdit" + "?examinationSuspensionID=" + id + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('缓考申请修改', redirectTo, 600, 250, null, null); } function applyEdit(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/applyEdit" + "?examinationSuspensionID=" + rowdata.ExaminationSuspensionID + "&MNU=" + mnu; $.popupTopWindow('申请原因', redirectTo, 440, 230, null, null); } //审核 function ExaminationSuspension_Approve() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要审核的缓考申请!"); return; } var recordstatus = d[0].RecordStatus; if ($.grep(d, function (v, i) { return v.RecordStatus != recordstatus; }).length > 0) { $.messager.alert("系统提示", "请选择相同状态的记录进行审核!"); return; } if ($.grep(d, function (v, i) { return v.RecordStatus == startStatusID; }).length > 0) { $.messager.alert("系统提示", "所选的缓考申请有部分未提交,请先提交在审核。"); return; } for (var i = 0; i < d.length; i++) { if (d[i].RecordStatus == 3) { $.messager.alert("系统提示", "缓考申请已审核如要撤销请点击撤销按钮!"); return; } if (d[i].RecordStatus == 4) { $.messager.alert("系统提示", "缓考申请已撤销请勿重复操作!"); return; } } var approveIDs = validChooseID(); var firstID = approveIDs[0]; $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=ER_ExaminationSuspension&FormID=' + firstID, 400, 300, ExaminationSuspension_Approve_Confirm); } function ExaminationSuspension_Approve_Confirm(action) { if (!action) return; if (action.ActionID == "") return; var approveIDs = validChooseID().join(','); $.post(CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/Approve", { examinationSuspensionIDs: approveIDs, actionID: action.Action, comment: action.Comment }, function (data) { $.messager.alert("系统提示", data.Message); if (data.IsSuccess) { reload(); } }, 'json'); } //删除 function ExaminationSuspension_Delete() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要删除的缓考申请。"); return; } var recordstatus = d[0].RecordStatus; if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) { $.messager.alert("系统提示", "所选的缓考申请有部分已经提交,无法删除。"); return; } var examinationSuspensionIDs = $.map(d, function (x) { return x.ExaminationSuspensionID; }).join(','); $.messager.confirm("系统提示", "您确定要删除该缓考申请信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSuspension/Delete', { examinationSuspensionIDs: examinationSuspensionIDs }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "删除成功。"); $("#dgExaminationSuspensionList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //提交 function ExaminationSuspension_Submit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要提交的缓考申请。"); return; } if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) { $.messager.alert("系统提示", "所选的缓考申请有部分已经提交,无法再次提交。"); return; } var examinationSuspensionIDs = $.map(d, function (x) { return x.ExaminationSuspensionID; }).join(','); $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSuspension/Submit', { examinationSuspensionIDs: examinationSuspensionIDs }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "提交成功!"); $("#dgExaminationSuspensionList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } //撤销 function ExaminationSuspension_Cancel() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要撤销的缓考申请!"); return; } var recordstatus = d[0].RecordStatus; if ($.grep(d, function (v, i) { return v.RecordStatus != recordstatus; }).length > 0) { $.messager.alert("系统提示", "请选择相同状态的记录进行撤销!"); return; } for (var i = 0; i < d.length; i++) { if (d[i].RecordStatus < 3) { $.messager.alert("系统提示", "只能撤销完成审核的缓考申请!"); return; } if (d[i].RecordStatus == 4) { $.messager.alert("系统提示", "缓考申请已撤销请勿重复操作!"); return; } } var approveIDs = $.map(d, function (x) { return x.ExaminationSuspensionID; }).join(','); $.messager.confirm("系统提示", "您确定要撤销该缓考申请信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSuspension/Cancel', { examinationSuspensionIDs: approveIDs, comment: $("[name='Comment']").val() }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "撤销成功!"); $("#dgExaminationSuspensionList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //退回 //function ExaminationSuspension_Rollback() { // var d = validChoose(); // if (d.length == 0) { // $.messager.alert("系统提示", "请选择您要退回的缓考申请!"); // return; // } // var recordstatus = d[0].RecordStatus; // if ($.grep(d, function (v, i) { return v.RecordStatus != recordstatus; }).length > 0) { // $.messager.alert("系统提示", "请选择相同状态的记录进行退回!"); // return; // } // if ($.grep(d, function (v, i) { return v.RecordStatus == startStatusID; }).length > 0) { // $.messager.alert("系统提示", "所选的缓考申请有部分未提交,请先提交在退回。"); // return; // } // var approveIDs = $.map(d, function (x) { return x.ExaminationSuspensionID; }).join(','); // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSuspension/Rollback', { examinationSuspensionIDs: approveIDs, comment: $("[name='Comment']").val() }, function (data) { // if (data.IsSuccess) { // $.messager.alert("系统提示", "退回成功!"); // $("#dgExaminationSuspensionList").cmsXDataTable('load'); // } else { // $.messager.alert("系统提示", data.Message); // } // }); //} function queryStandard() { if ($.data($("#cbgCollege")[0], "combogridX") && $.data($("#ddlYear")[0], "combobox")) { var parameterString = ""; var collegeID = $("#cbgCollege").combogridX("getValue"); var year = $("#ddlYear").combobox("getValue"); if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (year != nonSelect) parameterString += "DictionaryGrade|*|" + year + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#cbgStandard").combogridX("reload", eval(jsonString)); } else { $("#cbgStandard").combogridX("reload"); } } } function queryClassmajor() { if ($.data($("#cbgCollege")[0], "combogridX") && $.data($("#ddlYear")[0], "combobox") && $.data($("#cbgStandard")[0], "combogridX")) { var parameterString = ""; var collegeID = $("#cbgCollege").combogridX("getValue"); var year = $("#ddlYear").combobox("getValue"); var standard = $("#cbgStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combobox("getValue"); var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue"); if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (year != nonSelect) parameterString += "DictionaryGrade|*|" + year + "|@|"; if (standard != nonSelect && standard != "") parameterString += "DictionaryStandard|*|" + standard + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|"; if (LearnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + LearnSystem + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#cbgClassmajor").combogridX("reload", eval(jsonString)); } else { $("#cbgClassmajor").combogridX("reload"); } } }