2e0fd29c
wuxw
开发报修
|
1
|
<template>
|
5f798b88
wuxw
费用功能继续完善
|
2
|
<el-dialog :title="$t('editFee.title')" :visible.sync="visible" width="40%" :before-close="handleClose">
|
2e0fd29c
wuxw
开发报修
|
3
|
<el-form :model="editFeeInfo" label-width="120px">
|
24d3590f
wuxw
房屋收费页面开发完成
|
4
|
<el-form-item :label="$t('editFee.startTime')" prop="startTime">
|
5f798b88
wuxw
费用功能继续完善
|
5
6
7
|
<el-date-picker v-model="editFeeInfo.startTime" type="datetime"
:placeholder="$t('editFee.startTimePlaceholder')" value-format="yyyy-MM-dd HH:mm:ss"
@change="validateStartTime"></el-date-picker>
|
2e0fd29c
wuxw
开发报修
|
8
|
</el-form-item>
|
24d3590f
wuxw
房屋收费页面开发完成
|
9
|
<el-form-item :label="$t('editFee.endTime')" prop="endTime">
|
5f798b88
wuxw
费用功能继续完善
|
10
11
|
<el-date-picker v-model="editFeeInfo.endTime" type="date" :placeholder="$t('editFee.endTimePlaceholder')"
value-format="yyyy-MM-dd" @change="validateEndTime"></el-date-picker>
|
2e0fd29c
wuxw
开发报修
|
12
|
</el-form-item>
|
24d3590f
wuxw
房屋收费页面开发完成
|
13
|
<el-form-item :label="$t('editFee.maxEndTime')" prop="maxEndTime">
|
5f798b88
wuxw
费用功能继续完善
|
14
15
|
<el-date-picker v-model="editFeeInfo.maxEndTime" type="date" :placeholder="$t('editFee.maxEndTimePlaceholder')"
value-format="yyyy-MM-dd" @change="validateMaxEndTime"></el-date-picker>
|
2e0fd29c
wuxw
开发报修
|
16
|
</el-form-item>
|
24d3590f
wuxw
房屋收费页面开发完成
|
17
18
|
<template v-if="editFeeInfo.computingFormula === '1102'">
<el-form-item :label="$t('editFee.rateCycle')" prop="rateCycle">
|
5f798b88
wuxw
费用功能继续完善
|
19
|
<el-input v-model="editFeeInfo.rateCycle" :placeholder="$t('editFee.rateCyclePlaceholder')"></el-input>
|
2e0fd29c
wuxw
开发报修
|
20
|
</el-form-item>
|
24d3590f
wuxw
房屋收费页面开发完成
|
21
|
<el-form-item :label="$t('editFee.rate')" prop="rate">
|
5f798b88
wuxw
费用功能继续完善
|
22
|
<el-input v-model="editFeeInfo.rate" :placeholder="$t('editFee.ratePlaceholder')"></el-input>
|
2e0fd29c
wuxw
开发报修
|
23
|
</el-form-item>
|
24d3590f
wuxw
房屋收费页面开发完成
|
24
|
<el-form-item :label="$t('editFee.rateStartTime')" prop="rateStartTime">
|
5f798b88
wuxw
费用功能继续完善
|
25
26
27
|
<el-date-picker v-model="editFeeInfo.rateStartTime" type="date"
:placeholder="$t('editFee.rateStartTimePlaceholder')" value-format="yyyy-MM-dd"
@change="validateRateStartTime"></el-date-picker>
|
2e0fd29c
wuxw
开发报修
|
28
29
30
31
|
</el-form-item>
</template>
</el-form>
<span slot="footer" class="dialog-footer">
|
24d3590f
wuxw
房屋收费页面开发完成
|
32
|
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
2e0fd29c
wuxw
开发报修
|
33
34
35
36
37
38
|
<el-button type="primary" @click="_doEidtFee">{{ $t('common.submit') }}</el-button>
</span>
</el-dialog>
</template>
<script>
|
24d3590f
wuxw
房屋收费页面开发完成
|
39
40
|
import { updateFee } from '@/api/fee/editFeeApi'
import { getCommunityId } from '@/api/community/communityApi'
|
2e0fd29c
wuxw
开发报修
|
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
export default {
name: 'EditFee',
data() {
return {
visible: false,
editFeeInfo: {
feeId: '',
startTime: '',
endTime: '',
feeFlag: '',
maxEndTime: '',
computingFormula: '',
rateCycle: '',
rate: '',
rateStartTime: ''
}
}
},
methods: {
open(fee) {
|
24d3590f
wuxw
房屋收费页面开发完成
|
62
63
64
65
66
67
68
69
70
71
72
|
this.editFeeInfo = {
feeId: fee.feeId,
startTime: fee.startTime.indexOf(":") === -1 ? fee.startTime + " 00:00:00" : fee.startTime,
endTime: fee.endTime.split(' ')[0],
feeFlag: fee.feeFlag,
maxEndTime: fee.maxEndTime,
computingFormula: fee.computingFormula,
rateCycle: fee.rateCycle,
rate: fee.rate,
rateStartTime: fee.rateStartTime
}
|
2e0fd29c
wuxw
开发报修
|
73
74
|
this.visible = true
},
|
24d3590f
wuxw
房屋收费页面开发完成
|
75
|
handleClose() {
|
2e0fd29c
wuxw
开发报修
|
76
|
this.visible = false
|
24d3590f
wuxw
房屋收费页面开发完成
|
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
|
this.clearAddFeeConfigInfo()
},
validateStartTime(value) {
const start = new Date(value)
const end = new Date(this.editFeeInfo.endTime)
if (start >= end) {
this.$message.error(this.$t('editFee.startTimeError'))
this.editFeeInfo.startTime = ''
}
},
validateEndTime(value) {
const start = new Date(this.editFeeInfo.startTime)
const end = new Date(value)
if (start >= end) {
this.$message.error(this.$t('editFee.endTimeError'))
this.editFeeInfo.endTime = ''
}
},
validateMaxEndTime(value) {
const start = new Date(this.editFeeInfo.startTime)
const end = new Date(value)
if (start >= end) {
this.$message.error(this.$t('editFee.maxEndTimeError'))
this.editFeeInfo.maxEndTime = ''
}
},
validateRateStartTime(value) {
const start = new Date(this.editFeeInfo.startTime)
const end = new Date(value)
if (start >= end) {
this.$message.error(this.$t('editFee.rateStartTimeError'))
this.editFeeInfo.rateStartTime = ''
}
},
editFeeValidate() {
if (!this.editFeeInfo.startTime) {
this.$message.error(this.$t('editFee.startTimeRequired'))
return false
}
if (!this.editFeeInfo.endTime) {
this.$message.error(this.$t('editFee.endTimeRequired'))
return false
}
return true
|
2e0fd29c
wuxw
开发报修
|
121
|
},
|
24d3590f
wuxw
房屋收费页面开发完成
|
122
123
|
async _doEidtFee() {
if (!this.editFeeValidate()) return
|
5f798b88
wuxw
费用功能继续完善
|
124
|
|
24d3590f
wuxw
房屋收费页面开发完成
|
125
|
this.editFeeInfo.communityId = getCommunityId()
|
5f798b88
wuxw
费用功能继续完善
|
126
|
|
24d3590f
wuxw
房屋收费页面开发完成
|
127
128
129
130
|
try {
const res = await updateFee(this.editFeeInfo)
if (res.code === 0) {
this.$message.success(this.$t('common.operateSuccess'))
|
2e0fd29c
wuxw
开发报修
|
131
|
this.$emit('success')
|
24d3590f
wuxw
房屋收费页面开发完成
|
132
|
this.handleClose()
|
2e0fd29c
wuxw
开发报修
|
133
|
} else {
|
24d3590f
wuxw
房屋收费页面开发完成
|
134
|
this.$message.error(res.msg)
|
2e0fd29c
wuxw
开发报修
|
135
|
}
|
24d3590f
wuxw
房屋收费页面开发完成
|
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
} catch (error) {
console.error('请求失败:', error)
this.$message.error(this.$t('common.operateFail'))
}
},
clearAddFeeConfigInfo() {
this.editFeeInfo = {
feeId: '',
startTime: '',
endTime: '',
feeFlag: '',
maxEndTime: '',
computingFormula: '',
rateCycle: '',
rate: '',
rateStartTime: ''
}
|
2e0fd29c
wuxw
开发报修
|
153
154
155
|
}
}
}
|
5f798b88
wuxw
费用功能继续完善
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
</script>
<style scoped>
.el-form-item{
width: 90%;
text-align: left;
}
.el-select{
width: 100%;
}
.el-date-editor{
width: 100%;
}
</style>
|