123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- //加载
- $(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 ChargeDelay_Save() {
- //缓交金额
- 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);
- //可缓交金额
- $("#CanDelayAmount").attr("disabled", false);
- $(document.forms[0]).submit();
- }
- //获取收费标准应收金额
- function queryChargeDelayStandard(data) {
- var userID = $("#UserID").combogridX("getValue");
- if (userID == "" || userID == "-1" || userID == null) {
- $("#UserName").val("");
- $("#Amount").val("");
- $("#ChargeTag").combobox("setValue", "-1");
- $("#ChargeAmount").val("");
- $("#ActualAmount").val("");
- $("#PaidAmount").val("");
- $("#PassDelayAmount").val("");
- $("#CanDelayAmount").val("");
- $("#ApplyDelayAmount").val("");
- return;
- }
- else {
- $("#UserName").val(data.UserName);
- }
- var chargeYearID = $("#ChargeYear").combogrid("getValue");
- if (chargeYearID == "" || chargeYearID == "-1" || chargeYearID == null) {
- $("#Amount").val("");
- $("#ChargeTag").combobox("setValue", "-1");
- $("#ChargeAmount").val("");
- $("#ActualAmount").val("");
- $("#PaidAmount").val("");
- $("#PassDelayAmount").val("");
- $("#CanDelayAmount").val("");
- $("#ApplyDelayAmount").val("");
- return;
- }
- var chargeProjectID = $("#ChargeProjectID").combogridX("getValue");
- if (chargeProjectID == "" || chargeProjectID == "-1" || chargeProjectID == null) {
- $("#Amount").val("");
- $("#ChargeTag").combobox("setValue", "-1");
- $("#ChargeAmount").val("");
- $("#ActualAmount").val("");
- $("#PaidAmount").val("");
- $("#PassDelayAmount").val("");
- $("#CanDelayAmount").val("");
- $("#ApplyDelayAmount").val("");
- return;
- }
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ChargeDelay/ChargeDelayStandard', { userID: userID, chargeYearID: chargeYearID, chargeProjectID: chargeProjectID }, function (data) {
- if (data.IsSuccess == true) {
- if (data.Data != null) {
- $("#UserName").val(data.Data.UserName);
- $("#Amount").val(data.Data.Amount);
- $("#ChargeTag").combobox("setValue", data.Data.ChargeTag);
- $("#ChargeAmount").val(data.Data.ChargeAmount);
- $("#ActualAmount").val(data.Data.ActualAmount);
- $("#PaidAmount").val(data.Data.PaidAmount);
- $("#PassDelayAmount").val(data.Data.PassDelayAmount);
- $("#CanDelayAmount").val(data.Data.CanDelayAmount);
- $("#ApplyDelayAmount").val(data.Data.ApplyDelayAmount);
- }
- else {
- $("#Amount").val("");
- $("#ChargeTag").combobox("setValue", "-1");
- $("#ChargeAmount").val("");
- $("#ActualAmount").val("");
- $("#PaidAmount").val("");
- $("#PassDelayAmount").val("");
- $("#CanDelayAmount").val("");
- $("#ApplyDelayAmount").val("");
- $.messager.alert("系统提示", "对应的应收名单不存在,请核查。");
- }
- }
- else {
- $("#Amount").val("");
- $("#ChargeTag").combobox("setValue", "-1");
- $("#ChargeAmount").val("");
- $("#ActualAmount").val("");
- $("#PaidAmount").val("");
- $("#PassDelayAmount").val("");
- $("#CanDelayAmount").val("");
- $("#ApplyDelayAmount").val("");
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
|