fix: 移动端编辑拜访记录时客户名称显示UUID的问题

编辑模式下,el-select 的 customers 列表可能不包含当前记录对应的客户,
导致无法匹配选项而直接显示原始 UUID 值。
修复:从 GET 响应中获取 customer_name,补充到 customers 列表。

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 13:43:21 +08:00
parent f9eed82afb
commit e6237590c0
+4
View File
@@ -52,6 +52,10 @@ onMounted(async () => {
try {
const res = await visitsApi.get(route.params.id as string)
const v = res.data
// 确保当前客户在 select 选项列表中,避免显示 UUID
if (v.customer_id && v.customer_name && !customers.value.find(c => c.id === v.customer_id)) {
customers.value.unshift({ id: v.customer_id, name: v.customer_name })
}
form.value = {
customer_id: v.customer_id,
visit_date: v.visit_date,