leadAllocation.vue
7.58 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<template>
<div>
<div class="scrm-sub-client-container">
<div class="pageContent" :style="{ height: clientHeight + 'px' }">
<div class="baseTitle">
<p class="title">基本信息</p>
<hr />
</div>
<div class="combine">
<!-- 售前线索跟进员工 -->
<div class="drainage-form-item">
<label>
售前线索跟进员工
<el-popover placement="top" width="400" trigger="hover" content="请在首页-跟进专员模块里创建售前专员,并选择员工来跟进新车询价、试驾预约线索。">
<img src="@/assets/leadManage/grayquestion.png" slot="reference" class="count-item-question" />
</el-popover>
:
</label>
<div style="position: relative">
<el-button size="small" @click="handleAddEmp(1)">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="drainage-coutom-count">
(只能选择
<span class="count">1</span>
人)
</span>
<div class="el-input-tag input-tag-wrapper" v-if="choicedStaff.beforeUserName">
<el-tag effect="plain" type="info" :key="idx" :disable-transitions="false" closable @close="handleClose(1)">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ this.choicedStaff.beforeUserName }}
</el-tag>
</div>
</div>
</div>
<!-- 售后线索跟进员工 -->
<div class="drainage-form-item">
<label>
售后线索跟进员工
<el-popover placement="top" width="400" trigger="hover" content="请在首页-跟进专员模块里创建售后专员,并选择员工来跟进维保预约、救援服务线索。">
<img src="@/assets/leadManage/grayquestion.png" slot="reference" class="count-item-question" />
</el-popover>
:
</label>
<div style="position: relative">
<el-button size="small" @click="handleAddEmp(2)">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="drainage-coutom-count">
(只能选择
<span class="count">1</span>
人)
</span>
<div class="el-input-tag input-tag-wrapper" v-if="choicedStaff.afterUserName">
<el-tag effect="plain" type="info" :key="idx" :disable-transitions="false" closable @close="handleClose(2)">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ choicedStaff.afterUserName }}
</el-tag>
</div>
</div>
</div>
</div>
</div>
</div>
<select-emp ref="selectEmpForm" @selectTable="selectTable"></select-emp>
<GLFooter class="gl-footer">
<el-button @click="goback()">取消</el-button>
<el-button type="primary" @click="comEmployee()">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import { getfollowstaff, editfollowstaff } from '@/api/modules/leadManage'
import selectEmp from '@/components/selectEmp'
export default {
name: 'leadAllocation',
components: { selectEmp },
data() {
return {
choicedStaff: {
afterUserId: '',
afterUserName: '',
afterUserUuid: '',
beforeUserId: '',
beforeUserName: '',
beforeUserUuid: ''
}, //已选择的员工
clientHeight: '',
type: ''
}
},
created() {
this.getStaff()
},
mounted() {
this.clientHeight = document.documentElement.clientHeight - 130
},
methods: {
// 删除跟进员工
handleClose(tag) {
if (tag == 1) {
;(this.choicedStaff.beforeUserId = ''), (this.choicedStaff.beforeUserName = ''), (this.choicedStaff.beforeUserUuid = '')
}
if (tag == 2) {
;(this.choicedStaff.afterUserId = ''), (this.choicedStaff.afterUserName = ''), (this.choicedStaff.afterUserUuid = '')
}
},
// 获取到跟进员工
getStaff() {
getfollowstaff({}).then(res => {
this.choicedStaff = res
})
},
goback() {
this.$router.push({ path: '/leadManage/index' })
},
// 确认修改跟进员工
comEmployee() {
let params = this.choicedStaff
editfollowstaff(params).then(res => {
if (!res) {
return
}
this.goback()
this.$message.success('修改成功')
})
},
//选择跟进员工的类型和高亮
handleAddEmp(type) {
this.type = type
if (this.type == 1) {
this.$refs.selectEmpForm.init(type, this.choicedStaff.beforeUserUuid)
}
if (this.type == 2) {
this.$refs.selectEmpForm.init(type, this.choicedStaff.afterUserUuid)
}
},
// 跟进员工列表选择回显在页面
selectTable(item) {
if (this.type == 1) {
;(this.choicedStaff.beforeUserId = item.userId), (this.choicedStaff.beforeUserName = item.userName), (this.choicedStaff.beforeUserUuid = item.userUuid)
}
if (this.type == 2) {
;(this.choicedStaff.afterUserId = item.userId), (this.choicedStaff.afterUserName = item.userName), (this.choicedStaff.afterUserUuid = item.userUuid)
}
}
}
}
</script>
<style lang="scss" scoped>
.gl-footer {
margin-top: 16px;
}
.scrm-sub-client-container {
.pageContent {
background-color: #fff;
.baseTitle {
.title {
padding: 15px 30px 0px 20px;
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.combine {
padding: 0px 20px 30px;
.drainage-form-item {
display: flex;
margin-top: 20px;
/deep/ {
.el-input__inner {
width: 448px;
}
}
label {
color: #333;
text-align: right;
margin-right: 10px;
height: 36px;
line-height: 36px;
font-size: 14px;
img {
width: 16px;
height: 16px;
vertical-align: middle;
// margin-left: 5px;
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding-left: 5px;
max-height: 68px;
overflow: auto;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 580px;
display: flex;
//align-items: center;
margin-top: 6px;
font-size: 14px;
height: 75px;
/deep/ .el-tag {
margin-top: 8px;
height: 26px;
line-height: 26px;
padding: 0 8px;
margin-left: 5px;
}
i {
// margin-left: 3px;
color: #75acff;
font-size: 14px;
}
}
.drainage-coutom-count {
margin-left: 8px;
color: #999;
font-size: 14px;
.count {
color: #5850ff;
}
}
/deep/ .el-button--small {
height: 36px;
}
}
}
}
}
</style>