6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
1
|
<template>
|
ce5e1a2a
wuxw
系统模块开发中
|
2
|
<el-dialog :title="$t('paymentPool.edit.title')" :visible.sync="visible" width="50%" @close="handleClose">
|
27dcfde5
wuxw
系统全面测试完成
|
3
|
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="text-left">
|
ce5e1a2a
wuxw
系统模块开发中
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<el-form-item :label="$t('paymentPool.edit.paymentName')" prop="paymentName">
<el-input v-model="formData.paymentName" :placeholder="$t('paymentPool.edit.paymentNamePlaceholder')" />
</el-form-item>
<el-form-item :label="$t('paymentPool.edit.paymentType')" prop="paymentType">
<el-select v-model="formData.paymentType" :placeholder="$t('paymentPool.edit.paymentTypePlaceholder')"
style="width:100%" disabled>
<el-option v-for="item in paymentTypes" :key="item.paymentType" :label="item.name"
:value="item.paymentType" />
</el-select>
</el-form-item>
<el-form-item v-for="(item, index) in paymentKeys" :key="index" :label="item.name">
<el-input v-model="item.columnValue" type="textarea" :placeholder="item.remark" :rows="3" />
</el-form-item>
<el-form-item v-if="formData.paymentType === 'WECHAT'" :label="$t('paymentPool.edit.certFile')">
|
27dcfde5
wuxw
系统全面测试完成
|
21
|
<upload-file ref="uploadFile" @notify="handleNotifyCert" />
|
ce5e1a2a
wuxw
系统模块开发中
|
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
|
<div v-if="formData.certPath" class="cert-tip">
{{ $t('paymentPool.edit.currentCert') }}: {{ formData.certPath }}
</div>
</el-form-item>
<el-form-item :label="$t('paymentPool.edit.payRange')" prop="payType">
<el-select v-model="formData.payType" :placeholder="$t('paymentPool.edit.payRangePlaceholder')"
style="width:100%" disabled>
<el-option :label="$t('paymentPool.edit.communityFee')" value="1001" />
<el-option :label="$t('paymentPool.edit.tempCarFee')" value="2002" />
<el-option :label="$t('paymentPool.edit.specifiedFee')" value="3003" />
</el-select>
</el-form-item>
<el-form-item v-if="formData.payType === '3003'" :label="$t('paymentPool.edit.feeItems')">
<el-checkbox-group v-model="formData.configIds">
<el-checkbox v-for="item in feeConfigs" :key="item.configId" :label="item.configId">
{{ item.feeName }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item :label="$t('paymentPool.edit.state')" prop="state">
<el-select v-model="formData.state" :placeholder="$t('paymentPool.edit.statePlaceholder')" style="width:100%">
<el-option :label="$t('paymentPool.edit.enable')" value="Y" />
<el-option :label="$t('paymentPool.edit.disable')" value="N" />
</el-select>
</el-form-item>
<el-form-item :label="$t('paymentPool.edit.remark')">
<el-input v-model="formData.remark" type="textarea" :placeholder="$t('paymentPool.edit.remarkPlaceholder')"
:rows="3" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="visible = false">
{{ $t('common.cancel') }}
</el-button>
<el-button type="primary" @click="handleSubmit">
{{ $t('common.confirm') }}
</el-button>
</div>
</el-dialog>
</template>
<script>
|
27dcfde5
wuxw
系统全面测试完成
|
69
70
|
import { updatePaymentPool, listPaymentKey, listFeeConfigs, getPaymentPoolDetail, listPaymentAdapt } from '@/api/system/paymentPoolApi'
import UploadFile from '@/components/upload/uploadFile'
|
ce5e1a2a
wuxw
系统模块开发中
|
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
|
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'EditPaymentPool',
components: {
UploadFile
},
data() {
return {
visible: false,
formData: {
ppId: '',
paymentName: '',
paymentType: '',
certPath: '',
state: '',
remark: '',
payType: '',
configIds: [],
communityId: ''
},
paymentTypes: [],
paymentKeys: [],
feeConfigs: [],
rules: {
paymentName: [
{ required: true, message: this.$t('paymentPool.validate.paymentNameRequired'), trigger: 'blur' },
{ max: 64, message: this.$t('paymentPool.validate.paymentNameMaxLength'), trigger: 'blur' }
],
paymentType: [
{ required: true, message: this.$t('paymentPool.validate.paymentTypeRequired'), trigger: 'change' }
],
state: [
{ required: true, message: this.$t('paymentPool.validate.stateRequired'), trigger: 'change' }
]
}
}
},
created() {
this.formData.communityId = getCommunityId()
this.getPaymentTypes()
|
ce5e1a2a
wuxw
系统模块开发中
|
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
|
},
methods: {
open(row) {
this.visible = true
this.formData.ppId = row.ppId
this.getPaymentPoolDetail()
this.getFeeConfigs()
},
handleClose() {
this.$refs.form.resetFields()
this.formData = {
ppId: '',
paymentName: '',
paymentType: '',
certPath: '',
state: '',
remark: '',
payType: '',
configIds: [],
communityId: getCommunityId()
}
this.paymentKeys = []
if (this.$refs.uploadFile) {
this.$refs.uploadFile.clear()
}
},
async getPaymentTypes() {
try {
const { data } = await listPaymentAdapt({
page: 1,
row: 100,
})
this.paymentTypes = data
} catch (error) {
console.error('获取支付类型失败:', error)
}
},
async getFeeConfigs() {
try {
const params = {
page: 1,
row: 100,
isDefault: 'F',
communityId: this.formData.communityId
}
|
048b90a9
wuxw
v1.9 优化支付没法设置费用项bug
|
157
158
|
const { feeConfigs } = await listFeeConfigs(params)
this.feeConfigs = feeConfigs
|
ce5e1a2a
wuxw
系统模块开发中
|
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
} catch (error) {
console.error('获取费用配置失败:', error)
}
},
async getPaymentPoolDetail() {
try {
const params = {
ppId: this.formData.ppId,
communityId: this.formData.communityId
}
const { data } = await getPaymentPoolDetail(params)
this.formData = {
...this.formData,
paymentName: data[0].paymentName,
paymentType: data[0].paymentType,
certPath: data[0].certPath,
state: data[0].state,
remark: data[0].remark,
payType: data[0].payType
}
// 加载支付密钥
await this.loadPaymentKeys()
// 设置支付密钥值
if (data[0].values) {
data[0].values.forEach(value => {
const key = this.paymentKeys.find(k => k.columnKey === value.columnKey)
if (key) {
key.columnValue = value.columnValue
}
})
}
// 设置费用项
if (data[0].configs) {
this.formData.configIds = data[0].configs.map(c => c.configId)
}
// 如果有证书路径,通知上传组件
if (this.formData.certPath && this.$refs.uploadFile) {
this.$refs.uploadFile.fileName = this.formData.certPath
this.$refs.uploadFile.realFileName = this.formData.certPath
this.$refs.uploadFile.progress = 100
}
} catch (error) {
console.error('获取支付池详情失败:', error)
}
},
async loadPaymentKeys() {
try {
const params = {
paymentType: this.formData.paymentType,
page: 1,
row: 100
}
const { data } = await listPaymentKey(params)
this.paymentKeys = data.map(item => ({
...item,
columnValue: ''
}))
} catch (error) {
console.error('获取支付密钥失败:', error)
}
},
handleNotifyCert(param) {
this.formData.certPath = param.realFileName
},
handleSubmit() {
this.$refs.form.validate(async valid => {
if (!valid) return
try {
const params = {
...this.formData,
|
27dcfde5
wuxw
系统全面测试完成
|
234
|
paymentKeys: this.paymentKeys.map(item => ({
|
ce5e1a2a
wuxw
系统模块开发中
|
235
236
237
238
239
|
columnKey: item.columnKey,
columnValue: item.columnValue
}))
}
await updatePaymentPool(params)
|
6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
240
|
this.$message.success(this.$t('common.operationSuccess'))
|
ce5e1a2a
wuxw
系统模块开发中
|
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
this.visible = false
this.$emit('success')
} catch (error) {
this.$message.error(error.message || this.$t('paymentPool.edit.error'))
}
})
}
}
}
</script>
<style lang="scss" scoped>
.cert-tip {
margin-top: 5px;
font-size: 12px;
color: #909399;
}
</style>
|