merchantAdmin.vue
3.74 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
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
<!-- 商户管理员 -->
<template>
<div>
<!-- <d2-container> -->
<div class="d2-container-content">
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :has-page="false">
</d2-table>
</div>
<!-- </d2-container> -->
</div>
</template>
<script>
import { sendSms, getAdminInfo } from '@api/merchant'
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { listYqRefConfig } from '@/api/shopConfig.js'
export default {
name: 'MerchantAdmin',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
searchForm: {
},
searchFormSearch: {},
showFormData: [],
getListApi: listYqRefConfig,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
tableColumns: [{
label: '商户',
prop: 'merchantName'
}, {
label: '联系人',
prop: 'merchantLegalPerson'
}, {
label: '手机号',
prop: 'merchantLegalPersonPhone'
}, {
label: '关联场景',
prop: 'sceneStr'
}, {
label: '更新时间',
prop: 'updatedTime',
formatter: (cellValue) => {
return cellValue.updatedTime ? Util.dateFormate(cellValue.updatedTime, 'YYYY-MM-DD HH:mm:ss') : ''
}
}
]
},
// 短信模块
isSend: false,
sendMsg: '发送验证短信',
adminInfo: {
name: '',
phone: ''
},
rules: {
smsCode: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
},
isShowOkbtn: true,
num: 0
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
props: {
info: {
type: Object,
default: () => { }
}
},
mounted() {
getAdminInfo({}).then(res => {
this.adminInfo = res
})
// this.getBaseData()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
// async getBaseData() {
// this.getOptionsList()
// },
// 短信模块-start
handleSend() {
sendSms({}).then((res) => {
this.notice.okTips('已发送,30分钟内有效')
this.isSend = true
this.sendMsg = 60
this.msgDown()
})
},
msgDown() {
var time = setTimeout(() => {
clearTimeout(time)
if (this.sendMsg > 1) {
--this.sendMsg
this.msgDown()
} else {
this.isSend = false
}
}, 1000)
},
// 短信模块-end
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.merchantId = this.info.merchantId
resolve()
})
}
// getOptionsList() {
// this.showFormData.forEach((item, index) => {
// if (item.type === 'select') {
// if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
// const temp = {}
// temp[this.showFormData[index].optionId] = ''
// temp[this.showFormData[index].optionLabel] = '全部'
// this.baseData[item.optionsName].unshift(temp)
// }
// this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
// }
// })
// },
}
}
</script>
<style lang="scss" scoped></style>