成本计算保留两位小数
parent
a535e863c4
commit
8be9937813
|
@ -72,20 +72,20 @@ function updateCostData(details) {
|
||||||
details.forEach(function (t, number, ts) {
|
details.forEach(function (t, number, ts) {
|
||||||
if(t["type"] == "1"){
|
if(t["type"] == "1"){
|
||||||
//设备类
|
//设备类
|
||||||
deviceTaxInclude += parseFloat(t["totalTaxInclude"]);
|
deviceTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
deviceTaxExclude += parseFloat(t["totalTaxExclude"]);
|
deviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "2"){
|
}else if(t["type"] == "2"){
|
||||||
//施工类
|
//施工类
|
||||||
buildTaxInclude += parseFloat(t["totalTaxInclude"]);
|
buildTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
buildTaxExclude += parseFloat(t["totalTaxExclude"]);
|
buildTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "3"){
|
}else if(t["type"] == "3"){
|
||||||
//服务类
|
//服务类
|
||||||
serviceTaxInclude += parseFloat(t["totalTaxInclude"]);
|
serviceTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
serviceTaxExclude += parseFloat(t["totalTaxExclude"]);
|
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "4"){
|
}else if(t["type"] == "4"){
|
||||||
//其他类
|
//其他类
|
||||||
otherTaxInclude += parseFloat(t["totalTaxInclude"]);
|
otherTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
otherTaxExclude += parseFloat(t["totalTaxExclude"]);
|
otherTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("input[name='costPurchaseDeviceTaxInclude']").val(deviceTaxInclude);
|
$("input[name='costPurchaseDeviceTaxInclude']").val(deviceTaxInclude);
|
||||||
|
@ -108,24 +108,24 @@ function updateCostData(details) {
|
||||||
|
|
||||||
function bindOtherOtherChangeable() {
|
function bindOtherOtherChangeable() {
|
||||||
$("input[name='costOtherOtherTaxInclude']").change(function () {
|
$("input[name='costOtherOtherTaxInclude']").change(function () {
|
||||||
var costPurchaseDeviceTaxInclude = parseFloat($("input[name='costPurchaseDeviceTaxInclude']").val());
|
var costPurchaseDeviceTaxInclude = f2($("input[name='costPurchaseDeviceTaxInclude']").val());
|
||||||
var costPurchaseBuildTaxInclude = parseFloat($("input[name='costPurchaseBuildTaxInclude']").val());
|
var costPurchaseBuildTaxInclude = f2($("input[name='costPurchaseBuildTaxInclude']").val());
|
||||||
var costPurchaseServiceTaxInclude = parseFloat($("input[name='costPurchaseServiceTaxInclude']").val());
|
var costPurchaseServiceTaxInclude = f2($("input[name='costPurchaseServiceTaxInclude']").val());
|
||||||
var costPurchaseOtherTaxInclude = parseFloat($("input[name='costPurchaseOtherTaxInclude']").val());
|
var costPurchaseOtherTaxInclude = f2($("input[name='costPurchaseOtherTaxInclude']").val());
|
||||||
|
|
||||||
var costOtherOther = parseFloat($(this).val());
|
var costOtherOther = f2($(this).val());
|
||||||
|
|
||||||
$("input[name='costTotalTaxInclude']").val(costPurchaseDeviceTaxInclude+costPurchaseBuildTaxInclude+costPurchaseServiceTaxInclude+costPurchaseOtherTaxInclude+costOtherOther);
|
$("input[name='costTotalTaxInclude']").val(costPurchaseDeviceTaxInclude+costPurchaseBuildTaxInclude+costPurchaseServiceTaxInclude+costPurchaseOtherTaxInclude+costOtherOther);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("input[name='costOtherOtherTaxExclude']").change(function () {
|
$("input[name='costOtherOtherTaxExclude']").change(function () {
|
||||||
var costPurchaseDeviceTaxExclude = parseFloat($("input[name='costPurchaseDeviceTaxExclude']").val());
|
var costPurchaseDeviceTaxExclude = f2($("input[name='costPurchaseDeviceTaxExclude']").val());
|
||||||
var costPurchaseBuildTaxExclude = parseFloat($("input[name='costPurchaseBuildTaxExclude']").val());
|
var costPurchaseBuildTaxExclude = f2($("input[name='costPurchaseBuildTaxExclude']").val());
|
||||||
var costPurchaseServiceTaxExclude = parseFloat($("input[name='costPurchaseServiceTaxExclude']").val());
|
var costPurchaseServiceTaxExclude = f2($("input[name='costPurchaseServiceTaxExclude']").val());
|
||||||
var costPurchaseOtherTaxExclude = parseFloat($("input[name='costPurchaseOtherTaxExclude']").val());
|
var costPurchaseOtherTaxExclude = f2($("input[name='costPurchaseOtherTaxExclude']").val());
|
||||||
|
|
||||||
var costProjectManageTaxExclude = parseFloat($("input[name='costProjectManageTaxExclude']").val());
|
var costProjectManageTaxExclude = f2($("input[name='costProjectManageTaxExclude']").val());
|
||||||
var costOtherOther = parseFloat($(this).val());
|
var costOtherOther = f2($(this).val());
|
||||||
|
|
||||||
$("input[name='costTotalTaxExclude']").val(costPurchaseDeviceTaxExclude+costPurchaseBuildTaxExclude+costPurchaseServiceTaxExclude+costPurchaseOtherTaxExclude+costProjectManageTaxExclude+costOtherOther);
|
$("input[name='costTotalTaxExclude']").val(costPurchaseDeviceTaxExclude+costPurchaseBuildTaxExclude+costPurchaseServiceTaxExclude+costPurchaseOtherTaxExclude+costProjectManageTaxExclude+costOtherOther);
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,19 +53,17 @@ function appendTrCostProjectManage() {
|
||||||
function bindChangeableInputProjectManage() {
|
function bindChangeableInputProjectManage() {
|
||||||
//数量改变
|
//数量改变
|
||||||
$(".input-changeable-amount-project-manage").change(function () {
|
$(".input-changeable-amount-project-manage").change(function () {
|
||||||
var amount = parseFloat($(this).val());
|
var amount = parseInt($(this).val());
|
||||||
//找到对应的单价
|
//找到对应的单价
|
||||||
var price = parseFloat($(this).parent().parent().find(".input-changeable-price-project-manage").val());
|
var price = f2($(this).parent().parent().find(".input-changeable-price-project-manage").val());
|
||||||
console.log(amount,price);
|
|
||||||
|
|
||||||
$(this).parent().parent().find(".input-changeable-total-project-manage").val(amount*price);
|
$(this).parent().parent().find(".input-changeable-total-project-manage").val(amount*price);
|
||||||
});
|
});
|
||||||
//单价改变
|
//单价改变
|
||||||
$(".input-changeable-price-project-manage").change(function () {
|
$(".input-changeable-price-project-manage").change(function () {
|
||||||
var price = parseFloat($(this).val());
|
var price = f2($(this).val());
|
||||||
//找到对应的数量
|
//找到对应的数量
|
||||||
var amount = parseFloat($(this).parent().parent().find(".input-changeable-amount-project-manage").val());
|
var amount = parseInt($(this).parent().parent().find(".input-changeable-amount-project-manage").val());
|
||||||
console.log(amount,price);
|
|
||||||
|
|
||||||
$(this).parent().parent().find(".input-changeable-total-project-manage").val(amount*price);
|
$(this).parent().parent().find(".input-changeable-total-project-manage").val(amount*price);
|
||||||
});
|
});
|
||||||
|
@ -76,17 +74,17 @@ function bindChangeableInputProjectManage() {
|
||||||
function updateCostProjectManageData(details) {
|
function updateCostProjectManageData(details) {
|
||||||
var total = 0;
|
var total = 0;
|
||||||
details.forEach(function (t, number, ts) {
|
details.forEach(function (t, number, ts) {
|
||||||
total += parseFloat(t["total"]);
|
total += f2(t["total"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("input[name='costProjectManageTaxExclude']").val(total);
|
$("input[name='costProjectManageTaxExclude']").val(total);
|
||||||
|
|
||||||
var costPurchaseDeviceTaxExclude = parseFloat($("input[name='costPurchaseDeviceTaxExclude']").val());
|
var costPurchaseDeviceTaxExclude = f2($("input[name='costPurchaseDeviceTaxExclude']").val());
|
||||||
var costPurchaseBuildTaxExclude = parseFloat($("input[name='costPurchaseBuildTaxExclude']").val());
|
var costPurchaseBuildTaxExclude = f2($("input[name='costPurchaseBuildTaxExclude']").val());
|
||||||
var costPurchaseServiceTaxExclude = parseFloat($("input[name='costPurchaseServiceTaxExclude']").val());
|
var costPurchaseServiceTaxExclude = f2($("input[name='costPurchaseServiceTaxExclude']").val());
|
||||||
var costPurchaseOtherTaxExclude = parseFloat($("input[name='costPurchaseOtherTaxExclude']").val());
|
var costPurchaseOtherTaxExclude = f2($("input[name='costPurchaseOtherTaxExclude']").val());
|
||||||
|
|
||||||
var costOtherOtherTaxExclude = parseFloat($("input[name='costOtherOtherTaxExclude']").val());
|
var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val());
|
||||||
|
|
||||||
$("input[name='costTotalTaxExclude']").val(costPurchaseDeviceTaxExclude+costPurchaseBuildTaxExclude+costPurchaseServiceTaxExclude+costPurchaseOtherTaxExclude+total+costOtherOtherTaxExclude);
|
$("input[name='costTotalTaxExclude']").val(costPurchaseDeviceTaxExclude+costPurchaseBuildTaxExclude+costPurchaseServiceTaxExclude+costPurchaseOtherTaxExclude+total+costOtherOtherTaxExclude);
|
||||||
}
|
}
|
Loading…
Reference in New Issue