var url = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgFacultymajorList").cmsXDataTable("load", $.getDataGridParams("dgFacultymajorList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgFacultymajorList").cmsXDataTable("getSelections"), function (index) { d.push(this.FacultymajorID); }); return d; } //新增 function Facultymajor_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('院系专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Facultymajor/CopyAdd?facultymajorID=' + d[0] + '&MNU=' + mnu, 650, 420, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('院系专业新增', redirectTo, 650, 420, null, null); } } //修改按钮 function Facultymajor_Update() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?facultymajorID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('院系专业修改', redirectTo, 650, 420, null, null); } //查看 function edit(rowindex, rowdata) { var redirectTo = url + "?facultymajorID=" + rowdata.FacultymajorID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('院系专业信息', redirectTo, 650, 420, null, null); } //删除 function Facultymajor_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Facultymajor/Delete', { facultymajorIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgFacultymajorList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //院系专业对应的年级专业明细 function editGrademajorCount(rowindex, rowdata) { var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/GrademajorList?inSchoolStatus=" + inSchoolStatus + "&facultymajorID=" + rowdata.FacultymajorID + "&MNU=" + mnu; $.popupTopWindow('年级专业明细', redirectTo, 850, 540, null, null); } //院系专业学生明细 function editStudentCount(rowindex, rowdata) { var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&facultymajorID=" + rowdata.FacultymajorID + "&MNU=" + mnu; $.popupTopWindow('院系专业学生明细', redirectTo, 850, 540, null, null); } //Excel导出 function Facultymajor_Export() { $("#formQuery").submit(); } //Excel导入 function Facultymajor_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Facultymajor/Import?MNU=' + mnu; $.popupTopWindow('院系专业信息导入', redirectTo, 420, 300, reload); } //联动查询 function queryCampus(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); reload(); } 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)); reload(); }