1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<template>
<div>
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>项目经费 <strong>(单位:万元)</strong></span>
</div>
</a-col>
</a-row>
<a-row>
<a-col :span="6" class="bg-gray">
预算科目
</a-col>
<a-col :span="3" class="bg-gray">
总预算数
</a-col>
<a-col :span="5" class="bg-gray">
省级财政资金
</a-col>
<a-col :span="5" class="bg-gray">
自筹资金
</a-col>
<a-col :span="5" class="bg-gray">
备注
</a-col>
</a-row>
<div v-for="(item, index) in budget" :key="'budget' + index" class="row_center">
<a-row v-if="item.type ==='count'" type="flex">
<a-col :span="6" :style="'text-align: left;padding-left:'+left(item.level)+'px'">
<div class="special-middle">
{{item.budgetName}}
</div>
</a-col>
<a-col :span="3">
<div class="special-middle">
{{Count(item.source,'totalBudget',index)}}
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<span v-if="!!!item.code||item.code === 'applyFunds'">{{Count(item.source,'applyFunds',index)}}</span>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
{{Count(item.source,'selfFunds',index)}}
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<a-input v-model="item.calculationBasis" :maxLength="100" style="width: 80%;" />
</div>
</a-col>
</a-row>
<a-row v-else type="flex">
<a-col :span="6" :style="'text-align: left;padding-left:'+left(item.level)+'px'">
<div class="special-middle">
{{item.budgetName}}
</div>
</a-col>
<a-col :span="3">
<div class="special-middle">
{{Count1(index, item.applyFunds, item.selfFunds)}}
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<a-input-number v-model="item.applyFunds" :min="0" :step="0.01" style="width: 80%" v-if="!!!item.code||item.code === 'applyFunds'" />
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<a-input-number v-model="item.selfFunds" :min="0" :step="0.01" style="width: 80%" v-if="!!!item.code||item.code === 'selfFunds'" />
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<a-input v-model="item.calculationBasis" :maxLength="100" style="width: 80%;" />
</div>
</a-col>
</a-row>
</div>
</div>
</template>
<script>
import { budgetList } from "@/views/report/project/config"
export default {
name: "fundEdit",
data () {
return {
};
},
props: {
budget: {
type: Array,
default: () => {
return []
}
},
},
created () {
},
methods: {
Count (source, type, index) {
if (!source || !source.length) {
return 0.00
}
let applyFunds = 0.00
let selfFunds = 0.00
source.forEach(i => {
applyFunds = parseFloat(applyFunds + this.budget[i].applyFunds)
selfFunds = parseFloat(selfFunds + this.budget[i].selfFunds)
})
if (type === 'applyFunds') {
this.budget[index].applyFunds = applyFunds.toFixed(2)
return applyFunds.toFixed(2)
} else if (type === 'selfFunds') {
this.budget[index].selfFunds = selfFunds.toFixed(2)
return selfFunds.toFixed(2)
} else {
this.budget[index].totalBudget = (applyFunds + selfFunds).toFixed(2)
return parseFloat(applyFunds + selfFunds).toFixed(2)
}
},
Count1 (index, applyFunds, selfFunds) {
let apply = 0.00
let self = 0.00
if (!!applyFunds)
apply = applyFunds
if (!!selfFunds)
self = selfFunds
this.budget[index].totalBudget = (apply + self).toFixed(2)
return (apply + self).toFixed(2)
},
left (l) {
switch (l) {
case '1':
return 4;
case '2':
return 12;
case '3':
return 20;
case '4':
return 30;
}
return 0;
}
},
};
</script>