OpportunityDetail.vue
7.61 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<template>
<div class="opportunity-detail">
<div class="page-header">
<el-page-header @back="goBack" content="商机详情">
</el-page-header>
</div>
<el-card class="detail-card">
<div class="card-header">
<h3>基本信息</h3>
</div>
<div class="card-content">
<el-row :gutter="20">
<el-col :span="8">
<div class="info-item">
<span class="info-label">商机ID:</span>
<span class="info-value">{{ opportunity.id }}</span>
</div>
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="info-label">创建时间:</span>
<span class="info-value">{{ opportunity.createTime }}</span>
</div>
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="info-label">当前状态:</span>
<span class="info-value">
<el-tag :type="getStatusType(opportunity.status)">
{{ getStatusLabel(opportunity.status) }}
</el-tag>
</span>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="info-item">
<span class="info-label">客户地址:</span>
<span class="info-value">{{ opportunity.customerAddress }}</span>
</div>
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="info-label">用户账号:</span>
<span class="info-value">{{ opportunity.customerPhone }}</span>
</div>
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="info-label">最新跟进:</span>
<span class="info-value">{{ opportunity.lastFollowTime || '-' }}</span>
</div>
</el-col>
</el-row>
</div>
</el-card>
<el-card class="detail-card">
<div class="card-header">
<h3>人员信息</h3>
</div>
<div class="card-content">
<el-row :gutter="20">
<el-col :span="8">
<div class="info-item">
<span class="info-label">装维师傅:</span>
<span class="info-value">{{ opportunity.installerName }} ({{ opportunity.installerId }})</span>
</div>
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="info-label">联系电话:</span>
<span class="info-value">{{ opportunity.installerPhone }}</span>
</div>
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="info-label">营销人员:</span>
<span class="info-value">{{ opportunity.assignedToName || '-' }} ({{ opportunity.assignedTo || '-' }})</span>
</div>
</el-col>
</el-row>
</div>
</el-card>
<el-card class="detail-card">
<div class="card-header">
<h3>商机详情</h3>
</div>
<div class="card-content">
<div class="info-item">
<span class="info-label">商机标签:</span>
<span class="info-value">
<el-tag
v-for="tag in opportunity.tags"
:key="tag"
size="small"
style="margin-right: 8px;"
>
{{ tag }}
</el-tag>
</span>
</div>
<div class="info-item" style="margin-top: 15px;">
<span class="info-label">商机描述:</span>
<span class="info-value">{{ opportunity.description }}</span>
</div>
</div>
</el-card>
<el-card class="detail-card">
<div class="card-header">
<h3>跟进记录</h3>
</div>
<div class="card-content">
<el-timeline>
<el-timeline-item
v-for="(activity, index) in activities"
:key="index"
:timestamp="activity.timestamp"
:type="activity.type"
>
<div class="activity-content">
<p>{{ activity.content }}</p>
<p v-if="activity.operator" class="operator">操作人:{{ activity.operator }}</p>
</div>
</el-timeline-item>
</el-timeline>
</div>
</el-card>
<div class="actions">
<el-button @click="goBack">返回</el-button>
<el-button type="primary" @click="handleFollowUp">跟进</el-button>
<el-button type="success" @click="handleComplete">成单</el-button>
</div>
</div>
</template>
<script>
// 商机状态映射
const statusMap = {
'assigned': { label: '待跟进', type: 'info' },
'following': { label: '跟进中', type: 'warning' },
'pending_review': { label: '成单待审核', type: 'primary' },
'completed': { label: '已成单', type: 'success' },
'closed': { label: '已关闭', type: 'info' }
}
// 模拟商机数据
const mockOpportunity = {
id: 'OP202500001',
createTime: '2025-09-27 10:30:00',
customerAddress: '南京市玄武区中山路123号',
installerId: 'INS001',
installerName: '王师傅',
installerPhone: '13987654321',
tags: ['网络升级', '家庭安防'],
status: 'following',
assignedTo: 'SALE001',
assignedToName: '张营销',
lastFollowTime: '2025-09-28 14:20:00',
customerPhone: '138****5678',
description: '用户反馈家中网络卡顿,希望升级宽带套餐,同时对家庭监控摄像头很感兴趣',
region: '南京市玄武区',
gridName: 'A网格'
}
// 模拟跟进记录
const mockActivities = [
{
content: '商机创建',
timestamp: '2025-09-27 10:30:00',
type: 'primary',
operator: '王师傅'
},
{
content: '首次跟进,联系客户确认需求',
timestamp: '2025-09-27 15:45:00',
type: 'success',
operator: '张营销'
},
{
content: '预约上门时间',
timestamp: '2025-09-28 09:30:00',
type: 'success',
operator: '张营销'
},
{
content: '上门服务完成,客户有意向办理套餐升级',
timestamp: '2025-09-28 14:20:00',
type: 'success',
operator: '张营销'
}
]
export default {
name: 'OpportunityDetail',
data() {
return {
opportunity: mockOpportunity,
activities: mockActivities
}
},
methods: {
goBack() {
this.$router.go(-1)
},
getStatusType(status) {
return statusMap[status]?.type || 'info'
},
getStatusLabel(status) {
return statusMap[status]?.label || status
},
handleFollowUp() {
this.$message.info('跟进功能开发中')
},
handleComplete() {
this.$message.info('成单功能开发中')
}
}
}
</script>
<style lang="scss" scoped>
.opportunity-detail {
.page-header {
margin-bottom: 24px;
}
.detail-card {
margin-bottom: 24px;
.card-header {
margin-bottom: 20px;
h3 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #303133;
}
}
.card-content {
.info-item {
display: flex;
margin-bottom: 15px;
.info-label {
width: 100px;
color: #606266;
font-weight: 500;
}
.info-value {
flex: 1;
color: #303133;
}
}
.activity-content {
p {
margin: 0 0 5px 0;
}
.operator {
font-size: 12px;
color: #909399;
}
}
}
}
.actions {
text-align: center;
padding: 20px 0;
.el-button {
margin: 0 10px;
}
}
}
</style>