var url = CMS_SystemConfig.VirtualDirectoryPath + "/ProjectRecord/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function reload() { $("#dgProjectRecordList").cmsXDataTable("load", $.getDataGridParams("dgProjectRecordList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgProjectRecordList").cmsXDataTable("getSelections"), function (index) { d.push(this.ProjectRecordID); }); return d; } function ProjectRecord_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('督导项目新增', redirectTo, 1000, 700, null, null); } function show(rowIndex, rowData) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ProjectRecord/Edit?projectRecordID=" + rowData.ProjectRecordID + "&isShow=1&MNU=" + mnu; $.popupTopWindow('督导项目', redirectTo, 1000, 700, null, null); } function ProjectRecord_Edit() { var d = validChoose(); var id = validChoose().join(','); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } else if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?projectRecordID=" + d + "&MNU=" + mnu; $.popupTopWindow('督导项目修改', redirectTo, 1000, 700, null, null); } function startDateChanged(dp) { $("#StartDate").val($dp.cal.getNewDateStr()); reload(); } function endDateChanged(dp) { $("#EndDate").val($dp.cal.getNewDateStr()); reload(); } function ProjectRecord_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ProjectRecord/Delete', { projectRecordIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "删除成功!"); $("#dgProjectRecordList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } function ProjectRecord_Export() { var d = validChoose().join(','); $("[name='SelectedID']").val(d); $("#formQuery").submit(); }