1f3f7892
wuxw
开发完成admin 系统小区公众号
|
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
|
</el-form-item>
<el-form-item :label="$t('communityPayment.paymentScope')" prop="payType">
<el-select v-model="form.payType" :placeholder="$t('addCommunityPayment.scopePlaceholder')" style="width: 100%"
@change="handleScopeChange">
<el-option :label="$t('communityPayment.communityFee')" value="1001" />
<el-option :label="$t('communityPayment.tempParkingFee')" value="2002" />
<el-option :label="$t('communityPayment.specificFee')" value="3003" />
</el-select>
</el-form-item>
<el-form-item v-if="form.payType === '3003'" :label="$t('communityPayment.selectFeeItem')">
<el-checkbox-group v-model="form.configIds">
<el-checkbox v-for="fee in feeConfigs" :key="fee.configId" :label="fee.configId">
{{ fee.feeName }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item :label="$t('communityPayment.instruction')">
<el-input v-model="form.remark" type="textarea" :rows="3"
:placeholder="$t('addCommunityPayment.remarkPlaceholder')" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="visible = false">{{ $t('communityPayment.cancel') }}</el-button>
<el-button type="primary" @click="submitForm">{{ $t('communityPayment.save') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { saveAdminPaymentPool, listPaymentKey, listPaymentAdapt, queryAdminFeeConfigs } from '@/api/fee/communityPaymentApi'
|
1f3f7892
wuxw
开发完成admin 系统小区公众号
|
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
|
data() {
return {
visible: false,
form: {
communityId: '',
paymentName: '',
paymentType: '',
certPath: '',
state: 'Y',
remark: '',
payType: '1001',
configIds: []
},
paymentTypes: [],
paymentKeys: [],
feeConfigs: [],
rules: {
paymentName: [
{ required: true, message: this.$t('communityPayment.requiredField'), trigger: 'blur' },
{ max: 64, message: this.$t('communityPayment.maxLength64'), trigger: 'blur' }
],
paymentType: [
{ required: true, message: this.$t('communityPayment.requiredField'), trigger: 'change' }
],
payType: [
{ required: true, message: this.$t('communityPayment.requiredField'), trigger: 'change' }
]
}
}
},
created() {
this.loadPaymentTypes()
},
methods: {
open(params) {
this.form.communityId = params.communityId
this.visible = true
this.$nextTick(() => {
this.$refs.form && this.$refs.form.clearValidate()
this.loadFeeConfigs()
})
},
resetForm() {
this.form = {
communityId: this.form.communityId,
paymentName: '',
paymentType: '',
certPath: '',
state: 'Y',
remark: '',
payType: '1001',
configIds: []
}
this.paymentKeys = []
if (this.$refs.uploader) {
this.$refs.uploader.clearFile()
}
},
async loadPaymentTypes() {
try {
const res = await listPaymentAdapt({ page: 1, row: 100 })
this.paymentTypes = res.data || []
} catch (error) {
console.error('Failed to load payment types:', error)
}
},
async handleVendorChange() {
try {
const res = await listPaymentKey({
paymentType: this.form.paymentType,
page: 1,
row: 100
})
this.paymentKeys = (res.data || []).map(item => ({
...item,
columnValue: ''
}))
} catch (error) {
console.error('Failed to load payment keys:', error)
this.paymentKeys = []
}
},
async loadFeeConfigs() {
if (!this.form.communityId) return
try {
const res = await queryAdminFeeConfigs({
communityId: this.form.communityId,
isDefault: 'F',
page: 1,
row: 100
})
this.feeConfigs = res.feeConfigs || []
} catch (error) {
console.error('Failed to load fee configs:', error)
this.feeConfigs = []
}
},
handleScopeChange() {
this.form.configIds = []
},
handleUploadSuccess(file) {
this.form.certPath = file.realFileName
},
submitForm() {
this.$refs.form.validate(async valid => {
if (!valid) return
try {
const payload = {
...this.form,
paymentKeys: this.paymentKeys
}
await saveAdminPaymentPool(payload)
|