var url = CMS_SystemConfig.VirtualDirectoryPath + "/SCalendar/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //新增 function SCalendar_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('校历假日新增', redirectTo, 650, 300, null, null); } function reload() { $("#dgSCalendarList").cmsXDataTable("load", $.getDataGridParams("dgSCalendarList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgSCalendarList").cmsXDataTable("getSelections"), function (index) { d.push(this.ActivitiesID); }); return d; } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url + "?activitiesID=" + rowdata.ActivitiesID + "&MNU=" + mnu + "&isView=1"; $.popupTopWindow('校历假日信息', redirectTo, 650, 300, null, null); } //修改按钮 function SCalendar_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的校历假日信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?activitiesID=" + d + "&MNU=" + mnu; $.popupTopWindow('校历假日修改', redirectTo, 650, 300, null, null); } //删除 function SCalendar_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的校历假日信息!"); return; } $.messager.confirm("系统提示", "您确定要删除选择的校历假日信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SCalendar/Delete', { activitiesIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); $("#dgSCalendarList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function SCalendar_Export() { $("#formQuery").submit(); } function QueryActivitiesTypeDropdownList(data) { reload(); } function QueryTimesSegmentDropdownList(data) { reload(); }