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 0ba7a52..2cee0df 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -200,7 +200,7 @@ function appendTrCost() { $("#costTotal").before(template); //重新绑定删除事件和input修改事件 - bindDeleteBtn(); + bindDeleteBtnCost(); //绑定序号 bindNum(); //重新绑定 @@ -213,6 +213,20 @@ function appendTrCost() { bindNumberInput(); } +/** + * 绑定每一行的删除事件,删除当前的一行tr,修改总计值 + */ +function bindDeleteBtnCost() { + $(".am-modal-line-delete").click(function () { + //删除自己对应的tr + $(this).parent().parent().remove(); + bindNum(); + updateAmount("input-changeable-amount-cost", "input-changeable-total-amount-cost"); + updateTotal("input-changeable-total-tax-include-cost", "input-changeable-total-total-tax-include-cost"); + updateTotal("input-changeable-total-tax-exclude-cost", "input-changeable-total-total-tax-exclude-cost"); + }); +} + /** * 绑定每个可改变的输入框,修改后改变对应输入框的值 */ 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 54270cd..38e7654 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 @@ -131,7 +131,7 @@ function appendTrCostProjectManage() { ' '; $("#manageTotal").before(template); //重新绑定删除事件和input修改事件 - bindDeleteBtn(); + bindDeleteBtnCostManage(); //绑定序号 bindNum(); bindChangeableInputProjectManage(); @@ -142,6 +142,19 @@ function appendTrCostProjectManage() { bindNumberInput(); } +/** + * 绑定每一行的删除事件,删除当前的一行tr,修改总计值 + */ +function bindDeleteBtnCostManage() { + $(".am-modal-line-delete").click(function () { + //删除自己对应的tr + $(this).parent().parent().remove(); + bindNum(); + updateAmount("input-changeable-amount-project-manage", "input-changeable-total-amount-project-manage"); + updateTotal("input-changeable-total-project-manage", "input-changeable-total-total-project-manage"); + }); +} + /** * 绑定每个可改变的输入框,修改后改变对应输入框的值 */ diff --git a/src/main/resources/static/assets/js/project_budget_income.js b/src/main/resources/static/assets/js/project_budget_income.js index 11729f5..229da4e 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -147,7 +147,7 @@ function appendTrIncome() { ' '; $("#incomeTotal").before(template); //重新绑定删除事件和input修改事件 - bindDeleteBtn(); + bindDeleteBtnIncome(); bindNum(); bindChangeableInput(); bindIncomeTotal(); @@ -155,6 +155,20 @@ function appendTrIncome() { bindNumberInput(); } +/** + * 绑定每一行的删除事件,删除当前的一行tr,修改总计值 + */ +function bindDeleteBtnIncome() { + $(".am-modal-line-delete").click(function () { + //删除自己对应的tr + $(this).parent().parent().remove(); + bindNum(); + updateAmount("input-changeable-amount-income", "input-changeable-total-amount-income"); + updateTotal("input-changeable-total-tax-include-income", "input-changeable-total-total-tax-include-income"); + updateTotal("input-changeable-total-tax-exclude-income", "input-changeable-total-total-tax-exclude-income"); + }); +} + /** * 绑定每个可改变的输入框,修改后改变对应输入框的值 */ diff --git a/src/main/resources/templates/admin/project_settle_add.ftl b/src/main/resources/templates/admin/project_settle_add.ftl index e98ff84..841d8b2 100644 --- a/src/main/resources/templates/admin/project_settle_add.ftl +++ b/src/main/resources/templates/admin/project_settle_add.ftl @@ -34,7 +34,7 @@