This commit is contained in:
hrx 2026-07-10 16:53:11 +08:00
parent 3f149a6367
commit 3854c483fe

View File

@ -162,31 +162,31 @@
<div v-if="currentRow" class="detail-panel">
<div class="detail-grid">
<div class="detail-item">
<span class="detail-label">姓名</span>
<span class="detail-label">姓名</span>
<strong>{{ currentRow.name || '-' }}</strong>
</div>
<div class="detail-item">
<span class="detail-label">联系电话</span>
<span class="detail-label">联系电话</span>
<strong>{{ currentRow.phone || '-' }}</strong>
</div>
<div class="detail-item">
<span class="detail-label">邮箱</span>
<span class="detail-label">邮箱</span>
<strong>{{ currentRow.email || '-' }}</strong>
</div>
<div class="detail-item">
<span class="detail-label">公司名称</span>
<span class="detail-label">公司名称</span>
<strong>{{ currentRow.company || '-' }}</strong>
</div>
<div class="detail-item">
<span class="detail-label">企业类型</span>
<span class="detail-label">企业类型</span>
<strong>{{ currentRow.enterprise_type_name || currentRow.custom_type_name || '-' }}</strong>
</div>
<div class="detail-item">
<span class="detail-label">咨询渠道</span>
<span class="detail-label">咨询渠道</span>
<strong>{{ currentRow.source || '-' }}</strong>
</div>
<div class="detail-item">
<span class="detail-label">提交时间</span>
<div class="detail-item detail-item-full">
<span class="detail-label">提交时间</span>
<strong>{{ currentRow.update_time || currentRow.create_at || '-' }}</strong>
</div>
</div>
@ -203,8 +203,8 @@
<div class="detail-divider"></div>
<div class="detail-section">
<span class="detail-label">回复状态</span>
<div class="detail-section detail-section-inline">
<span class="detail-label">回复状态</span>
<el-tag size="small" effect="plain" :type="feedbackTagType(currentRow.feedback)">
{{ feedbackText(currentRow) }}
</el-tag>
@ -276,6 +276,8 @@ export default {
originalRemarkText: '',
currentRow: null,
sourceList: [],
sourceStats: {},
pendingCountFromApi: 0,
queryForm: {
name: '',
phone: '',
@ -283,12 +285,7 @@ export default {
source: '',
feedback: ''
},
feedbackOptions: [
{ id: 0, name: '待回复' },
{ id: 1, name: '沟通中' },
{ id: 2, name: '已关闭' },
{ id: 3, name: '号码错误' }
]
feedbackOptions: []
}
},
computed: {
@ -301,13 +298,13 @@ export default {
return (this.page - 1) * this.pageSize + this.tableData.length
},
wechatCount() {
return this.tableData.filter(item => /微信|云宝/.test(String(item.source || ''))).length
return Number(this.sourceStats['公众号'] || 0)
},
webCount() {
return this.tableData.filter(item => !/微信|云宝/.test(String(item.source || ''))).length
return Number(this.sourceStats['官网'] || 0)
},
pendingCount() {
return this.tableData.filter(item => String(item.feedback) === '0').length
return Number(this.pendingCountFromApi || 0)
}
},
created() {
@ -392,6 +389,20 @@ export default {
.filter(Boolean)
)]
},
extractFeedbackList(res) {
const data = (res && res.data) || {}
const list = data.feedback_list || data.feedbackList || res.feedback_list || res.feedbackList
return Array.isArray(list) ? list : []
},
extractSourceStats(res) {
const data = (res && res.data) || {}
return data.source_stats || data.sourceStats || res.source_stats || res.sourceStats || {}
},
extractPendingCount(res) {
const data = (res && res.data) || {}
const count = Number(data.pending_count || data.pendingCount || res.pending_count || res.pendingCount || 0)
return Number.isFinite(count) ? count : 0
},
getTableData(to_excel) {
const params = this.buildSearchParams(to_excel)
if (to_excel === '0') this.tableLoading = true
@ -409,6 +420,10 @@ export default {
this.tableData = rows
this.totalCount = this.extractTotal(res, rows.length)
this.sourceList = this.extractSourceList(res, rows)
const feedbackList = this.extractFeedbackList(res)
if (feedbackList.length) this.feedbackOptions = feedbackList
this.sourceStats = this.extractSourceStats(res)
this.pendingCountFromApi = this.extractPendingCount(res)
this.selectedRows = []
return
}
@ -801,43 +816,60 @@ export default {
.detail-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0px 72px;
gap: 14px 56px;
}
.detail-item {
display: flex;
flex-direction: column;
gap: 6px;
align-items: baseline;
gap: 0;
word-break: break-word;
}
.detail-item-full {
grid-column: 1 / -1;
}
.detail-label {
display: block;
margin-bottom: 8px;
color: #8a94a6;
font-size: 14px;
line-height: 1.4;
display: inline;
flex-shrink: 0;
margin-bottom: 0;
color: #667085;
font-size: 13px;
line-height: 1.5;
font-weight: 500;
}
.detail-item strong,
.detail-section strong {
color: #111827;
font-size: 16px;
line-height: 1.5;
font-weight: 700;
color: #344054;
font-size: 14px;
line-height: 1.7;
font-weight: 600;
}
.detail-section {
margin-top: 28px;
margin-top: 22px;
}
.detail-section-inline {
display: flex;
align-items: center;
gap: 0;
}
.detail-section:not(.detail-section-inline) .detail-label {
display: block;
margin-bottom: 8px;
}
.detail-content-box {
min-height: 42px;
padding: 14px 16px;
padding: 12px 14px;
border-radius: 8px;
background: #f8fafc;
color: #1f2937;
font-size: 15px;
color: #475467;
font-size: 14px;
line-height: 1.7;
word-break: break-word;
}