var url = CMS_SystemConfig.VirtualDirectoryPath + "/CoursesTime/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //新增 function CoursesTime_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('节次时间新增', redirectTo, 650, 230, null, null); } function reload() { $("#dgCoursesTimeList").cmsXDataTable("load", $.getDataGridParams("dgCoursesTimeList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgCoursesTimeList").cmsXDataTable("getSelections"), function (index) { d.push(this.CoursesTimeID); }); return d; } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url + "?coursesTimeID=" + rowdata.CoursesTimeID + "&MNU=" + mnu + "&isView=1"; $.popupTopWindow('节次时间信息', redirectTo, 650, 230, null, null); } //修改按钮 function CoursesTime_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?coursesTimeID=" + d + "&MNU=" + mnu; $.popupTopWindow('节次时间修改', redirectTo, 650, 230, null, null); } //删除 function CoursesTime_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CoursesTime/Delete', { coursesTimeIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); $("#dgCoursesTimeList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function CoursesTime_Export() { $("#formQuery").submit(); } function QueryTimesSegmentDropdownList(data) { reload(); } function formatStartTime(index, row, value) { return (Array(2).join('0') + row.StartHour).slice(-2) + ':' + (Array(2).join('0') + row.StartMinutes).slice(-2); } function formatEndTime(index, row, value) { return (Array(2).join('0') + row.EndHour).slice(-2) + ':' + (Array(2).join('0') + row.EndMinutes).slice(-2); }