|
@@ -37,18 +37,18 @@
|
37
|
37
|
<div class="selectCustom">已择0个客户</div>
|
38
|
38
|
</div>
|
39
|
39
|
<div class="flex">
|
40
|
|
- <el-button type="primary" plain size="mini">批量打标签</el-button>
|
41
|
|
- <el-button type="primary" plain size="mini">批量移除标签</el-button>
|
|
40
|
+ <el-button type="primary" plain size="mini" @click="setCustomerTag(1)">批量打标签</el-button>
|
|
41
|
+ <el-button type="primary" plain size="mini" @click="setCustomerTag(2)">批量移除标签</el-button>
|
42
|
42
|
<el-button type="primary" plain size="mini">导出Excel</el-button>
|
43
|
43
|
</div>
|
44
|
44
|
</div>
|
45
|
45
|
<!-- table -->
|
46
|
|
- <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
|
|
46
|
+ <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange" @select-all="handleSelectAll">
|
47
|
47
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
48
|
48
|
<el-table-column width="200" fixed="left">
|
49
|
49
|
<template slot-scope="scope" slot="header">
|
50
|
|
- <div class="customTitle" slot="reference">{{pageOptionValue==2?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
|
51
|
|
- <el-select v-model="pageOptionValue" class="customTitleSelect" placeholder="请选择" size="mini">
|
|
50
|
+ <div class="customTitle" slot="reference">{{old_pageOptionValue==2?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
|
|
51
|
+ <el-select v-model="pageOptionValue" class="customTitleSelect" placeholder="请选择" size="mini" @change="pageOptionSelect" @visible-change="pageOptionValue=''">
|
52
|
52
|
<el-option v-for="item in pageOptions" :key="item.id" :label="item.name" :value="item.id">
|
53
|
53
|
</el-option>
|
54
|
54
|
</el-select>
|
|
@@ -84,7 +84,7 @@
|
84
|
84
|
<template slot-scope="scope">
|
85
|
85
|
<div class="customerServiceTagBox biaoqian">
|
86
|
86
|
<div class="customerServiceTag" v-if="scope.row.gender==1||scope.row.gender==2">{{scope.row.gender==1?'男':scope.row.gender==2?'女':''}}</div>
|
87
|
|
- <div class="customerServiceTag" v-for="(item) in scope.row.tag_list" :key="item">{{item}}</div>
|
|
87
|
+ <div class="customerServiceTag" v-for="(item,index) in scope.row.tag_list" :key="index+'biaoqian'">{{item}}</div>
|
88
|
88
|
</div>
|
89
|
89
|
</template>
|
90
|
90
|
</el-table-column>
|
|
@@ -97,7 +97,8 @@
|
97
|
97
|
</el-table-column>
|
98
|
98
|
<el-table-column width="160" label="付费情况" align="center">
|
99
|
99
|
<template slot-scope="scope">
|
100
|
|
- <div>已付费(<span class="c-00B38A">3次</span>)</div>
|
|
100
|
+ <div v-if="scope.row.pay_num>0">已付费(<span class="c-00B38A">{{scope.row.pay_num}}次</span>)</div>
|
|
101
|
+ <div v-else>未付费</div>
|
101
|
102
|
</template>
|
102
|
103
|
</el-table-column>
|
103
|
104
|
<el-table-column prop="createtime" width="160" label="添加时间" show-overflow-tooltip align="center"></el-table-column>
|
|
@@ -107,11 +108,11 @@
|
107
|
108
|
<div>{{scope.row.add_way}}</div>
|
108
|
109
|
</template>
|
109
|
110
|
</el-table-column>
|
110
|
|
- <el-table-column width="200" label="操作" align="center" fixed="right">
|
|
111
|
+ <el-table-column width="130" label="操作" align="center" fixed="right">
|
111
|
112
|
<template slot-scope="scope">
|
112
|
113
|
<div class="flex">
|
113
|
114
|
<div class="c-00B38A pointer" @click="shieldingEvent(scope.row)">加入黑名单</div>
|
114
|
|
- <div class="c-00B38A pointer">聊天记录</div>
|
|
115
|
+ <!-- <div class="c-00B38A pointer">聊天记录</div> -->
|
115
|
116
|
<div class="c-00B38A pointer" @click="showDetial(scope.row)">详情</div>
|
116
|
117
|
</div>
|
117
|
118
|
</template>
|
|
@@ -126,15 +127,16 @@
|
126
|
127
|
<shielding-user @cancel='shieldingUserCancel' :shieldingData='shieldingData'></shielding-user>
|
127
|
128
|
</el-dialog>
|
128
|
129
|
|
129
|
|
- <el-drawer
|
130
|
|
- :size="drawerSize"
|
131
|
|
- :visible.sync="detialDrawer"
|
132
|
|
- :with-header="false">
|
|
130
|
+ <el-drawer :size="drawerSize" :visible.sync="detialDrawer" :with-header="false">
|
133
|
131
|
<detial @changeDrawerSize="changeDrawerSize" @closeDrawer="closeDrawer" :rowProp="{
|
134
|
132
|
customer_id:rowPro.customer_id,
|
135
|
133
|
user_id:rowPro.user_id
|
136
|
134
|
}" ref="detial"></detial>
|
137
|
135
|
</el-drawer>
|
|
136
|
+ <!-- 批量打标签 -->
|
|
137
|
+ <el-dialog :title="tagType==1?'批量打标签':'批量移除标签'" :visible.sync="tagVisible" width="600px" center top="15vh">
|
|
138
|
+ <tag-dialog @closeTagDialog="closeTagDialog" :tagType='tagType'></tag-dialog>
|
|
139
|
+ </el-dialog>
|
138
|
140
|
</div>
|
139
|
141
|
</template>
|
140
|
142
|
<script>
|
|
@@ -148,23 +150,26 @@ import lossBody from '@/components/assembly/screen/lossBody.vue'
|
148
|
150
|
import screenPay from '@/components/assembly/screen/pay.vue'
|
149
|
151
|
import shieldingUser from '@/components/assembly/shieldingUser.vue'
|
150
|
152
|
import detial from '@/components/detials/index.vue'
|
|
153
|
+import tagDialog from '@/components/assembly/tagDialog.vue'
|
|
154
|
+
|
151
|
155
|
export default {
|
152
|
|
- components: { detial, selfInput, selfCustomerservice, enterpriseTag, datePicker, selfChannel, selfGender, lossBody, screenPay, shieldingUser },
|
|
156
|
+ components: { tagDialog, detial, selfInput, selfCustomerservice, enterpriseTag, datePicker, selfChannel, selfGender, lossBody, screenPay, shieldingUser },
|
153
|
157
|
data () {
|
154
|
158
|
return {
|
155
|
|
- drawerSize:'60%',
|
|
159
|
+ drawerSize: '60%',
|
156
|
160
|
detialDrawer: false,
|
157
|
161
|
loading: false,
|
158
|
162
|
page: 1,
|
159
|
163
|
pages: 0,
|
160
|
164
|
total: 0,
|
161
|
|
- page_size: 20,
|
|
165
|
+ page_size: 2,
|
162
|
166
|
shieldingFlag: false,
|
163
|
167
|
pageOptions: [
|
164
|
168
|
{ name: '全部', id: 1 },
|
165
|
169
|
{ name: '当前页面', id: 2 },
|
166
|
170
|
],
|
167
|
171
|
pageOptionValue: 2,
|
|
172
|
+ old_pageOptionValue: 2,
|
168
|
173
|
input_keyword: '',
|
169
|
174
|
tableData: [],
|
170
|
175
|
user_id_list: [],//客服user_id列表
|
|
@@ -181,12 +186,81 @@ export default {
|
181
|
186
|
otherData: {},
|
182
|
187
|
shieldingData: {},//拉黑的数据
|
183
|
188
|
rowPro: {},//去详情的此条对象
|
|
189
|
+ multipleSelection: {},
|
|
190
|
+ exclude_multiple_selection: {},
|
|
191
|
+ isAll: false,//是否选择全部
|
|
192
|
+ tagVisible: true,
|
|
193
|
+ tagType: 1
|
184
|
194
|
}
|
185
|
195
|
},
|
186
|
196
|
created () {
|
187
|
197
|
this.init(1)
|
188
|
198
|
},
|
189
|
199
|
methods: {
|
|
200
|
+ closeTagDialog (val) {
|
|
201
|
+ if (val && val.length != 0) {
|
|
202
|
+ this.page = page ? page : this.page;
|
|
203
|
+ this.loading = true
|
|
204
|
+ this.$axios.get(this.URL.BASEURL + this.URL.customer_setCustomerTag, {
|
|
205
|
+ params: {
|
|
206
|
+ user_id_list: this.user_id_list,
|
|
207
|
+ customer_name: this.input_keyword,
|
|
208
|
+ add_date_start: this.add_date_start,
|
|
209
|
+ add_date_end: this.add_date_end,
|
|
210
|
+ add_way: this.add_way,
|
|
211
|
+ pay_status: this.pay_status,
|
|
212
|
+ pay_num_min: this.pay_num_min,
|
|
213
|
+ pay_num_max: this.pay_num_max,
|
|
214
|
+ tag_type: this.tag_type,
|
|
215
|
+ tag_id_list: this.tag_id_list,
|
|
216
|
+ loss_status: this.loss_status,
|
|
217
|
+ page: this.page,
|
|
218
|
+ page_size: this.page_size
|
|
219
|
+ }
|
|
220
|
+ }).then((res) => {
|
|
221
|
+ var res = res.data
|
|
222
|
+ this.loading = false
|
|
223
|
+ if (res && res.errno == 0) {
|
|
224
|
+ this.tableData = res.rst.data.list;
|
|
225
|
+ this.otherData = {
|
|
226
|
+ count: res.rst.data.count,
|
|
227
|
+ exclude_count: res.rst.data.exclude_count
|
|
228
|
+ }
|
|
229
|
+ this.total = res.rst.pageInfo.total;
|
|
230
|
+ this.pages = res.rst.pageInfo.pages;
|
|
231
|
+
|
|
232
|
+ // 回显选择
|
|
233
|
+ let page_multiple_data = [];
|
|
234
|
+ if (this.isAll && (!this.multipleSelection[this.page])) {
|
|
235
|
+ page_multiple_data = this.tableData
|
|
236
|
+ } else {
|
|
237
|
+ let multiple_id = this.multipleSelection[this.page] ? this.multipleSelection[this.page].map((v) => {
|
|
238
|
+ return v.user_id + '-' + v.customer_id
|
|
239
|
+ }) : []
|
|
240
|
+ this.tableData.forEach((item) => {
|
|
241
|
+ if (multiple_id.indexOf((item.user_id + '-' + item.customer_id)) != -1) {
|
|
242
|
+ page_multiple_data.push(item)
|
|
243
|
+ }
|
|
244
|
+ })
|
|
245
|
+ }
|
|
246
|
+ this.$nextTick(() => {
|
|
247
|
+ page_multiple_data.forEach((row) => {
|
|
248
|
+ this.$refs.multipleTable.toggleRowSelection(row, true);
|
|
249
|
+ })
|
|
250
|
+ })
|
|
251
|
+
|
|
252
|
+ } else if (res.errno != 4002) {
|
|
253
|
+ this.$message({
|
|
254
|
+ message: res.err,
|
|
255
|
+ type: "warning"
|
|
256
|
+ })
|
|
257
|
+ }
|
|
258
|
+ }).catch((err) => {
|
|
259
|
+ this.loading = false
|
|
260
|
+ });
|
|
261
|
+ }
|
|
262
|
+ this.tagVisible = false
|
|
263
|
+ },
|
190
|
264
|
resetEvent () {//重置
|
191
|
265
|
this.resetFlag = !this.resetFlag
|
192
|
266
|
this.input_keyword = '';
|
|
@@ -278,13 +352,33 @@ export default {
|
278
|
352
|
this.loading = false
|
279
|
353
|
if (res && res.errno == 0) {
|
280
|
354
|
this.tableData = res.rst.data.list;
|
281
|
|
- console.log(this.tableData);
|
282
|
355
|
this.otherData = {
|
283
|
356
|
count: res.rst.data.count,
|
284
|
357
|
exclude_count: res.rst.data.exclude_count
|
285
|
358
|
}
|
286
|
359
|
this.total = res.rst.pageInfo.total;
|
287
|
360
|
this.pages = res.rst.pageInfo.pages;
|
|
361
|
+
|
|
362
|
+ // 回显选择
|
|
363
|
+ let page_multiple_data = [];
|
|
364
|
+ if (this.isAll && (!this.multipleSelection[this.page])) {
|
|
365
|
+ page_multiple_data = this.tableData
|
|
366
|
+ } else {
|
|
367
|
+ let multiple_id = this.multipleSelection[this.page] ? this.multipleSelection[this.page].map((v) => {
|
|
368
|
+ return v.user_id + '-' + v.customer_id
|
|
369
|
+ }) : []
|
|
370
|
+ this.tableData.forEach((item) => {
|
|
371
|
+ if (multiple_id.indexOf((item.user_id + '-' + item.customer_id)) != -1) {
|
|
372
|
+ page_multiple_data.push(item)
|
|
373
|
+ }
|
|
374
|
+ })
|
|
375
|
+ }
|
|
376
|
+ this.$nextTick(() => {
|
|
377
|
+ page_multiple_data.forEach((row) => {
|
|
378
|
+ this.$refs.multipleTable.toggleRowSelection(row, true);
|
|
379
|
+ })
|
|
380
|
+ })
|
|
381
|
+
|
288
|
382
|
} else if (res.errno != 4002) {
|
289
|
383
|
this.$message({
|
290
|
384
|
message: res.err,
|
|
@@ -295,24 +389,75 @@ export default {
|
295
|
389
|
this.loading = false
|
296
|
390
|
});
|
297
|
391
|
},
|
|
392
|
+ setCustomerTag (type) {//批量打标签、移除标签
|
|
393
|
+ //type 操作类型 1添加标签 2移除标签
|
|
394
|
+ let multipleArr = []
|
|
395
|
+ for (var i in this.multipleSelection) {
|
|
396
|
+ multipleArr = multipleArr.concat(this.multipleSelection[1] ? this.multipleSelection[1] : [])
|
|
397
|
+ }
|
|
398
|
+ if (multipleArr.length == 0) {
|
|
399
|
+ this.$message({
|
|
400
|
+ message: '请选择客户!',
|
|
401
|
+ type: "warning"
|
|
402
|
+ })
|
|
403
|
+ return
|
|
404
|
+ }
|
|
405
|
+ this.tagVisible = true;
|
|
406
|
+ this.tagType = type
|
|
407
|
+ },
|
298
|
408
|
handleCurrentChange (val) {
|
299
|
409
|
this.init(val)
|
300
|
410
|
},
|
301
|
|
- handleSelectionChange () {
|
302
|
|
-
|
|
411
|
+ handleSelectAll (row) {//点击了全选
|
|
412
|
+ if (this.isAll && row.length == 0) {
|
|
413
|
+ this.multipleSelection = {}
|
|
414
|
+ this.exclude_multiple_selection = {}
|
|
415
|
+ this.isAll = false
|
|
416
|
+ }
|
303
|
417
|
},
|
304
|
|
-
|
305
|
|
- changeDrawerSize(){
|
|
418
|
+ handleSelectionChange (row) {//点击选择变化
|
|
419
|
+ this.multipleSelection[this.page] = row && row.length != 0 ? row : null;
|
|
420
|
+ if (this.isAll) {//全选状态下被排除的用户
|
|
421
|
+ let page_multiple_data = [];
|
|
422
|
+ let multiple_id = this.multipleSelection[this.page] ? this.multipleSelection[this.page].map((v) => {
|
|
423
|
+ return v.user_id + '-' + v.customer_id
|
|
424
|
+ }) : []
|
|
425
|
+ this.tableData.forEach((item) => {
|
|
426
|
+ if (multiple_id.indexOf((item.user_id + '-' + item.customer_id)) != -1) {
|
|
427
|
+ page_multiple_data.push(item)
|
|
428
|
+ }
|
|
429
|
+ })
|
|
430
|
+ this.exclude_multiple_selection[this.page] = page_multiple_data
|
|
431
|
+ }
|
|
432
|
+ },
|
|
433
|
+ pageOptionSelect (val) {//选择
|
|
434
|
+ if (val && val != '') {
|
|
435
|
+ this.old_pageOptionValue = val;
|
|
436
|
+ }
|
|
437
|
+ this.exclude_multiple_selection = {}
|
|
438
|
+ if (this.pageOptionValue == 1) {
|
|
439
|
+ this.isAll = true
|
|
440
|
+ } else {//选择当前页面
|
|
441
|
+ this.isAll = false
|
|
442
|
+ let current_page_data = this.multipleSelection[this.page];
|
|
443
|
+ this.multipleSelection = {};
|
|
444
|
+ this.multipleSelection[this.page] = current_page_data ? current_page_data : null;
|
|
445
|
+ }
|
|
446
|
+ this.tableData.forEach((row) => {
|
|
447
|
+ this.$refs.multipleTable.toggleRowSelection(row, true);
|
|
448
|
+ });
|
|
449
|
+ },
|
|
450
|
+ changeDrawerSize () {
|
306
|
451
|
this.drawerSize = this.drawerSize == '100%' ? '60%' : '100%'
|
307
|
452
|
},
|
308
|
|
- closeDrawer(){
|
|
453
|
+ closeDrawer () {
|
309
|
454
|
this.detialDrawer = false
|
310
|
455
|
},
|
311
|
456
|
showDetial (row) {
|
312
|
457
|
this.rowPro = row
|
313
|
458
|
this.drawerSize = '60%'
|
314
|
459
|
this.detialDrawer = true
|
315
|
|
- this.$nextTick(()=>{
|
|
460
|
+ this.$nextTick(() => {
|
316
|
461
|
this.$refs.detial.acIdx = 0
|
317
|
462
|
this.$refs.detial.init()
|
318
|
463
|
})
|