forked from verdnatura/salix-front
Ticket photos
This commit is contained in:
parent
2162315905
commit
91eb966586
|
@ -554,6 +554,7 @@ ticket:
|
|||
weeklyTickets: Weekly tickets
|
||||
services: Service
|
||||
tracking: Tracking
|
||||
pictures: Pictures
|
||||
list:
|
||||
nickname: Nickname
|
||||
state: State
|
||||
|
|
|
@ -552,6 +552,7 @@ ticket:
|
|||
weeklyTickets: Tickets programados
|
||||
services: Servicios
|
||||
tracking: Estados
|
||||
pictures: Fotos
|
||||
list:
|
||||
nickname: Alias
|
||||
state: Estado
|
||||
|
|
|
@ -7,7 +7,7 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
|||
import OrderCatalogItemDialog from 'pages/Order/Card/OrderCatalogItemDialog.vue';
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
|
||||
import toCurrency from '../../../filters/toCurrency';
|
||||
import { toCurrency } from 'filters/index';
|
||||
|
||||
const DEFAULT_PRICE_KG = 0;
|
||||
|
||||
|
@ -18,6 +18,10 @@ defineProps({
|
|||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
isCatalog: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const dialog = ref(null);
|
||||
|
@ -28,7 +32,7 @@ const dialog = ref(null);
|
|||
<QCard class="card shadow-6">
|
||||
<div class="img-wrapper">
|
||||
<VnImg :id="item.id" zoom-size="lg" class="image" />
|
||||
<div v-if="item.hex" class="item-color-container">
|
||||
<div v-if="item.hex && isCatalog" class="item-color-container">
|
||||
<div
|
||||
class="item-color"
|
||||
:style="{ backgroundColor: `#${item.hex}` }"
|
||||
|
@ -50,11 +54,12 @@ const dialog = ref(null);
|
|||
</template>
|
||||
<div class="footer">
|
||||
<div class="price">
|
||||
<p>
|
||||
<p v-if="isCatalog">
|
||||
{{ item.available }} {{ t('to') }}
|
||||
{{ toCurrency(item.price) }}
|
||||
</p>
|
||||
<QIcon name="add_circle" class="icon">
|
||||
<slot name="price" />
|
||||
<QIcon v-if="isCatalog" name="add_circle" class="icon">
|
||||
<QTooltip>{{ t('globals.add') }}</QTooltip>
|
||||
<QPopupProxy ref="dialog">
|
||||
<OrderCatalogItemDialog
|
||||
|
|
|
@ -77,7 +77,12 @@ function extractValueTags(items) {
|
|||
<div v-if="rows && !rows?.length" class="no-result">
|
||||
{{ t('globals.noResults') }}
|
||||
</div>
|
||||
<OrderCatalogItem v-for="row in rows" :key="row.id" :item="row" />
|
||||
<OrderCatalogItem
|
||||
v-for="row in rows"
|
||||
:key="row.id"
|
||||
:item="row"
|
||||
is-catalog
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import OrderCatalogItem from 'pages/Order/Card/OrderCatalogItem.vue';
|
||||
|
||||
import { toCurrency } from 'filters/index';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
||||
const salesFilter = {
|
||||
include: {
|
||||
relation: 'item',
|
||||
scope: {
|
||||
field: ['name', 'image'],
|
||||
},
|
||||
},
|
||||
where: { ticketFk: route.params.id },
|
||||
};
|
||||
const sales = ref([]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
ref="salesRef"
|
||||
url="sales"
|
||||
:filter="salesFilter"
|
||||
@on-fetch="(data) => (sales = data)"
|
||||
auto-load
|
||||
/>
|
||||
<div class="pictures-list">
|
||||
<OrderCatalogItem v-for="(sale, index) in sales" :key="index" :item="sale.item">
|
||||
<template #price>
|
||||
<div class="q-mt-md full-width row justify-between items-center">
|
||||
<span class="text-h6">{{ sale.quantity }}</span>
|
||||
<span>{{ t('by') }}</span>
|
||||
<span class="text-h6">{{ toCurrency(sale.item?.price) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</OrderCatalogItem>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pictures-list {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
by: por
|
||||
</i18n>
|
|
@ -23,6 +23,7 @@ export default {
|
|||
'TicketTracking',
|
||||
'TicketVolume',
|
||||
'TicketNotes',
|
||||
'TicketPicture',
|
||||
],
|
||||
},
|
||||
children: [
|
||||
|
@ -142,6 +143,15 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketLog.vue'),
|
||||
},
|
||||
{
|
||||
path: 'picture',
|
||||
name: 'TicketPicture',
|
||||
meta: {
|
||||
title: 'pictures',
|
||||
icon: 'vn:photo',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketPicture.vue'),
|
||||
},
|
||||
{
|
||||
path: 'boxing',
|
||||
name: 'TicketBoxing',
|
||||
|
|
Loading…
Reference in New Issue