fix(leads): keep a future follow-up as an activity on the lead
A scheduled follow-up only stored a date, and activities opened from a lead were not linked back, so they disappeared from the lead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -126,6 +126,7 @@ const dueDate = ref('');
|
||||
const dueTime = ref('10:30');
|
||||
const durationMinutes = ref(30);
|
||||
const personId = ref('');
|
||||
const leadId = ref('');
|
||||
const dealId = ref('');
|
||||
const assigneeIds = ref<string[]>([]);
|
||||
const isDone = ref(false);
|
||||
@@ -519,6 +520,7 @@ async function load() {
|
||||
if (data.person?.id) await ensurePersonLoaded(data.person.id);
|
||||
personId.value = data.person?.id ?? '';
|
||||
dealId.value = data.deal?.id ?? '';
|
||||
leadId.value = data.lead?.id ?? '';
|
||||
assigneeIds.value = data.assignees?.length
|
||||
? data.assignees.map((a) => a.id)
|
||||
: data.assignee?.id
|
||||
@@ -538,6 +540,7 @@ async function load() {
|
||||
await ensurePersonLoaded(incomingPerson);
|
||||
personId.value = incomingPerson;
|
||||
}
|
||||
leadId.value = typeof route.query.leadId === 'string' ? route.query.leadId : '';
|
||||
const incomingDef =
|
||||
typeof route.query.typeDefId === 'string'
|
||||
? activityTypes.byId.value.get(route.query.typeDefId)
|
||||
@@ -599,6 +602,7 @@ function payload(): CreateActivityRequest {
|
||||
personId: personId.value || null,
|
||||
companyId: selectedPerson.value?.company?.id ?? null,
|
||||
dealId: dealId.value || null,
|
||||
leadId: leadId.value || null,
|
||||
assigneeIds: [...assigneeIds.value],
|
||||
assigneeId: assigneeIds.value[0] || null,
|
||||
};
|
||||
|
||||
@@ -845,6 +845,16 @@ onBeforeUnmount(() => narrowMq?.removeEventListener('change', syncNarrow));
|
||||
</template>
|
||||
</a-list>
|
||||
<a-empty v-else description="فعالیت مرتبطی نیست." />
|
||||
<RouterLink
|
||||
:to="{ name: 'activity-new', query: { leadId: lead.id } }"
|
||||
custom
|
||||
v-slot="{ navigate }"
|
||||
>
|
||||
<a-button type="dashed" block @click="navigate">
|
||||
<template #icon><PlusOutlined /></template>
|
||||
ایجاد فعالیت
|
||||
</a-button>
|
||||
</RouterLink>
|
||||
|
||||
<a-divider orientation="right">جدول زمانی</a-divider>
|
||||
<a-timeline v-if="lead.events.length">
|
||||
@@ -889,17 +899,6 @@ onBeforeUnmount(() => narrowMq?.removeEventListener('change', syncNarrow));
|
||||
مشاهده همه فعالیتها
|
||||
</a-button>
|
||||
</RouterLink>
|
||||
<RouterLink
|
||||
v-if="narrow"
|
||||
:to="{ name: 'activity-new' }"
|
||||
custom
|
||||
v-slot="{ navigate }"
|
||||
>
|
||||
<a-button type="dashed" block @click="navigate">
|
||||
<template #icon><PlusOutlined /></template>
|
||||
ایجاد فعالیت
|
||||
</a-button>
|
||||
</RouterLink>
|
||||
</template>
|
||||
</a-card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user