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 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 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 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 projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(project.getId()); @@ -203,18 +205,22 @@ public class ProjectBudgetService { List 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 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 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 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 @@ - (备注:本表所用税率分别为:${incomeTaxRates!}) + (备注:本表所用税率分别为:) 成本 <#-- 采购成本明细表 @@ -1059,7 +1059,7 @@ - (备注:本表所用税率分别为:${costTaxRates!}) + (备注:本表所用税率分别为:) 管理 <#--资金计划表--> 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 @@
-
华智产品金额
+
*华智产品金额
@@ -202,7 +202,7 @@
-
汇智产品金额
+
*汇智产品金额
@@ -211,7 +211,7 @@
-
华三产品金额
+
*华三产品金额
@@ -220,7 +220,7 @@
-
其他产品金额
+
*其他产品金额
@@ -246,44 +246,44 @@
-
*项目负责人
+
项目负责人
+ value="" />
-
*预计合同签订时间
+
预计合同签订时间
+ data-am-datepicker>
-
*项目计划招标时间
+
项目计划招标时间
+ data-am-datepicker>
-
*是否二次合作
+
是否二次合作
@@ -304,7 +304,7 @@
-
*项目解决方案
+
项目解决方案
+ value="" />
-
*垫资峰值
+
垫资峰值
+ value="" />
-
*主合同收款条款
+
主合同收款条款
-
*主合同具体解决方案
+
主合同具体解决方案
-
*计收计划
+
计收计划
-
@@ -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 == '' ||