var url = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplication/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgPlanApplicationList").cmsXDataTable("load", $.getDataGridParams("dgPlanApplicationList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgPlanApplicationList").cmsXDataTable("getSelections"), function (index) { d.push(this.PlanApplicationID); }); return d; } //获取选中的数据All function validChooseAll() { var d = []; $.each($("#dgPlanApplicationList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //新增 function PlanApplication_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('计划申请复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplication/CopyAdd?planApplicationID=' + d[0] + '&MNU=' + mnu, 685, 540, null, null); } else { //var redirectTo = url + "?MNU=" + mnu; //$.popupTopWindow('计划申请新增', redirectTo, 685, 540, null, null); //采用以下方式申请 var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplication/PlanApplicationBatchAdd" + "?MNU=" + mnu; $.popupTopWindow('计划申请新增', redirectTo, 1200, 540, reload, null); } } //修改 function PlanApplication_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?planApplicationID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('计划申请修改', redirectTo, 685, 540, null, null); } //查看明细 function edit(rowindex, rowdata) { var redirectTo = url + "?planApplicationID=" + rowdata.PlanApplicationID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('计划申请信息', redirectTo, 685, 540, null, null); } //删除 function PlanApplication_Delete() { var id = validChoose().join(','); if (id == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } //var d = validChooseAll(); //if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) { // $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行删除。"); // return; //} $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplication/Delete', { planApplicationIDs: id }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgPlanApplicationList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //申请表打印 function PlanApplication_Print() { //暂不考虑 $.messager.alert("系统提示", ""); } //提交 function PlanApplication_Submit() { var id = validChoose().join(','); if (id.length == 0) { $.messager.alert("系统提示", "请选择您要提交的信息。"); return; } //var d = validChooseAll(); //if ($.grep(d, function (v, i) { return v.RecordStatus == endStatusID; }).length > 0) { // $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行提交。"); // return; //} $.messager.confirm("系统提示", "您确定要对选择的信息进行提交?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplication/PlanApplicationSubmit', { planApplicationIDs: id }, function (data) { if (data.IsSuccess == true) { $.messager.alert("系统提示", data.Message); $("#dgPlanApplicationList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //Excel导出 function PlanApplication_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(); }