storeList.vue
6.66 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
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
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
234
235
236
237
238
239
240
241
242
243
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-10-10 10:56:40
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-28 12:28:17
* @FilePath: \scrm-micro-provider\src\views\home\components\activityList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="srcm-main">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable v-loading="loading" ref="table" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="optionBtns" slot-scope="scope">
<el-button type="text" v-if="scope.scope.status == 0" @click="handleSure(scope.scope)">确认账号已开通</el-button>
</template>
<template slot="status" slot-scope="scope">
<div :class="['task_icon', `task_icon_${scope.scope.status == 1 ? 'green' : 'grey'}`]">{{ taskStatus(scope.scope.status) }}</div>
</template>
</GLTable>
<GLDialog title="门店状态变更" :hasFooter="true" :visible.sync="openVisible">
<div class="dialog-body-panel">
<div class="dialog-tips">请确认该门店账号已开通?</div>
<div class="dialog-body-form">
<label>输入已开通门店商户号:</label>
<div class="dialog-body-content">
<div class="body-input flex-center-align">
<el-input size="small" type="text" v-model="merchantId" @blur="handleBlur" @change="loadingM = false"></el-input>
<img v-if="merchantDetail.merchantName" src="@/assets/image/icon-check.png" />
</div>
<div class="input-tips" v-if="merchantDetail.merchantName">门店名称:{{ merchantDetail.merchantName }}</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="openVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="handleOpen">已开通</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import mixi from '@/mixins'
export default {
name: 'storeList',
mixins: [mixi],
data() {
return {
loadingM: false,
merchantId: '',
merchantDetail: {},
selectStore: '',
getListApi: this.$apis.application.merchantPage,
tableSearchForm: {},
searchFormData: [
{
label: '服务商名称',
name: 'serviceMerchantName',
type: 'input'
},
{
label: '服务商号',
name: 'serviceMerchantId',
type: 'input'
},
{
label: '开通门店',
name: 'applyMerchantName',
type: 'input'
},
{
label: '状态',
name: 'status',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: []
}
],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '服务商名称',
prop: 'serviceMerchantName',
minwidth: 120
},
{
label: '服务商商号',
prop: 'serviceMerchantId',
width: '120px'
},
{
label: '手机号码',
prop: 'serviceMerchantPhone',
width: '150px'
},
{
label: '开通门店名称',
prop: 'applyMerchantName',
width: 200,
line: 1
},
{
label: '门店联系人',
prop: 'merchantContact',
width: '220px'
},
{
label: '门店联系手机',
prop: 'phone',
width: '150px'
},
{
label: '状态',
prop: 'status',
width: '120px',
addHtml: 'status'
},
{
label: '申请时间',
prop: 'createdTime',
width: '180px'
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
openVisible: false
}
},
methods: {
handleSure(scope) {
this.openVisible = true
this.selectStore = scope
this.merchantId = ''
this.merchantDetail = {}
},
async handleOpen() {
if (!this.loadingM) {
await this.handleBlur()
}
const { merchantName } = this.merchantDetail
if (!merchantName) {
this.$message.error('商户号错误')
return
}
const { merchantId } = this
const { phone, id } = this.selectStore
this.$apis.application.merchantConfirm({ merchantName, merchantId, phone, id }).then(res => {
if (res) {
this.$message.success('操作成功')
this.openVisible = false
this.handleSearch()
}
})
},
handleBlur() {
const { merchantId } = this
return new Promise(resolve => {
if (!merchantId) {
this.merchantDetail = {}
return
}
this.$apis.application.findMerchantDetailByMerchantNo({ merchantId }).then(res => {
resolve()
this.loadingM = true
this.merchantDetail = res || {}
})
})
}
}
}
</script>
<style lang="scss" scoped>
.srcm-main {
padding: 16px;
background: #fff;
min-height: calc(100vh - 174px);
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon_grey {
&::after {
background: #999;
}
}
&.task_icon_green {
&::after {
background: #2cca74;
}
}
}
.dialog-tips {
font-weight: 600;
font-size: 16px;
color: #333333;
}
.dialog-body-form {
display: flex;
margin-top: 20px;
label {
line-height: 32px;
}
.dialog-body-content {
flex: 1;
img {
width: 20px;
}
/deep/ {
.el-input,
.el-date-editor {
width: 284px;
}
}
.input-tips {
height: 40px;
line-height: 40px;
background: #f9f9f9;
padding: 0px 6px;
box-sizing: border-box;
margin-top: 6px;
width: 80%;
}
}
}
}
</style>