|
| 1 | +<template> |
| 2 | + <ActiveCard> |
| 3 | + <Section> |
| 4 | + <div class="flex flex-row gap-2 items-center"> |
| 5 | + <UIcon name="i-lucide-banknote-arrow-up" class="size-8 text-primary" /> |
| 6 | + |
| 7 | + <div v-if="invoice.status === 'paid'" class="flex flex-row items-center gap-1.5 text-primary"> |
| 8 | + <UIcon |
| 9 | + name="i-lucide-bookmark-check" |
| 10 | + class="size-8" |
| 11 | + /> |
| 12 | + <p class="max-w-22 text-sm/4 font-bold"> |
| 13 | + Оплачено |
| 14 | + </p> |
| 15 | + </div> |
| 16 | + <div v-else class="flex flex-row items-center gap-1.5 text-muted"> |
| 17 | + <UIcon |
| 18 | + name="i-lucide-loader-circle" |
| 19 | + class="size-8 motion-preset-spin motion-duration-4000" |
| 20 | + /> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + |
| 24 | + <div class="flex flex-col gap-1"> |
| 25 | + <h3 class="text-xl/5 font-bold"> |
| 26 | + {{ new Intl.NumberFormat().format(invoice.total) }} ₽ |
| 27 | + </h3> |
| 28 | + |
| 29 | + <div class="text-base/5 font-bold"> |
| 30 | + {{ getInfoByType(invoice.type) }} |
| 31 | + </div> |
| 32 | + </div> |
| 33 | + |
| 34 | + <div class="flex flex-col gap-1"> |
| 35 | + <div class="text-base/5"> |
| 36 | + {{ invoice.title }} |
| 37 | + </div> |
| 38 | + |
| 39 | + <div class="text-base/5 text-muted"> |
| 40 | + {{ invoice.description }} |
| 41 | + </div> |
| 42 | + </div> |
| 43 | + |
| 44 | + <div class="text-sm/4 text-muted"> |
| 45 | + Создан {{ format(new Date(invoice.createdAt), 'd MMMM в HH:mm', { locale: ru }) }} |
| 46 | + </div> |
| 47 | + </Section> |
| 48 | + </ActiveCard> |
| 49 | +</template> |
| 50 | + |
| 51 | +<script setup lang="ts"> |
| 52 | +import type { Invoice } from '@roll-stack/database' |
| 53 | +import { format } from 'date-fns' |
| 54 | +import { ru } from 'date-fns/locale/ru' |
| 55 | +
|
| 56 | +defineProps<{ |
| 57 | + invoice: Invoice |
| 58 | +}>() |
| 59 | +
|
| 60 | +function getInfoByType(type: Invoice['type']) { |
| 61 | + switch (type) { |
| 62 | + case 'replenishment': |
| 63 | + return 'Пополнение' |
| 64 | + case 'royalties': |
| 65 | + return 'Роялти' |
| 66 | + case 'lump_sum_fee': |
| 67 | + return 'Паушальный взнос' |
| 68 | + case 'marketing_fee': |
| 69 | + return 'Маркетинговый сбор' |
| 70 | + case 'rospatent_fee': |
| 71 | + return 'Роспатент' |
| 72 | + case 'other': |
| 73 | + return 'Другое' |
| 74 | + default: |
| 75 | + return 'Другое' |
| 76 | + } |
| 77 | +} |
| 78 | +</script> |
0 commit comments