refs #6321 perf: update

This commit is contained in:
Javier Segarra 2024-03-14 14:21:02 +01:00
parent bffc496965
commit 2436db1c28
8 changed files with 41 additions and 42 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { h, onMounted } from 'vue'; import { onMounted } from 'vue';
import axios from 'axios'; import axios from 'axios';
const $props = defineProps({ const $props = defineProps({
@ -24,8 +24,8 @@ const $props = defineProps({
default: '', default: '',
}, },
limit: { limit: {
type: String, type: Number,
default: '', default: 30,
}, },
params: { params: {
type: Object, type: Object,

View File

@ -50,6 +50,10 @@ const $props = defineProps({
type: String, type: String,
default: null, default: null,
}, },
orderBy: {
type: String,
default: null,
},
limit: { limit: {
type: Number, type: Number,
default: 30, default: 30,

View File

@ -460,7 +460,7 @@ export default {
lack: 'Negativo', lack: 'Negativo',
inkFk: 'Color', inkFk: 'Color',
timed: 'timed', timed: 'timed',
minTimed: 'minTimed', minTimed: 'Hora',
detail:{ detail:{
itemFk:'Articulo', itemFk:'Articulo',
ticketFk:'Id_Ticket', ticketFk:'Id_Ticket',

View File

@ -1,32 +1,22 @@
<script setup> <script setup>
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { toDate, toPercentage } from 'filters/index';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { QBtn, QCheckbox, QSelect } from 'quasar'; import { QBtn, QCheckbox } from 'quasar';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnSelectFilter from 'components/common/VnSelectFilter.vue'; import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore';
import { toCurrency } from 'src/filters';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
import { useDialogPluginComponent } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n(); const { t } = useI18n();
const URL_KEY = 'Tickets/ItemLack'; const URL_KEY = 'Tickets/ItemLack';
const editableStates = ref([]); const editableStates = ref([]);
const rowsSelected = ref([]); const rowsSelected = ref([]);
const entryBuysPaginateRef = ref(null); // const entryBuysPaginateRef = ref(null);
const packagingsOptions = ref(null); // const packagingsOptions = ref(null);
const originalRowDataCopy = ref(null); const originalRowDataCopy = ref(null);
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -158,7 +148,10 @@ const tableColumnComponents = computed(() => ({
}, },
state: { state: {
component: VnSelectFilter, component: VnSelectFilter,
props: { type: 'select',
filterValue: null,
attrs: {
'option-value': 'id', 'option-value': 'id',
'option-label': 'name', 'option-label': 'name',
'emit-value': false, 'emit-value': false,
@ -265,8 +258,8 @@ defineEmits([...useDialogPluginComponent.emits]);
const { dialogRef, onDialogHide } = useDialogPluginComponent(); const { dialogRef, onDialogHide } = useDialogPluginComponent();
async function changeState(value) { // async function changeState(value) {
/* if (!ticket.value.id) return; /* if (!ticket.value.id) return;
const formData = { const formData = {
ticketFk: ticket.value.id, ticketFk: ticket.value.id,
@ -274,7 +267,7 @@ async function changeState(value) {
}; };
await axios.post(`TicketTrackings/changeState`, formData);*/ await axios.post(`TicketTrackings/changeState`, formData);*/
} // }
</script> </script>
<template> <template>
@ -331,11 +324,11 @@ async function changeState(value) {
}}</template> }}</template>
<template v-if="col.name === 'ticketFk'" <template v-if="col.name === 'ticketFk'"
>{{ col.value }} >{{ col.value }}
<ItemDescriptorProxy :id="props.row.id" <ItemDescriptorProxy :id="$props.id"
/></template> /></template>
<template v-if="col.name === 'itemFk'" <template v-if="col.name === 'itemFk'"
>{{ col.value }} >{{ col.value }}
<ItemDescriptorProxy :id="props.row.id" <ItemDescriptorProxy :id="$props.id"
/></template> /></template>
</component> </component>
</template> </template>

View File

@ -5,8 +5,10 @@ import { useStateStore } from 'stores/useStateStore';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnPaginate from 'components/ui/VnPaginate.vue';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue'; import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import TicketDescriptorDialog from 'pages/Ticket/Negative/TicketLackDescriptorDialog.vue'; import TicketDescriptorDialog from 'pages/Ticket/Negative/TicketLackDescriptorDialog.vue';
import { useQuasar } from 'quasar'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
const session = useSession(); const session = useSession();
const token = session.getToken(); const token = session.getToken();
@ -28,6 +30,12 @@ const viewSummary = (value) => {
// }); // });
}; };
const columns = computed(() => [ const columns = computed(() => [
{
name: 'minTimed',
label: t('ticket.negative.minTimed'),
field: ({ minTimed }) => minTimed,
sortable: true,
},
{ {
name: 'itemFk', name: 'itemFk',
label: t('ticket.negative.id'), label: t('ticket.negative.id'),
@ -145,16 +153,17 @@ const columns = computed(() => [
</QTd> </QTd>
</template> </template>
<template #body-cell-ticketFk="{ value }"> <template #body-cell-longName="{ row, value }">
<QTd align="right" class="text-primary"> <QTd align="right" class="text-primary">
<span class="text-primary link">{{ value }}</span> <QBtn flat color="blue" dense>{{ value }}</QBtn>
<ItemDescriptorProxy :id="row.itemFk" />
</QTd> </QTd>
</template> </template>
<template #body-cell-clientFk="{ value }"> <template #body-cell-clientFk="{ value }">
<QTd align="right" class="text-primary"> <QTd align="right" class="text-primary">
<span class="text-primary link">{{ value }}</span> <QBtn flat color="blue" dense>{{ value }}</QBtn>
<CustomerDescriptorProxy :id="value" /> <CustomerDescriptorProxy :id="row.itemFk" />
</QTd> </QTd>
</template> </template>
@ -193,14 +202,7 @@ const columns = computed(() => [
<span class="text-h6 text-grey">{{ currentRow.longName }}</span> <span class="text-h6 text-grey">{{ currentRow.longName }}</span>
<QSpace /> <QSpace />
<QBtn <QBtn icon="close" flat round dense v-close-popup />
icon="close"
:disable="isLoading"
flat
round
dense
v-close-popup
/>
</QCardSection> </QCardSection>
<QCardSection class="row items-center"> <QCardSection class="row items-center">
<TicketDescriptorDialog <TicketDescriptorDialog

View File

@ -5,7 +5,7 @@ export default {
path: '/ticket', path: '/ticket',
meta: { meta: {
title: 'tickets', title: 'tickets',
icon: 'vn:ticket', icon: 'outgoing_mail',
moduleName: 'Ticket', moduleName: 'Ticket',
}, },
component: RouterView, component: RouterView,

View File

@ -40,9 +40,9 @@ describe('VnLocation', () => {
cy.waitForElement('.q-card'); cy.waitForElement('.q-card');
}); });
it('Show all options', function() { it('Show locations options', function() {
cy.get(inputLocation).click(); cy.get(inputLocation).click();
cy.get(locationOptions).should('have.length', 1); cy.get(locationOptions).should('have.length', 5);
}); });
}); });
}) })

View File

@ -15,8 +15,8 @@ describe('WorkerList', () => {
it('should open the worker summary', () => { it('should open the worker summary', () => {
cy.openListSummary(0); cy.openListSummary(0);
cy.get('.summaryHeader div').should('have.text', '1110 - Jessica Jones'); cy.get('.summaryHeader > div').should('have.text', '1110 - Jessica Jones');
cy.get('.summary .header').eq(0).invoke('text').should('include', 'Basic data'); cy.get('.summaryBody > :nth-child(1) > .header').invoke('text').should('include', 'Basic data');
cy.get('.summary .header').eq(1).should('have.text', 'User data'); cy.get('.summaryBody > :nth-child(2) > .header').should('have.text', 'User data');
}); });
}); });