var url = CMS_SystemConfig.VirtualDirectoryPath + "/SpecialtyCourse/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgSpecialtyCourseList").cmsXDataTable("load", $.getDataGridParams("dgSpecialtyCourseList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgSpecialtyCourseList").cmsXDataTable("getSelections"), function (index) { d.push(this.SpecialtyCourseID); }); return d; } //新增 function SpecialtyCourse_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('专业课程复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/SpecialtyCourse/CopyAdd?specialtyCourseID=' + d[0] + '&MNU=' + mnu, 685, 540, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('专业课程新增', redirectTo, 685, 540, null, null); } } //修改 function SpecialtyCourse_Edit() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?specialtyCourseID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('专业课程修改', redirectTo, 685, 540, null, null); } //查看 function edit(rowindex, rowdata) { var redirectTo = url + "?specialtyCourseID=" + rowdata.SpecialtyCourseID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('专业课程信息', redirectTo, 685, 540, null, null); } //删除 function SpecialtyCourse_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SpecialtyCourse/Delete', { specialtyCourseIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgSpecialtyCourseList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //设置相应的行颜色为红色 function SetRedGrid(rowIndex, rowData) { if (rowData.IsEnable != true) { return "color: red;"; } else { return ""; } } //Excel导出 function SpecialtyCourse_Export() { $("#formQuery").submit(); } //Excel导入 function SpecialtyCourse_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/SpecialtyCourse/Import?MNU=' + mnu; $.popupTopWindow('专业课程信息导入', redirectTo, 420, 300, reload); } //联动查询 function queryCollege() { var collegeID = $("#CollegeDropdown").combogridX("getValue"); if (collegeID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})"; $("#DepartmentDropdown").combogridX("reload", eval(jsonString)); } else { $("#DepartmentDropdown").combogridX("reload"); } reload(); }