var url = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudent/Edit"; var mnu = ""; //url个性化配置 var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='NewStudentEdit']"); if (customerUrl.attr("value")) { url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value"); } //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgNewStudentList").cmsXDataTable("load", $.getDataGridParams("dgNewStudentList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgNewStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.NewStudentID); }); return d; } //新增 function NewStudent_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('新生名单复制新增', url + '?newNewStudentID=' + d[0] + '&MNU=' + mnu + '&type=copyAdd', 650, 540, null, null); } else { var redirectTo = url + "?MNU=" + mnu + "&type=add"; $.popupTopWindow('新生名单新增', redirectTo, 650, 540, null, null); } } //修改 function NewStudent_Edit() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?newNewStudentID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('新生名单修改', redirectTo, 650, 540, null, null); } //查看 function detail(rowindex, rowdata) { var redirectTo = url + "?newNewStudentID=" + rowdata.NewStudentID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('新生名单信息', redirectTo, 650, 540, null, null); } //删除 function NewStudent_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/Delete', { newStudentIDs: d }, function (data) { if (data.IsSuccess = true) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //删除照片 function NewStudent_PicDelete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除照片的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/PicDelete', { newStudentIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //Excel导出 function NewStudent_Export() { $("#formQuery").submit(); } //导入照片(个性化配置,默认照片以考生号或“F”或“Z”+考生号命名) function NewStudent_PicImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/PicImport?MNU=' + mnu; $.popupTopWindow('导入照片', redirectTo, 420, 300, reload); } //Excel导入 function NewStudent_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/Import?MNU=' + mnu; $.popupTopWindow('新生信息导入', redirectTo, 420, 300, reload); } //联动查询 function queryGrade(data) { reload(); } function queryStandard(data) { reload(); }