feat(crm): add deal create/update controls with status and payment

This commit is contained in:
Ruslan Bakiev
2026-02-27 09:44:15 +07:00
parent 881a8c6d39
commit 12af9979ab
13 changed files with 907 additions and 94 deletions

View File

@@ -229,6 +229,11 @@ const {
getDealCurrentStepLabel,
isDealStepDone,
formatDealStepMeta,
dealStageOptions,
createDealForContact,
dealCreateLoading,
updateDealDetails,
dealUpdateLoading,
refetchDeals,
} = useDeals({ apolloAuthReady, contacts, calendarEvents });
@@ -896,31 +901,6 @@ function closeCommQuickMenu() {
commQuickMenuOpen.value = false;
}
const commEventDateOptions = computed(() => {
const out: string[] = [];
const today = new Date();
for (let i = -7; i <= 30; i += 1) {
const d = new Date(today);
d.setDate(today.getDate() + i);
out.push(dayKey(d));
}
const selected = String(commEventForm.value.startDate ?? "").trim();
if (selected && !out.includes(selected)) out.unshift(selected);
return out;
});
const commEventTimeOptions = computed(() => {
const out: string[] = [];
for (let hour = 0; hour < 24; hour += 1) {
for (let minute = 0; minute < 60; minute += 15) {
out.push(`${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`);
}
}
const selected = String(commEventForm.value.startTime ?? "").trim();
if (selected && !out.includes(selected)) out.unshift(selected);
return out;
});
function commComposerPlaceholder() {
if (commComposerMode.value === "planned") return "Опиши, что нужно запланировать...";
if (commComposerMode.value === "logged") return "Опиши итог/отчёт по прошедшему событию...";
@@ -2135,32 +2115,18 @@ onBeforeUnmount(() => {
/>
<div v-if="commComposerMode === 'planned' || commComposerMode === 'logged'" class="comm-event-controls">
<select
<input
v-model="commEventForm.startDate"
class="select select-bordered select-xs h-7 min-h-7"
type="date"
class="input input-bordered input-xs h-7 min-h-7"
:disabled="commEventSaving"
>
<option
v-for="dateValue in commEventDateOptions"
:key="`comm-event-date-${dateValue}`"
:value="dateValue"
>
{{ formatDay(`${dateValue}T00:00:00`) }}
</option>
</select>
<select
<input
v-model="commEventForm.startTime"
class="select select-bordered select-xs h-7 min-h-7"
type="time"
class="input input-bordered input-xs h-7 min-h-7"
:disabled="commEventSaving"
>
<option
v-for="timeValue in commEventTimeOptions"
:key="`comm-event-time-${timeValue}`"
:value="timeValue"
>
{{ timeValue }}
</option>
</select>
<select
v-model.number="commEventForm.durationMinutes"
class="select select-bordered select-xs h-7 min-h-7"
@@ -2290,6 +2256,11 @@ onBeforeUnmount(() => {
:on-selected-deal-steps-expanded-change="(value) => { selectedDealStepsExpanded = value; }"
:is-deal-step-done="isDealStepDone"
:format-deal-step-meta="formatDealStepMeta"
:deal-stage-options="dealStageOptions"
:create-deal-for-contact="createDealForContact"
:deal-create-loading="dealCreateLoading"
:update-deal-details="updateDealDetails"
:deal-update-loading="dealUpdateLoading"
:active-review-contact-diff="activeReviewContactDiff"
:selected-workspace-contact="selectedWorkspaceContact"
/>