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
<template>
<el-dialog
center
:title="$t('客服')"
:visible.sync="show"
width="30%">
<div style="width: 100%;min-height: 200px;text-align: center">
<el-select filterable v-model="service">
<el-option v-for="(item,index) in customerServiceList" :key="index" :label="item.nickname" :value="item.id"></el-option>
</el-select>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:show',false)" >{{$t('取 消')}}</el-button>
<el-button type="primary" @click="submit">{{$t('确 定')}}</el-button>
</span>
</el-dialog>
</template>
<script>
import {listServiceUser} from "@/api/system/user";
import {handOverCustomer} from "@/api/ecw/customer";
export default {
name: "transferCustomer",
props:{
show:{
type:Boolean ,
default:false
},
customerIds:[Array,String],
tableName:String
},
created() {
listServiceUser().then(r=>{
this.customerServiceList = r.data;
})
},
computed:{
getCustomerIds(){
if(this.customerIds instanceof Array) return this.customerIds
else return this.customerIds.split(',')
}
},
data(){
return {
customerServiceList:[],
service:'',
}
},
methods:{
submit(){
if(!this.service){
return this.$message.warning(this.$t('请选择客户经理!'));
}
handOverCustomer({
customerServiceId:this.service,
customerIdList:this.getCustomerIds
}).then(r=>{
if(r.code === 0){
this.$emit('update:show',false)
this.$emit('update:customerIds',[])
this.$message.success(this.$t('用户批量转移成功!'))
}
})
},
}
}
</script>
<style scoped>
</style>