//var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/add"; var AuthenizationUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Authenization"; var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Edit"; var CancelUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Cancel"; var bathval = ""; var mnu; //联动查询 function queryStandard(data) { queryClass(); reload(); } $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) 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)); $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString)); // if (campusID != nonSelect) { // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; // $("#CollegeDropdown").combogridX("reload", eval(jsonString)); // } queryClass(); reload(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); //var educationID = $("#Education").combobox("getValue"); var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue"); var standardID = $("#StandardDictionaryDropDown").combogridX("getValue"); //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#ClassmajorDropdown").combogridX("reload", eval(jsonString)); } else { $("#ClassmajorDropdown").combogridX("reload"); } reload(); } function reload() { $("#dgPunishList").cmsXDataTable("load", $.getDataGridParams("dgPunishList")); } //新增 function StudentPunish_Add() { var redirectTo = url + '?MNU=' + mnu; $.popupTopWindow('学生处分填写', redirectTo, 600, 200, null, null); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) { d.push(this.StudentPunishID); }); return d; } //获取选中撤销日期 function validChooseCancelDate() { var d = []; $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) { d.push(this.CancelDate); }); return d; } //获取选中撤销文号 function validChooseCancelNo() { var d = []; $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) { d.push(this.CancelNo); }); return d; } //获取选中状态 function validChoosePunishStatus() { var d = []; $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) { d.push(this.PunishStatusID); }); return d; } //批量修改 SystemBatchModifyControl.OnSubmit = function (a) { //处理撤销日期 if (document.getElementById("CancelDateTextBoxDate_div").style.display != "none") { var StartDate = $("#CancelDate_TextBoxDate").val(); var d = validChooseCancelDate(); for (var i = 0; i < d.length; i++) { var time = new Date(d[i]); if (d[i] == null) { $.messager.alert("系统提示", "只有撤销状态的数据才能执行批量修改撤销日期"); return false; } if (d[i].toDateString("yyyy-MM-dd") > StartDate) { $.messager.alert("系统提示", "撤销日期不能小于处分日期"); return false; } } } if (document.getElementById("CancelDocNoTextBox_div").style.display != "none") { var StartDate = $("#CancelDocNo_TextBox").val(); var d = validChooseCancelDate(); for (var i = 0; i < d.length; i++) { if (d[i] == null) { $.messager.alert("系统提示", "只有撤销状态的数据才能执行批量修改撤销文号"); return false; } } } var s = validChoosePunishStatus(); for (var i = 0; i < s.length; i++) { if (s[i] == 3) { if (document.getElementById("SchoolyearIDDropdownList_div").style.display != "none") { $.messager.alert("系统提示", "撤销状态不能批量修改学年学期"); return false; } if (document.getElementById("PunishTypeIDDictionaryDropDownList_div").style.display != "none") { $.messager.alert("系统提示", "撤销状态不能批量修改处分类型"); return false; } if (document.getElementById("PunishLevelIDDictionaryDropDownList_div").style.display != "none") { $.messager.alert("系统提示", "撤销状态不能批量修改处分级别"); return false; } if (document.getElementById("ReasonTextBox_div").style.display != "none") { $.messager.alert("系统提示", "撤销状态不能批量修改处分原因"); return false; } if (document.getElementById("DocNoTextBox_div").style.display != "none") { $.messager.alert("系统提示", "撤销状态不能批量修改处分文号"); return false; } if (document.getElementById("PunishDateTextBoxDate_div").style.display != "none") { $.messager.alert("系统提示", "撤销状态不能批量修改处分日期"); return false; } } } } //查看 function Authenization(rowindex, rowdata) { var redirectTo = AuthenizationUrl; redirectTo = AuthenizationUrl + '?id=' + rowdata.StudentPunishID; redirectTo = redirectTo + '&MNU=' + mnu + '&isView=1'; $.popupTopWindow('学生处分查看', redirectTo, 600, 200, null, null); } //修改 function StudentPunish_Update() { var selected = $("#dgPunishList").cmsXDataTable("getSelections"); if (selected.length == 0) { $.messager.alert("系统提示", "请选择您要修改的处分信息!"); return; } if (selected.length > 1) { $.messager.alert("系统提示", "一次只能修改一条处分信息!"); return; } if (selected[0].PunishStatusID != 1) { $.messager.alert("系统提示", "只能修改待处理的处分信息!"); return; } var redirectTo = url; var a = selected[0].StudentPunishID; if (a) { redirectTo = url + '?id=' + a; } redirectTo = redirectTo + '&MNU=' + mnu; $.popupTopWindow('学生处分修改', redirectTo, 600, 200, null, null); } //审核 //function StudentPunish_Authenization() { // var selected = $("#dgList").cmsXDataTable("getSelections"); // if (selected.length == 0) { // $.messager.alert("系统提示", "请选择您要审核的处分信息!"); // return; // } // if (selected.length > 1) { // $.messager.alert("系统提示", "一次只能审核一条处分信息!"); // return; // } // if (selected[0].PunishStatusID != 1) { // $.messager.alert("系统提示", "只能审核待处理的处分信息!"); // return; // } // var redirectTo = AuthenizationUrl; // var a = selected[0].StudentPunishID; // if (a) { // redirectTo = AuthenizationUrl + '?id=' + a; // } // redirectTo = redirectTo + '&MNU=' + mnu; // $.popupTopWindow('学生处分审核', redirectTo, 800, 400, null, null); //} //审核 function StudentPunish_Authenization() { var selected = $("#dgPunishList").cmsXDataTable("getSelections"); if (selected.length == 0) { $.messager.alert("系统提示", "请选择您要审核的处分信息!"); return; } var ids = []; for (var i = 0; i < selected.length; i++) { if (selected[i].PunishStatusID != 1) { $.messager.alert("系统提示", "只能审核待处理的处分信息!"); return; } ids.push(selected[i].StudentPunishID); } $.messager.confirm("系统提示", "您确定要审核该处分申请信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/Authenization', { ids: ids.join(',') }, function (data) { if (data == "审核成功") { $.messager.alert("系统提示", "审核成功!"); $("#dgPunishList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //删除 function StudentPunish_Delete() { var selected = $("#dgPunishList").cmsXDataTable("getSelections"); if (selected.length == 0) { $.messager.alert("系统提示", "请选择您要删除的处分信息!"); return; } var ids = []; for (var i = 0; i < selected.length; i++) { if (selected[i].PunishStatusID != 1) { $.messager.alert("系统提示", "只能删除待处理的处分信息!"); return; } ids.push(selected[i].StudentPunishID); } $.messager.confirm("系统提示", "您确定要删除该处分申请信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/Delete', { ids: ids.join(',') }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", "删除成功!"); $("#dgPunishList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //导出 function StudentPunish_Export() { $("#formQuery").submit(); } //撤销 function StudentPunish_Cancel() { var selected = $("#dgPunishList").cmsXDataTable("getSelections"); if (selected.length == 0) { $.messager.alert("系统提示", "请选择您要撤销的处分信息!"); return; } if (selected.length > 1) { $.messager.alert("系统提示", "一次只能撤销一条处分信息!"); return; } if (selected[0].PunishStatusID != 2) { $.messager.alert("系统提示", "只能撤销已审核的处分信息!"); return; } var redirectTo = AuthenizationUrl; var a = selected[0].StudentPunishID; if (a) { redirectTo = CancelUrl + '?id=' + a; } redirectTo = redirectTo + '&MNU=' + mnu+'&isView=2';; $.popupTopWindow('学生处分撤销', redirectTo, 600, 200, null, null); }