var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentChargePaymen/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgStudentChargePaymenList").cmsXDataTable("load", $.getDataGridParams("dgStudentChargePaymenList")); //统计缴费总金额 $.post(CMS_SystemConfig.VirtualDirectoryPath + "/StudentChargePaymen/AmountCountList", $.getDataGridParams("dgStudentChargePaymenList"), function (data) { $("#amountSum").html(data.AmountSum.toString()); }) } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgStudentChargePaymenList").cmsXDataTable("getSelections"), function (index) { d.push(this.StudentChargePaymentID); }); return d; } //新增 function StudentChargePaymen_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('学生缴费新增', redirectTo, 600, 320, null, null); } //修改 function StudentChargePaymen_Update() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?studentChargePaymentID=" + d + "&MNU=" + mnu; $.popupTopWindow('学生缴费修改', redirectTo, 600, 320, null, null); } //批量修改(重写) SystemBatchModifyControl.OnSubmit = function () { if (document.getElementById("AmountNumberBox_div").style.display != "none") { //缴费金额 var amount = $("#Amount_NumberBox").val(); if (amount == null || amount == "") { $.messager.alert("系统提示", "请输入缴费金额。"); return false; } //正浮点数 ^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$ var reg = /^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/; if (!reg.test(amount)) { $.messager.alert("系统提示", "缴费金额输入有误,请重新输入。"); return false; } var d = validChoose().join(','); if (d == "") { return; } if (parseFloat(amount) > 0) { $.messager.confirm("系统提示", "您确定要批量修改选择的信息吗?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentChargePaymen/BatchModifyControl', { studentChargePaymentIDs: d, amount: amount }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); reload(); } }); } }); return true; } else { $.messager.alert("系统提示", "缴费金额输入有误。"); //reload(); return false; } } } //删除 function StudentChargePaymen_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentChargePaymen/Delete', { studentChargePaymenIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgStudentChargePaymenList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //Excel导入 function StudentChargePaymen_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StudentChargePaymen/Import?MNU=' + mnu; $.popupTopWindow('学生缴费导入', redirectTo, 420, 300, reload); } //Excel导出 function StudentChargePaymen_Excel() { $("#formQuery").submit(); } //已缴金额列设置颜色为红色 function SetAmountColumn(index, row, value) { return " " + value + ""; } //联动查询 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(); }