f0032091
wuxw
完成费用项页面
|
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
|
<div class="el-form-item__tip">{{ $t('addPayFeeConfigDiscount.discountEndTimeTip') }}</div>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="savePayFeeConfigDiscount" :loading="loading">
{{ $t('common.save') }}
</el-button>
</div>
</el-dialog>
</template>
<script>
import { savePayFeeConfigDiscount, getFeeDiscountList } from '@/api/fee/payFeeConfigDiscountManageApi'
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'AddPayFeeConfigDiscount',
data() {
return {
visible: false,
loading: false,
form: {
configDiscountId: '',
discountId: '',
configId: '',
discountType: '',
startTime: '',
endTime: '',
payMaxEndTime: '',
communityId: ''
},
discounts: [],
rules: {
discountType: [
{ required: true, message: this.$t('addPayFeeConfigDiscount.discountTypeRequired'), trigger: 'change' }
],
discountId: [
{ required: true, message: this.$t('addPayFeeConfigDiscount.discountNameRequired'), trigger: 'change' }
],
startTime: [
{ required: true, message: this.$t('addPayFeeConfigDiscount.startTimeRequired'), trigger: 'change' }
],
endTime: [
{ required: true, message: this.$t('addPayFeeConfigDiscount.endTimeRequired'), trigger: 'change' }
]
}
}
},
methods: {
open(configId) {
this.form.configId = configId
this.form.communityId = getCommunityId()
this.visible = true
},
resetForm() {
this.$refs.form.resetFields()
this.form = {
configDiscountId: '',
discountId: '',
configId: this.form.configId,
discountType: '',
startTime: '',
endTime: '',
payMaxEndTime: '',
communityId: this.form.communityId
}
this.discounts = []
},
async changeDiscountType() {
if (!this.form.discountType) return
|
f0032091
wuxw
完成费用项页面
|
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
try {
const params = {
page: 1,
row: 100,
communityId: this.form.communityId,
discountType: this.form.discountType
}
const response = await getFeeDiscountList(params)
this.discounts = response.data
} catch (error) {
this.$message.error(this.$t('addPayFeeConfigDiscount.fetchDiscountsError'))
}
},
async savePayFeeConfigDiscount() {
this.$refs.form.validate(async valid => {
if (!valid) return
|