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 {