From 49e617b3db0574b5c6ec25567150a812aefcadec Mon Sep 17 00:00:00 2001 From: hanbo <2608504783@qq.com> Date: Tue, 18 Jan 2022 16:09:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E7=AE=97?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=A1=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/assets/js/project_estimate.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/static/assets/js/project_estimate.js b/src/main/resources/static/assets/js/project_estimate.js index aa0842f..20ddbc4 100644 --- a/src/main/resources/static/assets/js/project_estimate.js +++ b/src/main/resources/static/assets/js/project_estimate.js @@ -147,6 +147,7 @@ function calIncomeAndCost() { $incomeDeviceTaxExclude.val(""); } else { $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); + $("input[name='incomeDeviceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); } @@ -180,6 +181,7 @@ function calIncomeAndCost() { $incomeEngineerTaxExclude.val(""); } else { $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); + $("input[name='incomeEngineerTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); } @@ -213,6 +215,7 @@ function calIncomeAndCost() { $incomeServiceTaxExclude.val(""); } else { $("input[name='incomeServiceTaxExclude']").attr('readonly',true); + $("input[name='incomeServiceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); } @@ -246,6 +249,7 @@ function calIncomeAndCost() { $costPurchaseDeviceTaxExclude.val(""); } else { $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); + $("input[name='costPurchaseDeviceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); } @@ -279,6 +283,7 @@ function calIncomeAndCost() { $costPurchaseBuildTaxExclude.val(""); } else { $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); + $("input[name='costPurchaseBuildTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); } @@ -312,6 +317,7 @@ function calIncomeAndCost() { $costPurchaseServiceTaxExclude.val(""); } else { $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); + $("input[name='costPurchaseServiceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); } @@ -378,6 +384,7 @@ function calIncomeAndCost() { $costPurchaseOtherTaxExclude.val(""); } else { $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); + $("input[name='costPurchaseOtherTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); } From bbf42734d72cfb5e41eba219c648579d3c9a699d Mon Sep 17 00:00:00 2001 From: hanbo <2608504783@qq.com> Date: Tue, 18 Jan 2022 16:12:01 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E7=AE=97?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=A1=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/admin/project_estimate_add.ftl | 50 ++++--------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/src/main/resources/templates/admin/project_estimate_add.ftl b/src/main/resources/templates/admin/project_estimate_add.ftl index 620cf45..7427f7c 100644 --- a/src/main/resources/templates/admin/project_estimate_add.ftl +++ b/src/main/resources/templates/admin/project_estimate_add.ftl @@ -467,26 +467,11 @@ return; } - var incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']").val(); - var incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']").val(); - var incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']").val(); - var costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']").val(); - var costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']").val(); - var costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']").val(); - var costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']").val(); - - if(incomeDeviceTaxExclude && incomeEngineerTaxExclude && incomeServiceTaxExclude - && costPurchaseDeviceTaxExclude && costPurchaseBuildTaxExclude && costPurchaseServiceTaxExclude && costOtherOtherTaxExclude){ - setTimeout(function () { - $("#saveDraft").attr('disabled', false); - }, 5000); - $("#pmsForm").attr("action","${base}/project/estimateAddSave"); - $("#pmsForm").submit(); - }else { - alert("请完善不含税金额"); - $("#saveDraft").attr('disabled',false); - return; - } + setTimeout(function () { + $("#saveDraft").attr('disabled', false); + }, 5000); + $("#pmsForm").attr("action","${base}/project/estimateAddSave"); + $("#pmsForm").submit(); }); $("#saveApprove").click(function () { @@ -505,26 +490,11 @@ return; } - var incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']").val(); - var incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']").val(); - var incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']").val(); - var costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']").val(); - var costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']").val(); - var costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']").val(); - var costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']").val(); - - if(incomeDeviceTaxExclude && incomeEngineerTaxExclude && incomeServiceTaxExclude - && costPurchaseDeviceTaxExclude && costPurchaseBuildTaxExclude && costPurchaseServiceTaxExclude && costOtherOtherTaxExclude){ - setTimeout(function () { - $("#saveApprove").attr('disabled', false); - }, 5000); - $("#pmsForm").attr("action","${base}/project/estimateAddSave"); - $("#pmsForm").submit(); - }else { - alert("请完善不含税金额"); - $("#saveApprove").attr('disabled',false); - return; - } + setTimeout(function () { + $("#saveApprove").attr('disabled', false); + }, 5000); + $("#pmsForm").attr("action","${base}/project/estimateAddSave"); + $("#pmsForm").submit(); }); }); From b789ff0465b8aedd46454346f8fd9ee7e2ff28c9 Mon Sep 17 00:00:00 2001 From: hanbo <2608504783@qq.com> Date: Tue, 18 Jan 2022 16:25:56 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E7=AE=97?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=A1=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/admin/project_estimate_add.ftl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/templates/admin/project_estimate_add.ftl b/src/main/resources/templates/admin/project_estimate_add.ftl index 7427f7c..d866a3b 100644 --- a/src/main/resources/templates/admin/project_estimate_add.ftl +++ b/src/main/resources/templates/admin/project_estimate_add.ftl @@ -200,7 +200,7 @@ 收入 设备类 - + - + - + - + - + - + - + - + / From 422b0676762b4e57f2bd849a45a972625dc62ab0 Mon Sep 17 00:00:00 2001 From: hanbo <2608504783@qq.com> Date: Tue, 18 Jan 2022 17:47:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A6=82=E7=AE=97?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=A1=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/assets/js/project_estimate.js | 18 +++++++------- .../templates/admin/project_estimate_add.ftl | 24 +++++++------------ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/main/resources/static/assets/js/project_estimate.js b/src/main/resources/static/assets/js/project_estimate.js index 20ddbc4..ac1ad26 100644 --- a/src/main/resources/static/assets/js/project_estimate.js +++ b/src/main/resources/static/assets/js/project_estimate.js @@ -141,13 +141,12 @@ function calIncomeAndCost() { var $incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']"); if(val == "自定义"){ $("input[name='incomeDeviceTaxExclude']").attr('readonly',false); - $incomeDeviceTaxExclude.val(""); + $("input[name='incomeDeviceTaxExclude']").attr("required",true); }else if(val == "请选择税率"){ $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); $incomeDeviceTaxExclude.val(""); } else { $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); - $("input[name='incomeDeviceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); } @@ -176,12 +175,12 @@ function calIncomeAndCost() { 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); - $("input[name='incomeEngineerTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); } @@ -209,13 +208,13 @@ function calIncomeAndCost() { let val = $('#incomeServiceSelect option:selected').val(); var $incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']"); if(val == "自定义"){ - $("input[name='incomeServiceTaxExclude']").attr('readonly',false) + $("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); - $("input[name='incomeServiceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); } @@ -244,12 +243,12 @@ function calIncomeAndCost() { 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); - $("input[name='costPurchaseDeviceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); } @@ -278,12 +277,12 @@ function calIncomeAndCost() { 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); - $("input[name='costPurchaseBuildTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); } @@ -312,12 +311,12 @@ function calIncomeAndCost() { 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); - $("input[name='costPurchaseServiceTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); } @@ -346,6 +345,7 @@ function calIncomeAndCost() { 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(""); @@ -379,12 +379,12 @@ function calIncomeAndCost() { 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); - $("input[name='costPurchaseOtherTaxExclude']").removeClass("number am-field-error am-active").addClass("number am-active am-field-valid"); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); } diff --git a/src/main/resources/templates/admin/project_estimate_add.ftl b/src/main/resources/templates/admin/project_estimate_add.ftl index d866a3b..751a4f0 100644 --- a/src/main/resources/templates/admin/project_estimate_add.ftl +++ b/src/main/resources/templates/admin/project_estimate_add.ftl @@ -200,10 +200,9 @@ 收入 设备类 - + - + - + - + - + - + - + - + / @@ -363,7 +356,6 @@