Commit 0a9de7bf authored by godwithdh's avatar godwithdh

算金额

parent 5d90df78
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<span class="iconfont icon-kehuguanli"/> <span class="iconfont icon-kehuguanli"/>
<div> <div>
<span>客户欠款</span> <span>客户欠款</span>
<span>{{(balance.filter(v=>v.sName.indexOf("客户欠款")>=0)||[{nAmount:0}])[0].nAmount}}</span> <span>{{computAmount("客户欠款")}}</span>
<span></span> <span></span>
</div> </div>
</div> </div>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<span class="iconfont icon-pengyou"/> <span class="iconfont icon-pengyou"/>
<div> <div>
<span>供应商欠款</span> <span>供应商欠款</span>
<span>{{(balance.filter(v=>v.sName.indexOf("供应商欠款")>=0)||[{nAmount:0}])[0].nAmount}}</span> <span>{{computAmount("供应商欠款")}}</span>
<span></span> <span></span>
</div> </div>
</div> </div>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<span class="iconfont icon-cardCode"/> <span class="iconfont icon-cardCode"/>
<div> <div>
<span>银行余额</span> <span>银行余额</span>
<span>{{(balance.filter(v=>v.sName.indexOf("银行余额")>=0)||[{nAmount:0}])[0].nAmount}}</span> <span>{{computAmount("银行余额")}}</span>
<span></span> <span></span>
</div> </div>
</div> </div>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<span class="iconfont icon-yingfu"/> <span class="iconfont icon-yingfu"/>
<div> <div>
<span>现金余额</span> <span>现金余额</span>
<span>{{(balance.filter(v=>v.sName.indexOf("现金余额")>=0)||[{nAmount:0}])[0].nAmount}}</span> <span>{{computAmount("现金余额")}}</span>
<span></span> <span></span>
</div> </div>
</div> </div>
...@@ -251,13 +251,13 @@ export default { ...@@ -251,13 +251,13 @@ export default {
more(val,tabIndex){ more(val,tabIndex){
this.$router.push({name:"financeDetail",params:{mode:val,tabIndex:tabIndex,start:this.start,end:this.end}}) 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:{ computed:{
balanceAmount(){ balanceAmount(){
var amount=0 var amount=(this.computAmount("现金余额") + this.computAmount("银行余额") + this.computAmount("客户欠款")) - this.computAmount("供应商欠款")
this.balance.forEach(v=>{
amount+=v.nAmount
})
return amount.toLocaleString(); 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