var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSubjectCountLimit/Edit"; var addUrl = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSubjectCountLimit/Add"; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); function SubjectCountLimit_Export() { $(document.forms[0]).submit(); } function SubjectCountLimit_Add() { redirectTo = addUrl + "?MNU=" + mnu; $.popupTopWindow("门数限制新增", redirectTo, 800, 400, null, null); } function reload() { $("#dgSubjectCountLimitList").cmsXDataTable("load", $.getDataGridParams("dgSubjectCountLimitList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgSubjectCountLimitList").cmsXDataTable("getSelections"), function (index) { d.push(this.ExaminationSubjectCountLimitID); }); return d; } function validChooseFacultymajorID() { var d = []; $.each($("#dgSubjectCountLimitList").cmsXDataTable("getSelections"), function (index) { d.push(this.FacultymajorID); }); return d; } function validChooseYears() { var d = []; $.each($("#dgSubjectCountLimitList").cmsXDataTable("getSelections"), function (index) { d.push(this.Years); }); return d; } //批量修改执行前触发事件 SystemBatchModifyControl.OnSubmit = function (a) { if (document.getElementById("ExaminationTypeIDDropdownList_div").style.display != "none") { var facultymajorIDs = validChooseFacultymajorID().join(","); var years = validChooseYears().join(","); var examinationType = $("#ExaminationTypeID_DropdownList").combobox("getValue"); var bool = true; $.ajax({ url: CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubjectCountLimit/Validation?examinationType=' + examinationType + '&facultymajorIDs=' + facultymajorIDs + '&years=' + years, type: "post", dataType: "json", async: false, success: function (data) { if (data.IsSuccess != true) { $.messager.alert("系统提示", data.Message); bool = false; } } }); if (bool != true) return false; } } //点击列表更新 function edit(rowindex, rowdata) { redirectTo = url + "?SubjectCountLimitID=" + rowdata.ExaminationSubjectCountLimitID + "&MNU=" + mnu + "&isView=1"; $.popupTopWindow("门数限制详情", redirectTo, 800, 200, null, null); } //修改按钮 function SubjectCountLimit_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的门数限制。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } redirectTo = url + "?SubjectCountLimitID=" + d + "&MNU=" + mnu; $.popupTopWindow("门数限制修改", redirectTo, 800, 200, null, null); } //删除 function SubjectCountLimit_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的门数限制。"); return; } $.messager.confirm("系统提示", "您确定要删除该门数限制?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubjectCountLimit/Delete', { subjectCountLimitIDs: d }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", "删除成功!"); $("#dgSubjectCountLimitList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); }