var url = CMS_SystemConfig.VirtualDirectoryPath + "/ArrearsList/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgArrearsListList").cmsXDataTable("load", $.getDataGridParams("dgArrearsListList")); } //获取选中的数据All function validChooseAll() { var d = []; $.each($("#dgArrearsListList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgArrearsListList").cmsXDataTable("getSelections"), function (index) { d.push(this.UserID); }); return d; } //放行 function ArrearsList_Pass() { var userIDs = validChoose().join(','); if (userIDs == "") { $.messager.alert("系统提示", "请选择您要放行的信息。"); return; } var d = validChooseAll(); if ($.grep(d, function (v, i) { return v.IsControl != isControlStatusID; }).length > 0) { $.messager.alert("系统提示", "只能对控制状态的信息进行放行。"); return; } $.messager.confirm("系统提示", "您确定要对选择的信息进行放行(允许登录)?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ArrearsList/Pass', { userIDs: userIDs }, function (data) { if (data.IsSuccess == true) { $.messager.alert("系统提示", data.Message); $("#dgArrearsListList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //控制 function ArrearsList_Control() { var userIDs = validChoose().join(','); if (userIDs == "") { $.messager.alert("系统提示", "请选择您要控制的信息。"); return; } var d = validChooseAll(); if ($.grep(d, function (v, i) { return v.IsControl == isControlStatusID; }).length > 0) { $.messager.alert("系统提示", "只能对未控制状态的信息进行控制。"); return; } $.messager.confirm("系统提示", "您确定要对选择的信息进行控制(控制登录)?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ArrearsList/Control', { userIDs: userIDs }, function (data) { if (data.IsSuccess == true) { $.messager.alert("系统提示", data.Message); $("#dgArrearsListList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //设置相应的行颜色为红色 function SetRedGrid(rowIndex, rowData) { if (rowData.IsArrear == 1) { return "color: red;"; } else { return ""; } } //Excel导出 function ArrearsList_Export() { $("#formQuery").submit(); } //联动查询 function queryStandard(data) { queryClass(); reload(); } 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)); queryClass(); reload(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var educationID = $("#DictionaryEducation").combobox("getValue"); var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue"); var standardID = $("#StandardDictionaryDropDown").combogridX("getValue"); var learningFormID = $("#DictionaryLearningform").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 + "'})"; $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString)); } else { $("#StandardDictionaryDropDown").combogridX("reload"); } reload(); }