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
<template>
<div>
<a-row type="flex" class="row_center">
<a-col :span="6" class="bg-gray">
<div class="special-middle" style="text-align: right;">
<div>三、分年度用款计划</div>
</div>
</a-col>
<a-col :span="18" class="bg-gray">
<div class="special-middle">
<div></div>
</div>
</a-col>
</a-row>
<a-row type="flex" class="row_center">
<a-col :span="6" class="bg-gray">
<div class="special-middle" style="text-align: right;">
<div>年度</div>
</div>
</a-col>
<a-col :span="5" class="bg-gray">
<div class="special-middle">
<div>第一年</div>
</div>
</a-col>
<a-col :span="5" class="bg-gray">
<div class="special-middle">
<div>第二年</div>
</div>
</a-col>
<a-col :span="5" class="bg-gray">
<div class="special-middle">
<div>第三年</div>
</div>
</a-col>
<!-- <a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>第四年</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>第五年</div>
</div>
</a-col> -->
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>合计</div>
</div>
</a-col>
</a-row>
<a-row v-for="(item, index) in fundPlan" :key="index" type="flex" class="row_center">
<a-col :span="6" style="text-align: right;">
<div class="special-middle">{{ item.fundName }}</div>
</a-col>
<a-col :span="5">
<a-form-model-item v-if="!invisibleYearValue1.includes(index)" :prop="'fundPlan.' + index + '.yearValue1'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.yearValue1" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.yearValue1).toFixed(2)}}</div>
</a-col>
<a-col :span="5">
<a-form-model-item v-if="!invisibleYearValue2.includes(index)" :prop="'fundPlan.' + index + '.yearValue2'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.yearValue2" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.yearValue2).toFixed(2)}}</div>
</a-col>
<a-col :span="5">
<a-form-model-item v-if="!invisibleYearValue3.includes(index)" :prop="'fundPlan.' + index + '.yearValue3'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.yearValue3" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.yearValue3).toFixed(2)}}</div>
</a-col>
<!-- <a-col :span="3">
<a-form-model-item v-if="!invisibleYearValue4.includes(index)" :prop="'fundPlan.' + index + '.yearValue4'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.yearValue4" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.yearValue4).toFixed(2)}}</div>
</a-col>
<a-col :span="3">
<a-form-model-item v-if="!invisibleYearValue5.includes(index)" :prop="'fundPlan.' + index + '.yearValue5'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.yearValue5" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.yearValue5).toFixed(2)}}</div>
</a-col> -->
<a-col :span="3">
<a-form-model-item v-if="!invisibleTotalAmount.includes(index)" :prop="'fundPlan.' + index + '.totalAmount'" :rules="{required: true, message: '*', trigger: 'blur',}">
<a-input-number v-model="item.totalAmount" @change="outNumberChange(index)" :min="0" :step="0.01" style="width: 80%" />
</a-form-model-item>
<div class="special-middle" v-else>{{parseFloat(item.totalAmount).toFixed(2)}}</div>
</a-col>
</a-row>
</div>
</template>
<script>
export default {
name: "FundPlanEdit",
data () {
return {
invisibleYearValue1: [0],
invisibleYearValue2: [0],
invisibleYearValue3: [0],
invisibleYearValue4: [0],
invisibleYearValue5: [0],
invisibleTotalAmount: [0, 1, 2],
};
},
props: {
fundPlan: {
type: Array,
default: () => {
return [];
},
},
},
created () { },
methods: {
calYearValue () {
this.fundPlan[0].yearValue1 = this.fundPlan[1].yearValue1 + this.fundPlan[2].yearValue1
this.fundPlan[0].yearValue2 = this.fundPlan[1].yearValue2 + this.fundPlan[2].yearValue2
this.fundPlan[0].yearValue3 = this.fundPlan[1].yearValue3 + this.fundPlan[2].yearValue3
this.fundPlan[0].yearValue4 = this.fundPlan[1].yearValue4 + this.fundPlan[2].yearValue4
this.fundPlan[0].yearValue5 = this.fundPlan[1].yearValue5 + this.fundPlan[2].yearValue5
},
outNumberChange (index) {
this.fundPlan[index].totalAmount = this.fundPlan[index].yearValue1 + this.fundPlan[index].yearValue2 + this.fundPlan[index].yearValue3 + this.fundPlan[index].yearValue4 + this.fundPlan[index].yearValue5
this.calYearValue()
this.fundPlan[0].totalAmount = this.fundPlan[0].yearValue1 + this.fundPlan[0].yearValue2 + this.fundPlan[0].yearValue3 + this.fundPlan[0].yearValue4 + this.fundPlan[0].yearValue5
this.$emit('save', [this.fundPlan[0].totalAmount, this.fundPlan[1].totalAmount, this.fundPlan[2].totalAmount])
},
},
};
</script>