From e6e2f1ee85999bc57ca99908843ba4f382784063 Mon Sep 17 00:00:00 2001 From: OathK1per <zhangypg@gmail.com> Date: Mon, 15 Aug 2022 15:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E7=AE=97=E6=A6=82=E7=AE=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/service/ProjectBudgetService.java | 9 +- .../static/assets/js/project_budget.js | 3 +- .../static/assets/js/project_budget_cost.js | 8 +- .../js/project_budget_cost_project_manage.js | 2 +- .../static/assets/js/project_common.js | 25 + .../static/assets/js/project_estimate.js | 925 +++++++++--------- .../templates/admin/project_budget_edit.ftl | 4 +- .../templates/admin/project_estimate_add.ftl | 156 +-- 8 files changed, 613 insertions(+), 519 deletions(-) diff --git a/src/main/java/cn/palmte/work/service/ProjectBudgetService.java b/src/main/java/cn/palmte/work/service/ProjectBudgetService.java index e6e6f05..5de6862 100644 --- a/src/main/java/cn/palmte/work/service/ProjectBudgetService.java +++ b/src/main/java/cn/palmte/work/service/ProjectBudgetService.java @@ -186,15 +186,17 @@ public class ProjectBudgetService { List<ProjectBudgetIncomeDetail> collectDevice = incomeDetails.stream().filter(d -> d.getType() == ProjectBudgetIncomeDetail.TYPE_DEVICE).collect(Collectors.toList()); budgetBean.setIncomeDeviceTaxInclude(getIncomeTotalTaxInclude(collectDevice)); budgetBean.setIncomeDeviceTaxExclude(getIncomeTotalTaxExclude(collectDevice)); -// budgetBean.setIncomeDeviceTax(); + budgetBean.setIncomeDeviceTax(budgetBean.getIncomeDeviceTaxInclude().subtract(budgetBean.getIncomeDeviceTaxExclude())); //工程类收入,含税和不含税 List<ProjectBudgetIncomeDetail> collectEngineer = incomeDetails.stream().filter(d -> d.getType() == ProjectBudgetIncomeDetail.TYPE_ENGINEER).collect(Collectors.toList()); budgetBean.setIncomeEngineerTaxInclude(getIncomeTotalTaxInclude(collectEngineer)); budgetBean.setIncomeEngineerTaxExclude(getIncomeTotalTaxExclude(collectEngineer)); + budgetBean.setIncomeEngineerTax(budgetBean.getIncomeEngineerTaxInclude().subtract(budgetBean.getIncomeEngineerTaxExclude())); //服务类收入,含税和不含税 List<ProjectBudgetIncomeDetail> collectService = incomeDetails.stream().filter(d -> d.getType() == ProjectBudgetIncomeDetail.TYPE_SERVICE).collect(Collectors.toList()); budgetBean.setIncomeServiceTaxInclude(getIncomeTotalTaxInclude(collectService)); budgetBean.setIncomeServiceTaxExclude(getIncomeTotalTaxExclude(collectService)); + budgetBean.setIncomeServiceTax(budgetBean.getIncomeServiceTaxInclude().subtract(budgetBean.getIncomeServiceTaxExclude())); } List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(project.getId()); @@ -203,18 +205,22 @@ public class ProjectBudgetService { List<ProjectBudgetCostDetail> collectDevice = projectBudgetCostDetails.stream().filter(d -> d.getType() == ProjectBudgetCostDetail.TYPE_DEVICE).collect(Collectors.toList()); budgetBean.setCostPurchaseDeviceTaxInclude(getCostTotalTaxInclude(collectDevice)); budgetBean.setCostPurchaseDeviceTaxExclude(getCostTotalTaxExclude(collectDevice)); + budgetBean.setCostPurchaseDeviceTax(budgetBean.getCostPurchaseDeviceTaxInclude().subtract(budgetBean.getCostPurchaseDeviceTaxExclude())); //采购成本-施工,含税和不含税 List<ProjectBudgetCostDetail> collectBuild = projectBudgetCostDetails.stream().filter(d -> d.getType() == ProjectBudgetCostDetail.TYPE_BUILD).collect(Collectors.toList()); budgetBean.setCostPurchaseBuildTaxInclude(getCostTotalTaxInclude(collectBuild)); budgetBean.setCostPurchaseBuildTaxExclude(getCostTotalTaxExclude(collectBuild)); + budgetBean.setCostPurchaseBuildTax(budgetBean.getCostPurchaseBuildTaxInclude().subtract(budgetBean.getCostPurchaseBuildTaxExclude())); //采购成本-服务,含税和不含税 List<ProjectBudgetCostDetail> collectService = projectBudgetCostDetails.stream().filter(d -> d.getType() == ProjectBudgetCostDetail.TYPE_SERVICE).collect(Collectors.toList()); budgetBean.setCostPurchaseServiceTaxInclude(getCostTotalTaxInclude(collectService)); budgetBean.setCostPurchaseServiceTaxExclude(getCostTotalTaxExclude(collectService)); + budgetBean.setCostPurchaseServiceTax(budgetBean.getCostPurchaseServiceTaxInclude().subtract(budgetBean.getCostPurchaseServiceTaxExclude())); //采购成本-其他,含税和不含税 List<ProjectBudgetCostDetail> collectOther = projectBudgetCostDetails.stream().filter(d -> d.getType() == ProjectBudgetCostDetail.TYPE_OHTER).collect(Collectors.toList()); budgetBean.setCostPurchaseOtherTaxInclude(getCostTotalTaxInclude(collectOther)); budgetBean.setCostPurchaseOtherTaxExclude(getCostTotalTaxExclude(collectOther)); + budgetBean.setCostPurchaseOtherTax(budgetBean.getCostPurchaseOtherTaxInclude().subtract(budgetBean.getCostPurchaseOtherTaxExclude())); budgetBean.setCostPurchaseTotalTaxInclude(getCostTotalTaxInclude(collectDevice).add(getCostTotalTaxInclude(collectBuild)).add(getCostTotalTaxInclude(collectService)).add(getCostTotalTaxInclude(collectOther))); budgetBean.setCostPurchaseTotalTaxExclude(getCostTotalTaxExclude(collectDevice).add(getCostTotalTaxExclude(collectBuild)).add(getCostTotalTaxExclude(collectService)).add(getCostTotalTaxExclude(collectOther))); @@ -232,6 +238,7 @@ public class ProjectBudgetService { ProjectBudgetCost projectBudgetCostOtherOther = costs.stream().filter(d -> d.getType() == ProjectBudgetCost.TYPE_OTHER_OTHER).collect(Collectors.toList()).get(0); budgetBean.setCostOtherOtherTaxInclude(projectBudgetCostOtherOther.getCostTaxInclude()); budgetBean.setCostOtherOtherTaxExclude(projectBudgetCostOtherOther.getCostTaxExclude()); + budgetBean.setCostOtherOtherTax(budgetBean.getCostOtherOtherTaxInclude().subtract(budgetBean.getCostPurchaseTotalTaxExclude())); } diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index 3c1affa..e610544 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -676,6 +676,7 @@ function updateCostDataIfUnsubmit(details) { calCostExclude(); calCostInclude(); + calCostTotalTax(); var costTotalTaxInclude = inputVal("costTotalTaxInclude"); var costTotalTaxExclude = inputVal("costTotalTaxExclude"); $("input[name='costTotalTax']").val(f2Fixed(f2(costTotalTaxInclude) - f2(costTotalTaxExclude))); @@ -762,7 +763,7 @@ function updateCostProjectManageDataUnsubmit(details) { calCostExclude(); calCostInclude(); - + calCostTotalTax() updateProjectContributionProfitRate(); } diff --git a/src/main/resources/static/assets/js/project_budget_cost.js b/src/main/resources/static/assets/js/project_budget_cost.js index 9e1e14c..4b8fb5a 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -308,7 +308,7 @@ function updateCostData(data, returnData) { calCostExclude(); calCostInclude(); - + calCostTotalTax(); updateProjectContributionProfitRate(); layuiAlert("保存成功"); @@ -330,6 +330,9 @@ function bindOtherOtherChangeable() { calCostInclude(); + calCostOtherOtherTax(); + calCostTotalTax(); + updateProjectContributionProfitRate(); digitalSelf("costOtherOtherTaxInclude", "input[name='costOtherOtherTaxInclude']"); }); @@ -348,6 +351,9 @@ function bindOtherOtherChangeable() { calCostExclude(); + calCostOtherOtherTax(); + calCostTotalTax(); + updateProjectContributionProfitRate(); digitalSelf("costOtherOtherTaxExclude", "input[name='costOtherOtherTaxExclude']"); }); diff --git a/src/main/resources/static/assets/js/project_budget_cost_project_manage.js b/src/main/resources/static/assets/js/project_budget_cost_project_manage.js index 38e7654..4eabecd 100644 --- a/src/main/resources/static/assets/js/project_budget_cost_project_manage.js +++ b/src/main/resources/static/assets/js/project_budget_cost_project_manage.js @@ -332,7 +332,7 @@ function updateCostProjectManageData(data,returnData) { calCostExclude(); calCostInclude(); - + calCostTotalTax(); updateProjectContributionProfitRate(); layuiAlert("保存成功"); diff --git a/src/main/resources/static/assets/js/project_common.js b/src/main/resources/static/assets/js/project_common.js index 6b7b4ae..1cf6376 100644 --- a/src/main/resources/static/assets/js/project_common.js +++ b/src/main/resources/static/assets/js/project_common.js @@ -286,4 +286,29 @@ function calCostExclude() { $costTotalTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxExclude)+f2(costPurchaseBuildTaxExclude) +f2(costPurchaseServiceTaxExclude)+f2(costPurchaseOtherTaxExclude) +f2(costProjectManageTaxExclude)+f2(costOtherOtherTaxExclude))); +} +/** + * 统计其他其他税金 + */ +function calCostOtherOtherTax() { + var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); + var costOtherOtherTaxExclude = inputVal("costOtherOtherTaxExclude"); + + var $costOtherOtherTax = $("input[name='costOtherOtherTax']"); + + $costOtherOtherTax.val(f2Fixed(f2(costOtherOtherTaxInclude)-f2(costOtherOtherTaxExclude))); +} +/** + * 统计总税金 + */ +function calCostTotalTax() { + var costPurchaseDeviceTax = inputVal("costPurchaseDeviceTax"); + var costPurchaseBuildTax = inputVal("costPurchaseBuildTax"); + var costPurchaseServiceTax = inputVal("costPurchaseServiceTax"); + var costPurchaseOtherTax = inputVal("costPurchaseOtherTax"); + var costOtherOtherTax = inputVal("costOtherOtherTax"); + + var $costTotalTax = $("input[name='costTotalTax']"); + + $costTotalTax.val(f2Fixed(f2(costPurchaseDeviceTax)+f2(costPurchaseBuildTax)+f2(costPurchaseServiceTax)+f2(costPurchaseOtherTax)+f2(costOtherOtherTax))); } \ No newline at end of file diff --git a/src/main/resources/static/assets/js/project_estimate.js b/src/main/resources/static/assets/js/project_estimate.js index f3c3f3e..77ac602 100644 --- a/src/main/resources/static/assets/js/project_estimate.js +++ b/src/main/resources/static/assets/js/project_estimate.js @@ -2,465 +2,484 @@ function calIncomeAndCost() { $("input[name='contractAmount']").change(function () { digitalSelf("contractAmount", "input[name='contractAmount']"); }); + $("input[name='grossProfit']").change(function () { + digitalSelf("grossProfit", "input[name='grossProfit']"); + }); + $("input[name='grossProfitMargin']").change(function () { + digitalSelf("grossProfitMargin", "input[name='grossProfitMargin']"); + }); $("input[name='huazhiProductAmount']").change(function () { digitalSelf("huazhiProductAmount", "input[name='huazhiProductAmount']"); }); + $("input[name='huizhiProductAmount']").change(function () { + digitalSelf("huizhiProductAmount", "input[name='huizhiProductAmount']"); + }); + $("input[name='huasanProductAmount']").change(function () { + digitalSelf("huasanProductAmount", "input[name='huasanProductAmount']"); + }); $("input[name='ziguangOtherAmount']").change(function () { digitalSelf("ziguangOtherAmount", "input[name='ziguangOtherAmount']"); }); - $("input[name='incomeDeviceTaxInclude']").change(function () { - calIncomeInclude(); - calIncomeCost(); - - calIncomeDeviceTaxExclude(); - digitalSelf("incomeDeviceTaxInclude", "input[name='incomeDeviceTaxInclude']"); + $("input[name='advanceInterestAmount']").change(function () { + digitalSelf("advanceInterestAmount", "input[name='advanceInterestAmount']"); }); - $("input[name='incomeEngineerTaxInclude']").change(function () { - calIncomeInclude(); - calIncomeCost(); - - calIncomeEngineerTaxExclude(); - digitalSelf("incomeEngineerTaxInclude", "input[name='incomeEngineerTaxInclude']"); + $("input[name='advancePeakAmount']").change(function () { + digitalSelf("advancePeakAmount", "input[name='advancePeakAmount']"); }); - $("input[name='incomeServiceTaxInclude']").change(function () { - calIncomeInclude(); - calIncomeCost(); - - calIncomeServiceTaxExclude(); - digitalSelf("incomeServiceTaxInclude", "input[name='incomeServiceTaxInclude']"); - }); - $("input[name='incomeDeviceTaxExclude']").change(function () { - calIncomeExclude(); - calIncomeCost(); - digitalSelf("incomeDeviceTaxExclude", "input[name='incomeDeviceTaxExclude']"); - }); - $("input[name='incomeEngineerTaxExclude']").change(function () { - calIncomeExclude(); - calIncomeCost(); - digitalSelf("incomeEngineerTaxExclude", "input[name='incomeEngineerTaxExclude']"); - }); - $("input[name='incomeServiceTaxExclude']").change(function () { - calIncomeExclude(); - calIncomeCost(); - digitalSelf("incomeServiceTaxExclude", "input[name='incomeServiceTaxExclude']"); - }); - - - - - $("input[name='costPurchaseDeviceTaxInclude']").change(function () { - calCostInclude(); - calIncomeCost(); - - calCostPurchaseDeviceTaxInclude(); - digitalSelf("costPurchaseDeviceTaxInclude", "input[name='costPurchaseDeviceTaxInclude']"); - }); - $("input[name='costPurchaseBuildTaxInclude']").change(function () { - calCostInclude(); - calIncomeCost(); - - calCostPurchaseBuildTaxInclude(); - digitalSelf("costPurchaseBuildTaxInclude", "input[name='costPurchaseBuildTaxInclude']"); - }); - $("input[name='costPurchaseServiceTaxInclude']").change(function () { - calCostInclude(); - calIncomeCost(); - - calCostPurchaseServiceTaxInclude(); - digitalSelf("costPurchaseServiceTaxInclude", "input[name='costPurchaseServiceTaxInclude']"); - }); - $("input[name='costPurchaseOtherTaxInclude']").change(function () { - calCostInclude(); - calIncomeCost(); - - calCostPurchaseOtherTaxInclude(); - digitalSelf("costPurchaseOtherTaxInclude", "input[name='costPurchaseOtherTaxInclude']"); - }); - /*$("input[name='costProjectManageTaxInclude']").change(function () { - calCostInclude(); - calIncomeCost(); - });*/ - $("input[name='costOtherOtherTaxInclude']").change(function () { - calCostInclude(); - calIncomeCost(); - - calCostOtherOtherTaxInclude(); - digitalSelf("costOtherOtherTaxInclude", "input[name='costOtherOtherTaxInclude']"); - }); - - $("input[name='costPurchaseDeviceTaxExclude']").change(function () { - calCostExclude(); - calIncomeCost(); - digitalSelf("costPurchaseDeviceTaxExclude", "input[name='costPurchaseDeviceTaxExclude']"); - }); - $("input[name='costPurchaseBuildTaxExclude']").change(function () { - calCostExclude(); - calIncomeCost(); - digitalSelf("costPurchaseBuildTaxExclude", "input[name='costPurchaseBuildTaxExclude']"); - }); - $("input[name='costPurchaseServiceTaxExclude']").change(function () { - calCostExclude(); - calIncomeCost(); - digitalSelf("costPurchaseServiceTaxExclude", "input[name='costPurchaseServiceTaxExclude']"); - }); - $("input[name='costPurchaseOtherTaxExclude']").change(function () { - calCostExclude(); - calIncomeCost(); - digitalSelf("costPurchaseOtherTaxExclude", "input[name='costPurchaseOtherTaxExclude']"); - }); - $("input[name='costProjectManageTaxExclude']").change(function () { - calCostExclude(); - - //不含税的=含税的 - //含税的总额更新 - $("input[name='costProjectManageTaxInclude']").val($("input[name='costProjectManageTaxExclude']").val()); - calCostInclude(); - - calIncomeCost(); - digitalSelf("costProjectManageTaxExclude", "input[name='costProjectManageTaxExclude']"); - digitalSelf("costProjectManageTaxInclude", "input[name='costProjectManageTaxInclude']"); - }); - $("input[name='costOtherOtherTaxExclude']").change(function () { - calCostExclude(); - calIncomeCost(); - digitalSelf("costOtherOtherTaxExclude", "input[name='costOtherOtherTaxExclude']"); - }); - - $("input[name='costExpropriationTaxExclude']").change(function () { - calIncomeCost(); - digitalSelf("costExpropriationTaxExclude", "input[name='costExpropriationTaxExclude']"); - }); - $("input[name='costCompanyManageTaxExclude']").change(function () { - calIncomeCost(); - digitalSelf("costCompanyManageTaxExclude", "input[name='costCompanyManageTaxExclude']"); - }); - - //设备类收入 - $("select[name='incomeDeviceSelect']").change(function () { - let val = $('#incomeDeviceSelect option:selected').val(); - var $incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']"); - if(val == "自定义"){ - $("input[name='incomeDeviceTaxExclude']").attr('readonly',false); - $("input[name='incomeDeviceTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); - $incomeDeviceTaxExclude.val(""); - } else { - $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); - var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); - $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); - } - calIncomeExclude(); - calIncomeCost(); - }); - - function calIncomeDeviceTaxExclude(){ - let val = $('#incomeDeviceSelect option:selected').val(); - var $incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']"); - var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); - } - calIncomeExclude(); - calIncomeCost(); - } - - //工程类收入 - $("select[name='incomeEngineerSelect']").change(function () { - let val = $('#incomeEngineerSelect option:selected').val(); - var $incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']"); - if(val == "自定义"){ - $("input[name='incomeEngineerTaxExclude']").attr('readonly',false) - $("input[name='incomeEngineerTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); - $incomeEngineerTaxExclude.val(""); - } else { - $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); - var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); - } - calIncomeExclude(); - calIncomeCost(); - }); - - function calIncomeEngineerTaxExclude(){ - let val = $('#incomeEngineerSelect option:selected').val(); - var $incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); - } - calIncomeExclude(); - calIncomeCost(); - } - - //服务类收入 - $("select[name='incomeServiceSelect']").change(function () { - let val = $('#incomeServiceSelect option:selected').val(); - var $incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']"); - if(val == "自定义"){ - $("input[name='incomeServiceTaxExclude']").attr('readonly',false); - $("input[name='incomeServiceTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='incomeServiceTaxExclude']").attr('readonly',true); - $incomeServiceTaxExclude.val(""); - } else { - $("input[name='incomeServiceTaxExclude']").attr('readonly',true); - var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); - } - calIncomeExclude(); - calIncomeCost(); - }); - - function calIncomeServiceTaxExclude(){ - let val = $('#incomeServiceSelect option:selected').val(); - var $incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); - } - calIncomeExclude(); - calIncomeCost(); - } - - //设备类采购成本 - $("select[name='costPurchaseDeviceSelect']").change(function () { - let val = $('#costPurchaseDeviceSelect option:selected').val(); - var $costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']"); - if(val == "自定义"){ - $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',false) - $("input[name='costPurchaseDeviceTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); - $costPurchaseDeviceTaxExclude.val(""); - } else { - $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); - var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); - $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - }); - - function calCostPurchaseDeviceTaxInclude(){ - let val = $('#costPurchaseDeviceSelect option:selected').val(); - var $costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); - $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - } - - //施工类采购成本 - $("select[name='costPurchaseBuildSelect']").change(function () { - let val = $('#costPurchaseBuildSelect option:selected').val(); - var $costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']"); - if(val == "自定义"){ - $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',false) - $("input[name='costPurchaseBuildTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); - $costPurchaseBuildTaxExclude.val(""); - } else { - $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); - var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); - $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - }); - - function calCostPurchaseBuildTaxInclude(){ - let val = $('#costPurchaseBuildSelect option:selected').val(); - var $costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); - $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - } - - //服务类采购成本 - $("select[name='costPurchaseServiceSelect']").change(function () { - let val = $('#costPurchaseServiceSelect option:selected').val(); - var $costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']"); - if(val == "自定义"){ - $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',false) - $("input[name='costPurchaseServiceTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); - $costPurchaseServiceTaxExclude.val(""); - } else { - $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); - var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); - $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - }); - - function calCostPurchaseServiceTaxInclude(){ - let val = $('#costPurchaseServiceSelect option:selected').val(); - var $costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); - $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - } - - //其他类采购成本 - $("select[name='costOtherOtherSelect']").change(function () { - let val = $('#costOtherOtherSelect option:selected').val(); - var $costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']"); - if(val == "自定义"){ - $("input[name='costOtherOtherTaxExclude']").attr('readonly',false) - $("input[name='costOtherOtherTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='costOtherOtherTaxExclude']").attr('readonly',true); - $costOtherOtherTaxExclude.val(""); - } else { - $("input[name='costOtherOtherTaxExclude']").attr('readonly',true); - var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - }); - - function calCostOtherOtherTaxInclude(){ - let val = $('#costOtherOtherSelect option:selected').val(); - var $costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - } - - //其他成本 - $("select[name='costPurchaseOtherSelect']").change(function () { - let val = $('#costPurchaseOtherSelect option:selected').val(); - var $costPurchaseOtherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']"); - if(val == "自定义"){ - $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',false) - $("input[name='costPurchaseOtherTaxExclude']").attr("required",true); - }else if(val == "请选择税率"){ - $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); - $costPurchaseOtherTaxExclude.val(""); - } else { - $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); - var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - }); - - function calCostPurchaseOtherTaxInclude(){ - let val = $('#costPurchaseOtherSelect option:selected').val(); - var $costPurchaseOtherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']"); - if(val == "自定义"){ - return; - }else if(val == "请选择税率"){ - return; - } else { - var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); - } - calCostExclude(); - calIncomeCost(); - } } - -/** - * 统计收入(含税),有一项没填就置空 - */ -function calIncomeInclude() { - var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); - var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - - var $incomeTotalTaxInclude = $("input[name='incomeTotalTaxInclude']"); - - $incomeTotalTaxInclude.val(f2Fixed(f2(incomeDeviceTaxInclude)+f2(incomeEngineerTaxInclude)+f2(incomeServiceTaxInclude))); -} -/** - * 统计收入(不含税),有一项没填就置空 - */ -function calIncomeExclude() { - var incomeDeviceTaxExclude = inputVal("incomeDeviceTaxExclude"); - var incomeEngineerTaxExclude = inputVal("incomeEngineerTaxExclude"); - var incomeServiceTaxExclude = inputVal("incomeServiceTaxExclude"); - - var $incomeTotalTaxExclude = $("input[name='incomeTotalTaxExclude']"); - - $incomeTotalTaxExclude.val(f2Fixed(f2(incomeDeviceTaxExclude)+f2(incomeEngineerTaxExclude)+f2(incomeServiceTaxExclude))); -} - -/** - * 计算毛利、毛利率、贡献、贡献率 - */ -function calIncomeCost() { - var incomeTotalTaxExclude = inputVal("incomeTotalTaxExclude"); - var costTotalTaxExclude = inputVal("costTotalTaxExclude"); - var costExpropriationTaxExclude = inputVal("costExpropriationTaxExclude"); - var costCompanyManageTaxExclude = inputVal("costCompanyManageTaxExclude"); - - var $projectGrossProfit = $("input[name='projectGrossProfit']"); - var $projectGrossProfitRate = $("input[name='projectGrossProfitRate']"); - var $projectContributionProfit = $("input[name='projectContributionProfit']"); - var $projectContributionProfitRate = $("input[name='projectContributionProfitRate']"); - - var incomeTotalTaxExcludeValue = f2(incomeTotalTaxExclude); - if (incomeTotalTaxExcludeValue != 0) { - $projectGrossProfit.val(f2Fixed(f2(incomeTotalTaxExclude) - f2(costTotalTaxExclude) - f2(costExpropriationTaxExclude))); - $projectGrossProfitRate.val(f2Fixed(f2($projectGrossProfit.val()) * 100 / incomeTotalTaxExcludeValue)); - } else { - $projectGrossProfit.val("0.00"); - $projectGrossProfitRate.val("0.00"); - } - - if ($projectGrossProfit.val()) { - $projectContributionProfit.val(f2Fixed(f2($projectGrossProfit.val()) - f2(costCompanyManageTaxExclude))); - $projectContributionProfitRate.val(f2Fixed(f2($projectContributionProfit.val()) * 100 / f2(incomeTotalTaxExclude))) - } else { - $projectContributionProfit.val("0.00"); - $projectContributionProfitRate.val("0.00"); - } -} \ No newline at end of file +// $("input[name='incomeDeviceTaxInclude']").change(function () { +// calIncomeInclude(); +// calIncomeCost(); +// +// calIncomeDeviceTaxExclude(); +// digitalSelf("incomeDeviceTaxInclude", "input[name='incomeDeviceTaxInclude']"); +// }); +// $("input[name='incomeEngineerTaxInclude']").change(function () { +// calIncomeInclude(); +// calIncomeCost(); +// +// calIncomeEngineerTaxExclude(); +// digitalSelf("incomeEngineerTaxInclude", "input[name='incomeEngineerTaxInclude']"); +// }); +// $("input[name='incomeServiceTaxInclude']").change(function () { +// calIncomeInclude(); +// calIncomeCost(); +// +// calIncomeServiceTaxExclude(); +// digitalSelf("incomeServiceTaxInclude", "input[name='incomeServiceTaxInclude']"); +// }); +// $("input[name='incomeDeviceTaxExclude']").change(function () { +// calIncomeExclude(); +// calIncomeCost(); +// digitalSelf("incomeDeviceTaxExclude", "input[name='incomeDeviceTaxExclude']"); +// }); +// $("input[name='incomeEngineerTaxExclude']").change(function () { +// calIncomeExclude(); +// calIncomeCost(); +// digitalSelf("incomeEngineerTaxExclude", "input[name='incomeEngineerTaxExclude']"); +// }); +// $("input[name='incomeServiceTaxExclude']").change(function () { +// calIncomeExclude(); +// calIncomeCost(); +// digitalSelf("incomeServiceTaxExclude", "input[name='incomeServiceTaxExclude']"); +// }); +// +// +// +// +// $("input[name='costPurchaseDeviceTaxInclude']").change(function () { +// calCostInclude(); +// calIncomeCost(); +// +// calCostPurchaseDeviceTaxInclude(); +// digitalSelf("costPurchaseDeviceTaxInclude", "input[name='costPurchaseDeviceTaxInclude']"); +// }); +// $("input[name='costPurchaseBuildTaxInclude']").change(function () { +// calCostInclude(); +// calIncomeCost(); +// +// calCostPurchaseBuildTaxInclude(); +// digitalSelf("costPurchaseBuildTaxInclude", "input[name='costPurchaseBuildTaxInclude']"); +// }); +// $("input[name='costPurchaseServiceTaxInclude']").change(function () { +// calCostInclude(); +// calIncomeCost(); +// +// calCostPurchaseServiceTaxInclude(); +// digitalSelf("costPurchaseServiceTaxInclude", "input[name='costPurchaseServiceTaxInclude']"); +// }); +// $("input[name='costPurchaseOtherTaxInclude']").change(function () { +// calCostInclude(); +// calIncomeCost(); +// +// calCostPurchaseOtherTaxInclude(); +// digitalSelf("costPurchaseOtherTaxInclude", "input[name='costPurchaseOtherTaxInclude']"); +// }); +// /*$("input[name='costProjectManageTaxInclude']").change(function () { +// calCostInclude(); +// calIncomeCost(); +// });*/ +// $("input[name='costOtherOtherTaxInclude']").change(function () { +// calCostInclude(); +// calIncomeCost(); +// +// calCostOtherOtherTaxInclude(); +// digitalSelf("costOtherOtherTaxInclude", "input[name='costOtherOtherTaxInclude']"); +// }); +// +// $("input[name='costPurchaseDeviceTaxExclude']").change(function () { +// calCostExclude(); +// calIncomeCost(); +// digitalSelf("costPurchaseDeviceTaxExclude", "input[name='costPurchaseDeviceTaxExclude']"); +// }); +// $("input[name='costPurchaseBuildTaxExclude']").change(function () { +// calCostExclude(); +// calIncomeCost(); +// digitalSelf("costPurchaseBuildTaxExclude", "input[name='costPurchaseBuildTaxExclude']"); +// }); +// $("input[name='costPurchaseServiceTaxExclude']").change(function () { +// calCostExclude(); +// calIncomeCost(); +// digitalSelf("costPurchaseServiceTaxExclude", "input[name='costPurchaseServiceTaxExclude']"); +// }); +// $("input[name='costPurchaseOtherTaxExclude']").change(function () { +// calCostExclude(); +// calIncomeCost(); +// digitalSelf("costPurchaseOtherTaxExclude", "input[name='costPurchaseOtherTaxExclude']"); +// }); +// $("input[name='costProjectManageTaxExclude']").change(function () { +// calCostExclude(); +// +// //不含税的=含税的 +// //含税的总额更新 +// $("input[name='costProjectManageTaxInclude']").val($("input[name='costProjectManageTaxExclude']").val()); +// calCostInclude(); +// +// calIncomeCost(); +// digitalSelf("costProjectManageTaxExclude", "input[name='costProjectManageTaxExclude']"); +// digitalSelf("costProjectManageTaxInclude", "input[name='costProjectManageTaxInclude']"); +// }); +// $("input[name='costOtherOtherTaxExclude']").change(function () { +// calCostExclude(); +// calIncomeCost(); +// digitalSelf("costOtherOtherTaxExclude", "input[name='costOtherOtherTaxExclude']"); +// }); +// +// $("input[name='costExpropriationTaxExclude']").change(function () { +// calIncomeCost(); +// digitalSelf("costExpropriationTaxExclude", "input[name='costExpropriationTaxExclude']"); +// }); +// $("input[name='costCompanyManageTaxExclude']").change(function () { +// calIncomeCost(); +// digitalSelf("costCompanyManageTaxExclude", "input[name='costCompanyManageTaxExclude']"); +// }); +// +// //设备类收入 +// $("select[name='incomeDeviceSelect']").change(function () { +// let val = $('#incomeDeviceSelect option:selected').val(); +// var $incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='incomeDeviceTaxExclude']").attr('readonly',false); +// $("input[name='incomeDeviceTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); +// $incomeDeviceTaxExclude.val(""); +// } else { +// $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); +// var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); +// $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); +// } +// calIncomeExclude(); +// calIncomeCost(); +// }); +// +// function calIncomeDeviceTaxExclude(){ +// let val = $('#incomeDeviceSelect option:selected').val(); +// var $incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']"); +// var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); +// } +// calIncomeExclude(); +// calIncomeCost(); +// } +// +// //工程类收入 +// $("select[name='incomeEngineerSelect']").change(function () { +// let val = $('#incomeEngineerSelect option:selected').val(); +// var $incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='incomeEngineerTaxExclude']").attr('readonly',false) +// $("input[name='incomeEngineerTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); +// $incomeEngineerTaxExclude.val(""); +// } else { +// $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); +// var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); +// $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); +// } +// calIncomeExclude(); +// calIncomeCost(); +// }); +// +// function calIncomeEngineerTaxExclude(){ +// let val = $('#incomeEngineerSelect option:selected').val(); +// var $incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); +// $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); +// } +// calIncomeExclude(); +// calIncomeCost(); +// } +// +// //服务类收入 +// $("select[name='incomeServiceSelect']").change(function () { +// let val = $('#incomeServiceSelect option:selected').val(); +// var $incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='incomeServiceTaxExclude']").attr('readonly',false); +// $("input[name='incomeServiceTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='incomeServiceTaxExclude']").attr('readonly',true); +// $incomeServiceTaxExclude.val(""); +// } else { +// $("input[name='incomeServiceTaxExclude']").attr('readonly',true); +// var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); +// $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); +// } +// calIncomeExclude(); +// calIncomeCost(); +// }); +// +// function calIncomeServiceTaxExclude(){ +// let val = $('#incomeServiceSelect option:selected').val(); +// var $incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); +// $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); +// } +// calIncomeExclude(); +// calIncomeCost(); +// } +// +// //设备类采购成本 +// $("select[name='costPurchaseDeviceSelect']").change(function () { +// let val = $('#costPurchaseDeviceSelect option:selected').val(); +// var $costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',false) +// $("input[name='costPurchaseDeviceTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); +// $costPurchaseDeviceTaxExclude.val(""); +// } else { +// $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); +// var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); +// $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// }); +// +// function calCostPurchaseDeviceTaxInclude(){ +// let val = $('#costPurchaseDeviceSelect option:selected').val(); +// var $costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); +// $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// } +// +// //施工类采购成本 +// $("select[name='costPurchaseBuildSelect']").change(function () { +// let val = $('#costPurchaseBuildSelect option:selected').val(); +// var $costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',false) +// $("input[name='costPurchaseBuildTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); +// $costPurchaseBuildTaxExclude.val(""); +// } else { +// $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); +// var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); +// $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// }); +// +// function calCostPurchaseBuildTaxInclude(){ +// let val = $('#costPurchaseBuildSelect option:selected').val(); +// var $costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); +// $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// } +// +// //服务类采购成本 +// $("select[name='costPurchaseServiceSelect']").change(function () { +// let val = $('#costPurchaseServiceSelect option:selected').val(); +// var $costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',false) +// $("input[name='costPurchaseServiceTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); +// $costPurchaseServiceTaxExclude.val(""); +// } else { +// $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); +// var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); +// $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// }); +// +// function calCostPurchaseServiceTaxInclude(){ +// let val = $('#costPurchaseServiceSelect option:selected').val(); +// var $costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); +// $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// } +// +// //其他类采购成本 +// $("select[name='costOtherOtherSelect']").change(function () { +// let val = $('#costOtherOtherSelect option:selected').val(); +// var $costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='costOtherOtherTaxExclude']").attr('readonly',false) +// $("input[name='costOtherOtherTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='costOtherOtherTaxExclude']").attr('readonly',true); +// $costOtherOtherTaxExclude.val(""); +// } else { +// $("input[name='costOtherOtherTaxExclude']").attr('readonly',true); +// var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); +// $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// }); +// +// function calCostOtherOtherTaxInclude(){ +// let val = $('#costOtherOtherSelect option:selected').val(); +// var $costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); +// $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// } +// +// //其他成本 +// $("select[name='costPurchaseOtherSelect']").change(function () { +// let val = $('#costPurchaseOtherSelect option:selected').val(); +// var $costPurchaseOtherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']"); +// if(val == "自定义"){ +// $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',false) +// $("input[name='costPurchaseOtherTaxExclude']").attr("required",true); +// }else if(val == "请选择税率"){ +// $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); +// $costPurchaseOtherTaxExclude.val(""); +// } else { +// $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); +// var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); +// $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// }); +// +// function calCostPurchaseOtherTaxInclude(){ +// let val = $('#costPurchaseOtherSelect option:selected').val(); +// var $costPurchaseOtherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']"); +// if(val == "自定义"){ +// return; +// }else if(val == "请选择税率"){ +// return; +// } else { +// var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); +// $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); +// } +// calCostExclude(); +// calIncomeCost(); +// } +// } +// +// /** +// * 统计收入(含税),有一项没填就置空 +// */ +// function calIncomeInclude() { +// var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); +// var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); +// var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); +// +// var $incomeTotalTaxInclude = $("input[name='incomeTotalTaxInclude']"); +// +// $incomeTotalTaxInclude.val(f2Fixed(f2(incomeDeviceTaxInclude)+f2(incomeEngineerTaxInclude)+f2(incomeServiceTaxInclude))); +// } +// /** +// * 统计收入(不含税),有一项没填就置空 +// */ +// function calIncomeExclude() { +// var incomeDeviceTaxExclude = inputVal("incomeDeviceTaxExclude"); +// var incomeEngineerTaxExclude = inputVal("incomeEngineerTaxExclude"); +// var incomeServiceTaxExclude = inputVal("incomeServiceTaxExclude"); +// +// var $incomeTotalTaxExclude = $("input[name='incomeTotalTaxExclude']"); +// +// $incomeTotalTaxExclude.val(f2Fixed(f2(incomeDeviceTaxExclude)+f2(incomeEngineerTaxExclude)+f2(incomeServiceTaxExclude))); +// } +// +// /** +// * 计算毛利、毛利率、贡献、贡献率 +// */ +// function calIncomeCost() { +// var incomeTotalTaxExclude = inputVal("incomeTotalTaxExclude"); +// var costTotalTaxExclude = inputVal("costTotalTaxExclude"); +// var costExpropriationTaxExclude = inputVal("costExpropriationTaxExclude"); +// var costCompanyManageTaxExclude = inputVal("costCompanyManageTaxExclude"); +// +// var $projectGrossProfit = $("input[name='projectGrossProfit']"); +// var $projectGrossProfitRate = $("input[name='projectGrossProfitRate']"); +// var $projectContributionProfit = $("input[name='projectContributionProfit']"); +// var $projectContributionProfitRate = $("input[name='projectContributionProfitRate']"); +// +// var incomeTotalTaxExcludeValue = f2(incomeTotalTaxExclude); +// if (incomeTotalTaxExcludeValue != 0) { +// $projectGrossProfit.val(f2Fixed(f2(incomeTotalTaxExclude) - f2(costTotalTaxExclude) - f2(costExpropriationTaxExclude))); +// $projectGrossProfitRate.val(f2Fixed(f2($projectGrossProfit.val()) * 100 / incomeTotalTaxExcludeValue)); +// } else { +// $projectGrossProfit.val("0.00"); +// $projectGrossProfitRate.val("0.00"); +// } +// +// if ($projectGrossProfit.val()) { +// $projectContributionProfit.val(f2Fixed(f2($projectGrossProfit.val()) - f2(costCompanyManageTaxExclude))); +// $projectContributionProfitRate.val(f2Fixed(f2($projectContributionProfit.val()) * 100 / f2(incomeTotalTaxExclude))) +// } else { +// $projectContributionProfit.val("0.00"); +// $projectContributionProfitRate.val("0.00"); +// } +// } \ No newline at end of file diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index c363728..699e052 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -986,7 +986,7 @@ <td><input type="text" class="number" name="incomeTotalTax" value="${Utils.format(budgetBean.incomeTotalTax,'0')}" required readonly title="此列累计"></td> </tr> </tbody> - (备注:本表所用税率分别为:${incomeTaxRates!}) + (备注:本表所用税率分别为:<input type="text" name="incomeTaxRates" value="${incomeTaxRates!}" readonly>) </table> <span>成本</span> <#-- <span class="am-text-primary"><a style="cursor: pointer" id="cost-detail">采购成本明细表</a></span> @@ -1059,7 +1059,7 @@ <td><input type="text" class="number" name="costTotalTax" value="${Utils.format(budgetBean.costTotalTax,'0')}" readonly required title="此列累计"></td> </tr> </tbody> - (备注:本表所用税率分别为:${costTaxRates!}) + (备注:本表所用税率分别为:<input type="text" name="costTaxRates" value="${costTaxRates!}" readonly>) </table> <span>管理</span> <#--<span class="am-text-primary budget-plan-detail"><a style="cursor: pointer">资金计划表</a></span>--> diff --git a/src/main/resources/templates/admin/project_estimate_add.ftl b/src/main/resources/templates/admin/project_estimate_add.ftl index bea4053..73bd5d3 100644 --- a/src/main/resources/templates/admin/project_estimate_add.ftl +++ b/src/main/resources/templates/admin/project_estimate_add.ftl @@ -193,7 +193,7 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right">华智产品金额</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>华智产品金额</div> <div class="am-u-sm-6 am-u-md-6"> <input type="text" class="number am-input" data-validation-message="华智产品金额" name="huazhiProductAmount" id="huazhiProductAmount" placeholder="单位(元)" maxlength="16" value="" /> @@ -202,7 +202,7 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right">汇智产品金额</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>汇智产品金额</div> <div class="am-u-sm-6 am-u-md-6"> <input type="text" class="number am-input" data-validation-message="汇智产品金额" name="huizhiProductAmount" id="huizhiProductAmount" placeholder="单位(元)" maxlength="16" value="" /> @@ -211,7 +211,7 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right">华三产品金额</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>华三产品金额</div> <div class="am-u-sm-6 am-u-md-6"> <input type="text" class="number am-input" data-validation-message="华三产品金额" name="huasanProductAmount" id="huasanProductAmount" placeholder="单位(元)" maxlength="16" value="" /> @@ -220,7 +220,7 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right">其他产品金额</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>其他产品金额</div> <div class="am-u-sm-6 am-u-md-6"> <input type="text" class="number am-input" data-validation-message="请输入其他产品金额" name="ziguangOtherAmount" id="ziguangOtherAmount" placeholder="单位(元)" maxlength="16" value="" /> @@ -246,44 +246,44 @@ <div class="am-tab-panel am-fade am-in" id="tab2"> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目负责人</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">项目负责人</div> <div class="am-u-sm-6 am-u-md-6"> <input type="text" id="principal" class="am-input" data-validate-async data-validation-message="请输入项目负责人" name="principal" placeholder="请输入项目负责人" maxlength="20" - value="" required /> + value="" /> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>预计合同签订时间</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">预计合同签订时间</div> <div class="am-u-sm-2 am-u-md-2"> <div class="am-form-group am-form-icon"> <i class="am-icon-calendar"></i> <input type="text" class="am-form-field am-input-sm" id="contractTime" name="contractTime" autocomplete="off" value="" placeholder="预计合同签订时间" - data-am-datepicker required> + data-am-datepicker> </div> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目计划招标时间</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">项目计划招标时间</div> <div class="am-u-sm-2 am-u-md-2"> <div class="am-form-group am-form-icon"> <i class="am-icon-calendar"></i> <input type="text" class="am-form-field am-input-sm" id="bidsTime" name="bidsTime" autocomplete="off" value="" placeholder="项目计划招标时间" - data-am-datepicker required> + data-am-datepicker> </div> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>是否二次合作</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">是否二次合作</div> <div class="am-u-sm-6 am-u-md-6"> <select data-am-selected id="isSecond" name="isSecond"> <option value="1" >是</option> @@ -294,7 +294,7 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>签单方式</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">签单方式</div> <div class="am-u-sm-6 am-u-md-6"> <select data-am-selected id="signType" name="signType"> <option value="1" >紫光汇智直接投标</option> @@ -304,7 +304,7 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目解决方案</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">项目解决方案</div> <div class="am-u-sm-6 am-u-md-6"> <select data-am-selected id="resolvePlan" name="resolvePlan"> <option value="1" >公共服务(智慧交通、雪亮工程、治安防控体系等)</option> @@ -316,52 +316,52 @@ </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资利息</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">垫资利息</div> <div class="am-u-sm-6 am-u-md-6"> <input type="number" class="am-input" data-validate-async data-validation-message="请输入垫资利息" name="advanceInterestAmount" placeholder="单位(元)" maxlength="16" - value="" required /> + value="" /> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资峰值</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">垫资峰值</div> <div class="am-u-sm-6 am-u-md-6"> <input type="number" class="am-input" data-validate-async data-validation-message="请输入垫资峰值" name="advancePeakAmount" placeholder="单位(元)" maxlength="16" - value="" required /> + value="" /> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>主合同收款条款</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">主合同收款条款</div> <div class="am-u-sm-6 am-u-md-6"> <textarea rows="3" cols="20" id="mainContractCollectionTerms" name="mainContractCollectionTerms" maxlength="1000" class="am-input" data-validate-async data-validation-message="请输入收款条款" - placeholder="请输入收款条款" required + placeholder="请输入收款条款" ></textarea> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>主合同具体解决方案</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">主合同具体解决方案</div> <div class="am-u-sm-6 am-u-md-6"> <textarea rows="3" cols="20" id="mainContractResolvePlan" name="mainContractResolvePlan" maxlength="1000" class="am-input" data-validate-async data-validation-message="请输入具体解决方案" - placeholder="请输入具体解决方案" required + placeholder="请输入具体解决方案" ></textarea> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> </div> <div class="am-g am-form-group am-margin-top"> - <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>计收计划</div> + <div class="am-u-sm-4 am-u-md-2 am-text-right">计收计划</div> <div class="am-u-sm-6 am-u-md-6"> - <textarea rows="3" cols="20" id="CalculationCollection" name="CalculationCollection" maxlength="1000" + <textarea rows="3" cols="20" id="calculationCollection" name="calculationCollection" maxlength="1000" class="am-input" data-validate-async data-validation-message="按照开票金额及时间罗列计收计划" - placeholder="按照开票金额及时间罗列计收计划" required + placeholder="按照开票金额及时间罗列计收计划" ></textarea> </div> <div class="am-u-sm-2 am-u-md-4 input-msg"></div> @@ -668,27 +668,33 @@ var terminalCustomer = $("#terminalCustomer").val(); var contractAmount = $("#contractAmount").val(); var industryScenario = $("#industryScenario").val(); - var mainContractCollectionTerms = $("#mainContractCollectionTerms").val(); + // var mainContractCollectionTerms = $("#mainContractCollectionTerms").val(); var valueRisk = $("#valueRisk").val(); - var incomeDeviceTaxInclude = $("#incomeDeviceTaxInclude").val(); - var incomeDeviceTaxExclude = $("#incomeDeviceTaxExclude").val(); - var incomeEngineerTaxInclude = $("#incomeEngineerTaxInclude").val(); - var incomeEngineerTaxExclude = $("#incomeEngineerTaxExclude").val(); - var incomeServiceTaxInclude = $("#incomeServiceTaxInclude").val(); - var incomeServiceTaxExclude = $("#incomeServiceTaxExclude").val(); - var costPurchaseDeviceTaxInclude = $("#costPurchaseDeviceTaxInclude").val(); - var costPurchaseDeviceTaxExclude = $("#costPurchaseDeviceTaxExclude").val(); - var costPurchaseBuildTaxInclude = $("#costPurchaseBuildTaxInclude").val(); - var costPurchaseBuildTaxExclude = $("#costPurchaseBuildTaxExclude").val(); - var costPurchaseServiceTaxInclude = $("#costPurchaseServiceTaxInclude").val(); - var costPurchaseServiceTaxExclude = $("#costPurchaseServiceTaxExclude").val(); - var costPurchaseOtherTaxInclude = $("#costPurchaseOtherTaxInclude").val(); - var costPurchaseOtherTaxExclude = $("#costPurchaseOtherTaxExclude").val(); - var costCompanyManageTaxExclude = $("#costCompanyManageTaxExclude ").val(); - var costProjectManageTaxExclude = $("#costProjectManageTaxExclude ").val(); - var costOtherOtherTaxInclude = $("#costOtherOtherTaxInclude").val(); - var costOtherOtherTaxExclude = $("#costOtherOtherTaxExclude").val(); + // var principal = $("#principal").val(); + // var contractTime = $("#contractTime").val(); + // var bidsTime = $("#bidsTime").val(); + // var mainContractResolvePlan = $("#mainContractResolvePlan").val(); + // var calculationCollection = $("#calculationCollection").val(); + + // var incomeDeviceTaxInclude = $("#incomeDeviceTaxInclude").val(); + // var incomeDeviceTaxExclude = $("#incomeDeviceTaxExclude").val(); + // var incomeEngineerTaxInclude = $("#incomeEngineerTaxInclude").val(); + // var incomeEngineerTaxExclude = $("#incomeEngineerTaxExclude").val(); + // var incomeServiceTaxInclude = $("#incomeServiceTaxInclude").val(); + // var incomeServiceTaxExclude = $("#incomeServiceTaxExclude").val(); + // var costPurchaseDeviceTaxInclude = $("#costPurchaseDeviceTaxInclude").val(); + // var costPurchaseDeviceTaxExclude = $("#costPurchaseDeviceTaxExclude").val(); + // var costPurchaseBuildTaxInclude = $("#costPurchaseBuildTaxInclude").val(); + // var costPurchaseBuildTaxExclude = $("#costPurchaseBuildTaxExclude").val(); + // var costPurchaseServiceTaxInclude = $("#costPurchaseServiceTaxInclude").val(); + // var costPurchaseServiceTaxExclude = $("#costPurchaseServiceTaxExclude").val(); + // var costPurchaseOtherTaxInclude = $("#costPurchaseOtherTaxInclude").val(); + // var costPurchaseOtherTaxExclude = $("#costPurchaseOtherTaxExclude").val(); + // var costCompanyManageTaxExclude = $("#costCompanyManageTaxExclude ").val(); + // var costProjectManageTaxExclude = $("#costProjectManageTaxExclude ").val(); + // var costOtherOtherTaxInclude = $("#costOtherOtherTaxInclude").val(); + // var costOtherOtherTaxExclude = $("#costOtherOtherTaxExclude").val(); if (startTime.length <= 0) { window.confirm('项目计划开始时间不能为空'); @@ -708,18 +714,18 @@ return; } - if (projectNo.length <= 0) { - window.confirm('项目编号不能为空'); - check = 1; - return; - } - - checkProjectNo(); - if (projectNoResult == 1) { - window.confirm('项目编号已存在'); - check = 1; - return; - } + // if (projectNo.length <= 0) { + // window.confirm('项目编号不能为空'); + // check = 1; + // return; + // } + // + // checkProjectNo(); + // if (projectNoResult == 1) { + // window.confirm('项目编号已存在'); + // check = 1; + // return; + // } if (name.length <= 0) { window.confirm('项目名称不能为空'); @@ -758,11 +764,11 @@ return; } - if (mainContractCollectionTerms == undefined || mainContractCollectionTerms.length <= 0) { - window.confirm('主合同收款条款不能为空'); - check = 1; - return; - } + // if (mainContractCollectionTerms == undefined || mainContractCollectionTerms.length <= 0) { + // window.confirm('主合同收款条款不能为空'); + // check = 1; + // return; + // } if (valueRisk == undefined || valueRisk.length <= 0) { window.confirm('价值及风险不能为空'); @@ -770,6 +776,36 @@ return; } + // if (principal == undefined || principal.length <= 0) { + // window.confirm('项目负责人不能为空'); + // check = 1; + // return; + // } + // + // if (contractTime.length <= 0) { + // window.confirm('预计合同签订时间不能为空'); + // check = 1; + // return; + // } + // + // if (bidsTime.length <= 0) { + // window.confirm('项目计划招标时间不能为空'); + // check = 1; + // return; + // } + // + // if (mainContractResolvePlan == undefined || mainContractResolvePlan.length <= 0) { + // window.confirm('主合同具体解决方案不能为空'); + // check = 1; + // return; + // } + // + // if (calculationCollection == undefined || calculationCollection.length <= 0) { + // window.confirm('计收计划不能为空'); + // check = 1; + // return; + // } + /*if (incomeDeviceTaxInclude == '' || incomeDeviceTaxExclude == '' || incomeEngineerTaxInclude == '' || incomeEngineerTaxExclude == '' || incomeServiceTaxInclude == '' || incomeServiceTaxExclude == '' || costPurchaseDeviceTaxInclude == '' || costPurchaseDeviceTaxExclude == '' || costPurchaseBuildTaxInclude == '' || costPurchaseBuildTaxExclude == '' || costPurchaseServiceTaxInclude == '' || costPurchaseServiceTaxExclude == '' ||