diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index 3b66599..46e77a6 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -728,13 +728,16 @@ function bindChangeableInput() { //税率改变 $(".input-changeable-tax-rate").change(function () { var taxRate = f2($(this).val()); - //找到对应的数量和单价 - var amount = f2($(this).parent().parent().find(".input-changeable-amount").val()); - var price = f5($(this).parent().parent().find(".input-changeable-price").val()); - console.log(amount, price, taxRate); - - $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100))); - $(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(amount * price * taxRate /(100 + taxRate))); + var rowVal=$(this).parent().parent().find(".input-changeable-total-tax-include").val() + $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100)))); + $(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100))); + }); + // 不含税金额改变 + $(".input-changeable-total-tax-include").change(function () { + var rowVal = f2($(this).val()); + var taxRate=$(this).parent().parent().find(".input-changeable-tax-rate").val() + $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100)))); + $(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100))); }); } @@ -985,3 +988,4 @@ function updateBudgetPlanDetailDataUnsubmit(data,returnData) { //更新现金流量 updateCashFlow(); } + 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 890fd82..8f3c8b7 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -6,41 +6,41 @@ COST_DETAIL2={ "num":[false,"序号","string"], "type":[false,"费用项目","string"], "category":[false,"采购类别","string"], - "name":[false,"名称","string"], - "unit":[false,"单位","string"], - "amount":[false,"数量","number"], - "price":[false,"单价","price"], + // "name":[false,"名称","string"], + // "unit":[false,"单位","string"], + // "amount":[false,"数量","number"], + // "price":[false,"单价","price"], "taxRate":[false,"税率","number"], "totalTaxInclude":[false,"含税总金额","number"], "totalTaxExclude":[false,"不含税金额","number"], "totalTax":[false,"税金","number"], - "contractParty":[false,"签约方","string"], - "isUnderwritten":[false,"是否垫资","string"], - "underwrittenAmount":[false,"预估垫资金额","number"], - "payTime":[false,"支出时间","string"], - "payAmount":[false,"支出金额","number"], - "payWay":[false,"付款方式","string"], + // "contractParty":[false,"签约方","string"], + // "isUnderwritten":[false,"是否垫资","string"], + // "underwrittenAmount":[false,"预估垫资金额","number"], + // "payTime":[false,"支出时间","string"], + // "payAmount":[false,"支出金额","number"], + // "payWay":[false,"付款方式","string"], "remark":[false,"备注","string"] }; COST_DETAIL={ "num":[false,"序号","string"], "type":[true,"费用项目","string"], - "category":[true,"采购类别","string"], + "category":[true,"产品大类","string"], "name":[true,"名称","string"], - "unit":[true,"单位","string"], - "amount":[true,"数量","number"], - "price":[true,"单价","price"], + // "unit":[true,"单位","string"], + // "amount":[true,"数量","number"], + // "price":[true,"单价","price"], "taxRate":[true,"税率","number"], "totalTaxInclude":[true,"含税总金额","number"], "totalTaxExclude":[true,"不含税金额","number"], "totalTax":[true,"税金","number"], - "contractParty":[false,"签约方","string"], - "isUnderwritten":[false,"是否垫资","string"], - "underwrittenAmount":[false,"预估垫资金额","number"], - "payTime":[false,"支出时间","string"], - "payAmount":[false,"支出金额","number"], - "payWay":[false,"付款方式","string"], + "contractParty":[false,"供应商","string"], + // "isUnderwritten":[false,"是否垫资","string"], + // "underwrittenAmount":[false,"预估垫资金额","number"], + // "payTime":[false,"支出时间","string"], + // "payAmount":[false,"支出金额","number"], + // "payWay":[false,"付款方式","string"], "remark":[false,"备注","string"] }; /* @@ -220,26 +220,26 @@ function appendTrCost() { ''+ ''+ - ''+ - ''+ - ''+ - ''+ + // ''+ + // ''+ + // ''+ + // ''+ ''+ - ''+ + ''+ ''+ ''+ '\n' + - '\n' + - ' \n' + - '\n' + - '\n' + - '\n' + - '\n' + - '\n' + + // '\n' + + // ' \n' + + // '\n' + + // '\n' + + // '\n' + + // '\n' + + // '\n' + '\n' + ''+ ''; @@ -319,6 +319,11 @@ function bindCostTotal() { $(".input-changeable-total-underwritten-amount-cost").change(function () { updateTotal("input-changeable-total-underwritten-amount-cost", "input-changeable-total-total-underwritten-amount-cost"); }); + $(".input-changeable-total-tax-include-cost").change(function () { + 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"); + updateTotal("input-changeable-total-tax-cost", "input-changeable-total-total-tax-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 69044f5..57f6eea 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 @@ -4,13 +4,10 @@ //COST_PROJECT_MANAGE_DETAIL_ARR=["type","name","detail","unit","amount","price","total","predictMethod","predictWhy","remark","deletable"]; COST_PROJECT_MANAGE_DETAIL2={ "num":[false,"序号","string"], - "type":[false,"财务费用类别","string"], + "type":[false,"费用类别","string"], "name1":[false,"业务项目","string"], - "name2":[false,"业务项目","string"], "detail":[false,"项目明细","string"], - "unit":[false,"单位","string"], - "amount":[false,"数量","number"], - "price":[false,"单价","price"], + "detail1":[false,"项目明细","string"], "total":[false,"总金额","number"], "payTime":[false,"支出时间","string"], "payAmount":[false,"支出金额","number"], @@ -22,20 +19,17 @@ COST_PROJECT_MANAGE_DETAIL2={ COST_PROJECT_MANAGE_DETAIL={ "num":[false,"序号","string"], - "type":[true,"财务费用类别","string"], + "type":[false,"费用类别","string"], "name1":[false,"业务项目","string"], - "name2":[false,"业务项目","string"], - "detail":[true,"项目明细","string"], - "unit":[true,"单位","string"], - "amount":[true,"数量","number"], - "price":[true,"单价","price"], - "total":[true,"总金额","number"], + "detail":[false,"项目明细","string"], + "detail1":[false,"项目明细","string"], + "total":[false,"总金额","number"], "payTime":[false,"支出时间","string"], "payAmount":[false,"支出金额","number"], "predictMethod":[false,"预估计算方法","string"], "predictWhy":[false,"预估依据","string"], "remark":[false,"备注","string"], - "deletable":[true,"是否可删除","string"] + "deletable":[false,"是否可删除","string"] }; SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER={}; @@ -98,6 +92,15 @@ $(function () { var data = collectData("am-modal-prompt-input-cost-project-manage"); //data = prepareAjaxData(data, COST_PROJECT_MANAGE_DETAIL_ARR, $("#id").val(),true); data = prepareAjaxDataVerify(data, COST_PROJECT_MANAGE_DETAIL2, $("#id").val()); + var totalTotal=data.details.reduce((total,now)=>{ + return now.total+total + },0) + var projectGrossProfitA=$('[name="projectGrossProfitA"]').val() + if(Number(totalTotal)> (Number(projectGrossProfitA)*0.1) ){ + layuiAlert(`总金额合计不能超过毛利A(${projectGrossProfitA})的10%`); + return + } + // if(data.managePayAmountTotal) if(data){ postAjax(base+"/project/budgetEditSaveCostProjectManageDetail", data, updateCostProjectManageData); } @@ -144,10 +147,10 @@ function appendTrCostProjectManage() { ' \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + + // ' \n' + + // ' \n' + + // ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + @@ -212,6 +215,9 @@ function bindCostManageTotal() { $(".input-changeable-pay-amount-project-manage").change(function () { updateTotal("input-changeable-pay-amount-project-manage", "input-changeable-total-pay-amount-project-manage"); }); + $(".input-changeable-total-project-manage").change(function () { + updateTotal("input-changeable-total-project-manage", "input-changeable-total-total-project-manage"); + }); } /** @@ -322,6 +328,7 @@ function bindChangeableInputProjectManage() { $(this).parent().parent().find(".input-changeable-total-project-manage").val(f2Fixed(amount*price)); }); + } /** * 更新页面收入的数据【累加】 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 6e5c54a..e6b58aa 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -5,12 +5,12 @@ INCOME_DETAIL2={ "num":[false,"序号","string"], "type":[false,"类别","string"], - "name":[false,"名称","string"], - "spec":[false,"规格类型","string"], - "param":[false,"参数","string"], - "unit":[false,"单位","string"], - "amount":[false,"数量","number"], - "price":[false,"单价","price"], + "name":[false,"产品大类","string"], + // "spec":[false,"规格类型","string"], + // "param":[false,"参数","string"], + // "unit":[false,"单位","string"], + // "amount":[false,"数量","number"], + // "price":[false,"单价","price"], "taxRate":[false,"税率","number"], "totalTaxInclude":[false,"含税总金额","number"], "totalTaxExclude":[false,"不含税金额","number"], @@ -185,7 +185,7 @@ function appendTrIncome() { // ' \n' + // ' \n' + ' \n' + - ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + @@ -216,6 +216,8 @@ function bindDeleteBtnIncome() { 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"); updateTotal("input-changeable-total-tax-income", "input-changeable-total-total-tax-income"); + + }); } @@ -241,4 +243,10 @@ function bindIncomeTotal() { updateTotal("input-changeable-total-tax-exclude-income", "input-changeable-total-total-tax-exclude-income"); updateTotal("input-changeable-total-tax-income", "input-changeable-total-total-tax-income"); }); + $(".input-changeable-total-tax-include-income").change(function () { + 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"); + updateTotal("input-changeable-total-tax-income", "input-changeable-total-total-tax-income"); + }); + } \ No newline at end of file diff --git a/src/main/resources/static/assets/js/project_budget_plan.js b/src/main/resources/static/assets/js/project_budget_plan.js index 8a47d62..219d5ba 100644 --- a/src/main/resources/static/assets/js/project_budget_plan.js +++ b/src/main/resources/static/assets/js/project_budget_plan.js @@ -4,8 +4,10 @@ BUDGET_PLAN_DETAIL_ARR=["month","deviceCost","engineerCost","projectManageCost","earnestMoneyCost","totalCost","saleIncome","earnestMoneyIncome","totalIncome","fundBalance","capitalInterest","underwrittenPlan","repaymentPlan"]; BUDGET_PLAN_DETAIL2={ "month":[true,"月份"], - "deviceCost":[false,"设备支出","number"], - "engineerCost":[false,"工程支出","number"], + "deviceCost":[false,"设备付款","number"], + "projectCost":[false,"工程付款","number"], + "serviceCost ":[false,"服务付款","number"], + "otherCost":[false,"其他付款","number"], "projectManageCost":[false,"经营性开支","number"], "earnestMoneyCost":[false,"保证金支出","number"], "totalCost":[false,"支出合计","number"], @@ -20,8 +22,10 @@ BUDGET_PLAN_DETAIL2={ BUDGET_PLAN_DETAIL={ "month":[true,"月份"], - "deviceCost":[true,"设备支出","number"], - "engineerCost":[true,"工程支出","number"], + "deviceCost":[true,"设备付款","number"], + "projectCost":[false,"工程付款","number"], + "serviceCost ":[false,"服务付款","number"], + "otherCost":[false,"其他付款","number"], "projectManageCost":[true,"经营性开支","number"], "earnestMoneyCost":[true,"保证金支出","number"], "totalCost":[true,"支出合计","number"], @@ -416,7 +420,11 @@ function appendTrBudgetPlan2() { var template = '\n' + ' \n' + ' \n' + - ' \n' + + // ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + ' \n' + ' \n' + @@ -548,17 +556,57 @@ function bindChangeableInputBudgetPlanDetail() { updatePageData(); }); //工程支出改变 - $(".input-changeable-engineer-cost-budget-plan").change(function () { + $(".input-changeable-projectCost-cost-budget-plan").change(function () { var engineerCost = f2($(this).val()); //找到对应的设备支出、经营性支出、保证金支出 var deviceCost = f2($(this).parent().parent().find(".input-changeable-device-cost-budget-plan").val()); var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); + var engineerCost2 = f2($(this).parent().parent().find(".input-changeable-serviceCost-cost-budget-plan").val()); + var engineerCost3 = f2($(this).parent().parent().find(".input-changeable-otherCost-cost-budget-plan").val()); //更新本月所有项支出 - $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost+engineerCost2+engineerCost3)); //更新所有月工程支出总额 - updateBudgetPlanTotal("input-changeable-engineer-cost-budget-plan","input-total-engineer-cost-budget-plan"); + updateBudgetPlanTotal("input-changeable-projectCost-cost-budget-plan","input-total-projectCost-cost-budget-plan"); + //更新所有月支出总额 + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-total-cost-budget-plan"); + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-title-total-cost-budget-plan"); + + updatePageData(); + }); + $(".input-changeable-serviceCost-cost-budget-plan").change(function () { + var engineerCost = f2($(this).val()); + //找到对应的设备支出、经营性支出、保证金支出 + var deviceCost = f2($(this).parent().parent().find(".input-changeable-device-cost-budget-plan").val()); + var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); + var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); + var engineerCost2 = f2($(this).parent().parent().find(".input-changeable-serviceCost-cost-budget-plan").val()); + var engineerCost3 = f2($(this).parent().parent().find(".input-changeable-otherCost-cost-budget-plan").val()); + + //更新本月所有项支出 + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost+engineerCost2+engineerCost3)); + //更新所有月工程支出总额 + updateBudgetPlanTotal("input-changeable-serviceCost-cost-budget-plan","input-total-serviceCost-cost-budget-plan"); + //更新所有月支出总额 + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-total-cost-budget-plan"); + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-title-total-cost-budget-plan"); + + updatePageData(); + }); + $(".input-changeable-otherCost-cost-budget-plan").change(function () { + var engineerCost = f2($(this).val()); + //找到对应的设备支出、经营性支出、保证金支出 + var deviceCost = f2($(this).parent().parent().find(".input-changeable-device-cost-budget-plan").val()); + var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); + var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); + var engineerCost2 = f2($(this).parent().parent().find(".input-changeable-serviceCost-cost-budget-plan").val()); + var engineerCost3 = f2($(this).parent().parent().find(".input-changeable-otherCost-cost-budget-plan").val()); + + //更新本月所有项支出 + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost+engineerCost2+engineerCost3)); + //更新所有月工程支出总额 + updateBudgetPlanTotal("input-changeable-otherCost-cost-budget-plan","input-total-otherCost-cost-budget-plan"); //更新所有月支出总额 updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-total-cost-budget-plan"); updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-title-total-cost-budget-plan"); diff --git a/src/main/resources/static/assets/js/project_common.js b/src/main/resources/static/assets/js/project_common.js index a1ec21e..798f7a1 100644 --- a/src/main/resources/static/assets/js/project_common.js +++ b/src/main/resources/static/assets/js/project_common.js @@ -260,14 +260,15 @@ function calCostInclude() { var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - var costProjectManageTaxInclude = inputVal("costProjectManageTaxInclude"); + // var costProjectManageTaxInclude = inputVal("costProjectManageTaxInclude"); + // f2(costProjectManageTaxInclude) var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); var $costTotalTaxInclude = $("input[name='costTotalTaxInclude']"); $costTotalTaxInclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude) +f2(costPurchaseBuildTaxInclude) +f2(costPurchaseServiceTaxInclude)+f2(costPurchaseOtherTaxInclude) - +f2(costProjectManageTaxInclude)+f2(costOtherOtherTaxInclude))); + +f2(costOtherOtherTaxInclude))); } /** * 统计成本(不含税),有一项没填就置空 @@ -277,7 +278,8 @@ function calCostExclude() { var costPurchaseBuildTaxExclude = inputVal("costPurchaseBuildTaxExclude"); var costPurchaseServiceTaxExclude = inputVal("costPurchaseServiceTaxExclude"); var costPurchaseOtherTaxExclude = inputVal("costPurchaseOtherTaxExclude"); - var costProjectManageTaxExclude = inputVal("costProjectManageTaxExclude"); + // var costProjectManageTaxExclude = inputVal("costProjectManageTaxExclude");\ + // f2(costProjectManageTaxExclude) var costOtherOtherTaxExclude = inputVal("costOtherOtherTaxExclude"); @@ -285,7 +287,7 @@ function calCostExclude() { $costTotalTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxExclude)+f2(costPurchaseBuildTaxExclude) +f2(costPurchaseServiceTaxExclude)+f2(costPurchaseOtherTaxExclude) - +f2(costProjectManageTaxExclude)+f2(costOtherOtherTaxExclude))); + +f2(costOtherOtherTaxExclude))); } /** * 统计其他其他税金 diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index e95471f..7d95f91 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -107,8 +107,8 @@
  • 项目基本信息
  • 收入明细表
  • 收款计划表
  • -
  • 采购成本明细表
  • -
  • 项目管理费用
  • +
  • 采购成本项目
  • +
  • 项目管理费用表
  • 资金计划表
  • 项目预算信息
  • @@ -794,7 +794,7 @@ <#-- --> <#-- --> - + @@ -899,27 +899,27 @@ 序号 - 费用项目 - 采购类别 - 名称 - 单位 - 数量 - 单价 + 采购成本项目 + 产品大类 +<#-- 名称--> +<#-- 单位--> +<#-- 数量--> +<#-- 单价--> 税率(%) 含税总金额(元) 不含税金额(元) 税金(元) - 签约方 - 是否垫资 - 预估垫资金额(元) - 支出时间 - 支出金额(元) - 付款方式 + 供应商 +<#-- 是否垫资--> +<#-- 预估垫资金额(元)--> +<#-- 支出时间--> +<#-- 支出金额(元)--> +<#-- 付款方式--> 备注 操作 - + <#if costDetails??> <#list costDetails as costDetail> @@ -947,26 +947,26 @@ - - - > - +<#-- --> +<#-- --> +<#-- --> +<#-- --> - + - - - - - - - +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> @@ -976,20 +976,20 @@ - - - > - +<#-- --> +<#-- --> +<#-- --> +<#-- --> - - - - - +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> @@ -1013,12 +1013,12 @@ 序号 - 财务费用类别 + 费用类别 业务项目 项目明细 - 单位 - 数量 - 单价 +<#-- 单位--> +<#-- 数量--> +<#-- 单价--> 总金额(元) 支出时间 支出金额(元) @@ -1063,10 +1063,10 @@ type="text"<#else>type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage am-modal-prompt-input-cost-project-manage-category2" value="${costProjectManageDetail.name!}"> - - oninput="if(value.length>8)value=value.slice(0,8)"> - - +<#-- --> +<#-- --> +<#-- --> + @@ -1083,9 +1083,9 @@ - - > - +<#-- --> +<#-- --> +<#-- --> @@ -1133,11 +1133,17 @@ - - - - - + +<#-- --> + + + + + + + + + @@ -1152,7 +1158,11 @@ - + + + + + @@ -1168,7 +1178,11 @@ - + + + + + @@ -1187,7 +1201,10 @@ - + + + + @@ -1366,7 +1383,7 @@ 合计 - + (备注:财务计取以不含税方式核算)