f52d2b06
wuxw
积分功能开发中
|
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
|
</span>
</el-dialog>
</template>
<script>
import { saveIntegralRuleConfig, listIntegralConfig } from '@/api/scm/integralRuleApi'
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'AddIntegralRuleConfig',
props: {
ruleId: {
type: String,
required: true
}
},
data() {
return {
visible: false,
form: {
configId: '',
ruleId: ''
},
rules: {
configId: [
{ required: true, message: this.$t('integralRule.configRequired'), trigger: 'change' }
]
},
configOptions: []
}
},
methods: {
async open() {
this.visible = true
this.form.ruleId = this.ruleId
await this.fetchConfigOptions()
},
async fetchConfigOptions() {
try {
const { data } = await listIntegralConfig({
page: 1,
row: 100,
communityId: getCommunityId()
})
this.configOptions = data
} catch (error) {
this.$message.error(this.$t('common.fetchError'))
}
},
handleClose() {
this.$refs.form.resetFields()
},
async handleSubmit() {
this.$refs.form.validate(async valid => {
if (!valid) return
|