概算页面税率计算、预算页面修改

master
hanbo 2022-01-05 10:57:17 +08:00
parent d1a3d7a56a
commit 1edd9cd4d7
2 changed files with 175 additions and 17 deletions

View File

@ -71,6 +71,9 @@ $(function () {
return; return;
} }
//如果没有提交则自动计算预算信息
updateIncomeDataUnsubmit(dataIncomeCheck);
var dataCost = collectData("am-modal-prompt-input-cost"); var dataCost = collectData("am-modal-prompt-input-cost");
if (dataCost.length <= 0) { if (dataCost.length <= 0) {
window.confirm('请填写采购成本明细表'); window.confirm('请填写采购成本明细表');
@ -82,6 +85,9 @@ $(function () {
return; return;
} }
//如果没有提交则自动计算预算信息
updateCostDataIfUnsubmit(dataCostCheck);
var dataManage = collectData("am-modal-prompt-input-cost-project-manage"); var dataManage = collectData("am-modal-prompt-input-cost-project-manage");
if (dataManage.length <= 0) { if (dataManage.length <= 0) {
window.confirm('请填写项目管理成本表'); window.confirm('请填写项目管理成本表');
@ -93,6 +99,8 @@ $(function () {
return; return;
} }
updateCostProjectManageDataUnsubmit(dataManageCheck);
var dataPlan = collectData("am-modal-prompt-input-budget-plan-detail"); var dataPlan = collectData("am-modal-prompt-input-budget-plan-detail");
if (dataPlan.length <= 0) { if (dataPlan.length <= 0) {
window.confirm('请填写项目资金计划表'); window.confirm('请填写项目资金计划表');
@ -172,6 +180,8 @@ $(function () {
return; return;
} }
updateBudgetPlanDetailDataUnsubmit();
$("#saveApprove").attr('disabled', true); $("#saveApprove").attr('disabled', true);
var message = verifyProjectContributionProfitRate(); var message = verifyProjectContributionProfitRate();
@ -431,4 +441,152 @@ function updateProjectContributionProfitRate() {
$("input[name='projectGrossProfitRate']").val(projectGrossProfitRate); $("input[name='projectGrossProfitRate']").val(projectGrossProfitRate);
$("input[name='projectContributionProfit']").val(projectContributionProfit); $("input[name='projectContributionProfit']").val(projectContributionProfit);
$("input[name='projectContributionProfitRate']").val(projectContributionProfitRate); $("input[name='projectContributionProfitRate']").val(projectContributionProfitRate);
} }
/**
* 更新页面收入的数据累加
*/
function updateCostDataIfUnsubmit(details) {
var deviceTaxInclude = 0;
var deviceTaxExclude = 0;
var buildTaxInclude = 0;
var buildTaxExclude = 0;
var serviceTaxInclude = 0;
var serviceTaxExclude = 0;
var otherTaxInclude = 0;
var otherTaxExclude = 0;
details.forEach(function (t, number, ts) {
if(t["type"] == "1"){
//设备类
deviceTaxInclude += f2(t["totalTaxInclude"]);
deviceTaxExclude += f2(t["totalTaxExclude"]);
}else if(t["type"] == "2"){
//施工类
buildTaxInclude += f2(t["totalTaxInclude"]);
buildTaxExclude += f2(t["totalTaxExclude"]);
}else if(t["type"] == "3"){
//服务类
serviceTaxInclude += f2(t["totalTaxInclude"]);
serviceTaxExclude += f2(t["totalTaxExclude"]);
}else if(t["type"] == "4"){
//其他类
otherTaxInclude += f2(t["totalTaxInclude"]);
otherTaxExclude += f2(t["totalTaxExclude"]);
}
});
$("input[name='costPurchaseDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude));
$("input[name='costPurchaseDeviceTaxExclude']").val(f2Fixed(deviceTaxExclude));
$("input[name='costPurchaseBuildTaxInclude']").val(f2Fixed(buildTaxInclude));
$("input[name='costPurchaseBuildTaxExclude']").val(f2Fixed(buildTaxExclude));
$("input[name='costPurchaseServiceTaxInclude']").val(f2Fixed(serviceTaxInclude));
$("input[name='costPurchaseServiceTaxExclude']").val(f2Fixed(serviceTaxExclude));
$("input[name='costPurchaseOtherTaxInclude']").val(f2Fixed(otherTaxInclude));
$("input[name='costPurchaseOtherTaxExclude']").val(f2Fixed(otherTaxExclude));
//资金计划表中的
$(".input-total-title-device-cost-budget-plan").val(f2Fixed(deviceTaxInclude));
$(".input-total-title-engineer-cost-budget-plan").val(f2Fixed(f2(serviceTaxInclude)+f2(buildTaxInclude)+f2(otherTaxInclude)));
$(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude)+f2(buildTaxInclude)+f2(serviceTaxInclude)+f2(otherTaxInclude)
+f2($(".input-total-title-project-manage-cost-budget-plan").val())
+f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
calCostExclude();
calCostInclude();
updateProjectContributionProfitRate();
}
/**
* 更新页面收入的数据累加
*/
function updateIncomeDataUnsubmit(incomeDetails) {
var deviceTaxInclude = 0;
var deviceTaxExclude = 0;
var engineerTaxInclude = 0;
var engineerTaxExclude = 0;
var serviceTaxInclude = 0;
var serviceTaxExclude = 0;
incomeDetails.forEach(function (t, number, ts) {
if(t["type"] == "1"){
//设备类
deviceTaxInclude += f2(t["totalTaxInclude"]);
deviceTaxExclude += f2(t["totalTaxExclude"]);
}else if(t["type"] == "2"){
//工程类
engineerTaxInclude += f2(t["totalTaxInclude"]);
engineerTaxExclude += f2(t["totalTaxExclude"]);
}else if(t["type"] == "3"){
//服务类
serviceTaxInclude += f2(t["totalTaxInclude"]);
serviceTaxExclude += f2(t["totalTaxExclude"]);
}
});
$("input[name='incomeDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude));
$("input[name='incomeDeviceTaxExclude']").val(f2Fixed(deviceTaxExclude));
$("input[name='incomeEngineerTaxInclude']").val(f2Fixed(engineerTaxInclude));
$("input[name='incomeEngineerTaxExclude']").val(f2Fixed(engineerTaxExclude));
$("input[name='incomeServiceTaxInclude']").val(f2Fixed(serviceTaxInclude));
$("input[name='incomeServiceTaxExclude']").val(f2Fixed(serviceTaxExclude));
$("input[name='incomeTotalTaxInclude']").val(f2Fixed(deviceTaxInclude+engineerTaxInclude+serviceTaxInclude));
$("input[name='incomeTotalTaxExclude']").val(f2Fixed(deviceTaxExclude+engineerTaxExclude+serviceTaxExclude));
$(".input-total-title-sale-income-budget-plan").val($("input[name='incomeTotalTaxInclude']").val());
$(".input-total-title-total-income-budget-plan").val(f2Fixed(f2($("input[name='incomeTotalTaxInclude']").val())
+f2($(".input-total-title-earnest-money-income-budget-plan").val())));
updateProjectContributionProfitRate();
}
/**
* 更新页面收入的数据累加
*/
function updateCostProjectManageDataUnsubmit(details) {
var total = 0;
details.forEach(function (t, number, ts) {
total += f2(t["total"]);
});
total = f2(total);
$("input[name='costProjectManageTaxExclude']").val(f2Fixed(total));
$("input[name='costProjectManageTaxInclude']").val(f2Fixed(total));
//资金计划表中的
$(".input-total-title-project-manage-cost-budget-plan").val(f2Fixed(total));
var deviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']").val();
var buildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']").val();
var serviceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']").val();
var otherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']").val();
var deviceTaxInclude = $("input[name='costPurchaseDeviceTaxInclude']").val();
var buildTaxInclude = $("input[name='costPurchaseBuildTaxInclude']").val();
var serviceTaxInclude = $("input[name='costPurchaseServiceTaxInclude']").val();
var otherTaxInclude = $("input[name='costPurchaseOtherTaxInclude']").val();
$(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude)+f2(buildTaxInclude)+f2(serviceTaxInclude)+f2(otherTaxInclude)
+total
+f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
calCostExclude();
calCostInclude();
updateProjectContributionProfitRate();
}
/**
* 更新页面收入的数据
*/
function updateBudgetPlanDetailDataUnsubmit(data,returnData) {
//var details = data.details;
//主页面上的财务费用
$("input[name='costExpropriationTaxExclude']").val($(".input-underwritten-plan-statistic-capital-interest-budget-plan").val());
//更新项目贡献率
updateProjectContributionProfitRate();
//更新现金流量
updateCashFlow();
}

View File

@ -119,7 +119,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='incomeDeviceTaxExclude']").attr('readonly',true); $("input[name='incomeDeviceTaxExclude']").attr('readonly',true);
var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude");
$incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude-(incomeDeviceTaxInclude*val))); $incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude/(1+Number(val))));
} }
calIncomeExclude(); calIncomeExclude();
calIncomeCost(); calIncomeCost();
@ -134,7 +134,7 @@ function calIncomeAndCost() {
}else if(val == "请选择税率"){ }else if(val == "请选择税率"){
return; return;
} else { } else {
$incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude-(incomeDeviceTaxInclude*val))); $incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude/(1+Number(val))));
} }
calIncomeExclude(); calIncomeExclude();
calIncomeCost(); calIncomeCost();
@ -152,7 +152,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='incomeEngineerTaxExclude']").attr('readonly',true); $("input[name='incomeEngineerTaxExclude']").attr('readonly',true);
var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude");
$incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude-(incomeEngineerTaxInclude*val))); $incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude/(1+Number(val))));
} }
calIncomeExclude(); calIncomeExclude();
calIncomeCost(); calIncomeCost();
@ -167,7 +167,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude");
$incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude-(incomeEngineerTaxInclude*val))); $incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude/(1+Number(val))));
} }
calIncomeExclude(); calIncomeExclude();
calIncomeCost(); calIncomeCost();
@ -185,7 +185,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='incomeServiceTaxExclude']").attr('readonly',true); $("input[name='incomeServiceTaxExclude']").attr('readonly',true);
var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude");
$incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude-(incomeServiceTaxInclude*val))); $incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude/(1+Number(val))));
} }
calIncomeExclude(); calIncomeExclude();
calIncomeCost(); calIncomeCost();
@ -200,7 +200,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude");
$incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude-(incomeServiceTaxInclude*val))); $incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude/(1+Number(val))));
} }
calIncomeExclude(); calIncomeExclude();
calIncomeCost(); calIncomeCost();
@ -218,7 +218,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true);
var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude");
$costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude-(costPurchaseDeviceTaxInclude*val))); $costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -233,7 +233,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude");
$costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude-(costPurchaseDeviceTaxInclude*val))); $costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -251,7 +251,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true);
var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude");
$costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude-(costPurchaseBuildTaxInclude*val))); $costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -266,7 +266,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude");
$costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude-(costPurchaseBuildTaxInclude*val))); $costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -284,7 +284,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true);
var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude");
$costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude-(costPurchaseServiceTaxInclude*val))); $costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -299,7 +299,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude");
$costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude-(costPurchaseServiceTaxInclude*val))); $costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -317,7 +317,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='costOtherOtherTaxExclude']").attr('readonly',true); $("input[name='costOtherOtherTaxExclude']").attr('readonly',true);
var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude");
$costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude-(costOtherOtherTaxInclude*val))); $costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -332,7 +332,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude");
$costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude-(costOtherOtherTaxInclude*val))); $costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -350,7 +350,7 @@ function calIncomeAndCost() {
} else { } else {
$("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true);
var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude");
$costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude-(costPurchaseOtherTaxInclude*val))); $costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();
@ -365,7 +365,7 @@ function calIncomeAndCost() {
return; return;
} else { } else {
var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude");
$costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude-(costPurchaseOtherTaxInclude*val))); $costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude/(1+Number(val))));
} }
calCostExclude(); calCostExclude();
calIncomeCost(); calIncomeCost();