var url = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentEnter/Edit"; var mnu = ""; //url个性化配置 var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='NewStudentEnterEdit']"); if (customerUrl.attr("value")) { url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value"); } //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgNewStudentEnterList").cmsXDataTable("load", $.getDataGridParams("dgNewStudentEnterList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgNewStudentEnterList").cmsXDataTable("getSelections"), function (index) { d.push(this.NewStudentID); }); return d; } //获取选中的状态 function validChooseStatus() { var d = []; $.each($("#dgNewStudentEnterList").cmsXDataTable("getSelections"), function (index) { d.push(this.RecordStatus); }); return d; } //查看 function detail(rowindex, rowdata) { var redirectTo = url + "?newNewStudentID=" + rowdata.NewStudentID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('录取名单信息', redirectTo, 650, 550, null, null); } //新增 function NewStudentEnter_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('录取名单复制新增', url + '?newNewStudentID=' + d[0] + '&MNU=' + mnu + '&type=copyAdd', 650, 550, null, null); } else { var redirectTo = url + "?MNU=" + mnu + "&type=add"; $.popupTopWindow('录取名单新增', redirectTo, 650, 550, null, null); } } //修改 function NewStudentEnter_Edit() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var r = validChooseStatus(); if (r[0] == submitted) { $.messager.alert("系统提示", "无法对已提交状态的信息进行修改。"); return; } var redirectTo = url + "?newNewStudentID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('录取名单修改', redirectTo, 650, 550, null, null); } //批量修改 SystemBatchModifyControl.OnSubmit = function () { var status = validChooseStatus().join(','); for (var i = 0; i < status.split(',').length; i++) { if (status.split(',')[i] == submitted) { $.messager.alert("系统提示", "无法对已提交状态的信息进行修改。"); return false; } } } //删除 function NewStudentEnter_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } var r = validChooseStatus(); if ($.grep(r, function (v, i) { return v == submitted; }).length > 0) { $.messager.alert("系统提示", "无法对已提交状态的信息进行删除。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/Delete', { newStudentIDs: d }, function (data) { if (data.IsSuccess = true) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentEnterList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //删除照片 function NewStudentEnter_PicDelete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除照片的信息。"); return; } var r = validChooseStatus(); if ($.grep(r, function (v, i) { return v == submitted; }).length > 0) { $.messager.alert("系统提示", "无法对已提交状态的信息进行删除照片。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/PicDelete', { newStudentIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentEnterList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //取消分配(未分配) function NewStudentEnter_CancelAssignCollege() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要取消分配的信息。"); return; } $.messager.confirm("系统提示", "您确定要对选择的信息取消分配?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/CancelAssignCollege', { newStudentIDs: d }, function (data) { if (data.IsSuccess = true) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentEnterList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //导入照片 function NewStudentEnter_PicImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/PicImport?MNU=' + mnu; $.popupTopWindow('导入照片', redirectTo, 420, 300, reload); } //导入标识 function NewStudentEnter_DoubtImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/DoubtImport?MNU=' + mnu; $.popupTopWindow('导入标识', redirectTo, 420, 300, reload); } //标识名单 function NewStudentEnter_DoubtList() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentEnter/DoubtList" + "?MNU=" + mnu;; $.popupTopWindow('标识名单信息', redirectTo, 950, 540, reload); } //初始化(班级信息、学号) function NewStudentEnter_Init() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要初始化的信息。"); return; } $.messager.confirm("系统提示", "您确定要对选择的信息初始化?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/Init', { newStudentIDs: d }, function (data) { if (data.IsSuccess = true) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentEnterList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //生成学号 function NewStudentEnter_AssignClass() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要生成学号的信息。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentEnter/AssignClass?MNU=" + mnu; $.popupTopWindow('生成学号', redirectTo, 750, 325, reload, d); } //自动生成学号 function NewStudentEnter_AutoAssignClass() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要自动生成学号的信息。"); return; } $.messager.confirm("系统提示", "您确定要对选择的信息自动生成学号?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/AutoAssignClass', { newStudentIDs: d }, function (data) { if (data.IsSuccess = true) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentEnterList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //获取列表字段查询对应比较符 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 NewStudentEnter_AdmissionLetter() { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var gradeID = $("#DictionaryGrade").combogridX("getValue"); //combobox 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"); var classmajorID = $("#ClassmajorComboGrid").combogridX("getValue"); var isDoubt = $("#DictionaryGeneralPurpose").combobox("getValue"); var isStudentNo = $("#DictionaryGeneralExist").combobox("getValue"); var recordStatus = $("#DictionaryNewStudentEnterStatus").combobox("getValue"); var newStudentIDs = validChoose().join(','); var conditionString = GetDynamicConditionString(); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/AdmissionLetterReport?MNU=' + mnu; $.popupTopWindow('录取通知书打印', redirectTo, 720, 550, null, { CampusID: campusID, CollegeID: collegeID, GradeID: gradeID, StandardID: standardID, EducationID: educationID, LearningformID: learningformID, LearnSystem: learnSystem, GrademajorID: grademajorID, ClassmajorID: classmajorID, IsDoubt: isDoubt, IsStudentNo: isStudentNo, RecordStatus: recordStatus, NewStudentIDs: newStudentIDs, ConditionString: conditionString }); } //提交 function NewStudentEnter_Submit() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要提交的信息。"); return; } $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/Submit', { newStudentIDs: d }, function (data) { if (data.IsSuccess = true) { $.messager.alert("系统提示", data.Message); $("#dgNewStudentEnterList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //设置相应的行字体颜色为红色 function SetRowGrid(rowIndex, rowData) { if (rowData.IsDoubt == true) { return "color: red;"; } else { return ""; } } //设置相应的行背景颜色 function SetRowBackgroundGrid(rowIndex, rowData) { if (rowData.IsDoubt == true) { return "background-color: yellow;"; } else { return ""; } } //Excel导出 function NewStudentEnter_Export() { $("#formQuery").submit(); } //联动查询 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)); 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 + "'})"; $("#GrademajorComboGrid").combogridX("reload", eval(jsonString)); $("#ClassmajorComboGrid").combogridX("reload", eval(jsonString)); } else { $("#GrademajorComboGrid").combogridX("reload"); $("#ClassmajorComboGrid").combogridX("reload"); } reload(); }