marketingPeople.vue
14.3 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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<template>
<div>
<!-- 大标题 -->
<p class="topTitle">
<span class="title">待定保客户</span>
<span class="desc">下个月待定保客户</span>
</p>
<!-- 切换导航栏 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="营销人群" name="first">
<!-- v-if="activeName == 'first'" -->
<div class="pageContent">
<div class="markPeople">
<span>营销人群</span>
<span v-if="itemArr.length > 4 && !closeFlag" @click="expandClick('expand')">
展开营销人群
<i class="el-icon-arrow-down color-58"></i>
</span>
<span v-if="closeFlag" @click="expandClick('close')">
收起营销人群
<i class="el-icon-arrow-up color-58"></i>
</span>
</div>
<el-divider></el-divider>
<!-- 营销人群展示 -->
<div class="bigMarketItem" v-if="closeFlag">
<div v-for="(item, idx) in itemArr" :key="idx" :class="[{ active: isActive == idx }, 'marketItem']" @click="choickItem(idx)">
<template v-if="idx < displayNum">
<p class="peopleName">人群名称</p>
<div class="itemBox">
<p class="peopleNum">
{{ item.num }}
<span>人</span>
</p>
<p class="peopledesc">{{ item.desc }}</p>
<el-button class="createSOP" @click.stop="createMarketSOP()" :disabled="item.type">创建营销SOP</el-button>
</div>
</template>
</div>
</div>
<div v-show="!closeFlag">
<div class="swiper-container" id="swiper">
<div class="swiper-wrapper">
<div v-for="(item, idx) in itemArr" :key="idx" :class="[{ active: isActive == idx }, 'marketItem', 'swiper-slide']" @click="choickItem(idx, item.title)">
<div class="marketItem-border">
<p class="peopleName">{{ item.title }}</p>
<div class="itemBox">
<p class="peopleNum">
{{ item.num }}
<span>人</span>
</p>
<p class="peopledesc">{{ item.desc }}</p>
<el-button class="createSOP" @click.stop="createMarketSOP(item.id)" :disabled="item.type">创建营销SOP</el-button>
</div>
</div>
</div>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
</div>
</div>
</div>
<div class="otherPageContent">
<GLCombiForm v-if="activeName == 'first'" :formObj="searchForm" :formData="marketPeopleFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<div class="leadList">
<div>
<span>{{ showTitle }}</span>
</div>
<div>
<el-button size="small" @click="handleExport">导出</el-button>
<el-button class="marketSOP" size="small" @click="marketButton()">营销SOP</el-button>
</div>
</div>
<GLTable v-loading="loading" :hasNum="true" @setTableHeightEvent="setTableHeightEvent" @setTableFinishFun="setTableFinishFun" ref="marketPeople" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :tableParams="tableParams"></GLTable>
</div>
</el-tab-pane>
<el-tab-pane label="营销计划" name="second">
<marketing-plan v-if="activeName == 'second'"></marketing-plan>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import marketingPlan from './components/marketingPlan.vue'
import Swiper from 'swiper'
import util from '@/utils/util'
import 'swiper/dist/css/swiper.min.css'
export default {
name: 'marketPeople',
components: { marketingPlan },
data() {
return {
activeName: 'first',
searchForm: {},
isActive: -1,
displayNum: 4, //展示的数目
closeFlag: false, //展开收起
showTitle: '', // 展示的标题
itemArr: [
// 后台传一个状态回来
{ title: 'N-23待定保客户', num: 323, desc: '我顶着大太阳,只想为你撑伞', id: 1, type: 'false' },
{ title: 'N-45待定保客户', num: 1312, desc: '你专心在画睫毛,我专心在等你笑', id: 2 },
{ title: 'N-33待定保客户', num: 43133, desc: '气球在我手上,牵着你瞎逛' },
{ title: 'N-1待定保客户', num: 123213, desc: '城堡为爱守着秘密,而我为你守着爱情' },
{ title: 'N-2待定保客户', num: 1233, desc: '喜欢在人潮中,你只属于我的那画面' },
{ title: 'N-7待定保客户', num: 43133, desc: '但偏偏,风渐渐,把距离吹的好远' },
{ title: 'N-6待定保客户', num: 123213, desc: '最美的不是下雨天,是曾与你躲过雨的屋檐' },
{ title: 'N-5待定保客户', num: 1233, desc: '美人鱼的眼泪' },
{ title: 'N-4待定保客户', num: 1233, desc: '我一路向北,离开有你的季节' }
],
marketPeopleFormList: [
{
type: 'input',
inputType: 'text',
name: 'keyword',
label: '车牌号'
},
{
type: 'input',
inputType: 'text',
name: 'keyword',
label: '车系'
},
{
type: 'select',
name: 'status',
label: '跟进员工',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
{
label: '待跟进',
value: 0
},
{
label: '跟进中',
value: 1
},
{
label: '已完成',
value: 2
}
],
placeholder: '请选择'
},
{
type: 'input',
inputType: 'text',
name: 'keyword',
label: '联系电话'
},
{
type: 'input',
inputType: 'text',
name: 'keyword',
label: '企微名称'
},
{
type: 'input',
inputType: 'text',
name: 'userName',
label: '客户名称'
},
{
type: 'select',
name: 'isJoin',
label: '是否已加企微',
placeholder: '请选择',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: null
},
{
label: '是',
value: 1
},
{
label: '否',
value: 0
}
]
},
{
type: 'datePicker',
name: 'daterange',
label: '购车',
valueFormat: 'yyyy-MM-dd',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'datePicker',
name: 'daterange',
label: '车险到期时间',
valueFormat: 'yyyy-MM-dd',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
minWidth: 150
},
{
label: '企微名称',
prop: 'customerPhone',
minWidth: 120
},
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
},
{
label: '入群方式',
prop: 'joinScene',
addHtml: 'joinScene',
minWidth: 140
},
{
label: '邀请人',
prop: 'invitorName',
minWidth: 120
},
{
label: '入群时间',
prop: 'joinTime',
width: 170
}
],
tableOption: {
width: 60,
btnList: [
{
name: '详情',
pType: 'detail'
}
]
}
}
// getListApi: getDetailQuitTableList,
}
},
mounted() {
new Swiper('.swiper-container', {
// paginationClickable: true,
grabCursor: true,
spaceBetween: 16,
mousewheel: true,
slidesPerView: 'auto',
pagination: {
el: '.swiper-pagination',
type: 'progressbar'
}
})
},
methods: {
// 搜索表格
searchTable() {
console.log(this.searchForm)
this.$refs.marketPeople.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {}
this.$refs.marketPeople.refreshTable()
},
// 跳转到营销SOP
createMarketSOP(id) {
util.openUrl(location.origin + `/marketing/sop/editSop?addOrEdit=add&fromPage=sopList&corwedId=${id}`)
},
expandClick(val) {
if (val == 'expand') {
this.closeFlag = true
this.displayNum = this.itemArr.length
} else {
this.closeFlag = false
this.displayNum = 4
}
},
// 选择的人群
choickItem(idx, title) {
this.isActive = idx
this.showTitle = title
// 发送请求查询列表
},
setTableFinishFun() {
this.$refs.marketPeople.data.length ? (this.$refs.marketPeople.tableHeightValues = '') : this.$refs.marketPeople.setTableHeightFun()
},
setTableHeightEvent() {
this.$refs.marketPeople.setTableHeightFun()
},
handleClick(tab) {
console.log(tab)
}
}
}
</script>
<style lang="scss" scoped>
/deep/.swiper-container-horizontal > .swiper-pagination-progressbar {
width: 5%;
bottom: 0px;
top: auto;
right: 0;
margin: auto;
border-radius: 3px;
background: #dddee0;
.swiper-pagination-progressbar-fill {
background: #5850ff;
border-radius: 3px;
}
}
#swiper {
padding: 0 20px;
.swiper-wrapper {
margin-bottom: 20px;
.swiper-slide {
width: 274px;
.marketItem-border {
min-height: 251px;
.peopleName {
height: 54px;
line-height: 54px;
background: #f7f7fc;
font-size: 16px;
font-weight: 600;
padding-left: 16px;
vertical-align: middle;
}
.itemBox {
border-left: 1px solid #ededf0;
border-right: 1px solid #ededf0;
border-bottom: 1px solid #ededf0;
padding: 0 16px;
box-sizing: border-box;
.peopleNum {
padding: 24px 0;
font-size: 26px;
font-weight: 600;
color: #333333;
span {
font-size: 14px;
font-weight: 400;
}
}
.peopledesc {
font-size: 14px;
color: #999999;
line-height: 20px;
height: 40px;
}
.createSOP {
margin: 24px 0;
border-radius: 4px;
border: 1px solid #5850ff;
width: 100%;
color: #5850ff;
padding: 9px 20px;
}
}
}
}
}
}
.active {
border: 1px solid #5850ff;
}
.topTitle {
.title {
color: #333333;
font-size: 20px;
font-weight: 600;
}
.desc {
margin-left: 8px;
font-size: 14px;
color: #666666;
}
}
/deep/.el-tabs__header {
padding: 5px 0;
.el-tabs__item {
font-size: 16px;
}
}
.pageContent {
padding: 0 0 20px;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
background-color: #fff;
.markPeople {
padding: 20px 20px 0;
display: flex;
justify-content: space-between;
font-weight: 600;
color: #333333;
span:last-child {
color: #5850ff;
cursor: pointer;
}
}
.bigMarketItem {
padding: 0 20px;
display: grid;
grid-template-columns: 25% 25% 25% 25%;
.marketItem {
margin-right: 16px;
margin-bottom: 16px;
// width: 25%;
&:nth-child(4n) {
margin-right: 0;
}
.peopleName {
height: 54px;
line-height: 54px;
background: #f7f7fc;
font-size: 16px;
font-weight: 600;
padding-left: 16px;
vertical-align: middle;
}
.itemBox {
border-left: 1px solid #ededf0;
border-right: 1px solid #ededf0;
border-bottom: 1px solid #ededf0;
padding: 0 16px;
box-sizing: border-box;
.peopleNum {
padding: 24px 0;
font-size: 26px;
font-weight: 600;
color: #333333;
span {
font-size: 14px;
font-weight: 400;
}
}
.peopledesc {
font-size: 14px;
color: #999999;
line-height: 20px;
}
.createSOP {
margin: 24px 0;
border-radius: 4px;
border: 1px solid #5850ff;
width: 100%;
color: #5850ff;
padding: 9px 20px;
}
}
}
}
.progressBar {
width: 40px;
height: 4px;
background: #dddee0;
border-radius: 3px;
margin: 20px auto 0px;
.progress {
background: #5850ff;
height: 4px;
width: 0;
border-radius: 3px;
}
}
}
.otherPageContent {
padding: 20px 20px 30px;
margin-top: 16px;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
background-color: #fff;
.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: 20px;
}
}
/deep/ .el-button {
color: #5850ff;
border: 1px solid #5850ff;
}
.marketSOP {
color: #666666;
border: 1px solid #696969;
}
}
}
.PageContent2 {
padding: 20px 20px 30px;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
background-color: #fff;
}
</style>