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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<template>
<div>
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>经费预算 <strong>(单位:万元)</strong></span>
</div>
</a-col>
</a-row>
<a-row type="flex" class="row_center">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div>概算科目名称</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">合计</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div>申请专项经费</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div>自筹经费</div>
</div>
</a-col>
<a-col :span="8" class="bg-gray">
<div class="special-middle">
<div>备注</div>
</div>
</a-col>
</a-row>
<a-row v-for="(item, index) in budget" :key="index" type="flex" class="row_center">
<a-col :span="4" style="text-align: left;">
{{item.budgetName}}
</a-col>
<a-col :span="4">
<a-form-model-item v-if="invisibleTotalBudget.includes(index)" :prop="'budget.' + index + '.totalBudget'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.totalBudget" @change="totalNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.totalBudget).toFixed(2)}}</div>
</a-col>
<a-col :span="4">
<a-form-model-item v-if="!invisibleApplyFunds.includes(index)" :prop="'budget.' + index + '.applyFunds'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.applyFunds" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.applyFunds).toFixed(2)}}</div>
</a-col>
<a-col :span="4">
<a-form-model-item v-if="!invisibleSelfFunds.includes(index)" :prop="'budget.' + index + '.selfFunds'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.selfFunds" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.selfFunds).toFixed(2)}}</div>
</a-col>
<a-col :span="8">
<a-form-model-item :prop="'budget.' + index + '.calculationBasis'">
<a-input v-model="item.calculationBasis" :maxLength="100" style="width: 90%;" />
</a-form-model-item>
</a-col>
</a-row>
</div>
</template>
<script>
// 用法 <budget-edit :budget.sync="formData.budget" />
const Budget = { id: null, budgetName: null, budgetId: null, objectId: null, totalBudget: null, applyFunds: null, selfFunds: null, calculationBasis: null }
export default {
name: "BudgetEidt",
props: {
budget: {
type: Array,
default: () => {
return [{ ...Budget }];
},
},
},
created() {
},
data() {
return {
invisibleTotalBudget: [ 16, 18, 19, 20 ],
invisibleApplyFunds: [ 0, 1, 10, 15, 16, 17, 18, 19, 20 ],
invisibleSelfFunds: [ 0, 1, 10, 15, 16, 17, 18, 19, 20 ],
//一、经费支出
TotalExpenditure: 0,
ApplyExpenditure: 0,
SelfExpenditure: 0,
//(一)经费支出
expenditureTotal: 0,
expenditureApply: 0,
expenditureSelf: 0,
//(二)间接经费
indirectfundTotal: 0,
indirectfundApply: 0,
indirectfundSelf: 0,
//二、经费来源
TotalSource: 0,
//(一)申请专项经费
applySpecialTotal: 0,
//(二)自筹经费来源
selfFundsTotal: 0,
selfFundsApply: 0,
selfFundsSelf: 0,
};
},
methods: {
outNumberChange (index) {
this.budget[index].totalBudget = (parseFloat(this.budget[index].applyFunds) + parseFloat(this.budget[index].selfFunds)).toFixed(2);
this.expenditureCal();
this.indirectfundCal();
this.selfFundsCal();
this.budget[0].totalBudget = (parseFloat(this.expenditureTotal) + parseFloat(this.indirectfundTotal)).toFixed(2);
this.budget[0].applyFunds = (parseFloat(this.expenditureApply) + parseFloat(this.indirectfundApply)).toFixed(2);
this.budget[0].selfFunds = (parseFloat(this.expenditureSelf) + parseFloat(this.indirectfundSelf)).toFixed(2);
this.TotalExpenditure = this.budget[0].totalBudget;
this.ApplyExpenditure = this.budget[0].applyFunds;
this.SelfExpenditure = this.budget[0].selfFunds;
},
//一、经费支出 begin
//(一)经费支出 begin
expenditureCal() {
this.expenditureApplyCal();
this.expenditureSelfCal();
this.expenditureTotalCal();
},
expenditureApplyCal() {
this.budget[1].applyFunds = (parseFloat(this.budget[2].applyFunds) + parseFloat(this.budget[3].applyFunds) + parseFloat(this.budget[4].applyFunds)
+ parseFloat(this.budget[5].applyFunds) + parseFloat(this.budget[6].applyFunds) + parseFloat(this.budget[7].applyFunds)
+ parseFloat(this.budget[8].applyFunds) + parseFloat(this.budget[9].applyFunds)).toFixed(2);
this.expenditureApply = this.budget[1].applyFunds;
},
expenditureSelfCal() {
this.budget[1].selfFunds = (parseFloat(this.budget[2].selfFunds) + parseFloat(this.budget[3].selfFunds) + parseFloat(this.budget[4].selfFunds)
+ parseFloat(this.budget[5].selfFunds) + parseFloat(this.budget[6].selfFunds) + parseFloat(this.budget[7].selfFunds)
+ parseFloat(this.budget[8].selfFunds) + parseFloat(this.budget[9].selfFunds)).toFixed(2);
this.expenditureSelf = this.budget[1].selfFunds;
},
expenditureTotalCal() {
this.budget[1].totalBudget = (parseFloat(this.budget[2].totalBudget) + parseFloat(this.budget[3].totalBudget) + parseFloat(this.budget[4].totalBudget)
+ parseFloat(this.budget[5].totalBudget) + parseFloat(this.budget[6].totalBudget) + parseFloat(this.budget[7].totalBudget)
+ parseFloat(this.budget[8].totalBudget) + parseFloat(this.budget[9].totalBudget)).toFixed(2);
this.expenditureTotal = this.budget[1].totalBudget;
},
//(一)经费支出 end
//(二)间接经费 begin
indirectfundCal() {
this.indirectfundApplyCal();
this.indirectfundSelfCal();
this.indirectfundTotalCal();
},
indirectfundApplyCal() {
this.budget[10].applyFunds = (parseFloat(this.budget[11].applyFunds) + parseFloat(this.budget[12].applyFunds) + parseFloat(this.budget[13].applyFunds)
+ parseFloat(this.budget[14].applyFunds)).toFixed(2);
this.indirectfundApply = this.budget[10].applyFunds;
},
indirectfundSelfCal() {
this.budget[10].selfFunds = (parseFloat(this.budget[11].selfFunds) + parseFloat(this.budget[12].selfFunds) + parseFloat(this.budget[13].selfFunds)
+ parseFloat(this.budget[14].selfFunds)).toFixed(2);
this.indirectfundSelf = this.budget[10].selfFunds;
},
indirectfundTotalCal() {
this.budget[10].totalBudget = (parseFloat(this.budget[11].totalBudget) + parseFloat(this.budget[12].totalBudget) + parseFloat(this.budget[13].totalBudget)
+ parseFloat(this.budget[14].totalBudget)).toFixed(2);
this.indirectfundTotal = this.budget[10].totalBudget;
},
//(二)间接经费 end
//一、经费支出 end
//二、经费来源 begin
//(一)申请专项经费 begin
//(一)申请专项经费 end
//(二)自筹经费来源 begin
selfFundsCal() {
this.selfFundsApplyCal();
this.selfFundsSelfCal();
this.selfFundsTotalCal();
},
selfFundsApplyCal() {
this.budget[17].applyFunds = (parseFloat(this.budget[18].applyFunds) + parseFloat(this.budget[19].applyFunds) + parseFloat(this.budget[20].applyFunds)).toFixed(2);
this.selfFundsApply = this.budget[17].applyFunds;
},
selfFundsSelfCal() {
this.budget[17].selfFunds = (parseFloat(this.budget[18].selfFunds) + parseFloat(this.budget[19].selfFunds) + parseFloat(this.budget[20].selfFunds)).toFixed(2);
this.selfFundsSelf = this.budget[17].selfFunds;
},
selfFundsTotalCal() {
this.budget[17].totalBudget = (parseFloat(this.budget[18].totalBudget) + parseFloat(this.budget[19].totalBudget) + parseFloat(this.budget[20].totalBudget)).toFixed(2);
this.selfFundsTotal = this.budget[17].totalBudget;
},
//(二)自筹经费来源 end
//二、经费来源 end
totalNumberChange() {
//(一)申请专项经费
this.applySpecialTotal = this.budget[16].totalBudget;
//(二)自筹经费来源
this.selfFundsCal();
this.budget[15].totalBudget = (parseFloat(this.selfFundsTotal) + parseFloat(this.applySpecialTotal)).toFixed(2);
this.TotalSource = this.budget[15].totalBudget;
},
},
computed: {
},
};
</script>