123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- //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);
- }
|