var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorSpecialty/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function reload() { $("#dgMinorSpecialty").cmsXDataTable("load", $.getDataGridParams("dgMinorSpecialty")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgMinorSpecialty").cmsXDataTable("getSelections"), function (index) { d.push(this.GrademinorID); }); return d; } function validChooseStatusName() { var d = []; $.each($("#dgMinorSpecialty").cmsXDataTable("getSelections"), function (index) { d.push(this.ApprovalStatusName); }); return d; } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url + "?GrademinorID=" + rowdata.GrademinorID + "&MNU=" + mnu + '&isView=1'; $.popupTopWindow('辅修专业详情', redirectTo, 1000, 600, null, null); } //开放 function MinorSpecialty_Open() { var d = validChoose().join(','); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要开放的辅修专业信息。"); return; } $.messager.confirm("系统提示", "您确定要开放该辅修专业信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/OpenMinorSpecialty', { GrademinorIDs: d }, function (data) { if (data == "开放成功") { $.messager.alert("系统提示", "开放成功。"); $("#dgMinorSpecialty").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //取消开放 function MinorSpecialty_Cancel() { var d = validChoose().join(','); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要取消开放的辅修专业信息。"); return; } $.messager.confirm("系统提示", "您确定要取消开放该辅修专业信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/CancelMinorSpecialty', { GrademinorIDs: d }, function (data) { if (data == "取消开放成功") { $.messager.alert("系统提示", "取消开放成功。"); $("#dgMinorSpecialty").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function StudentList(rowindex, rowdata) { $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/StudentList?grademinorID=' + rowdata.GrademinorID + '&MNU=' + mnu, 800, 600); } function MinorSpecialty_OpenClass() { var d = validChoose().join(','); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要开班的辅修专业信息。"); return; } $.messager.confirm("系统提示", "您确定要对所选辅修专业进行开班?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/OpenClass', { grademinorIDs: d }, function (data) { if (data == "开班成功") { $.messager.alert("系统提示", "开班成功。"); $("#dgMinorSpecialty").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function MinorSpecialty_CancelClass() { var d = validChoose().join(','); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要取消开班的辅修专业信息。"); return; } $.messager.confirm("系统提示", "您确定要对所选辅修专业取消开班?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/OpenCancel', { grademinorIDs: d }, function (data) { if (data == "取消开班成功") { $.messager.alert("系统提示", "取消开班成功。"); $("#dgMinorSpecialty").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //导出Excel function MinorSpecialty_Export() { var d = validChoose().join(',') if (d != "") { document.getElementById("GrademinorID").value = d; } else { document.getElementById("GrademinorID").value = ""; } $("#formQuery").submit(); }