var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function reload() { $("#dgExaminationSuspensionList").cmsXDataTable("load", $.getDataGridParams("dgExaminationSuspensionList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgExaminationSuspensionList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //新增 function ExaminationSuspension_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('缓考申请', redirectTo, 600, 200, null, null); } //修改 function ExaminationSuspension_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的缓考申请。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var recordstatus = d[0].RecordStatus; if (recordstatus != startStatusID) { $.messager.alert("系统提示", "该缓考申请已经提交,无法修改。"); return; } var redirectTo = url + "?examinationSuspensionID=" + d[0].ExaminationSuspensionID + "&MNU=" + mnu; $.popupTopWindow('缓考申请', redirectTo, 600, 200, null, null); } //删除 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); } }); }