var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function reload() { $("#dgMinorPlanApply").cmsXDataTable("load", $.getDataGridParams("dgMinorPlanApply")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgMinorPlanApply").cmsXDataTable("getSelections"), function (index) { d.push(this.GradeMinorApplicationID); }); return d; } function validChooseStatusName() { var d = []; $.each($("#dgMinorPlanApply").cmsXDataTable("getSelections"), function (index) { d.push(this.ApprovalStatusName); }); return d; } //新增 function MinorPlanApply_Apply(){ var d = validChoose(); if (d.length == 1) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/CopyAdd?GradeMinorApplicationIDs=" + d + "&MNU=" + mnu; $.popupTopWindow('辅修课程信息复制新增', redirectTo, 800, 600, null, null); } else { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/MinorPlanApplyChoiceList?MNU=" + mnu; $.popupTopWindow('辅修申请新增', redirectTo, 1000, 560, null, null); } } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url + "?GradeMinorApplicationIDs=" + rowdata.GradeMinorApplicationID + "&MNU=" + mnu + '&isView=1'; $.popupTopWindow('辅修课程信息详情', redirectTo, 800, 600, null, null); } //修改按钮 function MinorPlanApply_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的辅修课程信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?GradeMinorApplicationIDs=" + d + "&MNU=" + mnu; $.popupTopWindow('辅修申请信息修改', redirectTo, 800, 600, null, null); } //删除 function MinorPlanApply_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统信息", "请选择您要删除辅修课程申请信息。"); return; } $.messager.confirm("系统提示", "您确定要删除该辅修课程申请信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorPlanApply/Delete', { GradeMinorApplicationIDs: d }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", "删除成功。"); $("#dgMinorPlanApply").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function MinorPlanApply_GradeCopy() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/CopyByGrade?MNU=" + mnu; $.popupTopWindow('专业计划年级复制', redirectTo, 1000, 200, null, null); } function MinorSpecialtyCourse_Export() { var d = validChoose().join(',') if (d != "") { document.getElementById("MinorCourseID").value = d; } else { document.getElementById("MinorCourseID").value = ""; } $("#formQuery").submit(); } function MinorPlanApply_Submit() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统信息", "请选择您要提交的辅修申请信息。"); return; } var statusNames = validChooseStatusName().join(','); $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorPlanApply/SubmitPlanApplication', { GradeMinorApplicationIDs: d, statusNames: statusNames }, function (data) { if (data == "成功") { $.messager.alert("系统提示", "辅修申请提交成功。"); $("#dgMinorPlanApply").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); }