|
@@ -67,7 +67,7 @@
|
67
|
67
|
<el-radio v-model="customer_filter" :disabled="!editFlag" :label="0" @change="changeEvent">全部客户</el-radio>
|
68
|
68
|
<el-radio v-model="customer_filter" :disabled="!editFlag" :label="1" @change="changeEvent">筛选客户</el-radio>
|
69
|
69
|
</div>
|
70
|
|
- <div class="screeningCustomers" v-if="customer_filter == 1">
|
|
70
|
+ <div class="screeningCustomers" v-show="customer_filter == 1">
|
71
|
71
|
<div class="screeningItem">
|
72
|
72
|
<label>性别:</label>
|
73
|
73
|
<el-checkbox-group class="checkboxGroup" v-model="gender" :disabled="!editFlag" @change="changeEvent">
|
|
@@ -108,15 +108,15 @@
|
108
|
108
|
</div>
|
109
|
109
|
</div>
|
110
|
110
|
|
111
|
|
- <!-- S 标签相关 单主体模式时显示 -->
|
112
|
|
- <div v-show="operate_type == 1" class="screeningItem">
|
|
111
|
+ <!-- S 标签相关 单主体模式时传id 多主体模式时传name -->
|
|
112
|
+ <div class="screeningItem">
|
113
|
113
|
<label>标签:</label>
|
114
|
|
- <enterprise-tag title="" width="355px" :disabled="!editFlag" :afferent_obj='afferent_tag_obj' :reset='resetFlag' @tagDefine="tagDefine" style="margin:0" />
|
|
114
|
+ <enterprise-tag :isTagName="isTagName" title="" width="355px" :disabled="!editFlag" :afferent_obj='afferent_tag_obj' :reset='resetFlag' @tagDefine="tagDefine" style="margin:0" />
|
115
|
115
|
</div>
|
116
|
|
- <div v-show="operate_type == 1" class="screeningItem" style="align-items: flex-start;">
|
|
116
|
+ <div class="screeningItem" style="align-items: flex-start;">
|
117
|
117
|
<label>排除客户:</label>
|
118
|
118
|
<div style="flex:1">
|
119
|
|
- <enterprise-tag title="" width="355px" :disabled="!editFlag" :afferent_obj='afferent_exclude_tag_obj' :excludeFlag="true" :reset='resetFlag' @tagDefine="exclude_tagDefine" style="margin:0" />
|
|
119
|
+ <enterprise-tag :isTagName="isTagName" title="" width="355px" :disabled="!editFlag" :afferent_obj='afferent_exclude_tag_obj' :excludeFlag="true" :reset='resetFlag' @tagDefine="exclude_tagDefine" style="margin:0" />
|
120
|
120
|
<p class="screening-hint">可根据标签选择客户,群发时将不会发送给该标签内的客户。若选择了排除的客户,需要较长时间创建本条群发消息哦~</p>
|
121
|
121
|
</div>
|
122
|
122
|
</div>
|
|
@@ -251,6 +251,7 @@ export default {
|
251
|
251
|
name: '',//群发标题
|
252
|
252
|
tag_info: {},//标签
|
253
|
253
|
exclude_tag_info: {},//排除标签
|
|
254
|
+ isTagName: false,
|
254
|
255
|
is_for_all: 1,
|
255
|
256
|
user_id_list: [],
|
256
|
257
|
customerMatchCountLoading: false,
|
|
@@ -313,11 +314,14 @@ export default {
|
313
|
314
|
}
|
314
|
315
|
this.isLookCount = false;
|
315
|
316
|
this.gender = res.rst.gender ? res.rst.gender.split(',') : [];
|
|
317
|
+ this.isTagName = res.rst.operate_type == 2
|
316
|
318
|
this.afferent_tag_obj = {
|
|
319
|
+ tag_name_list: res.rst.tag_list ? res.rst.tag_list.split(',') : [],
|
317
|
320
|
tag_id_list: res.rst.tag_list ? res.rst.tag_list.split(',') : [],
|
318
|
321
|
tag: res.rst.tag_screen_type
|
319
|
322
|
}
|
320
|
323
|
this.afferent_exclude_tag_obj.tag_id_list = res.rst.exclude_tag_list ? res.rst.exclude_tag_list.split(',') : [];
|
|
324
|
+ this.afferent_exclude_tag_obj.tag_name_list = res.rst.exclude_tag_list ? res.rst.exclude_tag_list.split(',') : [];
|
321
|
325
|
|
322
|
326
|
// this.tag_info = this.afferent_tag_obj;
|
323
|
327
|
this.tag_info = {
|
|
@@ -326,6 +330,12 @@ export default {
|
326
|
330
|
}
|
327
|
331
|
|
328
|
332
|
this.exclude_tag_info = this.afferent_exclude_tag_obj
|
|
333
|
+ if(this.isTagName && (res.rst.tag_list || res.rst.exclude_tag_list)) { // 根据标签名 反差标签id
|
|
334
|
+ this.handleSetTagIdInfo()
|
|
335
|
+ } else if (!this.isTagName && (res.rst.tag_list || res.rst.exclude_tag_list)) { // 根据标签id 反差标签名
|
|
336
|
+ this.handleSetTagNameInfo()
|
|
337
|
+ }
|
|
338
|
+
|
329
|
339
|
this.send_type = res.rst.send_type;
|
330
|
340
|
this.send_type == 2 ? this.send_time = {
|
331
|
341
|
date: res.rst.send_time.split(' ')[0],
|
|
@@ -463,7 +473,6 @@ export default {
|
463
|
473
|
})
|
464
|
474
|
return
|
465
|
475
|
}
|
466
|
|
- this.$loading(this.$loadingConfig)
|
467
|
476
|
let params = {
|
468
|
477
|
rule_id: this.is_copy ? '' : this.rule_id ? this.rule_id : '',
|
469
|
478
|
name: this.name,
|
|
@@ -496,12 +505,17 @@ export default {
|
496
|
505
|
params.add_time_end = this.afferent_time && this.afferent_time.length > 1 ? this.afferent_time[1] : '';
|
497
|
506
|
}
|
498
|
507
|
|
499
|
|
- if (this.operate_type == 1) { // 单主体支持标签 多主体不支持
|
|
508
|
+ if (this.operate_type == 1) { // 单主体支持标签 传标签id
|
500
|
509
|
params.tag_screen_type = this.tag_info && this.tag_info.tag_type ? this.tag_info.tag_type : 0
|
501
|
510
|
params.tag_list = this.tag_info && this.tag_info.tag_id_list ? this.tag_info.tag_id_list.join(',') : ''
|
502
|
511
|
params.exclude_tag_list = this.exclude_tag_info && this.exclude_tag_info.tag_id_list ? this.exclude_tag_info.tag_id_list.join(',') : ''
|
|
512
|
+ } else if (this.operate_type == 2) { // 多主体 传标签name
|
|
513
|
+ params.tag_screen_type = this.tag_info && this.tag_info.tag_type ? this.tag_info.tag_type : 0
|
|
514
|
+ params.tag_list = this.tag_info && this.tag_info.tag_name_list ? this.tag_info.tag_name_list.join(',') : ''
|
|
515
|
+ params.exclude_tag_list = this.exclude_tag_info && this.exclude_tag_info.tag_name_list ? this.exclude_tag_info.tag_name_list.join(',') : ''
|
503
|
516
|
}
|
504
|
|
-
|
|
517
|
+ console.log('params => ', JSON.parse(JSON.stringify(params)))
|
|
518
|
+ this.$loading(this.$loadingConfig)
|
505
|
519
|
this.$axios.post(this.URL.BASEURL + this.URL.massMsg_set, params).then((res) => {
|
506
|
520
|
var res = res.data
|
507
|
521
|
this.$loading(this.$loadingConfig).close()
|
|
@@ -535,17 +549,20 @@ export default {
|
535
|
549
|
if (data.tag == 1 || data.tag == 2) {
|
536
|
550
|
if (data.tag_id_list && data.tag_id_list.length != 0) {
|
537
|
551
|
this.tag_info = {
|
|
552
|
+ tag_name_list: data.tag_name_list,
|
538
|
553
|
tag_id_list: data.tag_id_list,
|
539
|
554
|
tag_type: data.tag
|
540
|
555
|
}
|
541
|
556
|
} else {
|
542
|
557
|
this.tag_info = {
|
|
558
|
+ tag_name_list: [],
|
543
|
559
|
tag_id_list: [],
|
544
|
560
|
tag_type: 0
|
545
|
561
|
}
|
546
|
562
|
}
|
547
|
563
|
} else {
|
548
|
564
|
this.tag_info = {
|
|
565
|
+ tag_name_list: [],
|
549
|
566
|
tag_id_list: [],
|
550
|
567
|
tag_type: data.tag
|
551
|
568
|
}
|
|
@@ -556,17 +573,20 @@ export default {
|
556
|
573
|
if (data.tag == 1 || data.tag == 2) {
|
557
|
574
|
if (data.tag_id_list && data.tag_id_list.length != 0) {
|
558
|
575
|
this.exclude_tag_info = {
|
|
576
|
+ tag_name_list: data.tag_name_list,
|
559
|
577
|
tag_id_list: data.tag_id_list,
|
560
|
578
|
tag_type: data.tag
|
561
|
579
|
}
|
562
|
580
|
} else {
|
563
|
581
|
this.exclude_tag_info = {
|
|
582
|
+ tag_name_list: [],
|
564
|
583
|
tag_id_list: [],
|
565
|
584
|
tag_type: 0
|
566
|
585
|
}
|
567
|
586
|
}
|
568
|
587
|
} else {
|
569
|
588
|
this.exclude_tag_info = {
|
|
589
|
+ tag_name_list: [],
|
570
|
590
|
tag_id_list: [],
|
571
|
591
|
tag_type: data.tag
|
572
|
592
|
}
|
|
@@ -596,10 +616,14 @@ export default {
|
596
|
616
|
}
|
597
|
617
|
if (this.customer_filter == 1) {//筛选客户
|
598
|
618
|
params.gender = this.gender && this.gender.join(',');
|
599
|
|
- if (this.operate_type == 1) { // 单主体支持标签 多主体不支持
|
|
619
|
+ if (this.operate_type == 1) { // 单主体支持标签 传标签id
|
600
|
620
|
params.tag_screen_type = this.tag_info && this.tag_info.tag_type ? this.tag_info.tag_type : 0;
|
601
|
621
|
params.tag_list = this.tag_info && this.tag_info.tag_id_list ? this.tag_info.tag_id_list.join(',') : '';
|
602
|
622
|
params.exclude_tag_list = this.exclude_tag_info && this.exclude_tag_info.tag_id_list ? this.exclude_tag_info.tag_id_list.join(',') : '';
|
|
623
|
+ } else if (this.operate_type == 2) { // 多主体标签 传标签name
|
|
624
|
+ params.tag_screen_type = this.tag_info && this.tag_info.tag_type ? this.tag_info.tag_type : 0;
|
|
625
|
+ params.tag_list = this.tag_info && this.tag_info.tag_name_list ? this.tag_info.tag_name_list.join(',') : '';
|
|
626
|
+ params.exclude_tag_list = this.exclude_tag_info && this.exclude_tag_info.tag_name_list ? this.exclude_tag_info.tag_name_list.join(',') : '';
|
603
|
627
|
}
|
604
|
628
|
params.pay_status = this.payInfo.pay_status || this.payInfo.pay_status == 0 ? this.payInfo.pay_status : '';
|
605
|
629
|
params.pay_num_min = this.payInfo.pay_num_min || this.payInfo.pay_num_min == 0 ? this.payInfo.pay_num_min : '';
|
|
@@ -676,6 +700,59 @@ export default {
|
676
|
700
|
// }
|
677
|
701
|
this.changeEvent()
|
678
|
702
|
},
|
|
703
|
+
|
|
704
|
+ handleSetTagIdInfo() {
|
|
705
|
+ this.$axios.get(this.URL.BASEURL + this.URL.tagList, {}).then((res) => {
|
|
706
|
+ var res = res.data
|
|
707
|
+ if (res && res.errno == 0) {
|
|
708
|
+ const allTagList = res.rst;
|
|
709
|
+ const tagIdArr = []
|
|
710
|
+ const tagIdArrExclude = []
|
|
711
|
+ allTagList.forEach(allTag => {
|
|
712
|
+ allTag.tag_list.forEach(tag => {
|
|
713
|
+ const res = this.tag_info.tag_name_list.find(item => item === tag.tag_name)
|
|
714
|
+ if (res) tagIdArr.push(tag.tag_id)
|
|
715
|
+ const resExclude = this.exclude_tag_info.tag_name_list.find(item => item === tag.tag_name)
|
|
716
|
+ if (resExclude) tagIdArrExclude.push(tag.tag_id)
|
|
717
|
+ })
|
|
718
|
+ })
|
|
719
|
+ this.tag_info.tag_id_list = [...tagIdArr]
|
|
720
|
+ this.exclude_tag_info.tag_id_list = [...tagIdArrExclude]
|
|
721
|
+ } else if (res.errno != 4002) {
|
|
722
|
+ this.$message({
|
|
723
|
+ message: res.err,
|
|
724
|
+ type: "warning"
|
|
725
|
+ })
|
|
726
|
+ }
|
|
727
|
+ }).catch((err) => {
|
|
728
|
+ });
|
|
729
|
+ },
|
|
730
|
+ handleSetTagNameInfo() {
|
|
731
|
+ this.$axios.get(this.URL.BASEURL + this.URL.tagList, {}).then((res) => {
|
|
732
|
+ var res = res.data
|
|
733
|
+ if (res && res.errno == 0) {
|
|
734
|
+ const allTagList = res.rst;
|
|
735
|
+ const tagNameArr = []
|
|
736
|
+ const tagNameArrExclude = []
|
|
737
|
+ allTagList.forEach(allTag => {
|
|
738
|
+ allTag.tag_list.forEach(tag => {
|
|
739
|
+ const res = this.tag_info.tag_id_list.find(item => item === tag.tag_id)
|
|
740
|
+ if (res) tagNameArr.push(tag.tag_name)
|
|
741
|
+ const resExclude = this.exclude_tag_info.tag_id_list.find(item => item === tag.tag_id)
|
|
742
|
+ if (resExclude) tagNameArrExclude.push(tag.tag_name)
|
|
743
|
+ })
|
|
744
|
+ })
|
|
745
|
+ this.tag_info.tag_name_list = [...tagNameArr]
|
|
746
|
+ this.exclude_tag_info.tag_name_list = [...tagNameArrExclude]
|
|
747
|
+ } else if (res.errno != 4002) {
|
|
748
|
+ this.$message({
|
|
749
|
+ message: res.err,
|
|
750
|
+ type: "warning"
|
|
751
|
+ })
|
|
752
|
+ }
|
|
753
|
+ }).catch((err) => {
|
|
754
|
+ });
|
|
755
|
+ },
|
679
|
756
|
}
|
680
|
757
|
}
|
681
|
758
|
</script>
|