diff --git a/src/main/resources/static/assets/js/project_estimate.js b/src/main/resources/static/assets/js/project_estimate.js index 19af6c8..aa0842f 100644 --- a/src/main/resources/static/assets/js/project_estimate.js +++ b/src/main/resources/static/assets/js/project_estimate.js @@ -1,4 +1,13 @@ function calIncomeAndCost() { + $("input[name='contractAmount']").change(function () { + digitalSelf("contractAmount", "input[name='contractAmount']"); + }); + $("input[name='huazhiProductAmount']").change(function () { + digitalSelf("huazhiProductAmount", "input[name='huazhiProductAmount']"); + }); + $("input[name='ziguangOtherAmount']").change(function () { + digitalSelf("ziguangOtherAmount", "input[name='ziguangOtherAmount']"); + }); $("input[name='incomeDeviceTaxInclude']").change(function () { calIncomeInclude(); calIncomeCost(); @@ -139,7 +148,7 @@ function calIncomeAndCost() { } else { $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); - $incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude/(1+Number(val)))); + $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -154,7 +163,7 @@ function calIncomeAndCost() { }else if(val == "请选择税率"){ return; } else { - $incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude/(1+Number(val)))); + $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -172,7 +181,7 @@ function calIncomeAndCost() { } else { $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - $incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude/(1+Number(val)))); + $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -187,7 +196,7 @@ function calIncomeAndCost() { return; } else { var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - $incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude/(1+Number(val)))); + $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -205,7 +214,7 @@ function calIncomeAndCost() { } else { $("input[name='incomeServiceTaxExclude']").attr('readonly',true); var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - $incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude/(1+Number(val)))); + $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -220,7 +229,7 @@ function calIncomeAndCost() { return; } else { var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - $incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude/(1+Number(val)))); + $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -238,7 +247,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); - $costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude/(1+Number(val)))); + $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -253,7 +262,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); - $costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude/(1+Number(val)))); + $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -271,7 +280,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); - $costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude/(1+Number(val)))); + $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -286,7 +295,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); - $costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude/(1+Number(val)))); + $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -304,7 +313,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); - $costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude/(1+Number(val)))); + $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -319,7 +328,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); - $costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude/(1+Number(val)))); + $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -337,7 +346,7 @@ function calIncomeAndCost() { } else { $("input[name='costOtherOtherTaxExclude']").attr('readonly',true); var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - $costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude/(1+Number(val)))); + $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -352,7 +361,7 @@ function calIncomeAndCost() { return; } else { var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - $costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude/(1+Number(val)))); + $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -370,7 +379,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - $costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude/(1+Number(val)))); + $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -385,7 +394,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - $costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude/(1+Number(val)))); + $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index b3f3dbe..7043e23 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -156,7 +156,7 @@