index.vue
47.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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
<template>
<div class="scrm-sub-client-container">
<!-- 是否门店账号会影响一些标题文字的显示 accountLevel==4 是门店 -->
<template v-if="isShowModal">
<div class="modalLayer"></div>
<img class="tipPanel" src="@/assets/clientDataOverview/allPicture.png" alt="" />
<img class="knewBtn" src="@/assets/clientDataOverview/btnBg.png" @click="btnKnewClick" />
</template>
<!-- @click="goNextPage" -->
<div class="bannerWrapBox" v-if="isHasCustomerCountBanner">
<img class="bannerWrap" usemap="#planetmap" src="@/assets/clientDataOverview/companyBanner.png" alt="" />
<map name="planetmap" id="planetmap" style="cursor: pointer">
<area shape="rect" coords="849,97,933,121" @click="goNextPage" target="_blank" />
</map>
</div>
<div class="topmsg">
<span class="normalTitle">客户分层</span>
<div style="display:flex">
<div class="leftPieEcharts">
<div class="leftIntro">
<span class="title">客户总数</span>
<el-popover placement="top" width="400" trigger="hover" content="门店的所有客户数,包括企微客户、导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重">
<span class="dataOverPopover">门店的所有客户数,包括企微客户,导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重</span>
<img class="questionImg" v-if="accountLevel == 4" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
<el-popover placement="top" width="400" trigger="hover" content="企业的所有客户数,包括企业客户和旗下所有门店客户,并根据手机号码识别同一客户后合并去重">
<span class="dataOverPopover">企业的所有客户数,包括企业客户和旗下所有门店客户,并根据手机号码识别同一客户后合并去重</span>
<img class="questionImg" v-if="accountLevel !== 4" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<p class="clientTotal">
<!-- 可以动态跑数字 -->
<!-- <animate-number from="0" :to="(topDataObj.customerCount || 0) | overThousandFilter" :key="(topDataObj.customerCount || 0) | overThousandFilter" duration="2000"></animate-number> -->
{{ (topDataObj.customerCount || 0) | overThousandFilter }}
<span class="totalUnit">人</span>
</p>
<template v-if="isShowData">
<!-- <div class="topIcon">
<span class="top-inWechat">已加企微</span>
<span class="top-outWechat">未加企微</span>
</div> -->
<div class="qiwei-total">
<div class="qiwei-describe">
<div class="inWechat">已加企微</div>
<div class="blueNum">{{ (topDataObj.entmicroAddCustomerCount || 0) | overThousandFilter }}人</div>
</div>
<div class="qiwei-describe">
<div class="outWechat">未加企微</div>
<div class="yellowNum">{{ (topDataObj.entmicroNotAddCustomerCount || 0) | overThousandFilter }}人</div>
</div>
</div>
<!-- 引入echart组件 -->
<pie-echart width="100%" height="300px" :topDataObj="topDataObj"></pie-echart>
<!-- <pie-echart-copy class="pieCopy" width="100%" height="300px" :topDataObj="topDataObj"></pie-echart-copy> -->
<div class="personsMap" v-if="topDataObj.entmicroAddCustomerCount > 0">
<!-- <pictorial-bar width="100%" height="500px" :entmicroAddCustomerCount="topDataObj.entmicroAddCustomerCount" :entmicroNotAddCustomerCount="topDataObj.entmicroNotAddCustomerCount"></pictorial-bar> -->
</div>
</template>
<no-data :type="'hasIconText'" v-if="!isShowData"></no-data>
</div>
<div class="itembox">
<div style="display:flex;overflow:hidden">
<div class="buy">
<div class="buy-total item" @click="goto(4)" fn="人群客户列表" mode="div">
<div class="buyTitle">
<span class="client">基盘客户</span>
<el-popover placement="top" trigger="hover" content="有购车或其他交易行为的所有客户">
<span class="dataOverPopover">有购车或其他交易行为的所有客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<div class="proportion">
<span class="proNum" v-if="!isEmptyObj">
{{ (topDataObj.purchaseCustomerCount || 0) | overThousandFilter }}
<span class="proPerson">人</span>
</span>
<span class="ratio" v-if="!isEmptyObj">
占比:
<img src="@/assets/clientDataOverview/upIcon.png" />
{{ purchasePercent }}%
<!-- <i class="triangle-+" :class="{ active: isBuyUp === 2 }" v-if="isBuyUp"></i>
<i v-else>--</i> -->
</span>
</div>
<el-divider></el-divider>
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
<div class="firmClient">
<div @click="goto(5)" fn="人群客户列表" mode="div" class="wid50">
<div class="clientCompleted">
<span>已加企微</span>
<el-popover placement="top" trigger="hover" content="在基盘客户中,已加企微的客户">
<span class="dataOverPopover">在基盘客户中,已加企微的客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<p class="clientNum">
{{ (topDataObj.purchaseCustomerAddCount || 0) | overThousandFilter }}
<span class="personText">人</span>
<span class="numPro">占比:{{ (topDataObj.purchaseCustomerAddPercent && topDataObj.purchaseCustomerAddPercent.toFixed(2) || 0) }}%</span>
</p>
<!-- <div class="marketingBtn">
<el-dropdown>
<span class="el-dropdown-link">
一键营销
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>智能营销</el-dropdown-item>
<el-dropdown-item>群发助手</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div> -->
</div>
<div @click="goto(6)" fn="人群客户列表" mode="div" class="wid50">
<div class="clientCompleted">
<span>未加企微</span>
<el-popover placement="top" trigger="hover" content="在基盘客户中,未加企微的客户">
<span class="dataOverPopover">在基盘客户中,未加企微的客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<p class="clientNum">
{{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }}
<span class="personText">人</span>
<span class="numPro">占比:{{ (topDataObj.purchaseCustomerNAddPercent && topDataObj.purchaseCustomerNAddPercent.toFixed(2) || 0)}}%</span>
</p>
<!-- <div class="marketingBtn">
智能营销
<i class="el-icon-arrow-right"></i>
</div> -->
<!-- <span>未加企微客户数</span>
<span>{{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }}人</span>
<span>在基盘客户中,未加企微的客户</span>
<button class="btn" @click.stop="toGuideCompanyWechat" v-if="accountLevel == 4">
引流企微
<i class="el-icon-d-arrow-right"></i>
</button> -->
</div>
</div>
</div>
<!-- <el-divider direction="vertical"></el-divider> -->
</div>
<div class="buy">
<div class="buy-total item" @click="goto(1)" fn="人群客户列表" mode="div">
<div class="buyTitle">
<span class="client">潜在意向客户</span>
<el-popover placement="top" trigger="hover" content="无购车且无其他交易行为的所有客户">
<span class="dataOverPopover">无购车且无其他交易行为的所有客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<div class="proportion">
<span class="proNum" v-if="!isEmptyObj">
{{ (topDataObj.purposeCustomerCount || 0) | overThousandFilter }}
<span class="proPerson">人</span>
</span>
<span class="ratio" v-if="!isEmptyObj">
占比:
<img src="@/assets/clientDataOverview/upIcon.png" />
{{ purposePercent }}%
<!-- <i class="triangle" :class="{ active: isBuyUp === 2 }" v-if="isBuyUp"></i>
<i v-else>--</i> -->
</span>
</div>
<el-divider></el-divider>
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
<div class="firmClient">
<div @click="goto(2)" fn="人群客户列表" mode="div" class="wid50">
<div class="clientCompleted">
<span>已加企微</span>
<el-popover placement="top" trigger="hover" content="在潜在意向客户中,已加企微的客户">
<span class="dataOverPopover">在潜在意向客户中,已加企微的客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<p class="clientNum">
{{ (topDataObj.purposeCustomerAddCount || 0) | overThousandFilter }}
<span class="personText">人</span>
<span class="numPro">占比:{{ (topDataObj.purposeCustomerAddPercent && topDataObj.purposeCustomerAddPercent.toFixed(2) || 0) }}%</span>
</p>
<!-- <div class="marketingBtn">
<el-dropdown>
<span class="el-dropdown-link">
一键营销
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>智能营销</el-dropdown-item>
<el-dropdown-item>群发助手</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div> -->
</div>
<div @click="goto(3)" fn="人群客户列表" mode="div" class="wid50">
<div class="clientCompleted">
<span>未加企微</span>
<el-popover placement="top" trigger="hover" content="在潜在意向客户中,未加企微的客户">
<span class="dataOverPopover">在潜在意向客户中,未加企微的客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<p class="clientNum">
{{ (topDataObj.purposeCustomerNAddCount || 0) | overThousandFilter }}
<span class="personText">人</span>
<span class="numPro">占比:{{ (topDataObj.purposeCustomerNAddPercent && topDataObj.purposeCustomerNAddPercent.toFixed(2) || 0) }}%</span>
</p>
<!-- <div class="marketingBtn">
智能营销
<i class="el-icon-arrow-right"></i>
</div> -->
</div>
</div>
</div>
</div>
</div>
<!-- 已加企微,待匹配客户 -->
<!-- <div class="intended mgt10" @click="goto(11)">
<div class="intend-name">已加企微,待匹配客户</div>
<div class="intend-info">已加企微,且未匹配到潜在意向和基盘客户的客户</div>
<div class="intend-statistics">
<div class="intend-statistics-num">{{ (topDataObj.waitMatchCustomerAddCount || 0) | overThousandFilter }}人</div>
<div class="intend-statistics-rate">
占比:{{ (topDataObj.waitMatchPercent && topDataObj.waitMatchPercent.toFixed(2)) || 0 }}%
<i class="triangle" :class="{ active: topDataObj.waitMatchUp === 2 }" v-if="topDataObj.waitMatchUp"></i>
<i v-else>--</i>
</div>
</div>
</div> -->
<div class="intendedTop">
<!-- 已加企微,待匹配客户 -->
<div class="intended" @click="goto(11)">
<p class="intend-name">
<span class="nameHover">已加企微,待匹配客户</span>
<span class="intend-phone" @click.stop="goto(20)">(已绑定手机号{{ topDataObj.notMatchCustomerAddPhoneCount ? topDataObj.notMatchCustomerAddPhoneCount : 0 }}人)</span>
<el-popover placement="top" trigger="hover" content="已加企微,且未匹配到潜在意向或基盘客户的客户">
<span class="dataOverPopover">已加企微,且未匹配到潜在意向或基盘客户的客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</p>
<div class="proportion">
<span class="proNum" v-if="!isEmptyObj">
{{ (topDataObj.waitMatchCustomerAddCount || 0) | overThousandFilter }}
<span class="proPerson">人</span>
</span>
<span class="ratio" v-if="!isEmptyObj">
占比:
<img src="@/assets/clientDataOverview/upIcon.png" />
{{ (topDataObj.waitMatchPercent && topDataObj.waitMatchPercent.toFixed(2)) || 0 }}%
<i class="triangle" :class="{ active: topDataObj.waitMatchUp === 2 }" v-if="topDataObj.waitMatchUp"></i>
<i v-else>--</i>
</span>
</div>
</div>
<!-- 未加企微,未匹配客户 -->
<div class="intended" @click="goto(21)">
<p class="intend-name">
<span>未加企微,未匹配客户</span>
<el-popover placement="top" trigger="hover" content="未添加企微或添加企微后删除好友,且未匹配到意向和基盘客户的客户">
<span class="dataOverPopover">未添加企微或添加企微后删除好友,且未匹配到意向和基盘客户的客户</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</p>
<div class="proportion">
<span class="proNum" v-if="!isEmptyObj">
{{ (topDataObj.notMatchCustomerNAddCount || 0) | overThousandFilter }}
<span class="proPerson">人</span>
</span>
<span class="ratio" v-if="!isEmptyObj">
占比:
<img src="@/assets/clientDataOverview/upIcon.png" />
{{ (topDataObj.notMatchCustomerNAddPercent && topDataObj.notMatchCustomerNAddPercent.toFixed(2)) || 0 }}%
<i class="triangle" :class="{ active: topDataObj.waitMatchUp === 2 }" v-if="topDataObj.waitMatchUp"></i>
<i v-else>--</i>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="middlemsg">
<span class="normalTitle">客户分群</span>
<div class="itembox">
<template v-for="(item, index) in titles">
<div class="item" @click="goto(item.id)" fn="人群客户列表" mode="div" :key="index">
<div class="itemTitle">
<span class="itemName">{{ item.name }}</span>
<el-popover placement="top" trigger="hover" :content="item.subName">
<span class="dataOverPopover">{{ item.subName }}</span>
<img class="questionImg" src="@/assets/clientDataOverview/grayquestion.png" slot="reference" />
</el-popover>
</div>
<div class="itemBottom">
<p class="totalNum">
{{ item.num | overThousandFilter }}
<span class="enum">人</span>
</p>
<div class="middlemsg-qiwei-total">
<div class="qiwei-describe">
<div class="inWechat">已加企微</div>
<div class="num">
{{ (item.add(topDataObj) || 0) | overThousandFilter }}
<span class="person-text">人</span>
</div>
</div>
<div class="qiwei-describe">
<div class="inWechat">未加企微</div>
<div class="num">
{{ (item.noAdd(topDataObj) || 0) | overThousandFilter }}
<span class="person-text">人</span>
</div>
</div>
</div>
</div>
</div>
</template>
</div>
</div>
<!-- <h3 class="pageSubTitle">客户增长趋势</h3> -->
<div class="bottommsg">
<span class="normalTitle">客户增长趋势</span>
<no-data :type="'hasIconText'" v-if="!isShowBarMap"></no-data>
<template v-if="isShowBarMap">
<span class="timeDuring">{{ allMapList[0].dateTime }}~{{ allMapList[allMapList.length - 1].dateTime }}</span>
<span class="lastest">近{{ timeGap }}天</span>
<button class="btn30 optionBtn" :class="{ activeDayIcon: this.timeGap == 30 }" @click="clickThirty">近30天</button>
<button class="btn7 optionBtn" :class="{ activeDayIcon: this.timeGap == 7 }" @click="clickSeven">近7天</button>
<div class="clientAddTrend">
<div class="one1">
<span>区间合计:</span>
<span>
全部客户:
<a>{{ bottomDataObj.customerCount | overThousandFilter }}人</a>
</span>
<span>
企微客户:
<a>{{ bottomDataObj.entmicroCustomerCount | overThousandFilter }}人</a>
</span>
</div>
<div class="one2">
<span>
日均新增:
<a>{{ bottomDataObj.dayAvergGrow | overThousandFilter }}人</a>
</span>
<span>
日均新增:
<a>{{ bottomDataObj.entmicroDayAvergGrow | overThousandFilter }}人</a>
</span>
</div>
</div>
<!-- v-if="isShowBarMap" width="100%" -->
<multiple-echart v-if="isReload" width="100%" height="420px" :totalData="allMapList" :isCloseShowNumTag="isCloseShowNumTag"></multiple-echart>
</template>
</div>
<el-dialog title="提示" :visible.sync="dialogVisible" top="15vh" width="30%" :before-close="handleClose">
<span>企微魔方正在开发中,敬请期待...</span>
</el-dialog>
</div>
</template>
<script>
import $ from 'jquery'
import { rwdImageMaps } from './jquery.rwdImageMaps.js'
import { getDataOverview, getDataOverviewBarMap } from '@/api/modules/clientDataOverview'
import { getLoginCount } from '@/api/modules/loginCount'
import pieEchart from '@/components/echarts/pieEchart'
// import pieEchartCopy from '@/components/echarts/pieEchartCopy'
import multipleEchart from '@/components/echarts/multipleEchart'
import noData from '@/components/noData/noData'
export default {
name: 'clientDataOverview',
components: {
pieEchart,
multipleEchart,
// pictorialBar,
noData,
// pieEchartCopy
},
data() {
return {
isCloseShowNumTag: false,
isReload: true,
isShowModal: false,
isHasCustomerCountBanner: false,
topDataObj: {
customerCount: 0,
entmicroAddCustomerCount: 0,
entmicroNotAddCustomerCount: 0,
purposeCustomerCount: 0,
purposeCustomerAddCount: 0, //已加企微客户数
purposeCustomerNAddCount: 0,
purchaseCustomerCount: 0,
purchaseCustomerAddCount: 0,
purchaseCustomerNAddCount: 0,
newCarCustomerCount: 0,
newRenewalCustomerCount: 0,
burseholderCustomerCount: 0,
silenceCustomerCount: 0
},
titles: [
{
name: '新车客户数',
subName: '购车时间3个月的客户',
num: 0,
add: obj => {
return obj.newCarCustomerAddCount
},
noAdd: obj => {
return obj.newCarCustomerNAddCount
},
id: 7
},
{
name: '车险待续保客户数',
subName: '近一个月内车险即将到期的客户',
num: 0,
add: obj => {
return obj.needRenewalCustomerAddCount
},
noAdd: obj => {
return obj.needRenewalCustomerNAddCount
},
id: 8
},
{
name: '新车待首保客户数',
subName: '购车时间5~7个月内,且无保养记录的客户',
num: 0,
add: obj => {
return obj.burseholderCustomerAddCount
},
noAdd: obj => {
return obj.burseholderCustomerNAddCount
},
id: 9
},
{
name: '沉默客户数',
subName: '超过180天未到店的客户',
num: 0,
add: obj => {
return obj.silenceCustomerAddCount
},
noAdd: obj => {
return obj.silenceCustomerNAddCount
},
id: 10
}
],
isNoBuyUp: 0, //默认环比为增
isBuyUp: 0,
bottomDataObj: {},
allMapList: [],
isShowBarMap: false, //是否显示底部多种数据图
timeGap: 7,
sevenDayStorage: {},
thirtyDayStorage: {},
dialogVisible: false,
//只有门店可以引流企微
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
userType: 0 //1是商户,2是员工
}
},
mounted() {
document.body.style.overflow = 'hidden'
var that = this
window.addEventListener('resize', () => {
that.isReload = false
that.$nextTick(() => {
that.isReload = true
})
})
},
computed: {
isEmptyObj() {
if (Object.keys(this.topDataObj).length == 0) {
return true
}
return false
},
isShowData() {
return Object.keys(this.topDataObj).length > 0 && this.topDataObj.customerCount > 0 ? true : false
},
purposePercent() {
if (this.topDataObj.purposePercent) return (this.topDataObj.purposePercent * 100).toFixed(2) || 0
return 0
},
purchasePercent() {
if (this.topDataObj.purchasePercent) return (this.topDataObj.purchasePercent * 100).toFixed(2) || 0
return 0
}
},
async created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.accountLevel = this.$globalState.session.accountLevel
this.userType = this.$globalState.session.userType
}
// 掉两个数据接口
// await this.getDataOverviewFun()
await this.getLoginCountFun()
//先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
//不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于0,继续显示banner;
this.getDataOverviewBarMapFun()
},
methods: {
goNextPage() {
// window.open('https://www.baidu.com', '_blank')
// this.dialogVisible = true
// let timer = 3
// setInterval(() => {
// timer--
// if (timer == 0) {
// this.dialogVisible = false
// }
// }, 1000)
// this.$router.push('drainage/square/index')
this.$history.push('/drainage/square/index')
//要引流企微魔方
// this.getDataOverviewFun()
// this.getDataOverviewBarMapFun()
},
//引流企微按钮暂时效果
toGuideCompanyWechat() {
// window.open('https://www.baidu.com', '_blank')
// $('.subtitle').hide()
this.$history.push('/drainage/square/drainage')
// this.dialogVisible = true
// let timer = 3
// setInterval(() => {
// timer--
// if (timer == 0) {
// this.dialogVisible = false
// }
// }, 1000)
},
showModalLayer() {
var baseNavEle = document.querySelector('.scrm-base-nav')
var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
var baseNavEleHeight = 0
var baseSubNavEleHeight = 0
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
baseNavEleHeight = baseNavEle.clientHeight
baseSubNavEleHeight = baseSubNavEle.clientHeight
}
// if (baseNavEle && baseNavEle) {
// baseNavEleHeight = baseNavEle.clientHeight
// baseSubNavEleHeight = baseSubNavEle.clientHeight
// }
var bannerWrapEle = document.querySelector('.bannerWrap')
var tipPanelEle = document.querySelector('.tipPanel')
var knewBtnEle = document.querySelector('.knewBtn')
// setTimeout(() => {
document.querySelector('.modalLayer').style.display = 'block'
tipPanelEle.style.display = 'block'
document.querySelector('.modalLayer').style.width = bannerWrapEle.clientWidth + 'px'
// document.querySelector('.modalLayer').style.height = document.querySelector('.bannerWrap').offsetHeight + 'px'
var bannerHeight = bannerWrapEle.clientWidth / 8 + 'px'
document.querySelector('.modalLayer').style.height = bannerHeight
document.querySelector('.modalLayer').style.left = window.getComputedStyle(bannerWrapEle).left //bannerWrapEle.offsetLeft + 'px'
document.querySelector('.modalLayer').style.top = window.getComputedStyle(bannerWrapEle).top // 74 + bannerWrapEle.offsetTop + 'px'
tipPanelEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + 10 + 'px'
knewBtnEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + tipPanelEle.clientHeight + 20 + 'px'
// }, 300)
console.log(window, '子系统')
window.addEventListener('resize', () => {
tipPanelEle.style.display = 'block'
document.querySelector('.modalLayer').style.width = document.querySelector('.bannerWrap').clientWidth + 'px'
// document.querySelector('.modalLayer').style.height = document.querySelector('.bannerWrap').offsetHeight + 'px'
var bannerHeight = document.querySelector('.bannerWrap').clientWidth / 8 + 'px'
document.querySelector('.modalLayer').style.height = bannerHeight
document.querySelector('.modalLayer').style.left = window.getComputedStyle(bannerWrapEle).left
document.querySelector('.modalLayer').style.top = window.getComputedStyle(bannerWrapEle).top
document.querySelector('.modalLayer').style.visible = tipPanelEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + 10 + 'px'
knewBtnEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + tipPanelEle.clientHeight + 20 + 'px'
})
},
getLoginCountFun() {
//loginType:2是查客户数据概览浏览次数
getLoginCount({ loginType: 2 }).then(res => {
// res = true
//true和false都接受
// if (!res) {
// return
// }
this.isShowModal = res
this.getDataOverviewFun() //获取客户总数
})
},
//获取上面的数据
getDataOverviewFun() {
// const res = await getDataOverview()
getDataOverview({}).then(res => {
if (!res) {
this.isHasCustomerCountBanner = true
return
}
this.topDataObj = res
console.log(this.topDataObj, 'this.topDataObj')
// this.titles[0].num = res.newCarCustomerCount
// this.titles[1].num = res.needRenewalCustomerCount
// this.titles[2].num = res.burseholderCustomerCount
// this.titles[4].num = res.silenceCustomerCount
console.log(res, '这是上面数据')
this.isNoBuyUp = res.purposeUp
this.isBuyUp = res.purchaseUp
//先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
//不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于等于0,继续显示banner;
console.log(this.accountLevel, this.isShowModal, this.topDataObj.customerCount, 'myData')
if (this.isShowModal && this.accountLevel !== 4) {
this.isShowModal = false //关掉引导层
}
if (this.isShowModal && this.accountLevel == 4) {
this.isHasCustomerCountBanner = true
this.$nextTick(() => {
$('img[usemap]').rwdImageMaps()
})
//打开遮罩层
setTimeout(() => {
this.showModalLayer()
}, 1000)
} else if (!this.isShowModal && this.topDataObj.customerCount > 0) {
this.isHasCustomerCountBanner = false
} else if (!this.isShowModal && this.topDataObj.customerCount <= 0 && this.accountLevel == 4) {
this.isHasCustomerCountBanner = true
this.$nextTick(() => {
$('img[usemap]').rwdImageMaps()
})
}
// if (this.topDataObj.customerCount > 0) {
// this.isHasCustomerCountBanner = false
// } else {
// this.isHasCustomerCountBanner = true
// this.$nextTick(() => {
// $('img[usemap]').rwdImageMaps()
// })
// }
console.log(this.isHasCustomerCountBanner, 'true/fasle')
this.$set(this.titles[0], 'num', res.newCarCustomerCount)
this.$set(this.titles[1], 'num', res.needRenewalCustomerCount)
this.$set(this.titles[2], 'num', res.burseholderCustomerCount)
this.$set(this.titles[3], 'num', res.silenceCustomerCount)
})
// .catch(err => {
// console.log('错误信息:', err)
// })
},
//首次进来获取下方柱状图数据(一进来默认传7天)
async getDataOverviewBarMapFun(dayCount = 7) {
const res = await getDataOverviewBarMap({ day: dayCount })
if (!res) {
return
}
console.log('下方数据', res)
this.bottomDataObj = res
if (dayCount == 7) {
this.sevenDayStorage = res
} else if (dayCount == 30) {
this.thirtyDayStorage = res
}
this.allMapList = res.customerGrowthTrends
console.log(this.allMapList, '数组')
this.isShowBarMap = true //第一次有数据进来,就让图表显示
},
clickThirty() {
this.timeGap = 30
this.isCloseShowNumTag = true
if (Object.keys(this.thirtyDayStorage).length == 0) {
this.getDataOverviewBarMapFun(30) //第一次点击30天,获取数据
} else {
this.bottomDataObj = this.thirtyDayStorage
this.allMapList = this.thirtyDayStorage.customerGrowthTrends
}
},
clickSeven() {
this.timeGap = 7
this.isCloseShowNumTag = false
if (Object.keys(this.sevenDayStorage).length == 0) {
this.getDataOverviewBarMapFun() //重新掉一遍接口
} else {
this.bottomDataObj = this.sevenDayStorage
this.allMapList = this.sevenDayStorage.customerGrowthTrends
}
},
btnKnewClick() {
this.isShowModal = false
// 允许页面滚动:
document.body.style.overflow = 'visible'
},
//跳转到人群客户列表
goto(id) {
if (this.userType == 2) return
this.$router.push('/clientDataOverview/group/' + id)
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.dataOverPopover {
font-size: 12px;
line-height: 18px;
color: #666666;
}
.pieCopy {
//设置两个pie重合
top: -300px;
}
.scrm-sub-client-container {
.person-text {
font-size: 16px !important;
}
.modalLayer {
position: fixed;
z-index: 99;
top: 20px;
left: 20px;
// visibility: hidden;
display: none;
// width: 155px;
// width: 100%;
// height: 207px;
// border: 4px;
// filter: blur(15px);
// border-radius: 60px;
// box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.79);
outline: 5000px solid rgba(0, 0, 0, 0.79);
border: 2px solid #fff;
border-radius: 4px;
}
.tipPanel {
position: fixed;
z-index: 100;
top: 25%;
// top: 0;
// left: 0;
// bottom: 0;
// right: 0;
width: 100%;
}
.knewBtn {
position: fixed;
display: inline-block;
z-index: 100;
// width: 124px;
// height: 40px;
left: 50%;
bottom: 18%;
transform: translateX(-50%);
}
.bannerWrapBox {
width: 100%;
min-width: 1050px;
.bannerWrap {
width: 100%;
//object-fit: contain; //保持图片的原始比例,最大程度展示
}
}
.pageSubTitle {
position: relative;
margin: 20px 0;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.topmsg {
// display: flex;
min-width: 1050px;
background: #ffffff;
.leftPieEcharts {
position: relative;
background-color: #fff;
width: 372px;
height: 370px;
// height: 480px; //470
box-sizing: border-box;
.leftIntro {
margin-top: 20px;
.title {
margin-left: 20px;
font-weight: bold;
font-size: 16px;
color: #333333;
}
}
.subtitle {
position: absolute;
padding-right: 16px;
left: 20px;
top: 54px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
.clientTotal {
margin: 16px 0 0 20px;
font-size: 36px;
color: #333333;
font-weight: 700;
.totalUnit {
font-size: 16px;
color: #333333;
font-weight: 400;
}
}
.topIcon {
position: absolute;
left: 20px;
top: 127px;
width: 160px;
height: 17px;
align-items: center;
font-size: 12px;
font-family: Helvetica;
color: #8c8c8c;
display: flex;
justify-content: space-between;
.top-inWechat {
position: relative;
&::before {
content: '';
width: 9px;
height: 9px;
border-radius: 50%;
margin-right: 10px;
background-color: #716aff;
display: inline-block;
}
}
.top-outWechat {
position: relative;
&::before {
content: '';
// position: absolute;
width: 9px;
height: 9px;
border-radius: 50%;
margin-right: 10px;
// top: 1px;
background-color: #fe9c1c;
display: inline-block;
}
}
}
.qiwei-total {
width: 372px;
padding: 0 57px;
position: absolute;
bottom: 18px;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.inWechat {
font-size: 14px;
color: #333333;
z-index: 9;
text-align: center;
margin-bottom: 8px;
}
.blueNum {
height: 25px;
font-size: 18px;
text-align: center;
font-weight: 600;
color: #333333;
line-height: 25px;
z-index: 9;
}
.outWechat {
font-size: 14px;
color: #333333;
z-index: 9;
text-align: center;
margin-bottom: 8px;
}
.yellowNum {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
text-align: center;
}
.personsMap {
width: 468px;
position: absolute;
left: 0;
bottom: 0px;
// z-index: 9;
}
}
.itembox {
width: calc(100% - 392px);
margin-top: 20px;
.item {
// border: 1px solid rgba(121, 121, 121, 1);
height: 86px;
box-sizing: border-box;
}
.item.no-buy-total,
.item.buy-total {
// height: 238px;
// width: 50%;
position: relative;
height: auto;
cursor: pointer;
> span {
position: absolute;
&:first-child {
font-weight: bold;
height: 22px;
font-size: 16px;
color: #333333;
line-height: 22px;
top: 20px;
left: 24px;
}
&:nth-child(2) {
left: 24px;
top: 50px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
&:nth-child(3) {
top: 106px;
// left: 126px;
left: 50%;
transform: translateX(-50%);
height: 26px;
font-size: 26px;
font-weight: 600;
color: #333333;
line-height: 26px;
letter-spacing: 1px;
}
&:nth-child(4) {
top: 156px;
// left: 136px;
left: 50%;
transform: translateX(-50%);
height: 22px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
// vertical-align: middle;
> .triangle {
// position: absolute;
// left: 51.8%;
// top: 165px;
// margin-bottom: 20px;
display: inline-block;
vertical-align: middle;
width: 0px;
height: 0px;
border-bottom: 6px solid #ff2020;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
&.active {
border-bottom: 6px solid #2cca74;
transform: rotate(180deg);
}
}
}
}
.vertical-line {
position: absolute;
width: 2px;
height: 200px;
background: #f0f0f0;
top: 20px;
right: 0;
}
}
.el-divider--vertical {
display: inline-block;
width: 1px;
height: 200px;
margin: 20px 8px;
vertical-align: middle;
position: relative;
}
.no-buy,
.buy {
display: flex;
margin-left: 16px;
width: 50%;
background-color: #f9f9fc;
padding-bottom: 20px;
.buy-total {
width: 100%;
.buyTitle {
margin-top: 16px;
.client {
margin-left: 16px;
font-size: 16px;
color: #333333;
font-weight: 600;
&:hover {
color: #625aff;
}
}
}
.proportion {
padding: 24px 0 16px 16px;
// border-bottom: 1px solid #e5e5e5;
width: 100%;
box-sizing: border-box;
.proNum {
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: 700;
.proPerson {
font-size: 14px;
color: #333333;
font-weight: 400;
}
}
.ratio {
margin-left: 16px;
font-size: 14px;
color: #666666;
img {
vertical-align: middle;
}
}
}
/deep/ .el-divider--horizontal {
width: 96%;
margin: 4px auto;
text-align: center;
}
.firmClient {
display: flex;
justify-content: space-between;
.clientCompleted {
margin: 20px 0 10px 16px;
display: flex;
font-size: 14px;
color: #666666;
}
.clientNum {
margin: 10px 0px 10px 16px;
font-size: 16px;
color: #333333;
font-weight: 700;
.personText {
font-size: 12px;
color: #333333;
font-weight: 400;
}
.numPro {
margin-left: 16px;
font-size: 12px;
color: #666666;
font-weight: 400;
}
}
.marketingBtn {
margin: 16px 0 10px 16px;
font-size: 14px;
color: #625aff;
/deep/ .el-dropdown-link {
color: #625aff;
}
}
}
}
}
.intendedTop {
display: flex;
margin-top: 16px;
.intended {
// height: 110px;
width: 50%;
background: #f9f9fc;
margin-left: 16px;
padding: 16px 32px 20px 16px;
cursor: pointer;
.intend-name {
font-size: 16px;
color: #333333;
letter-spacing: 0.8px;
font-weight: 600;
white-space: nowrap;
.nameHover {
&:hover {
color: #625aff;
}
}
.intend-phone {
font-size: 14px;
color: #666666;
font-weight: 400;
&:hover {
color: #625aff;
}
}
}
.proportion {
padding: 26px 0 0 0px;
.proNum {
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: 700;
.proPerson {
font-size: 14px;
color: #333333;
font-weight: 400;
}
}
.ratio {
margin-left: 16px;
font-size: 14px;
color: #666666;
img {
vertical-align: middle;
}
}
}
}
}
}
}
.middlemsg {
margin-top: 16px;
min-width: 1050px;
background: #ffffff;
padding-bottom: 1px;
.itembox {
margin: 20px;
display: flex;
justify-content: space-between;
.item {
width: 25%;
cursor: pointer;
margin-right: 16px;
&:last-child{
margin-right: 0;
}
.itemTitle {
height: 54px;
background: #f4f6fc;
display: flex;
align-items: center;
.itemName {
font-size: 16px;
font-weight: 600;
padding-left: 16px;
}
}
.itemBottom {
padding-bottom: 20px;
border-left: 1px solid #e5e5e5;
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
.totalNum {
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: 700;
padding: 24px 0 32px 16px;
.enum {
font-size: 18px;
font-weight: 400;
color: #333333;
vertical-align: middle;
}
}
.middlemsg-qiwei-total {
display: flex;
justify-content: space-between;
.qiwei-describe {
padding: 0px 16px;
.inWechat {
color: #666666;
font-size: 14px;
}
.num {
margin-top: 4px;
font-size: 16px;
color: #333333;
font-weight: 600;
.person-text {
font-size: 14px;
color: #333333;
font-weight: 400;
}
}
}
}
}
}
}
}
.bottommsg {
position: relative;
width: 100%;
min-width: 1050px;
height: 578px;
background-color: #fff;
margin-top: 16px;
.timeDuring {
margin-left: 20px;
margin-top: 20px;
display: inline-block;
padding-right: 8px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
border-right: 1px solid #d9d9d9;
}
.lastest {
// margin-top: 20px;
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 8px;
}
.clientAddTrend {
width: 100%;
height: 80px;
.one1 {
margin-top: 30px;
height: 36px;
position: relative;
span {
position: absolute;
font-size: 14px;
font-weight: 400;
color: #333333;
height: 20px;
line-height: 20px;
> i {
font-weight: 500;
}
}
span:nth-child(1) {
left: 31.5%;
}
span:nth-child(2) {
left: 38.4%;
}
span:nth-child(3) {
left: 54%;
}
}
.one2 {
height: 40px;
position: relative;
span {
position: absolute;
font-size: 14px;
font-weight: 400;
color: #333333;
height: 20px;
line-height: 20px;
> a {
font-weight: 500;
}
}
span:nth-child(1) {
left: 38.4%;
}
span:nth-child(2) {
left: 54%;
}
}
}
.btn30 {
float: right;
margin: 20px 20px 0 20px;
}
.btn7 {
float: right;
margin-top: 20px;
}
.optionBtn {
width: 68px;
height: 36px;
background-color: #fff;
border-radius: 2px;
border: 1px solid #999999;
font-size: 14px;
font-weight: 400;
color: #999999;
&:hover {
cursor: pointer;
border: 1px solid $btnBlue;
color: $btnBlue;
}
}
.activeDayIcon {
border: 1px solid $btnBlue;
color: $btnBlue;
}
}
}
</style>