Keep previous import source and code when a person is re-imported from another source

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-05 20:54:23 +03:30
co-authored by Cursor
parent c8753a4c4e
commit 46dcf296d3
8 changed files with 103 additions and 11 deletions
+7 -1
View File
@@ -655,7 +655,13 @@ onMounted(load);
قبلی: {{ p.previousFullName }}
</div>
</td>
<td>{{ sourceLabel(p.importSource || 'manual') }}</td>
<td>
{{ sourceLabel(p.importSource || 'manual') }}
<div v-if="p.previousImportSource" class="muted tiny">
قبلاً: {{ sourceLabel(p.previousImportSource) }}
<bdi v-if="p.previousSourceRef">{{ toFaDigits(p.previousSourceRef) }}</bdi>
</div>
</td>
<td dir="ltr">{{ externalCodeLabel(p) }}</td>
<td>{{ p.position || '—' }}</td>
<td>
+28 -10
View File
@@ -148,18 +148,25 @@ const externalCode = computed(() => {
}
return '';
});
const SOURCE_LABELS: Record<string, string> = {
manual: 'دستی',
tahesab: 'ته‌حساب',
didar: 'دیدار',
excel: 'اکسل',
phone: 'مخاطبین گوشی',
lead_form: 'فرم لید',
other: 'سایر',
};
const importSourceLabel = computed(() => {
const src = person.value?.importSource || 'manual';
const map: Record<string, string> = {
manual: 'دستی',
tahesab: 'ته‌حساب',
didar: 'دیدار',
excel: 'اکسل',
phone: 'مخاطبین گوشی',
lead_form: 'فرم لید',
other: 'سایر',
};
return map[src] || src;
return SOURCE_LABELS[src] || src;
});
const previousSourceLabel = computed(() => {
const src = person.value?.previousImportSource;
if (!src) return '';
return SOURCE_LABELS[src] || src;
});
const lastCallAt = computed(() => {
@@ -643,6 +650,12 @@ watch(() => route.query.tab, readTab, { immediate: true });
<span v-if="person.previousFullName" class="meta-chip">
نام قبلی: {{ person.previousFullName }}
</span>
<span v-if="previousSourceLabel" class="meta-chip prev">
قبلاً در {{ previousSourceLabel }}
<template v-if="person.previousSourceRef">
— کد <bdi>{{ toFaDigits(person.previousSourceRef) }}</bdi>
</template>
</span>
</div>
</div>
<div class="hero-side">
@@ -1185,6 +1198,11 @@ watch(() => route.query.tab, readTab, { immediate: true });
color: #0f766e;
}
.meta-chip.prev {
background: #fef3c7;
color: #92400e;
}
.hero-side {
display: grid;
justify-items: end;