channelSelectDialog.vue
2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
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
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
<!-- 分账测试渠道 -->
<template>
<d2-dialog title="选择分账测试渠道" :is-visible="verificationCodeVisible" width="750px" @closeDialog="handleClose"
@confirmDialog="handleConfirm">
<!-- <div class="box" v-for="(item, index) in accountValidMerchants" :key="index"> -->
<el-radio-group v-model="paymentChannelId">
<el-radio :label="item.paymentChannelId" class="verificationCode" v-for="(item, index) in divisionRuleTests"
:key="index">{{
item.paymentChannelName }}</el-radio>
</el-radio-group>
<!-- </div> -->
</d2-dialog>
</template>
<script>
// import { sendSms, getAdminInfo } from '@api/merchant'
import { mapActions } from 'vuex'
export default {
name: 'ChannelSelectDialog',
props: {
visible: {
// 弹窗是否展示
type: Boolean,
default: false
},
accountValidMerchants: {
type: Array,
default: () => []
},
divisionRuleTests: {
type: Array,
default: () => []
}
},
computed: {
verificationCodeVisible: {
// return this.
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', false)
}
},
paymentChannelObj() {
return this.divisionRuleTests.find(item => item.paymentChannelId === this.paymentChannelId)
}
},
data() {
return {
paymentChannelId: ''
}
},
methods: {
...mapActions({
close: 'd2admin/page/close'
}),
handleClose() {
// this.$emit('dialogClose')
// this.$update
this.verificationCodeVisible = false
},
// handleApply() {
// },
// 选择并确认
handleConfirm() {
if (!this.paymentChannelId) {
return this.$message.error('请选择渠道');
}
this.$emit('handleConfirm', this.paymentChannelObj)
this.handleClose()
// this.$router.push({ name: 'accountList_new' })
// this.close({ tagName: '/merchantDetail' })
}
}
}
</script>
<style scoped lang="scss">
.verificationCode {
&+.verificationCode {
margin-top: 20px;
}
width: 100%;
}
.container {
padding: 16px 44px;
color: #333333;
background: #f6f8fa;
}
.channel {
color: #333333;
font-size: 16px;
}
.info {
color: #666666;
font-size: 14px;
}
</style>