index.vue
11.2 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<template>
<div>
<div class="header-button"><el-button type="primary" size="small" icon="el-icon-plus" @click="handleAdd()">新增映射</el-button></div>
<div class="scrm-sub-client-container">
<div class="pageContent">
<GLCombiForm :rowNumber="1" :formObj="searchForm" :formData="clientGroupFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="clientGroupManage" :hasNum="false" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :pageConf="pageConf" :searchForm="searchFormTable" :tableParams="tableParams" :expand-row-keys="expandArr">
<div class="sub-tabel" slot="labelRelationDetailDTOList" slot-scope="scope" v-if="scope.scope.labelRelationDetailDTOList && scope.scope.labelRelationDetailDTOList.length">
<div class="table-tr">
<div class="tabel-th">系统标签组</div>
<div class="tabel-th">系统标签值</div>
<div class="tabel-th">企业标签组</div>
<div class="tabel-th">企业标签值</div>
<div class="tabel-th">操作</div>
</div>
<div class="table-tr" v-for="item in scope.scope.labelRelationDetailDTOList" :key="item">
<div class="tabel-td">{{ item.sysGroupName }}</div>
<div class="tabel-td">{{ item.sysLabelName }}</div>
<div class="tabel-td">{{ item.envGroupName }}</div>
<div class="tabel-td">{{ item.envLabelName }}</div>
<div class="tabel-td del-btn" @click="delTag(item)">删除</div>
</div>
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleAdd(scope.scope)" class="blue-text">
编辑
</el-button>
</template>
</GLTable>
</div>
</div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisibleDel = false" type="error" :visible.sync="dialogVisibleDel" mode="small">
<div class="dialog-body">
<i class="el-icon-warning"></i>
<div class="dialog-tips">是否删除标签映射关系?</div>
<div class="dialog-tips-2">删除后,将无法支持朋友圈目标客户筛选</div>
<div class="dialog-tips-3">
<span>系统标签</span>
<span class="tag">{{ selectItem.sysGroupName }}-{{ selectItem.sysLabelName }}</span>
<img src="@/assets/mapping.png" alt="" />
<span>企业标签</span>
<span class="tag">{{ selectItem.envGroupName }}-{{ selectItem.envLabelName }}</span>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
// import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'grouping',
data() {
return {
dialogVisibleDel: false,
selectItem: '',
firstSearch: true,
expandArr: [],
isReload: true,
// url: url,
sloading: false,
searchForm: {
merchantKey: '',
sysGroupName: '',
envGroupName: ''
},
searchFormTable: {},
clientGroupFormList: [
{
type: 'input',
inputType: 'text',
name: 'merchantKey',
label: '门店'
},
{
type: 'input',
inputType: 'text',
name: 'sysGroupName',
label: '系统标签组'
},
{
type: 'input',
inputType: 'text',
name: 'envGroupName',
label: '企业标签组'
}
],
pageConf: { pageSize: 'req.pageSize', pageNum: 'req.pageNum', totalCount: 'count' },
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
mutiSelectUniqueKey: 'merchantId',
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand',
'default-expand-all': true
},
addHtml: 'labelRelationDetailDTOList'
},
{
label: '门店商户号',
prop: 'merchantId',
width: 300,
line: 1
},
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '企微授权模式',
prop: 'merchantModel',
formatter: val => {
return val.merchantModel == 1 ? '单店' : '集团'
}
},
{
label: '所属工厂商户号',
prop: 'topMerchantId'
},
{
label: '所属工厂名称',
prop: 'topMerchantName'
},
{
label: '操作',
width: 180,
prop: 'auth-button',
addHtml: 'auth-button'
}
]
// tableOption: {
// width: 240
// // btnList: [
// // {
// // name: '详情',
// // // pType: 'detail'
// // }
// // ]
// }
},
getListApi: this.$apis.mapping.labelRelationPageList,
merchantModel: 1,
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
flushTime: false
}
},
methods: {
handleAdd(row) {
let query = ''
if (row) query = `?merchantId=${row.merchantId}&merchantName=${row.merchantName}&$title=编辑标签映射`
this.$router.push(`/mapping/addMapping${query}`)
},
//删除
delTag(scope) {
console.log(scope)
this.selectItem = scope
this.dialogVisibleDel = true
},
handleSure() {
this.dialogVisibleDel = false
const params = {
req: {
merchantId: this.selectItem.merchantNo,
relationId: this.selectItem.id
}
}
this.$apis.mapping.deleteLabelRelation(params).then(res => {
if (res.code == '0') {
this.searchTable()
this.$message.success('操作成功')
}
})
},
setTableHeightEvent() {
this.$refs.clientGroupManage.setTableHeightFun()
},
setTableFinishFun(content) {
// if (!this.flushTime) {
// this.flushTime = true
// this.searchTable()
// }
//接收到的数据为空
// if (!this.$refs.clientGroupManage.data.length) {
// this.$refs.clientGroupManage.setTableHeightFun()
// }
if (this.firstSearch) {
this.expandArr = this.$refs.clientGroupManage.data.length ? [this.$refs.clientGroupManage.data[0].merchantId + ''] : []
this.firstSearch = false
}
this.$refs.clientGroupManage.data.length ? (this.$refs.clientGroupManage.tableHeightValues = '') : this.$refs.clientGroupManage.setTableHeightFun()
},
searchTable() {
this.$refs.clientGroupManage.refreshTable()
},
getParams() {
var params = {
req: {
...this.searchForm
}
}
delete params.daterange
return params
},
beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.beginTime = this.searchForm.daterange[0]
// this.searchFormTable.endTime = this.searchForm.daterange[1]
// delete this.searchFormTable.daterange
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// resolve()
// })
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve()
})
},
resetTable() {
this.searchForm = {}
this.isReload = false
this.$nextTick(() => {
this.isReload = true
})
},
goDetail(item) {
this.$router.push(`/clientDataOverview/marketingPeople?crowdId=${item.crowdGroupId}&crowdGroupName=${item.crowdGroupName}&crowdGroupDesc=${item.crowdGroupDesc}`)
}
}
}
</script>
<style lang="scss" scoped>
.dialog-body {
text-align: center;
i {
color: #5850ff;
font-size: 48px;
margin-bottom: 20px;
}
.dialog-tips {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-bottom: 10px;
}
.dialog-tips-2 {
font-size: 14px;
color: #666666;
margin-bottom: 16px;
}
.dialog-tips-3 {
text-align: center;
font-size: 12px;
color: #999999;
img {
vertical-align: bottom;
width: 16px;
height: 16px;
margin: 0px 5px;
}
span {
&.tag {
font-size: 14px;
color: #333333;
margin: 0px 5px;
}
}
}
}
.GLFooter {
z-index: 100;
}
.header-button {
margin-bottom: 10px;
}
.sub-tabel {
padding: 16px;
}
.table-tr {
width: 100%;
display: flex;
border-top: 1px solid #e8e8ea;
&:first-child {
background: #f4f6fc;
color: #333333;
font-weight: 700;
}
.del-btn {
color: #5850ff;
cursor: pointer;
}
div {
height: 40px;
line-height: 40px;
padding-left: 10px;
width: 25%;
}
}
.scrm-sub-client-container {
margin-bottom: 60px;
.pageTitle {
position: relative;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.pageContent {
/deep/ {
.expanded {
& + tr:hover td {
background: none !important;
}
}
.el-table__expand-icon {
width: 14px;
height: 14px;
background: rgba(88, 80, 255, 0.3);
border-radius: 2px;
position: relative;
&.el-table__expand-icon--expanded {
transform: rotate(0deg);
}
&::after {
top: -2px;
left: 0px;
content: '+';
position: absolute;
color: #5850ff;
width: 14px;
height: 14px;
font-size: 14px;
}
i {
display: none;
}
&.el-table__expand-icon--expanded {
&::after {
top: -2px;
left: 0px;
content: '-';
position: absolute;
color: #5850ff;
width: 14px;
height: 14px;
font-size: 14px;
}
}
}
}
.leadList {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
div {
text-align: center;
span:nth-child(1) {
font-weight: 600;
font-size: 16px;
}
}
/deep/ .el-button {
color: #5850ff;
border: 1px solid #5850ff;
}
}
.glsx-table {
/deep/ .el-table__fixed,
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
}
padding: 20px 20px 30px;
// min-width: 1300px;
background-color: #fff;
.el-button + .el-button {
margin-left: 10px;
}
}
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid #5850ff;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
}
</style>