From 01bb134ff788274965dc21b151f907a401f71a9d Mon Sep 17 00:00:00 2001 From: v6ole Date: Wed, 19 Aug 2026 18:08:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=8F=E5=90=8C=E6=8B=9C=E8=AE=BF?= =?UTF-8?q?=E5=89=AF=E6=9C=AC=E5=88=A4=E6=96=AD=20=E2=80=94=20=E4=B8=BB?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=B8=8D=E5=86=8D=E8=A2=AB=E8=AF=AF=E5=88=A4?= =?UTF-8?q?=E4=B8=BA=E5=89=AF=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 原逻辑: 只要 visit_group_id 存在就当副本,导致主记录被误判 - 且用 companions[0](第一个同访人)当作创建者,显示错误的协同人 - 新逻辑: 用 edit_log[0].editor 判断 — editor==归属经理 是主记录, editor!=归属经理 才是副本 - 副本提示的创建者改为 edit_log[0].editor,不再依赖 companions[0] Co-Authored-By: Claude --- frontend/src/views/mobile/VisitForm.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/mobile/VisitForm.vue b/frontend/src/views/mobile/VisitForm.vue index 48173be..f4eeb32 100644 --- a/frontend/src/views/mobile/VisitForm.vue +++ b/frontend/src/views/mobile/VisitForm.vue @@ -81,15 +81,16 @@ onMounted(async () => { const parts = v.time_range.split('-') timeRangeValue.value = [parts[0], parts[1]] } - // Check if this is a companion record - if (v.visit_group_id) { + // Check if this is a companion copy (a record created BY someone else + // and copied to you as a co-visitor). The original (主记录) has + // editor == manager; a copy has editor != manager. + const creatorName = (v.edit_log && v.edit_log[0] && v.edit_log[0].editor) || '' + if (v.visit_group_id && creatorName && creatorName !== (v.manager_name || '')) { isCompanionRecord.value = true - // The companions field on a companion record contains the primary creator - const creatorId = (v.companions || [])[0] - if (creatorId) { - const creator = managers.value.find((m: any) => m.id === String(creatorId)) - companionOf.value = creator?.name || '' - } + companionOf.value = creatorName + } else { + isCompanionRecord.value = false + companionOf.value = '' } for (const key of (v.photos || [])) { try {