var url = CMS_SystemConfig.VirtualDirectoryPath + "/Student/Edit"; var mnu = ""; //url个性化配置 var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StudentEdit']"); if (customerUrl.attr("value")) { url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value"); } //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList")); } //获取选中的数据UserID function validChoose() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.UserID); }); return d; } //获取选中的数据LoginID function validChooseLoginID() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.StudentNo); }); return d; } //新增 function Student_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('学生信息复制新增', url + '?newUserID=' + d[0] + '&MNU=' + mnu + '&type=copyAdd', 680, 550, null, null); } else { var redirectTo = url + "?MNU=" + mnu + "&type=add"; $.popupTopWindow('学生信息新增', redirectTo, 680, 550, null, null); } } //修改按钮 function Student_Edit() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?newUserID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('学生信息修改', redirectTo, 680, 550, null, null); } //明细查看 function edit(rowindex, rowdata) { var redirectTo = url + "?newUserID=" + rowdata.UserID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('学生信息明细', redirectTo, 680, 550, null, null); } //班级信息查看 function editClassmajor(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/Edit" + "?classmajorID=" + rowdata.ClassmajorID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('班级信息', redirectTo, 720, 480, null, null); } //照片信息查看 function editPhoto(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/PhotoDetail" + "?userID=" + rowdata.UserID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('照片信息', redirectTo, 700, 580, null, null); } //学籍异动信息查看 function editChange(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/ChangeDetail" + "?userID=" + rowdata.UserID + "&MNU=" + mnu; $.popupTopWindow('学籍异动信息', redirectTo, 1200, 540, null, null); } //学籍注册信息查看 function editReport(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/ReportDetail" + "?userID=" + rowdata.UserID + "&MNU=" + mnu; $.popupTopWindow('学籍注册信息', redirectTo, 1024, 540, null, null); } //删除 function Student_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/Delete', { userIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgStudentList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //照片比对 function Student_PictureComparison() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/PicComparison?MNU=" + mnu; $.popupTopWindow('照片比对信息', redirectTo, 1250, 600, null, null); } //删除照片 function Student_PicDelete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除照片的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/PicDelete', { userIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgStudentList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //模拟登录 function Student_SimulateLogin() { var d = validChooseLoginID(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要模拟登录的学生。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择一个学生进行模拟登录。"); return; } $.messager.confirm("系统提示", "您确定要进行模拟登录?", function (r) { if (r) { var loginID = d.toString(); $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SimulateLogin/Login', { LoginID: loginID }, function (data) { parent.location.reload(); }); } }); } //上报导出 function Student_ReportExport() { var userIDs = validChoose().join(','); var dgStudentList = $.getDataGridParams("dgStudentList"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/ReportExport?userIDs=" + userIDs + "&MNU=" + mnu; $.popupTopWindow('上报导出', redirectTo, 880, 580, null, dgStudentList); } //操行录入 function Student_ConductInput() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要进行录入的信息。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/ConductInput" + "?MNU=" + mnu; $.popupTopWindow('操行录入', redirectTo, 480, 320, null, d); } //毕业证书编号Excel导入 function Student_GraduateNoImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/GraduateNoImport?MNU=' + mnu; $.popupTopWindow('证书编号导入', redirectTo, 420, 300, reload); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //Excel导出 function Student_Export() { var userIDs = validChoose().join(','); if (userIDs == "") { document.getElementById("UserIDs").value = ""; } else { document.getElementById("UserIDs").value = userIDs; } $("#formQuery").attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Student/Excel"); $("#formQuery").submit(); } //导入学籍照片 function Student_PicImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/PicImport?MNU=' + mnu; $.popupTopWindow('导入学籍照片', redirectTo, 420, 300, reload); } //导入学历照片 function Student_GraPicImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/GraPicImport?MNU=' + mnu; $.popupTopWindow('导入学历照片', redirectTo, 420, 300, reload); } //导出照片 function Student_PictureExport() { var userIDs = validChoose().join(','); var dgStudentList = $.getDataGridParams("dgStudentList"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/PictureExport?userIDs=" + userIDs + "&MNU=" + mnu; $.popupTopWindow('导出照片', redirectTo, 400, 280, null, dgStudentList); } //Excel导入 function Student_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/Import?MNU=' + mnu; $.popupTopWindow('学生信息导入', redirectTo, 420, 300, reload); } //获取列表字段查询对应比较符 function GetDynamicConditionString() { var conditionString = ""; var attribute = eval('(' + $("[name='Attribute']").val() + ')').Value; var condition = $("[name='Condition']").val(); var value = $.trim($("[name='Condition']").parent().parent().next().find("[name^=" + attribute + "]").val()); if (document.getElementsByName(attribute + "_QueryDictionaryDropDownList")[0] != null) { if (value == "-1") { conditionString = ""; } else { conditionString = "WHERE " + attribute + "=" + value; } } else { if (value != "") { if (condition == "左") { conditionString = "WHERE " + attribute + " LIKE '" + value + "%'"; } else if (condition == "右") { conditionString = "WHERE " + attribute + " LIKE '%" + value + "'"; } else if (condition == "中") { conditionString = "WHERE " + attribute + " LIKE '%" + value + "%'"; } else { conditionString = "WHERE " + attribute + condition + "'" + value + "'"; } } else { conditionString = ""; } } return conditionString; } //学生证明报表 function Student_ProveReport() { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var gradeID = $("#DictionaryGrade").combogridX("getValue"); var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningformID = $("#DictionaryLearningform").combogridX("getValue"); var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); var classmajorID = $("#ClassmajorComboGrid").combogridX("getValue"); var isPhoto = $("#IsPhotoDropdown").combogridX("getValue"); var reportStatus = $("#DictionaryReportStatus").combogridX("getValue"); var planningGraduateDate = $("#PlanningGraduateDateDropDown").combogridX("getValue"); var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); var userIDs = validChoose().join(','); var conditionString = GetDynamicConditionString(); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/ProveReport?MNU=' + mnu; var learningProveReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='LearningProveReport']").attr("customName"); var riseOnlyThisProveReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='RiseOnlyThisProveReport']").attr("customName"); var graduateProveReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='GraduateProveReport']").attr("customName"); $.popupTopWindow('证明报表', redirectTo, 680, 550, null, { CampusID: campusID, CollegeID: collegeID, GradeID: gradeID, StandardID: standardID, EducationID: educationID, LearningformID: learningformID, LearnSystem: learnSystem, ClassmajorID: classmajorID, IsPhoto: isPhoto, ReportStatus: reportStatus, PlanningGraduateDate: planningGraduateDate, InSchoolStatus: inSchoolStatus, UserIDs: userIDs, ConditionString: conditionString, LearningProveReportName: learningProveReportName, RiseOnlyThisProveReportName: riseOnlyThisProveReportName, GraduateProveReportName: graduateProveReportName }); } //学生学籍卡报表 function Student_CradReport() { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var gradeID = $("#DictionaryGrade").combogridX("getValue"); var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningformID = $("#DictionaryLearningform").combogridX("getValue"); var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); var classmajorID = $("#ClassmajorComboGrid").combogridX("getValue"); var isPhoto = $("#IsPhotoDropdown").combogridX("getValue"); var reportStatus = $("#DictionaryReportStatus").combogridX("getValue"); var planningGraduateDate = $("#PlanningGraduateDateDropDown").combogridX("getValue"); var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); var userIDs = validChoose().join(','); var conditionString = GetDynamicConditionString(); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/CradReport?MNU=' + mnu; var studentCradReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='StudentCradReport']").attr("customName"); if (studentCradReportName == "HBGDStudentCard") { $.popupTopWindow('学籍报表', redirectTo, 680, 550, null, { CampusID: campusID, CollegeID: collegeID, GradeID: gradeID, StandardID: standardID, EducationID: educationID, LearningformID: learningformID, LearnSystem: learnSystem, ClassmajorID: classmajorID, IsPhoto: isPhoto, ReportStatus: reportStatus, PlanningGraduateDate: planningGraduateDate, InSchoolStatus: inSchoolStatus, UserIDs: userIDs, ConditionString: conditionString, StudentCradReportName: studentCradReportName }); } else { $.popupTopWindow('学籍报表', redirectTo, 1124, 550, null, { CampusID: campusID, CollegeID: collegeID, GradeID: gradeID, StandardID: standardID, EducationID: educationID, LearningformID: learningformID, LearnSystem: learnSystem, ClassmajorID: classmajorID, IsPhoto: isPhoto, ReportStatus: reportStatus, PlanningGraduateDate: planningGraduateDate, InSchoolStatus: inSchoolStatus, UserIDs: userIDs, ConditionString: conditionString, StudentCradReportName: studentCradReportName }); } } //鉴定报表 function Student_AppraiseReport() { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var gradeID = $("#DictionaryGrade").combogridX("getValue"); var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningformID = $("#DictionaryLearningform").combogridX("getValue"); var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); var classmajorID = $("#ClassmajorComboGrid").combogridX("getValue"); var isPhoto = $("#IsPhotoDropdown").combogridX("getValue"); var reportStatus = $("#DictionaryReportStatus").combogridX("getValue"); var planningGraduateDate = $("#PlanningGraduateDateDropDown").combogridX("getValue"); var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); var userIDs = validChoose().join(','); var conditionString = GetDynamicConditionString(); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Student/AppraiseReport?MNU=' + mnu; var studentGraAppraiseReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='StudentGraAppraiseReport']").attr("customName"); var studentPPraAppraiseReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='StudentPPraAppraiseReport']").attr("customName"); if (studentGraAppraiseReportName == "DefaultGraduateAppraise") { $.popupTopWindow('鉴定报表', redirectTo, 680, 550, null, { CampusID: campusID, CollegeID: collegeID, GradeID: gradeID, StandardID: standardID, EducationID: educationID, LearningformID: learningformID, LearnSystem: learnSystem, ClassmajorID: classmajorID, IsPhoto: isPhoto, ReportStatus: reportStatus, PlanningGraduateDate: planningGraduateDate, InSchoolStatus: inSchoolStatus, UserIDs: userIDs, ConditionString: conditionString, StudentGraAppraiseReportName: studentGraAppraiseReportName, StudentPPraAppraiseReportName: studentPPraAppraiseReportName }); } else { $.popupTopWindow('鉴定报表', redirectTo, 680, 550, null, { CampusID: campusID, CollegeID: collegeID, GradeID: gradeID, StandardID: standardID, EducationID: educationID, LearningformID: learningformID, LearnSystem: learnSystem, ClassmajorID: classmajorID, IsPhoto: isPhoto, ReportStatus: reportStatus, PlanningGraduateDate: planningGraduateDate, InSchoolStatus: inSchoolStatus, UserIDs: userIDs, ConditionString: conditionString, StudentGraAppraiseReportName: studentGraAppraiseReportName, StudentPPraAppraiseReportName: studentPPraAppraiseReportName }); } } //联动查询 function queryCampus(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); queryClass(); } function queryCollege(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|"; jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); $("#DictionaryStandard").combogridX("reload", eval(jsonString)); queryClass(); } function queryGrade(data) { queryClass(); } function queryStandard(data) { queryClass(); } function queryLearnSystem(data) { queryClass(); } function queryGrademajor(data) { queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var gradeID = $("#DictionaryGrade").combogridX("getValue"); var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningformID = $("#DictionaryLearningform").combogridX("getValue"); var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); //var grademajorID = $("#GrademajorComboGrid").combogridX("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|"; if (learnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + learnSystem + "|@|"; //if (grademajorID != nonSelect) parameterString += "GrademajorComboGrid|*|" + grademajorID + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#DictionaryStandard").combogridX("reload", eval(jsonString)); //$("#GrademajorComboGrid").combogridX("reload", eval(jsonString)); $("#ClassmajorComboGrid").combogridX("reload", eval(jsonString)); } else { $("#DictionaryStandard").combogridX("reload"); //$("#GrademajorComboGrid").combogridX("reload"); $("#ClassmajorComboGrid").combogridX("reload"); } reload(); } function StudentCardReport() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要打印学籍卡的学生信息。"); return; } $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Students/StudentCardReport', { userIDList: d }, function (data) { if (data.IsSuccess) { var redirectTo = "../../Scripts/pdf.js/web/viewer.html?file=" + data.Message; $.popupTopWindow('学籍卡', redirectTo, 850, 480, reload); } else { $.messager.alert("系统提示", data); } }); }