63 lines
1.4 KiB
Vue

<template>
<h4
v-if="requests.length === 0"
class="text-center"
>
Заявок нет
</h4>
<table
v-else
class="table"
>
<thead>
<tr>
<th></th>
<th>ФИО</th>
<th>Сумма</th>
<th>Телефон</th>
<th>Статус</th>
<th>Действие</th>
</tr>
</thead>
<tbody>
<tr
v-for="(request, index) in requests"
:key="request.id"
>
<td>{{ index + 1 }}</td>
<td>{{ request.fio }}</td>
<td>{{ currencyFormatter.format(request.amount) }}</td>
<td>{{ request.phone }}</td>
<td>
<app-status :status="request.status" />
</td>
<td>
<router-link
v-slot="{navigate}"
custom
:to="{name: PAGE.REQUEST, params: {id: request.id}}"
>
<button
class="btn primary"
@click="navigate"
>
Открыть
</button>
</router-link>
</td>
</tr>
</tbody>
</table>
</template>
<script setup lang="ts">
import { currencyFormatter } from '@/utils/helpers';
import type { AppRequest } from '@/utils/constants';
import AppStatus from '@/components/ui/AppStatus.vue';
import { PAGE } from '@/router';
defineProps<{requests: AppRequest[]}>()
</script>