var url = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplicationApprove/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgPlanApplicationApproveList").cmsXDataTable("load", $.getDataGridParams("dgPlanApplicationApproveList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgPlanApplicationApproveList").cmsXDataTable("getSelections"), function (index) { d.push(this.PlanApplicationID); }); return d; } //查看明细 function edit(rowindex, rowdata) { var redirectTo = url + "?planApplicationID=" + rowdata.PlanApplicationID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('计划审核信息', redirectTo, 685, 540, null, null); } //删除 function PlanApplicationApprove_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplicationApprove/Delete', { planApplicationIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgPlanApplicationApproveList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //审核 function PlanApplicationApprove_Approve() { var planApplicationIDs = validChoose(); if (planApplicationIDs.length == 0) { $.messager.alert("系统提示", "请选择您要审核的信息。"); return; } if (planApplicationIDs.length > 1) { //批量审核 var approveID = planApplicationIDs[0]; $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=EM_PlanApplication&FormID=' + approveID, 400, 300, PlanApplicationApprove_ApproveConfirm); } else { var planApplicationID = planApplicationIDs; //单个审核 var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplicationApprove/Approve?MNU=" + mnu + "&planApplicationID=" + planApplicationID; $.popupTopWindow('计划申请审核', redirectTo, 685, 540, null, null); } } //确定(审核) function PlanApplicationApprove_ApproveConfirm(action) { if (!action) { return; } if (action.ActionID == "") { return; } var approveIDs = validChoose().join(','); $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplicationApprove/ApproveConfirm", { planApplicationIDs: approveIDs, actionID: action.Action, comment: action.Comment }, function (data) { if (data.IsSuccess) { reload(); } $.messager.alert("系统提示", data.Message); }, 'json'); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //Excel导出 function PlanApplicationApprove_Export() { $("#formQuery").submit(); } //联动查询 function queryCampus(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); if (campusID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); } else { $("#CollegeDropdown").combogridX("reload"); } queryClass(); } function queryCollege(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|"; jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); $("#DictionaryStandard").combogridX("reload", eval(jsonString)); queryClass(); } function querySchoolyear(data) { queryClass(); } function queryStandard(data) { queryClass(); } function queryGrademajor(data) { queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var schoolYearID = $("#DictionarySchoolyear").combogridX("getValue"); //combobox var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningFormID = $("#DictionaryLearningform").combogridX("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#DictionaryStandard").combogridX("reload", eval(jsonString)); $("#GrademajorComboGrid").combogridX("reload", eval(jsonString)); } else { $("#DictionaryStandard").combogridX("reload"); $("#GrademajorComboGrid").combogridX("reload"); } reload(); }