var url = CMS_SystemConfig.VirtualDirectoryPath + "/CollegePriority/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgCollegePriorityList").cmsXDataTable("load", $.getDataGridParams("dgCollegePriorityList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) { d.push(this.CollegePriorityID); }); return d; } //新增 function CollegePriority_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('院系控制复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/CollegePriority/CopyAdd?collegePriorityID=' + d[0] + '&MNU=' + mnu, 750, 280, null, null); } else { //var redirectTo = url + "?MNU=" + mnu; //$.popupTopWindow('院系控制新增', redirectTo, 750, 280, null, null); //采用以下方式新增 var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/CollegePriority/CollegePriorityBatchAdd" + "?MNU=" + mnu; $.popupTopWindow('院系控制新增', redirectTo, 800, 530, reload, null); } } //修改按钮 function CollegePriority_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?collegePriorityID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('院系控制修改', redirectTo, 750, 280, null, null); } //查看明细 function edit(rowindex, rowdata) { var redirectTo = url + "?collegePriorityID=" + rowdata.CollegePriorityID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('院系控制明细', redirectTo, 750, 280, null, null); } //删除 function CollegePriority_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/CollegePriority/Delete', { collegePriorityIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgCollegePriorityList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //导出Excel function CollegePriority_Export() { $("#formQuery").submit(); } //联动查询 function queryCampus(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); if (campusID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); } else { $("#CollegeDropdown").combogridX("reload"); } reload(); }