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
<template>
<el-dialog
center
:title="$t('客服')"
:visible="show"
@close="close"
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.deptName ? item.nickname + `(${item.deptName})` : item.nickname " :value="item.id"></el-option>
</el-select>
<div style="display: flex;margin-top: 20px;">
<label style="width:100px;" >申请理由</label>
<el-input v-model="textarea" type="textarea"></el-input>
</div>
</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 {handoverApproval, 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(){
console.log(this.customerIds,'this.customerIds')
if(this.customerIds instanceof Array) return this.customerIds
else return this.customerIds.split(',')
}
},
data(){
return {
customerServiceList:[],
service:'',
textarea:''
}
},
methods:{
submit(){
if(!this.service){
return this.$message.warning(this.$t('请选择客户经理!'));
}
handoverApproval({
customerServiceId:this.service,
customerIdList:this.getCustomerIds,
reason:this.textarea
}).then(r=>{
if(r.code === 0){
if(r.data){
this.$message.success(r.data)
this.$emit('update:show',false)
this.$emit('update:customerIds',[])
this. service = '';
this.textarea = '';
}else {
this.$emit('update:show',false)
this.$emit('update:customerIds',[])
this. service = '';
this.textarea = '';
this.$message.success(this.$t('用户批量转移成功!'))
}
}
})
},
close(){
this. service = '';
this.textarea = '';
this.$emit('update:show',false)
},
}
}
</script>
<style scoped>
</style>