|
@@ -8,7 +8,7 @@
|
8
|
8
|
<self-input :hasLabel="false" label_name="电话/备注名" @inputChange='(val)=>{input_keyword = val;init(1)}'></self-input>
|
9
|
9
|
<el-button class="lMar10" type="primary" plain size="small" @click="$refs.importCustomerRef.dialogVisible = true">导入客户</el-button>
|
10
|
10
|
<el-button type="primary" plain size="small" @click="$router.push('/importRecord')">导入记录</el-button>
|
11
|
|
- <el-button type="primary" plain size="small" @click="$refs.settingRef.dialogVisible = true">设置</el-button>
|
|
11
|
+ <el-button type="primary" plain size="small" @click="$refs.settingRef.dialogVisible = true,$refs.settingRef.rebackInfo()">设置</el-button>
|
12
|
12
|
|
13
|
13
|
<el-button v-if="status!==0" type="primary" plain size="small" @click="batchDele()">批量删除</el-button>
|
14
|
14
|
<el-button v-if="status==1 || status==2" type="primary" plain size="small" @click="batchRemind()">批量提醒</el-button>
|
|
@@ -22,10 +22,11 @@
|
22
|
22
|
:data="tableData"
|
23
|
23
|
tooltip-effect="dark"
|
24
|
24
|
style="width: 100%"
|
|
25
|
+ @select="rowSelectClick"
|
25
|
26
|
@selection-change="handleSelectionChange"
|
26
|
27
|
v-loading="loading">
|
27
|
28
|
<el-table-column width="30px" type="selection" v-if="status!==0"></el-table-column>
|
28
|
|
- <el-table-column label="电话号码" align="center" show-overflow-tooltip>
|
|
29
|
+ <el-table-column label="电话号码" align="center" show-overflow-tooltip min-width="120">
|
29
|
30
|
<template #header v-if="status!==0">
|
30
|
31
|
<div class="customTitle" slot="reference">{{pageOptionValue==0?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
|
31
|
32
|
<!-- @visible-change="pageOptionValue=''"-->
|
|
@@ -103,9 +104,9 @@
|
103
|
104
|
<el-table-column label="操作" align="center">
|
104
|
105
|
<template slot-scope="scope">
|
105
|
106
|
<div style="display: flex;align-items: center;justify-content: center;flex-wrap: wrap">
|
106
|
|
- <div class="c-00B38A pointer" @click="goDetail(scope.row.id)">详情</div>
|
|
107
|
+ <div v-if="scope.row.add_status==3" class="c-00B38A pointer" @click="goDetail(scope.row.id)">详情</div>
|
107
|
108
|
<div class="c-00B38A pointer lMar10" @click="deleCustomer(scope.row.id)">删除</div>
|
108
|
|
- <div v-if="scope.row.add_status==4" class="lMar10" :class="scope.row.add_status==4 ? 'c-00B38A pointer' : 'c-999 pointer-drop' " @click="scope.row.add_status==4 && allotCustomer(scope.row.id)">分配</div>
|
|
109
|
+ <div v-if="scope.row.add_status==4" class="lMar10" :class="scope.row.add_status==4 ? 'c-00B38A pointer' : 'c-999 pointer-drop' " @click="allotCustomer(scope.row.id)">分配</div>
|
109
|
110
|
<div v-if="scope.row.add_status==1||scope.row.add_status==2" class="c-00B38A pointer lMar10" @click="remindCustomer(scope.row.user_id,scope.row.add_status)">提醒</div>
|
110
|
111
|
</div>
|
111
|
112
|
</template>
|
|
@@ -117,7 +118,7 @@
|
117
|
118
|
</div>
|
118
|
119
|
|
119
|
120
|
<!-- 提醒分配等公共弹框-->
|
120
|
|
- <dialogPublic ref="dialogPublic" :dialogTitle="dialogTitle" :dialogMsg="dialogMsg" type="addCustomer" :user_ids="user_ids"></dialogPublic>
|
|
121
|
+ <dialogPublic ref="dialogPublic" :dialogTitle="dialogTitle" :dialogMsg="dialogMsg" :type="dialogType" :user_ids="user_ids"></dialogPublic>
|
121
|
122
|
<!-- 设置-->
|
122
|
123
|
<setting ref="settingRef"></setting>
|
123
|
124
|
<!-- 导入客户-->
|
|
@@ -170,16 +171,19 @@ export default {
|
170
|
171
|
page_size: 20,
|
171
|
172
|
dialogTitle:'',
|
172
|
173
|
dialogMsg:'',
|
|
174
|
+ dialogType:'',
|
173
|
175
|
user_id_list:[],
|
174
|
176
|
noChooseFlag:false,//是否选中电话号码,true,表示没有人
|
175
|
177
|
time:[],
|
176
|
|
- user_ids:[],//批量选中的人
|
177
|
|
- exclude_id_list:[],//批量选中后,删除的人
|
|
178
|
+ user_ids:[],//批量选中的人,user_id
|
|
179
|
+ select_id_list:[],//批量选中的人,id
|
|
180
|
+ exclude_id_list:[],//批量选中后,删除的人,id
|
178
|
181
|
pageOptionValue:0,
|
179
|
182
|
pageOptions: [
|
180
|
183
|
{ name: '全部', id: 1 },
|
181
|
184
|
{ name: '当前页面', id: 0 },
|
182
|
185
|
],
|
|
186
|
+ allotId:''
|
183
|
187
|
}
|
184
|
188
|
},
|
185
|
189
|
watch:{
|
|
@@ -196,34 +200,28 @@ export default {
|
196
|
200
|
|
197
|
201
|
this.height = document.documentElement.clientHeight - 250 > 400 ? document.documentElement.clientHeight - 250 : 400
|
198
|
202
|
this.init(1)
|
199
|
|
- this.$nextTick(()=>{
|
200
|
|
- this.$refs.settingRef.dialogVisible = true
|
201
|
|
- })
|
202
|
203
|
},
|
203
|
204
|
methods:{
|
204
|
205
|
pageOptionSelect (val) {//选择
|
205
|
206
|
this.pageOptionValue = val
|
206
|
|
- console.log(this.pageOptionValue);
|
207
|
|
- // if (val && val != '') {
|
208
|
|
- // this.old_pageOptionValue = val;
|
209
|
|
- // }
|
210
|
|
- // this.exclude_multiple_selection = {}
|
|
207
|
+
|
211
|
208
|
if (this.pageOptionValue == 1) {
|
212
|
|
- // this.isAll = true
|
|
209
|
+ this.$nextTick(()=>{
|
|
210
|
+ this.tableData.forEach((row) => {
|
|
211
|
+ this.$refs.multipleTable.toggleRowSelection(row, true);
|
|
212
|
+ })
|
|
213
|
+ })
|
|
214
|
+
|
213
|
215
|
} else {//选择当前页面
|
214
|
|
- // this.isAll = false
|
215
|
|
- // let current_page_data = this.multipleSelection[this.page];
|
216
|
|
- // this.multipleSelection = {};
|
217
|
|
- // this.multipleSelection[this.page] = current_page_data ? current_page_data : null;
|
|
216
|
+ this.$nextTick(()=>{
|
|
217
|
+ this.tableData.forEach((row) => {
|
|
218
|
+ this.$refs.multipleTable.toggleRowSelection(row, false);
|
|
219
|
+ })
|
|
220
|
+ })
|
|
221
|
+
|
218
|
222
|
}
|
219
|
|
- // this.tableData.forEach((row) => {
|
220
|
|
- // this.$refs.multipleTable.toggleRowSelection(row, true);
|
221
|
|
- // });
|
222
|
223
|
|
223
|
224
|
},
|
224
|
|
- clearuser_ids(){ //清空批量选中的人
|
225
|
|
- this.user_ids = []
|
226
|
|
- },
|
227
|
225
|
noChooseCustomeTips(){//没有选择客户提示
|
228
|
226
|
this.noChooseFlag = false
|
229
|
227
|
if( this.user_ids&& this.user_ids.length==0){
|
|
@@ -234,29 +232,42 @@ export default {
|
234
|
232
|
this.noChooseFlag = true
|
235
|
233
|
}
|
236
|
234
|
},
|
|
235
|
+ rowSelectClick(selection, row){
|
|
236
|
+ if(this.pageOptionValue==1){
|
|
237
|
+ this.exclude_id_list.push(row.id)
|
|
238
|
+ }
|
|
239
|
+ },
|
237
|
240
|
handleSelectionChange(val){//列表选择人员
|
238
|
|
- console.log(val);
|
239
|
241
|
this.user_ids = []
|
|
242
|
+ this.select_id_list = []
|
240
|
243
|
val.forEach(item=>{
|
241
|
244
|
this.user_ids.push(item.user_id)
|
|
245
|
+ this.select_id_list.push(item.id)
|
242
|
246
|
})
|
243
|
|
-
|
244
|
247
|
},
|
245
|
248
|
batchDele(){//批量删除
|
246
|
249
|
this.noChooseCustomeTips()
|
247
|
250
|
if(this.noChooseFlag){
|
248
|
251
|
return
|
249
|
252
|
}
|
250
|
|
- this.$alert('确定删除选择的客户?', '提示', {
|
|
253
|
+ this.$alert(`确定删除选择的${this.select_id_list&&this.select_id_list.length}个客户?`, '提示', {
|
251
|
254
|
cancelButtonText: '取消',
|
252
|
255
|
confirmButtonText: '确定',
|
253
|
256
|
}).then(()=>{
|
254
|
|
- this.$message({
|
255
|
|
- type: 'success',
|
256
|
|
- message: '删除成功!'
|
257
|
|
- });
|
|
257
|
+ this.allot_dele_remind_pack('dele',this.pageOptionValue,this.select_id_list,this.exclude_id_list)
|
258
|
258
|
})
|
259
|
259
|
},
|
|
260
|
+ deleCustomer(id){//单个删除
|
|
261
|
+ this.$alert('是否确定删除此客户', '提示', {
|
|
262
|
+ cancelButtonText: '取消',
|
|
263
|
+ confirmButtonText: '确定',
|
|
264
|
+ }).then(()=>{
|
|
265
|
+ let ids = []
|
|
266
|
+ ids.push(id)
|
|
267
|
+ this.allot_dele_remind_pack('dele',0,ids)
|
|
268
|
+ })
|
|
269
|
+ },
|
|
270
|
+
|
260
|
271
|
batchRemind(){//批量提醒
|
261
|
272
|
this.noChooseCustomeTips()
|
262
|
273
|
if(this.noChooseFlag){
|
|
@@ -266,73 +277,73 @@ export default {
|
266
|
277
|
cancelButtonText: '取消',
|
267
|
278
|
confirmButtonText: '确定',
|
268
|
279
|
}).then(()=>{
|
269
|
|
- this.$axios.post(this.URL.BASEURL + this.URL.batchRemind, {
|
270
|
|
- add_status:this.status==0?'':this.status,
|
271
|
|
- keyword:this.input_keyword,
|
272
|
|
- start_time: this.time[0],
|
273
|
|
- end_time: this.time[1],
|
274
|
|
- select_all:this.pageOptionValue,
|
275
|
|
- select_id_list:this.user_ids,
|
276
|
|
- exclude_id_list:this.exclude_id_list
|
277
|
|
- }).then((res) => {
|
278
|
|
- var res = res.data
|
279
|
|
- this.$message({
|
280
|
|
- message: res.err,
|
281
|
|
- type: "warning"
|
282
|
|
- })
|
283
|
|
-
|
284
|
|
- }).catch((err) => {
|
285
|
|
- this.loading = false
|
286
|
|
- this.$message({
|
287
|
|
- message: err,
|
288
|
|
- type: "warning"
|
289
|
|
- })
|
290
|
|
- });
|
|
280
|
+ this.allot_dele_remind_pack('remind',this.pageOptionValue,this.select_id_list,this.exclude_id_list)
|
|
281
|
+ })
|
|
282
|
+ },
|
|
283
|
+ remindCustomer(user_id,status){//单个提醒,走的接口二
|
|
284
|
+ this.$nextTick(()=>{
|
|
285
|
+ this.$refs.dialogPublic.dialogVisible = true
|
|
286
|
+ this.dialogType = 'remindSingle'
|
|
287
|
+ this.dialogTitle = '提醒'
|
|
288
|
+ this.dialogMsg = `如果员工长时间未${status == 1 ? '添加客户' : '通过好友申请可再次添加'},可通过企微助手再次提醒员工${status == 1 ? '添加' : '跟进'}客户,是否确认发送?`
|
|
289
|
+ this.user_ids = []
|
|
290
|
+ this.user_ids.push(user_id)
|
291
|
291
|
})
|
292
|
292
|
},
|
293
|
|
- batchAllot(){//批量分配
|
|
293
|
+
|
|
294
|
+ batchAllot(){//批量分配,单个分配
|
294
|
295
|
this.noChooseCustomeTips()
|
295
|
296
|
if(this.noChooseFlag){
|
296
|
297
|
return
|
297
|
298
|
}
|
298
|
299
|
this.$nextTick(()=>{
|
299
|
300
|
this.$refs.dialogPublic.dialogVisible = true
|
|
301
|
+ this.dialogType = 'allotMultiple'
|
300
|
302
|
this.dialogTitle = '分配'
|
301
|
303
|
this.dialogMsg = ''
|
|
304
|
+ this.user_id_list = []
|
302
|
305
|
})
|
303
|
306
|
|
304
|
307
|
},
|
305
|
|
- goDetail(){
|
306
|
|
-
|
307
|
|
- },
|
308
|
|
- allotCustomer(){//单个分配
|
|
308
|
+ allotCustomer(id){//单个分配
|
309
|
309
|
this.$nextTick(()=>{
|
310
|
310
|
this.$refs.dialogPublic.dialogVisible = true
|
|
311
|
+ this.dialogType = 'allotSingle'
|
311
|
312
|
this.dialogTitle = '分配'
|
312
|
313
|
this.dialogMsg = ''
|
313
|
314
|
this.user_id_list = []
|
|
315
|
+ this.allotId = id
|
314
|
316
|
})
|
|
317
|
+ },
|
315
|
318
|
|
|
319
|
+ dialogPublic_allot_single(){//单个分配
|
|
320
|
+ let ids = []
|
|
321
|
+ ids.push(this.allotId)
|
|
322
|
+ this.allot_dele_remind_pack('allot',0,ids)
|
316
|
323
|
},
|
317
|
|
- remindCustomer(user_id,status){//单个提醒
|
318
|
|
- this.$nextTick(()=>{
|
319
|
|
- this.$refs.dialogPublic.dialogVisible = true
|
320
|
|
- this.dialogTitle = '提醒'
|
321
|
|
- this.dialogMsg = `如果员工长时间未${status == 1 ? '添加客户' : '通过好友申请可再次添加'},可通过企微助手再次提醒员工${status == 1 ? '添加' : '跟进'}客户,是否确认发送?`
|
322
|
|
- this.user_ids = []
|
323
|
|
- this.user_ids.push(user_id)
|
324
|
|
- })
|
|
324
|
+ dialogPublic_allot_multiple(){//多选分配
|
|
325
|
+ this.allot_dele_remind_pack('allot',this.pageOptionValue,this.select_id_list,this.exclude_id_list)
|
325
|
326
|
},
|
326
|
|
- delePack(select_id_list,exclude_id_list){
|
|
327
|
+
|
|
328
|
+ allot_dele_remind_pack(type,select_all,select_id_list,exclude_id_list){//分配,删除,提醒,多选及单个
|
327
|
329
|
this.loading=true
|
328
|
|
- this.$axios.post(this.URL.BASEURL + this.URL.batchAddCustomer_delete, {
|
|
330
|
+ let api = ''
|
|
331
|
+ if(type == 'allot'){
|
|
332
|
+ api=this.URL.batchDistributionCustomer
|
|
333
|
+ }else if(type == 'dele'){
|
|
334
|
+ api=this.URL.batchAddCustomer_delete
|
|
335
|
+ }else if(type == 'remind'){
|
|
336
|
+ api=this.URL.batchRemind
|
|
337
|
+ }
|
|
338
|
+ this.$axios.post(this.URL.BASEURL + api, {
|
329
|
339
|
add_status:this.status==0?'':this.status,
|
330
|
340
|
keyword:this.input_keyword,
|
331
|
341
|
start_time: this.time[0],
|
332
|
342
|
end_time: this.time[1],
|
333
|
|
- select_all:0,
|
|
343
|
+ select_all:select_all,
|
334
|
344
|
select_id_list:select_id_list,
|
335
|
|
- exclude_id_list:exclude_id_list?exclude_id_list:[]
|
|
345
|
+ exclude_id_list:exclude_id_list?exclude_id_list:[],
|
|
346
|
+ user_id_list:this.$refs.dialogPublic.user_id_list
|
336
|
347
|
}).then((res) => {
|
337
|
348
|
this.loading = false
|
338
|
349
|
var res = res.data
|
|
@@ -351,16 +362,11 @@ export default {
|
351
|
362
|
})
|
352
|
363
|
});
|
353
|
364
|
},
|
354
|
|
- deleCustomer(id){//单个删除
|
355
|
|
- this.$alert('是否确定删除此客户', '提示', {
|
356
|
|
- cancelButtonText: '取消',
|
357
|
|
- confirmButtonText: '确定',
|
358
|
|
- }).then(()=>{
|
359
|
|
- let ids = []
|
360
|
|
- ids.push(id)
|
361
|
|
- this.delePack(ids)
|
362
|
|
- })
|
|
365
|
+
|
|
366
|
+ goDetail(){
|
|
367
|
+
|
363
|
368
|
},
|
|
369
|
+
|
364
|
370
|
init (page, type) {
|
365
|
371
|
this.page = page ? page : this.page;
|
366
|
372
|
this.loading = true
|
|
@@ -380,6 +386,20 @@ export default {
|
380
|
386
|
this.tableData = res.rst.data;
|
381
|
387
|
this.total = res.rst.pageInfo.total;
|
382
|
388
|
this.pages = res.rst.pageInfo.pages;
|
|
389
|
+
|
|
390
|
+ //重置
|
|
391
|
+ this.user_ids=[]
|
|
392
|
+ this.select_id_list=[]
|
|
393
|
+ this.exclude_id_list=[]
|
|
394
|
+
|
|
395
|
+ if(this.pageOptionValue == 1){
|
|
396
|
+ this.$nextTick(() => {
|
|
397
|
+ this.tableData.forEach((row) => {
|
|
398
|
+ this.$refs.multipleTable.toggleRowSelection(row, true);
|
|
399
|
+ })
|
|
400
|
+ })
|
|
401
|
+ }
|
|
402
|
+
|
383
|
403
|
} else if (res.errno != 4002) {
|
384
|
404
|
this.$message({
|
385
|
405
|
message: res.err,
|