统计小数

master
xy 2 years ago
parent 4cccb2b415
commit 35ceb8fc3d

@ -74,7 +74,7 @@ export default {
if (b == 0) { if (b == 0) {
return 0 return 0
} }
return (parseInt(a) / parseInt(b) * 100).toFixed(2) return (Number(a) / Number(b) * 100).toFixed(2)
}, },
async getList() { async getList() {
@ -127,8 +127,8 @@ export default {
<div style="display: flex;flex-direction: column;"> <div style="display: flex;flex-direction: column;">
<p class="split split__department" style="text-align: right;padding-right: 5px;">{ <p class="split split__department" style="text-align: right;padding-right: 5px;">{
row.plan?.reduce((a, b) => { row.plan?.reduce((a, b) => {
return parseInt(a) + parseInt(b.money) return Number(a) + Number(b.money)
},0) },0).toFixed(2)
}</p> }</p>
{ {
row.plan?.map((i,index) => { row.plan?.map((i,index) => {
@ -166,8 +166,8 @@ export default {
<div style="display: flex;flex-direction: column;"> <div style="display: flex;flex-direction: column;">
<p class="split split__department" style="text-align: right;padding-right: 5px;">{ <p class="split split__department" style="text-align: right;padding-right: 5px;">{
row.plan?.reduce((a, b) => { row.plan?.reduce((a, b) => {
return parseInt(a) + parseInt(b.detail[z].plan_total) return Number(a) + Number(b.detail[z].plan_total)
},0) },0).toFixed(2)
}</p> }</p>
{ {
row.plan?.map((i,index) => { row.plan?.map((i,index) => {
@ -189,8 +189,8 @@ export default {
<div style="display: flex;flex-direction: column;"> <div style="display: flex;flex-direction: column;">
<p class="split split__department" style="text-align: right;padding-right: 5px;">{ <p class="split split__department" style="text-align: right;padding-right: 5px;">{
row.plan?.reduce((a, b) => { row.plan?.reduce((a, b) => {
return parseInt(a) + parseInt(b.detail[z].act_total) return Number(a) + Number(b.detail[z].act_total)
},0) },0).toFixed(2)
}</p> }</p>
{ {
row.plan?.map((i,index) => { row.plan?.map((i,index) => {
@ -212,9 +212,9 @@ export default {
<div style="display: flex;flex-direction: column;"> <div style="display: flex;flex-direction: column;">
<p class="split split__department" style="text-align: right;padding-right: 5px;">{ <p class="split split__department" style="text-align: right;padding-right: 5px;">{
this.percent(row.plan?.reduce((a, b) => { this.percent(row.plan?.reduce((a, b) => {
return parseInt(a) + parseInt(b.detail[z].act_total) return Number(a) + Number(b.detail[z].act_total)
},0),row.plan?.reduce((a, b) => { },0),row.plan?.reduce((a, b) => {
return parseInt(a) + parseInt(b.detail[z].plan_total) return Number(a) + Number(b.detail[z].plan_total)
},0)) },0))
}%</p> }%</p>
{ {
@ -247,8 +247,8 @@ export default {
return ( return (
<p class="split" style={{"text-align": "right","background":index%2===0?'#ff000012':''}}>{ <p class="split" style={{"text-align": "right","background":index%2===0?'#ff000012':''}}>{
i.detail?.reduce((a,b) => { i.detail?.reduce((a,b) => {
return a + parseInt(b.plan_total) return a + Number(b.plan_total)
},0) },0).toFixed(2)
}</p> }</p>
) )
}) })

Loading…
Cancel
Save