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; $.popupTopWindow('年级专业修改', redirectTo, 700, 420, null, null); } //批量修改(重写) SystemBatchModifyControl.OnSubmit = function () { try { //年级 if (document.getElementById("SchoolyearIDDictionaryDropDownList_div").style.display != "none") { var r = false; var d = validChoose().join(','); var schoolyearID = $("#SchoolyearID_DictionaryDropDownList").combobox("getValue"); var schoolcodeID = null; if (d == "") { return; } $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, schoolyearID: schoolyearID, schoolcodeID: schoolcodeID }, function (data) { if (data != "保存成功。") { $.messager.alert("系统提示", data.Message); $("#dgGrademajorList").cmsXDataTable('load'); } else { return true; } }); return r; } //学期 else if (document.getElementById("SchoolcodeIDDictionaryDropDownList_div").style.display != "none") { var r = false; var d = validChoose().join(','); var schoolyearID = null; var schoolcodeID = $("#SchoolcodeID_DictionaryDropDownList").combobox("getValue"); if (d == "") { return; } $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, schoolyearID: schoolyearID, schoolcodeID: schoolcodeID }, function (data) { if (data != "保存成功。") { $.messager.alert("系统提示", data.Message); $("#dgGrademajorList").cmsXDataTable('load'); } else { return true; } }); return r; } } catch (e) { } } //删除 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 == "删除成功。") { $.messager.alert("系统提示", data); $("#dgGrademajorList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //查看 function edit(rowindex, rowdata) { var redirectTo = url + "?grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu + "&Type=1"; $.popupTopWindow('年级专业信息', redirectTo, 700, 420, null, null); } //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, 750, 450, 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, 800, 500, null, null); } 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(); reload(); } function querySchoolyear(data) { queryClass(); reload(); } function queryStandard(data) { queryClass(); reload(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var schoolYearID = $("#DictionarySchoolyear").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 (schoolYearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + schoolYearID + "|@|"; 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(); }