0
0
Fork 0

corrections

This commit is contained in:
Alexandre Riera 2022-11-30 14:35:05 +01:00
parent 7ee8dbf2d6
commit e35c11d714
4 changed files with 226 additions and 237 deletions

View File

@ -3,7 +3,6 @@ import toDate from './toDate';
import toCurrency from './toCurrency';
import toPercentage from './toPercentage';
import dashIfEmpty from './dashIfEmpty';
import zeroFill from './zeroFill';
export {
toLowerCase,
@ -11,5 +10,4 @@ export {
toCurrency,
toPercentage,
dashIfEmpty,
zeroFill
};

View File

@ -1,4 +0,0 @@
export default function (value, pad) {
const valueStr = String(value);
return valueStr.padStart(pad, '0');
}

View File

@ -3,7 +3,7 @@ import { onMounted, ref, computed, onUpdated } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { dashIfEmpty, toDate, toCurrency, zeroFill } from 'src/filters';
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
import FetchData from 'components/FetchData.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
@ -33,7 +33,6 @@ async function fetch() {
const { data } = await axios.get(`Tickets/${entityId.value}/summary`);
if (data) {
ticket.value = data;
console.log(ticket.value);
salesLines.value = data.sales;
}
}
@ -92,7 +91,8 @@ async function changeState(value) {
<q-btn-dropdown
side
top
color="dark"
color="orange-11"
text-color="black"
:label="t('ticket.summary.changeState')"
:disable="!isEditable()"
>
@ -248,11 +248,17 @@ async function changeState(value) {
</div>
<div class="row q-pa-md" v-if="salesLines.length > 0">
<div class="col">
<q-list>
<q-item-label header class="text-h6">
{{ t('ticket.summary.saleLines') }}
<q-tooltip>{{ t('ticket.summary.goTo') }}</q-tooltip>
<router-link
:to="{ name: 'TicketBasicData', params: { id: entityId } }"
target="_blank"
>
<q-icon name="open_in_new" />
</router-link>
</q-item-label>
<q-table :rows="ticket.sales">
<q-table :rows="ticket.sales" flat>
<template #header="props">
<q-tr :props="props">
<q-th auto-width></q-th>
@ -301,12 +307,23 @@ async function changeState(value) {
{{ props.row.claimBeginning.claimFk }}</q-tooltip
>
</q-btn>
<q-icon name="warning" v-show="props.row.visible < 0" size="xs" color="primary">
<q-icon
name="warning"
v-show="props.row.visible < 0"
size="xs"
color="primary"
>
<q-tooltip
>{{ t('ticket.summary.visible') }}: {{ props.row.visible }}</q-tooltip
>{{ t('ticket.summary.visible') }}:
{{ props.row.visible }}</q-tooltip
>
</q-icon>
<q-icon name="vn:reserva" v-show="props.row.reserved" size="xs" color="primary">
<q-icon
name="vn:reserva"
v-show="props.row.reserved"
size="xs"
color="primary"
>
<q-tooltip>{{ t('ticket.summary.reserved') }}</q-tooltip>
</q-icon>
<q-icon
@ -326,7 +343,7 @@ async function changeState(value) {
<q-tooltip>{{ t('ticket.summary.hasComponentLack') }}</q-tooltip>
</q-icon>
</q-td>
<q-td class="link">{{ zeroFill(props.row.itemFk, 6) }}</q-td>
<q-td class="link">{{ props.row.itemFk }}</q-td>
<q-td>{{ props.row.visible }}</q-td>
<q-td>{{ props.row.available }}</q-td>
<q-td>{{ props.row.quantity }}</q-td>
@ -354,15 +371,17 @@ async function changeState(value) {
</q-tr>
</template>
</q-table>
</q-list>
</div>
</div>
<div class="row q-pa-md" v-if="ticket.packagings.length > 0 || ticket.services.length > 0">
<div class="col" v-if="ticket.packagings.length > 0">
<q-list>
<q-item-label header class="text-h6">
{{ t('ticket.summary.packages') }}
<q-tooltip>{{ t('ticket.summary.goTo') }}</q-tooltip>
<q-icon name="open_in_new" />
</q-item-label>
<q-table :rows="ticket.packagings">
<q-table :rows="ticket.packagings" flat>
<template #header="props">
<q-tr :props="props">
<q-th auto-width>{{ t('ticket.summary.created') }}</q-th>
@ -378,13 +397,15 @@ async function changeState(value) {
</q-tr>
</template>
</q-table>
</q-list>
</div>
<div class="col" v-if="ticket.services.length > 0">
<q-list>
<q-item-label header class="text-h6">
{{ t('ticket.summary.services') }}
<q-tooltip>{{ t('ticket.summary.goTo') }}</q-tooltip>
<q-icon name="open_in_new" />
</q-item-label>
<q-table :rows="ticket.services">
<q-table :rows="ticket.services" flat>
<template #header="props">
<q-tr :props="props">
<q-th auto-width>{{ t('ticket.summary.quantity') }}</q-th>
@ -404,15 +425,17 @@ async function changeState(value) {
</q-tr>
</template>
</q-table>
</q-list>
</div>
</div>
<div class="row q-pa-md" v-if="ticket.requests.length > 0">
<div class="col">
<q-list>
<q-item-label header class="text-h6">
{{ t('ticket.summary.request') }}
<q-tooltip>{{ t('ticket.summary.goTo') }}</q-tooltip>
<q-icon name="open_in_new" />
</q-item-label>
<q-table :rows="ticket.requests">
<q-table :rows="ticket.requests" flat>
<template #header="props">
<q-tr :props="props">
<q-th auto-width>{{ t('ticket.summary.description') }}</q-th>
@ -434,13 +457,12 @@ async function changeState(value) {
<q-td>{{ props.row.quantity }}</q-td>
<q-td>{{ toCurrency(props.row.price) }}</q-td>
<q-td v-if="!props.row.sale">-</q-td>
<q-td v-if="props.row.sale" class="link">{{
zeroFill(props.row.sale.itemFk, 6)
}}</q-td>
<q-td v-if="props.row.sale" class="link">{{ props.row.sale.itemFk }}</q-td>
<q-td><q-checkbox v-model="props.row.isOk" :disable="true" /></q-td>
</q-tr>
</template>
</q-table>
</q-list>
</div>
</div>
</template>
@ -455,9 +477,21 @@ async function changeState(value) {
.q-card {
width: 100%;
height: 100%;
max-width: 1200px;
}
.summary {
.q-list {
.q-item__label--header {
display: flex;
justify-content: space-between;
a {
color: $primary;
}
}
}
.fetched-tags {
display: flex;
flex-wrap: wrap;
@ -494,26 +528,6 @@ async function changeState(value) {
}
}
.text-h6 {
margin-bottom: $spacing-md;
text-transform: uppercase;
line-height: 1;
padding: 7px 0;
padding-bottom: 5px;
border-bottom: 2px solid $primary;
overflow: hidden;
position: relative;
}
.text-h6:after {
font-family: 'Material Icons';
content: 'open_in_new';
position: absolute;
right: 5px;
text-transform: none;
color: $primary;
}
.header {
font-size: 18px;
display: flex;
@ -532,4 +546,8 @@ async function changeState(value) {
}
}
}
.q-dialog .summary {
max-width: 1200px;
}
</style>

View File

@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import Paginate from 'components/Paginate.vue';
import { toDate, toCurrency } from 'src/filters/index';
// import TicketSummary from './Card/TicketSummary.vue';
import TicketSummary from './Card/TicketSummary.vue';
const router = useRouter();
const { t } = useI18n();
@ -55,7 +55,7 @@ const preview = ref({
function showPreview(id) {
preview.value.shown = true;
preview.value.data = {
customerId: id,
ticketId: id,
};
}
</script>
@ -108,42 +108,19 @@ function showPreview(id) {
</q-item-section>
<q-separator vertical />
<q-card-actions vertical class="justify-between">
<!-- <q-btn color="grey-7" round flat icon="more_vert">
<q-tooltip>{{ t('customer.list.moreOptions') }}</q-tooltip>
<q-menu cover auto-close>
<q-list>
<q-item clickable>
<q-item-section avatar>
<q-icon name="add" />
</q-item-section>
<q-item-section>Add a note</q-item-section>
</q-item>
<q-item clickable>
<q-item-section avatar>
<q-icon name="history" />
</q-item-section>
<q-item-section>Display customer history</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn> -->
<q-btn flat round color="orange" icon="arrow_circle_right" @click="navigate(row.id)">
<q-tooltip>{{ t('components.smartCard.openCard') }}</q-tooltip>
</q-btn>
<q-btn flat round color="grey-7" icon="preview" @click="showPreview(row.id)">
<q-tooltip>{{ t('components.smartCard.openSummary') }}</q-tooltip>
</q-btn>
<!-- <q-btn flat round color="grey-7" icon="vn:ticket">
<q-tooltip>{{ t('customer.list.customerOrders') }}</q-tooltip>
</q-btn> -->
</q-card-actions>
</q-item>
</q-card>
</template>
</paginate>
</q-page>
<!-- <q-dialog v-model="preview.shown">
<customer-summary :customer-id="preview.data.customerId" />
</q-dialog> -->
<q-dialog v-model="preview.shown">
<ticket-summary :id="preview.data.ticketId" />
</q-dialog>
</template>