|
| 1 | +<template> |
| 2 | + <div class="p-4 space-y-6"> |
| 3 | + <h2 class="text-lg font-semibold">Company Tasks Timeline</h2> |
| 4 | + |
| 5 | + <!-- Stepper Container --> |
| 6 | + <Stepper |
| 7 | + v-model="currentStep" |
| 8 | + orientation="vertical" |
| 9 | + :linear="false" |
| 10 | + class="flex flex-col" |
| 11 | + > |
| 12 | + <TaskConfirmation |
| 13 | + :company-id="companyWithParticipation.id" |
| 14 | + :participation="currentParticipation" |
| 15 | + @package-changed="onPackageChanged" |
| 16 | + /> |
| 17 | + |
| 18 | + <TaskBillingLogos |
| 19 | + :billing-info="companyWithParticipation.billingInfo" |
| 20 | + :company-id="companyWithParticipation.id" |
| 21 | + /> |
| 22 | + |
| 23 | + <TaskContract :company-id="companyWithParticipation.id" /> |
| 24 | + |
| 25 | + <TaskSessionTitles |
| 26 | + v-if="showSessionTitles" |
| 27 | + :package-items="packageItems" |
| 28 | + /> |
| 29 | + |
| 30 | + <TaskCorlief |
| 31 | + :company-id="companyWithParticipation.id" |
| 32 | + :step-number="showSessionTitles ? 5 : 4" |
| 33 | + /> |
| 34 | + |
| 35 | + <TaskLogistics |
| 36 | + :company-id="companyWithParticipation.id" |
| 37 | + :step-number="showSessionTitles ? 6 : 5" |
| 38 | + :is-last="true" |
| 39 | + /> |
| 40 | + </Stepper> |
| 41 | + </div> |
| 42 | +</template> |
| 43 | + |
| 44 | +<script setup lang="ts"> |
| 45 | +import { ref, computed } from "vue"; |
| 46 | +import type { CompanyWithParticipation } from "@/dto/companies"; |
| 47 | +import type { Item } from "@/dto/item"; |
| 48 | +import { Stepper } from "@/components/ui/stepper"; |
| 49 | +import TaskConfirmation from "../../../../components/tasks/TaskConfirmation.vue"; |
| 50 | +import TaskBillingLogos from "../../../../components/tasks/TaskBillingLogos.vue"; |
| 51 | +import TaskContract from "../../../../components/tasks/TaskContract.vue"; |
| 52 | +import TaskSessionTitles from "../../../../components/tasks/TaskSessionTitles.vue"; |
| 53 | +import TaskCorlief from "../../../../components/tasks/TaskCorlief.vue"; |
| 54 | +import TaskLogistics from "../../../../components/tasks/TaskLogistics.vue"; |
| 55 | +
|
| 56 | +interface Props { |
| 57 | + companyWithParticipation: CompanyWithParticipation; |
| 58 | +} |
| 59 | +
|
| 60 | +const props = defineProps<Props>(); |
| 61 | +
|
| 62 | +// Get current participation |
| 63 | +const currentParticipation = computed( |
| 64 | + () => props.companyWithParticipation?.participation, |
| 65 | +); |
| 66 | +
|
| 67 | +// Package items for session titles |
| 68 | +const packageItems = ref<Item[]>([]); |
| 69 | +
|
| 70 | +const onPackageChanged = (_name: string, items: Item[]) => { |
| 71 | + packageItems.value = items; |
| 72 | +}; |
| 73 | +
|
| 74 | +// Show session titles only if package has presentation or workshop items |
| 75 | +const showSessionTitles = computed(() => { |
| 76 | + return packageItems.value.some( |
| 77 | + (item) => |
| 78 | + item.name?.toLowerCase() === "presentation" || |
| 79 | + item.name?.toLowerCase() === "workshop", |
| 80 | + ); |
| 81 | +}); |
| 82 | +
|
| 83 | +// Set current step to 0 so the stepper doesn't auto-mark any steps as completed |
| 84 | +const currentStep = ref(0); |
| 85 | +</script> |
0 commit comments