123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- //加载
- $(function () {
- //缓交金额
- $("#DelayAmount").blur(function () {
- //可缓交金额
- var canDelayAmount = $("#CanDelayAmount").val();
- //缓交金额
- var delayAmount = $("#DelayAmount").val();
-
- if (delayAmount != null && delayAmount != "") {
- //正浮点数(/^(([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(delayAmount)) {
- $("#DelayAmount").val("");
- $("#DelayPercent").val("");
- $.messager.alert("系统提示", "请输入金额。");
- return;
- }
- $("#DelayPercent").attr("disabled", true);
- if (parseFloat(delayAmount) <= parseFloat(canDelayAmount)) {
- var delayPercent = Math.round((delayAmount / canDelayAmount).toFixed(2) * 100) > 0
- ? Math.round((delayAmount / canDelayAmount).toFixed(2) * 100) : 1;
- //缓交百分比
- $("#DelayPercent").val(delayPercent);
- }
- else {
- $("#DelayAmount").val("");
- $("#DelayPercent").attr("disabled", false);
- $("#DelayPercent").val("");
- $.messager.alert("系统提示", "缓交金额不能大于可缓交金额。");
- }
- }
- else {
- $("#DelayPercent").attr("disabled", false);
- $("#DelayPercent").val("");
- }
- });
- //缓交百分比
- $("#DelayPercent").blur(function () {
- //可缓交金额
- var canDelayAmount = $("#CanDelayAmount").val();
- //缓交百分比
- var delayPercent = $("#DelayPercent").val();
- if (delayPercent != null && delayPercent != "") {
- //正整数(/^[0-9]*[1-9][0-9]*$/)
- var reg = /^[0-9]*[1-9][0-9]*$/;
- if (!reg.test(delayPercent)) {
- $("#DelayPercent").val("");
- $("#DelayAmount").val("");
- $.messager.alert("系统提示", "请输入数字。");
- return;
- }
- $("#DelayAmount").attr("disabled", true);
- if (parseInt(delayPercent) > 100 || parseInt(delayPercent) <= 0) {
- $("#DelayPercent").val("");
- $("#DelayAmount").attr("disabled", false);
- $("#DelayAmount").val("");
- $.messager.alert("系统提示", "缓缴百分比必须在1-100之间");
- }
- else {
- var delayAmount = ((canDelayAmount * (delayPercent / 100).toFixed(2))).toFixed(1);
- //缓交金额
- $("#DelayAmount").val(delayAmount);
- }
- }
- else {
- $("#DelayAmount").attr("disabled", false);
- $("#DelayAmount").val("");
- }
- });
- })
- //刷新
- function reload() {
- $("#dgStudentChargeList").cmsXDataTable("load", $.getDataGridParams("dgStudentChargeList"));
- }
- //保存
- function StudentCharge_Save() {
- var amount = $("#Amount").val();
- if (amount == "" || amount == null) {
- $.messager.alert("系统提示", "应收金额不能为空,请核对对应的收费标准。");
- return;
- }
- $(document.forms[0]).submit();
- }
- //缓交申请确定
- function ChangeDelay_Apply() {
- //缓交金额
- var delayAmount = $("#DelayAmount").val();
- //缓交百分比
- var delayPercent = $("#DelayPercent").val();
- if ((delayAmount == null || delayAmount == "") && (delayPercent == null || delayPercent == "")) {
- $.messager.alert("系统提示", "请输入缓交金额或缓交百分比。");
- return;
- }
- if (delayPercent != null && delayPercent != "") {
- if (parseInt(delayPercent) > 100 || parseInt(delayPercent) <= 0) {
- $.messager.alert("系统提示", "缓缴百分比必须在1-100之间");
- return;
- }
- }
- //可缓交金额
- var canDelayAmount = $("#CanDelayAmount").val();
-
- //缓交金额在可缓交金额范围内
- if (parseFloat(delayAmount) > parseFloat(canDelayAmount)) {
- $.messager.alert("系统提示", "缓交金额不能大于可缓交金额。");
- $("#DelayAmount").val("");
- $("#DelayPercent").val("");
- return;
- }
- $("#DelayAmount").attr("disabled", false);
- $("#DelayPercent").attr("disabled", false);
- $(document.forms[0]).submit();
- }
- //费用调整确定
- function StudentCharge_PayEdit() {
- $(document.forms[0]).submit();
- }
- //获取收费标准应收金额
- function queryStudentChargeAmount(data) {
- var userID = $("#UserID").combogridX("getValue");
- if (userID == "" || userID == "-1" || userID == null) {
- $("#Amount").val("");
- return;
- }
- var chargeYearID = $("#ChargeYear").combogrid("getValue");
- if (chargeYearID == "" || chargeYearID == "-1" || chargeYearID == null) {
- $("#Amount").val("");
- return;
- }
- var chargeProjectID = $("#ChargeProjectID").combogridX("getValue");
- if (chargeProjectID == "" || chargeProjectID == "-1" || chargeProjectID == null) {
- $("#Amount").val("");
- return;
- }
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentCharge/StudentChargeStandard', { userID: userID, chargeYearID: chargeYearID, chargeProjectID: chargeProjectID }, function (data) {
- if (data.IsSuccess == true) {
- $("#Amount").val(data.Message);
- }
- else {
- $("#Amount").val("");
- }
- });
- reload();
- }
|