|
@@ -82,7 +82,7 @@
|
|
|
<!-- 发票 -->
|
|
|
<van-field label="发票" readonly>
|
|
|
<template #input
|
|
|
- >总费用: ¥{{ totalCost | numtosum }}</template
|
|
|
+ >总费用: ¥{{ totalCost }}</template
|
|
|
>
|
|
|
</van-field>
|
|
|
<div class="invoice" v-if="invoiceList.length != 0">
|
|
@@ -142,7 +142,6 @@
|
|
|
label="费用金额(含税):"
|
|
|
v-model="item.amount"
|
|
|
type="number"
|
|
|
- @input="costCount"
|
|
|
:readonly="!canEdit"
|
|
|
required
|
|
|
></van-field>
|
|
@@ -284,7 +283,6 @@ export default {
|
|
|
createDateShow: false,
|
|
|
typeShow: false,
|
|
|
typeList: ['一般','差旅','外包'],
|
|
|
- totalCost: 0,
|
|
|
|
|
|
invoiceIndex: 0,
|
|
|
in_projectShow: false,
|
|
@@ -298,6 +296,15 @@ export default {
|
|
|
uploader: [[]],
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ totalCost(){
|
|
|
+ let costnum = 0
|
|
|
+ for(let i in this.invoiceList){
|
|
|
+ costnum += (this.invoiceList[i].amount ? parseFloat(this.invoiceList[i].amount) : 0)
|
|
|
+ }
|
|
|
+ return costnum.toFixed(2)
|
|
|
+ }
|
|
|
+ },
|
|
|
filters: {
|
|
|
numtosum(value) {
|
|
|
if (value == undefined || !value) return '0.00'
|
|
@@ -342,13 +349,13 @@ export default {
|
|
|
let amo = amount / (1 + per)*per
|
|
|
return amo.toFixed(2)
|
|
|
},
|
|
|
- costCount(){
|
|
|
- let costnum = 0
|
|
|
- for(let i in this.invoiceList){
|
|
|
- costnum += this.invoiceList[i].amount*1
|
|
|
- }
|
|
|
- this.totalCost = costnum
|
|
|
- },
|
|
|
+ // costCount(){
|
|
|
+ // let costnum = 0
|
|
|
+ // for(let i in this.invoiceList){
|
|
|
+ // costnum += this.invoiceList[i].amount*1
|
|
|
+ // }
|
|
|
+ // this.totalCost = costnum
|
|
|
+ // },
|
|
|
|
|
|
ownerIdChange(value,key){
|
|
|
this.editForm.ownerId = value.id
|