Improve person assets UI and fix Tahesab asnad date/list.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-05 11:08:46 +03:30
co-authored by Cursor
parent 43526cb980
commit 1ac23e13c1
4 changed files with 117 additions and 32 deletions
+36 -2
View File
@@ -33,6 +33,7 @@ import type {
PaginatedResponse,
PersonDto,
PersonAiSummaryDto,
PersonAccountingLinkDto,
PipelineBoardDto,
ProjectBoardBoardDto,
ProjectCardDto,
@@ -94,6 +95,7 @@ const tickets = ref<TicketDto[]>([]);
const memories = ref<MemoryItemDto[]>([]);
const deals = ref<DealDto[]>([]);
const cards = ref<ProjectCardDto[]>([]);
const tahesabMoshtariCode = ref<number | null>(null);
const moreOpen = ref(false);
const filterOpen = ref(false);
@@ -372,6 +374,7 @@ async function load() {
moreOpen.value = false;
filterOpen.value = false;
aiSummary.value = null;
tahesabMoshtariCode.value = null;
try {
const [personRes, actRes, noteRes, quoteRes, memRes, boardRes] = await Promise.all([
api.get<PersonDto>(`/people/${id.value}`),
@@ -407,6 +410,9 @@ async function load() {
params: { personId: id.value, limit: 50 },
}),
api.get<ProjectBoardBoardDto>('/project-boards/board'),
api.get<PersonAccountingLinkDto[]>(
`/integrations/tahesab/people/${id.value}/links`,
),
]);
invoices.value =
extras[0].status === 'fulfilled' ? extras[0].value.data.items : [];
@@ -418,6 +424,12 @@ async function load() {
.flatMap((s) => s.cards)
.filter((c) => c.person?.id === id.value)
: [];
if (extras[3].status === 'fulfilled' && extras[3].value.data.length) {
const preferred =
extras[3].value.data.find((l) => l.isDefaultConnection) ??
extras[3].value.data[0];
tahesabMoshtariCode.value = preferred?.moshtariCode ?? null;
}
} catch {
error.value = 'بارگذاری پرونده مشتری ناموفق بود.';
person.value = null;
@@ -488,6 +500,10 @@ async function completeNext() {
}
}
function onTahesabLinkChanged(code: number | null) {
tahesabMoshtariCode.value = code;
}
async function downloadAttachment(noteId: string, att: NoteAttachmentDto) {
const { data } = await api.get<Blob>(
`/notes/${noteId}/attachments/${att.id}/download`,
@@ -568,6 +584,9 @@ watch(() => route.query.tab, readTab, { immediate: true });
<div class="who">
<h2>
{{ fullName }}
<span v-if="tahesabMoshtariCode != null" class="tahesab-code" dir="ltr">{{
tahesabMoshtariCode
}}</span>
<span v-if="vip" class="vip-mark">VIP</span>
</h2>
<p v-if="subtitle" class="sub">{{ subtitle }}</p>
@@ -601,7 +620,12 @@ watch(() => route.query.tab, readTab, { immediate: true });
<div class="mob-id">
<CustomerMoodFace :mood="mood" :size="72" />
<div class="who">
<h2>{{ fullName }}</h2>
<h2>
{{ fullName }}
<span v-if="tahesabMoshtariCode != null" class="tahesab-code" dir="ltr">{{
tahesabMoshtariCode
}}</span>
</h2>
<p v-if="subtitle" class="sub">{{ subtitle }}</p>
</div>
</div>
@@ -812,7 +836,7 @@ watch(() => route.query.tab, readTab, { immediate: true });
</div>
<div v-show="tab === 'assets'" class="panel assets-panel">
<PersonAssetsPanel :person-id="id" />
<PersonAssetsPanel :person-id="id" @link-changed="onTahesabLinkChanged" />
</div>
<div v-show="tab === 'info'" class="panel info-panel" :class="{ 'is-empty': infoEmpty }">
@@ -1071,6 +1095,16 @@ watch(() => route.query.tab, readTab, { immediate: true });
padding: 0.12rem 0.45rem;
}
.tahesab-code {
font-size: 0.85rem;
font-weight: 700;
color: #0f766e;
background: color-mix(in srgb, #0f766e 12%, transparent);
border-radius: 8px;
padding: 0.1rem 0.45rem;
letter-spacing: 0.02em;
}
.sub {
margin: 0.25rem 0 0.7rem;
color: #64748b;