var url = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgGrademajorList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgGrademajorList").cmsXDataTable("getSelections"), function (index) { d.push(this.GrademajorID); }); return d; } //(年级专业复制)批量新增 function Grademajor_BatchAdd() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/BatchAdd?MNU=" + mnu; $.popupTopWindow('年级专业复制', redirectTo, 700, 320, null, null); } //新增 function Grademajor_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('年级专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/CopyAdd?grademajorID=' + d[0] + '&MNU=' + mnu, 700, 420, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('年级专业新增', redirectTo, 700, 420, null, null); } } //修改按钮 function Grademajor_Update() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?grademajorID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('年级专业修改', redirectTo, 700, 420, null, null); } //查看 function edit(rowindex, rowdata) { var redirectTo = url + "?grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('年级专业信息', redirectTo, 700, 420, null, null); } //批量修改(重写) SystemBatchModifyControl.OnSubmit = function () { //年级 if (document.getElementById("GradeIDDictionaryDropDownList_div").style.display != "none") { var r = false; var d = validChoose().join(','); var gradeID = $("#GradeID_DictionaryDropDownList").combobox("getValue"); var semesterID = null; if (d == "") { return; } $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, gradeID: gradeID, semesterID: semesterID }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgGrademajorList").cmsXDataTable('load'); } else { return true; } }); return r; } //学期 else if (document.getElementById("SemesterIDDictionaryDropDownList_div").style.display != "none") { var r = false; var d = validChoose().join(','); var gradeID = null; var semesterID = $("#SemesterID_DictionaryDropDownList").combobox("getValue"); if (d == "") { return; } $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, gradeID: gradeID, semesterID: semesterID }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgGrademajorList").cmsXDataTable('load'); } else { return true; } }); return r; } } //删除 function Grademajor_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/Delete', { grademajorIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgGrademajorList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //Excel导出 function Grademajor_Export() { $("#formQuery").submit(); } //Excel导入 function Grademajor_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/Import?MNU=' + mnu; $.popupTopWindow('年级专业信息导入', redirectTo, 420, 300, reload); } //年级专业对应的班级明细 function editClassmajorCount(rowindex, rowdata) { var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/ClassmajorList?inSchoolStatus=" + inSchoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu; $.popupTopWindow('年级专业班级明细', redirectTo, 850, 540, null, null); } //年级专业学生明细 function editStudentCount(rowindex, rowdata) { var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu; $.popupTopWindow('年级专业学生明细', redirectTo, 850, 540, null, null); } //联动查询 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 queryStandard(data) { queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningformID = $("#DictionaryLearningform").combogridX("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#DictionaryStandard").combogridX("reload", eval(jsonString)); } else { $("#DictionaryStandard").combogridX("reload"); } reload(); }