Commit 0a9de7bf authored by godwithdh's avatar godwithdh

算金额

parent 5d90df78
......@@ -115,7 +115,7 @@
<span class="iconfont icon-kehuguanli"/>
<div>
<span>客户欠款</span>
<span>{{(balance.filter(v=>v.sName.indexOf("客户欠款")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span>{{computAmount("客户欠款")}}</span>
<span></span>
</div>
</div>
......@@ -123,7 +123,7 @@
<span class="iconfont icon-pengyou"/>
<div>
<span>供应商欠款</span>
<span>{{(balance.filter(v=>v.sName.indexOf("供应商欠款")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span>{{computAmount("供应商欠款")}}</span>
<span></span>
</div>
</div>
......@@ -131,7 +131,7 @@
<span class="iconfont icon-cardCode"/>
<div>
<span>银行余额</span>
<span>{{(balance.filter(v=>v.sName.indexOf("银行余额")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span>{{computAmount("银行余额")}}</span>
<span></span>
</div>
</div>
......@@ -139,7 +139,7 @@
<span class="iconfont icon-yingfu"/>
<div>
<span>现金余额</span>
<span>{{(balance.filter(v=>v.sName.indexOf("现金余额")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span>{{computAmount("现金余额")}}</span>
<span></span>
</div>
</div>
......@@ -251,13 +251,13 @@ export default {
more(val,tabIndex){
this.$router.push({name:"financeDetail",params:{mode:val,tabIndex:tabIndex,start:this.start,end:this.end}})
},
computAmount(name){
return (this.balance.filter(v=>v.sName.indexOf(name)>=0)[0]||{nAmount:0}).nAmount
},
},
computed:{
balanceAmount(){
var amount=0
this.balance.forEach(v=>{
amount+=v.nAmount
})
var amount=(this.computAmount("现金余额") + this.computAmount("银行余额") + this.computAmount("客户欠款")) - this.computAmount("供应商欠款")
return amount.toLocaleString();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment