var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationOpenControl/Edit"; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); function OpenControl_Export() { $(document.forms[0]).submit(); } function OpenControl_Add() { redirectTo = url + "?MNU=" + mnu; $.popupTopWindow("开放控制新增", redirectTo, 800, 400, null, null); } function reload() { $("#dgOpenControlList").cmsXDataTable("load", $.getDataGridParams("dgOpenControlList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgOpenControlList").cmsXDataTable("getSelections"), function (index) { d.push(this.ExaminationOpenControlID); }); return d; } function validChooseStartDate() { var d = []; $.each($("#dgOpenControlList").cmsXDataTable("getSelections"), function (index) { d.push(this.StartDate); }); return d; } function validChooseEndDate() { var d = []; $.each($("#dgOpenControlList").cmsXDataTable("getSelections"), function (index) { d.push(this.EndDate); }); return d; } //批量修改执行前触发事件 SystemBatchModifyControl.OnSubmit = function (a) { if (document.getElementById("StartDateTextBoxDate_div").style.display != "none") { var StartDate = $("#StartDate_TextBoxDate").val(); var d = validChooseEndDate(); for (var i = 0; i < d.length; i++) { var time = new Date(d[i]); if (d[i].toDateString("yyyy-MM-dd") <= StartDate) { $.messager.alert("系统提示", "报名时间起要小于报名时间止"); return false; } } } else if (document.getElementById("EndDateTextBoxDate_div").style.display != "none") { var EndDate = $("#EndDate_TextBoxDate").val(); var d = validChooseStartDate(); for (var i = 0; i < d.length; i++) { if (EndDate <= d[i].toDateString("yyyy-MM-dd")) { $.messager.alert("系统提示", "报名时间止要大于报名时间起"); return false; } } } } //点击列表更新 function edit(rowindex, rowdata) { redirectTo = url + "?OpenControlID=" + rowdata.ExaminationOpenControlID + "&MNU=" + mnu + "&isView=1"; $.popupTopWindow("开放控制详情", redirectTo, 800, 400, null, null); } //修改按钮 function OpenControl_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的开放控制记录。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } redirectTo = url + "?OpenControlID=" + d + "&MNU=" + mnu ; $.popupTopWindow("开放控制详情", redirectTo, 800, 400, null, null); } //删除 function OpenControl_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的开放控制记录。"); return; } $.messager.confirm("系统提示", "您确定要删除该开放控制记录?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationOpenControl/Delete', { openControlIDs: d }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", "删除成功!"); $("#dgOpenControlList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function queryExaminationSubject(data) { $("#ExaminationSubjectDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSubject/DropdownList?examinationTypeID=" + data.Value + ""); }