|
|
@ -61,29 +61,29 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="container"> |
|
|
|
<h4 class="form-header h4">计算</h4> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class=" col-sm-2">物料合计:</label><input class="col-sm-4" th:field="*{materialSum}" name="materialSum" id="materialSum_add" type="number" readonly/> |
|
|
|
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" th:field="*{enterpriseSum}" name="enterpriseSum" id="enterpriseSum_add" type="number" readonly/> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2"> 不含税单价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{noTaxRmb}" name="noTaxRmb" id="noTaxRmb_add" type="number" readonly/> |
|
|
|
<label class="col-sm-2"> 不含税总价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{allNoTaxRmb}" name="allNoTaxRmb" id="allNoTaxRmb_add" type="number" readonly/> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2"> 含税单价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{taxRmb}" name="taxRmb" id="taxRmb_add" type="number" readonly/> |
|
|
|
<label class="col-sm-2"> 含税总价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{allTaxRmb}" name="allTaxRmb" id="allTaxRmb_add" type="number" readonly/> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12"> |
|
|
|
<label class="col-sm-2">不含税单价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{noTaxDollar}" name="noTaxDollar" id="noTaxDollar_add" type="number" readonly/> |
|
|
|
<label class="col-sm-2">不含税总价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{allNoTaxDollar}" name="allNoTaxDollar" id="allNoTaxDollar_add" type="number" readonly/> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2">含税单价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{taxDollar}" name="taxDollar" id="taxDollar_add" type="number" readonly/> |
|
|
|
<label class="col-sm-2">含税总价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{allTaxDollar}" name="allTaxDollar" id="allTaxDollar_add" type="number" readonly/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <div class="container">--> |
|
|
|
<!-- <h4 class="form-header h4">计算</h4>--> |
|
|
|
<!-- <div class="col-xs-12 form-row">--> |
|
|
|
<!-- <label class=" col-sm-2">物料合计:</label><input class="col-sm-4" th:field="*{materialSum}" name="materialSum" id="materialSum_add" type="number" readonly/>--> |
|
|
|
<!-- <label class=" col-sm-2">数量合计:</label><input class="col-sm-4" th:field="*{enterpriseSum}" name="enterpriseSum" id="enterpriseSum_add" type="number" readonly/>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="col-xs-12 form-row">--> |
|
|
|
<!-- <label class="col-sm-2"> 不含税单价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{noTaxRmb}" name="noTaxRmb" id="noTaxRmb_add" type="number" readonly/>--> |
|
|
|
<!-- <label class="col-sm-2"> 不含税总价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{allNoTaxRmb}" name="allNoTaxRmb" id="allNoTaxRmb_add" type="number" readonly/>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="col-xs-12 form-row">--> |
|
|
|
<!-- <label class="col-sm-2"> 含税单价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{taxRmb}" name="taxRmb" id="taxRmb_add" type="number" readonly/>--> |
|
|
|
<!-- <label class="col-sm-2"> 含税总价(RMB):</label><input placeholder="RMB" class="col-sm-4" th:field="*{allTaxRmb}" name="allTaxRmb" id="allTaxRmb_add" type="number" readonly/>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="col-xs-12">--> |
|
|
|
<!-- <label class="col-sm-2">不含税单价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{noTaxDollar}" name="noTaxDollar" id="noTaxDollar_add" type="number" readonly/>--> |
|
|
|
<!-- <label class="col-sm-2">不含税总价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{allNoTaxDollar}" name="allNoTaxDollar" id="allNoTaxDollar_add" type="number" readonly/>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="col-xs-12 form-row">--> |
|
|
|
<!-- <label class="col-sm-2">含税单价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{taxDollar}" name="taxDollar" id="taxDollar_add" type="number" readonly/>--> |
|
|
|
<!-- <label class="col-sm-2">含税总价(USD):</label><input placeholder="美元" class="col-sm-4" th:field="*{allTaxDollar}" name="allTaxDollar" id="allTaxDollar_add" type="number" readonly/>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
</form> |
|
|
|
|
|
|
@ -197,35 +197,35 @@ |
|
|
|
field: 'materialNum', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '不含税单价', |
|
|
|
title: '不含税单价(RMB)', |
|
|
|
field: 'noTaxRmb', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '含税单价', |
|
|
|
title: '含税单价(RMB)', |
|
|
|
field: 'taxRmb', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '不含税总价', |
|
|
|
title: '不含税总价(RMB)', |
|
|
|
field: 'allNoTaxRmb', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '含税总价', |
|
|
|
title: '含税总价(RMB)', |
|
|
|
field: 'allTaxRmb', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '含税单价', |
|
|
|
title: '含税单价(美元)', |
|
|
|
field: 'taxDollar', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '不含税单价', |
|
|
|
title: '不含税单价(美元)', |
|
|
|
field: 'noTaxDollar', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '含税总价', |
|
|
|
title: '含税总价(美元)', |
|
|
|
field: 'allTaxDollar', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '不含税总价', |
|
|
|
title: '不含税总价(美元)', |
|
|
|
field: 'allNoTaxDollar', |
|
|
|
}, |
|
|
|
{ |
|
|
@ -235,7 +235,7 @@ |
|
|
|
}], |
|
|
|
onEditableSave:function(field, row, oldValue, $el){ |
|
|
|
// 确保getTotalAmount函数存在且正确引用 |
|
|
|
getTotalAmount(); |
|
|
|
// getTotalAmount(); |
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
@ -328,13 +328,31 @@ |
|
|
|
// 使用第一条数据 |
|
|
|
var firstRow = data[0].rows[0]; |
|
|
|
|
|
|
|
// 初始化累积变量 |
|
|
|
let noTaxPurchaseRmb = 0; |
|
|
|
let taxPurchaseRmb = 0; |
|
|
|
|
|
|
|
// 累加无税购买金额 |
|
|
|
data[0].rows.forEach(function (row) { |
|
|
|
noTaxPurchaseRmb += row.noTaxPurchaseRmb; |
|
|
|
}); |
|
|
|
|
|
|
|
// 累加含税购买金额 |
|
|
|
data[0].rows.forEach(function (row) { |
|
|
|
taxPurchaseRmb += row.taxPurchaseRmb; |
|
|
|
}); |
|
|
|
|
|
|
|
// 将结果赋值给 costs 对象 |
|
|
|
costs.noTaxPurchaseRmb = noTaxPurchaseRmb; |
|
|
|
costs.taxPurchaseRmb = taxPurchaseRmb; |
|
|
|
|
|
|
|
// 从 `firstRow` 中获取成本信息 |
|
|
|
const { |
|
|
|
noTaxDevelopCosts = '', |
|
|
|
noTaxShippingCosts = '', |
|
|
|
noTaxServiceCosts = '', |
|
|
|
noTaxPurchaseRmb = '', |
|
|
|
taxPurchaseRmb = '' |
|
|
|
// noTaxPurchaseRmb = '', |
|
|
|
// taxPurchaseRmb = '' |
|
|
|
} = firstRow || {}; |
|
|
|
|
|
|
|
// 从 `salesEstimateDetailVo` 中获取其他成本信息 |
|
|
@ -595,51 +613,51 @@ |
|
|
|
|
|
|
|
|
|
|
|
//form计算模块 |
|
|
|
function getTotalAmount(){ |
|
|
|
let getData = $('#bootstrap-table').bootstrapTable('getData'); |
|
|
|
var materialSum = 0; |
|
|
|
var enterpriseSum = 0; |
|
|
|
var noTaxRmb = 0; |
|
|
|
var taxRmb = 0; |
|
|
|
var allNoTaxRmb = 0; |
|
|
|
var allTaxRmb = 0; |
|
|
|
var noTaxDollar = 0; |
|
|
|
var taxDollar = 0; |
|
|
|
var allNoTaxDollar = 0; |
|
|
|
var allTaxDollar = 0; |
|
|
|
materialSum = getData.length; |
|
|
|
|
|
|
|
enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0); |
|
|
|
for(var i=0;i<getData.length;i++){ |
|
|
|
noTaxRmb += parseFloat(getData[i].noTaxRmb) || 0; |
|
|
|
taxRmb += parseFloat(getData[i].taxRmb) || 0; |
|
|
|
allNoTaxRmb += parseFloat(getData[i].allNoTaxRmb) || 0; |
|
|
|
allTaxRmb += parseFloat(getData[i].allTaxRmb) || 0; |
|
|
|
noTaxDollar += parseFloat(getData[i].noTaxDollar) || 0; |
|
|
|
taxDollar += parseFloat(getData[i].taxDollar) || 0; |
|
|
|
allNoTaxDollar += parseFloat(getData[i].allNoTaxDollar) || 0; |
|
|
|
allTaxDollar += parseFloat(getData[i].allTaxDollar) || 0; |
|
|
|
} |
|
|
|
noTaxRmb = noTaxRmb.toFixed(2); |
|
|
|
taxRmb = taxRmb.toFixed(2); |
|
|
|
allNoTaxRmb = allNoTaxRmb.toFixed(2); |
|
|
|
allTaxRmb = allTaxRmb.toFixed(2); |
|
|
|
noTaxDollar = noTaxDollar.toFixed(2); |
|
|
|
taxDollar = taxDollar.toFixed(2); |
|
|
|
allNoTaxDollar = allNoTaxDollar.toFixed(2); |
|
|
|
allTaxDollar = allTaxDollar.toFixed(2); |
|
|
|
$("input[name='materialSum']").val(materialSum); |
|
|
|
$("input[name='enterpriseSum']").val(enterpriseSum); |
|
|
|
$("input[name='noTaxRmb']").val(noTaxRmb); |
|
|
|
$("input[name='taxRmb']").val(taxRmb); |
|
|
|
$("input[name='allNoTaxRmb']").val(allNoTaxRmb); |
|
|
|
$("input[name='allTaxRmb']").val(allTaxRmb); |
|
|
|
$("input[name='noTaxDollar']").val(noTaxDollar); |
|
|
|
$("input[name='taxDollar']").val(taxDollar); |
|
|
|
$("input[name='allNoTaxDollar']").val(allNoTaxDollar); |
|
|
|
$("input[name='allTaxDollar']").val(allTaxDollar); |
|
|
|
|
|
|
|
} |
|
|
|
// function getTotalAmount(){ |
|
|
|
// let getData = $('#bootstrap-table').bootstrapTable('getData'); |
|
|
|
// var materialSum = 0; |
|
|
|
// var enterpriseSum = 0; |
|
|
|
// var noTaxRmb = 0; |
|
|
|
// var taxRmb = 0; |
|
|
|
// var allNoTaxRmb = 0; |
|
|
|
// var allTaxRmb = 0; |
|
|
|
// var noTaxDollar = 0; |
|
|
|
// var taxDollar = 0; |
|
|
|
// var allNoTaxDollar = 0; |
|
|
|
// var allTaxDollar = 0; |
|
|
|
// materialSum = getData.length; |
|
|
|
// |
|
|
|
// enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0); |
|
|
|
// for(var i=0;i<getData.length;i++){ |
|
|
|
// noTaxRmb += parseFloat(getData[i].noTaxRmb) || 0; |
|
|
|
// taxRmb += parseFloat(getData[i].taxRmb) || 0; |
|
|
|
// allNoTaxRmb += parseFloat(getData[i].allNoTaxRmb) || 0; |
|
|
|
// allTaxRmb += parseFloat(getData[i].allTaxRmb) || 0; |
|
|
|
// noTaxDollar += parseFloat(getData[i].noTaxDollar) || 0; |
|
|
|
// taxDollar += parseFloat(getData[i].taxDollar) || 0; |
|
|
|
// allNoTaxDollar += parseFloat(getData[i].allNoTaxDollar) || 0; |
|
|
|
// allTaxDollar += parseFloat(getData[i].allTaxDollar) || 0; |
|
|
|
// } |
|
|
|
// noTaxRmb = noTaxRmb.toFixed(2); |
|
|
|
// taxRmb = taxRmb.toFixed(2); |
|
|
|
// allNoTaxRmb = allNoTaxRmb.toFixed(2); |
|
|
|
// allTaxRmb = allTaxRmb.toFixed(2); |
|
|
|
// noTaxDollar = noTaxDollar.toFixed(2); |
|
|
|
// taxDollar = taxDollar.toFixed(2); |
|
|
|
// allNoTaxDollar = allNoTaxDollar.toFixed(2); |
|
|
|
// allTaxDollar = allTaxDollar.toFixed(2); |
|
|
|
// $("input[name='materialSum']").val(materialSum); |
|
|
|
// $("input[name='enterpriseSum']").val(enterpriseSum); |
|
|
|
// $("input[name='noTaxRmb']").val(noTaxRmb); |
|
|
|
// $("input[name='taxRmb']").val(taxRmb); |
|
|
|
// $("input[name='allNoTaxRmb']").val(allNoTaxRmb); |
|
|
|
// $("input[name='allTaxRmb']").val(allTaxRmb); |
|
|
|
// $("input[name='noTaxDollar']").val(noTaxDollar); |
|
|
|
// $("input[name='taxDollar']").val(taxDollar); |
|
|
|
// $("input[name='allNoTaxDollar']").val(allNoTaxDollar); |
|
|
|
// $("input[name='allTaxDollar']").val(allTaxDollar); |
|
|
|
// |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|