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