Merge pull request 'CambiosSolicitadosEntries' (!201) from hyervoni/salix-front-mindshore:CambiosSolicitadosEntries into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #201
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Alex Moreno 2024-03-14 06:39:45 +00:00
commit ab8e1fdc04
8 changed files with 112 additions and 64 deletions

View File

@ -59,6 +59,9 @@ const toggleForm = () => {
:name="actionIcon" :name="actionIcon"
:size="actionIcon === 'add' ? 'xs' : 'sm'" :size="actionIcon === 'add' ? 'xs' : 'sm'"
:class="['default-icon', { '--add-icon': actionIcon === 'add' }]" :class="['default-icon', { '--add-icon': actionIcon === 'add' }]"
:style="{
'font-variation-settings': `'FILL' ${1}`,
}"
> >
<QTooltip v-if="tooltip">{{ tooltip }}</QTooltip> <QTooltip v-if="tooltip">{{ tooltip }}</QTooltip>
</QIcon> </QIcon>

View File

@ -97,6 +97,11 @@ select:-webkit-autofill {
background-color: var(--vn-light-gray); background-color: var(--vn-light-gray);
} }
.vn-table-separation-row {
height: 16px !important;
background-color: var(--vn-gray) !important;
}
/* Estilo para el asterisco en campos requeridos */ /* Estilo para el asterisco en campos requeridos */
.q-field.required .q-field__label:after { .q-field.required .q-field__label:after {
content: ' *'; content: ' *';

View File

@ -310,8 +310,8 @@ export default {
reference: 'Referencia', reference: 'Referencia',
invoiceNumber: 'Núm. factura', invoiceNumber: 'Núm. factura',
ordered: 'Pedida', ordered: 'Pedida',
confirmed: 'Confirmado', confirmed: 'Confirmada',
booked: 'Asentado', booked: 'Contabilizada',
raid: 'Redada', raid: 'Redada',
excludedFromAvailable: 'Inventario', excludedFromAvailable: 'Inventario',
travelReference: 'Referencia', travelReference: 'Referencia',

View File

@ -61,6 +61,7 @@ const onFilterTravelSelected = (formData, id) => {
:url-update="`Entries/${route.params.id}`" :url-update="`Entries/${route.params.id}`"
model="entry" model="entry"
auto-load auto-load
:clear-store-on-unmount="false"
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">

View File

@ -43,7 +43,7 @@ const tableColumnComponents = computed(() => ({
item: { item: {
component: QBtn, component: QBtn,
props: { props: {
color: 'blue', color: 'primary',
flat: true, flat: true,
}, },
event: () => ({}), event: () => ({}),
@ -54,6 +54,7 @@ const tableColumnComponents = computed(() => ({
type: 'number', type: 'number',
min: 0, min: 0,
class: 'input-number', class: 'input-number',
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -67,6 +68,7 @@ const tableColumnComponents = computed(() => ({
'use-input': true, 'use-input': true,
'hide-selected': true, 'hide-selected': true,
options: packagingsOptions.value, options: packagingsOptions.value,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -76,6 +78,7 @@ const tableColumnComponents = computed(() => ({
type: 'number', type: 'number',
min: 0, min: 0,
class: 'input-number', class: 'input-number',
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -84,6 +87,7 @@ const tableColumnComponents = computed(() => ({
props: { props: {
type: 'number', type: 'number',
min: 0, min: 0,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -92,6 +96,7 @@ const tableColumnComponents = computed(() => ({
props: { props: {
type: 'number', type: 'number',
min: 0, min: 0,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -100,6 +105,7 @@ const tableColumnComponents = computed(() => ({
props: { props: {
type: 'number', type: 'number',
min: 0, min: 0,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -108,6 +114,7 @@ const tableColumnComponents = computed(() => ({
props: { props: {
type: 'number', type: 'number',
min: 0, min: 0,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -116,6 +123,7 @@ const tableColumnComponents = computed(() => ({
props: { props: {
type: 'number', type: 'number',
min: 0, min: 0,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -124,6 +132,7 @@ const tableColumnComponents = computed(() => ({
props: { props: {
type: 'number', type: 'number',
min: 0, min: 0,
dense: true,
}, },
event: getInputEvents, event: getInputEvents,
}, },
@ -276,7 +285,7 @@ const toggleGroupingMode = async (buy, mode) => {
} }
}; };
const showLockIcon = (groupingMode, mode) => { const lockIconType = (groupingMode, mode) => {
if (mode === 'packing') { if (mode === 'packing') {
return groupingMode === 2 ? 'lock' : 'lock_open'; return groupingMode === 2 ? 'lock' : 'lock_open';
} else { } else {
@ -320,17 +329,21 @@ const showLockIcon = (groupingMode, mode) => {
:columns="entriesTableColumns" :columns="entriesTableColumns"
selection="multiple" selection="multiple"
row-key="id" row-key="id"
hide-bottom
class="full-width q-mt-md" class="full-width q-mt-md"
:grid="$q.screen.lt.md" :grid="$q.screen.lt.md"
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
:no-data-label="t('globals.noResults')"
> >
<template #body="props"> <template #body="props">
<QTr> <QTr>
<QTd> <QTd>
<QCheckbox v-model="props.selected" /> <QCheckbox v-model="props.selected" />
</QTd> </QTd>
<QTd v-for="col in props.cols" :key="col.name"> <QTd
v-for="col in props.cols"
:key="col.name"
style="max-width: 100px"
>
<component <component
:is="tableColumnComponents[col.name].component" :is="tableColumnComponents[col.name].component"
v-bind="tableColumnComponents[col.name].props" v-bind="tableColumnComponents[col.name].props"
@ -350,7 +363,7 @@ const showLockIcon = (groupingMode, mode) => {
> >
<QBtn <QBtn
:icon=" :icon="
showLockIcon(props.row.groupingMode, col.name) lockIconType(props.row.groupingMode, col.name)
" "
@click="toggleGroupingMode(props.row, col.name)" @click="toggleGroupingMode(props.row, col.name)"
class="cursor-pointer" class="cursor-pointer"
@ -359,6 +372,16 @@ const showLockIcon = (groupingMode, mode) => {
dense dense
unelevated unelevated
push push
:style="{
'font-variation-settings': `'FILL' ${
lockIconType(
props.row.groupingMode,
col.name
) === 'lock'
? 1
: 0
}`,
}"
/> />
</template> </template>
<template <template
@ -397,7 +420,7 @@ const showLockIcon = (groupingMode, mode) => {
</QTr> </QTr>
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys --> <!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
<QTr v-if="props.rowIndex !== rows.length - 1" class="separation-row"> <QTr v-if="props.rowIndex !== rows.length - 1" class="separation-row">
<QTd colspan="12" style="height: 24px" /> <QTd colspan="12" class="vn-table-separation-row" />
</QTr> </QTr>
</template> </template>
<template #item="props"> <template #item="props">
@ -448,9 +471,6 @@ const showLockIcon = (groupingMode, mode) => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.separation-row {
background-color: var(--vn-gray) !important;
}
.grid-style-transition { .grid-style-transition {
transition: transform 0.28s, background-color 0.28s; transition: transform 0.28s, background-color 0.28s;
} }

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -7,6 +7,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import { useState } from 'src/composables/useState';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
@ -25,6 +26,8 @@ const $props = defineProps({
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const { openReport } = usePrintService(); const { openReport } = usePrintService();
const state = useState();
const entryDescriptorRef = ref(null);
const entryFilter = { const entryFilter = {
include: [ include: [
@ -71,6 +74,8 @@ const data = ref(useCardDescription());
const setData = (entity) => const setData = (entity) =>
(data.value = useCardDescription(entity.supplier.nickname, entity.id)); (data.value = useCardDescription(entity.supplier.nickname, entity.id));
const currentEntry = computed(() => state.get('entry'));
const getEntryRedirectionFilter = (entry) => { const getEntryRedirectionFilter = (entry) => {
let entryTravel = entry && entry.travel; let entryTravel = entry && entry.travel;
@ -95,17 +100,20 @@ const getEntryRedirectionFilter = (entry) => {
const showEntryReport = () => { const showEntryReport = () => {
openReport(`Entries/${route.params.id}/entry-order-pdf`); openReport(`Entries/${route.params.id}/entry-order-pdf`);
}; };
watch;
</script> </script>
<template> <template>
<CardDescriptor <CardDescriptor
ref="entryDescriptorRef"
module="Entry" module="Entry"
:url="`Entries/${entityId}`" :url="`Entries/${entityId}`"
:filter="entryFilter" :filter="entryFilter"
:title="data.title" :title="data.title"
:subtitle="data.subtitle" :subtitle="data.subtitle"
@on-fetch="setData" @on-fetch="setData"
data-key="entryData" data-key="entry"
> >
<template #menu="{ entity }"> <template #menu="{ entity }">
<QItem v-ripple clickable @click="showEntryReport(entity)"> <QItem v-ripple clickable @click="showEntryReport(entity)">
@ -126,17 +134,17 @@ const showEntryReport = () => {
:value="entity.travel?.warehouseOut?.name" :value="entity.travel?.warehouseOut?.name"
/> />
</template> </template>
<template #icons="{ entity }"> <template #icons>
<QCardActions class="q-gutter-x-md"> <QCardActions class="q-gutter-x-md">
<QIcon <QIcon
v-if="entity.isExcludedFromAvailable" v-if="currentEntry.isExcludedFromAvailable"
name="vn:inventory" name="vn:inventory"
color="primary" color="primary"
size="xs" size="xs"
> >
<QTooltip>{{ t('Inventory entry') }}</QTooltip> <QTooltip>{{ t('Inventory entry') }}</QTooltip>
</QIcon> </QIcon>
<QIcon v-if="entity.isRaid" name="vn:web" color="primary" size="xs"> <QIcon v-if="currentEntry.isRaid" name="vn:net" color="primary" size="xs">
<QTooltip>{{ t('Virtual entry') }}</QTooltip> <QTooltip>{{ t('Virtual entry') }}</QTooltip>
</QIcon> </QIcon>
</QCardActions> </QCardActions>

View File

@ -165,19 +165,27 @@ const fetchEntryBuys = async () => {
@on-fetch="(data) => setEntryData(data)" @on-fetch="(data) => setEntryData(data)"
> >
<template #header-left> <template #header-left>
<a class="header-link" :href="entryUrl"> <router-link
v-if="route.name !== 'EntrySummary'"
:to="{ name: 'EntrySummary', params: { id: entityId } }"
class="header link"
:href="entryUrl"
>
<QIcon name="open_in_new" color="white" size="sm" /> <QIcon name="open_in_new" color="white" size="sm" />
</a> </router-link>
</template> </template>
<template #header> <template #header>
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span> <span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
</template> </template>
<template #body> <template #body>
<QCard class="vn-one"> <QCard class="vn-one">
<a class="header header-link" :href="`#/entry/${entityId}/basic-data`"> <router-link
:to="{ name: 'EntryBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ t('globals.summary.basicData') }} {{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" /> <QIcon name="open_in_new" />
</a> </router-link>
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" /> <VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
@ -191,37 +199,15 @@ const fetchEntryBuys = async () => {
:label="t('entry.summary.invoiceNumber')" :label="t('entry.summary.invoiceNumber')"
:value="entry.invoiceNumber" :value="entry.invoiceNumber"
/> />
<QCheckbox
:label="t('entry.summary.ordered')"
v-model="entry.isOrdered"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.confirmed')"
v-model="entry.isConfirmed"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.booked')"
v-model="entry.isBooked"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.raid')"
v-model="entry.isRaid"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.excludedFromAvailable')"
v-model="entry.isExcludedFromAvailable"
:disable="true"
/>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<a class="header header-link" :href="entryUrl"> <router-link
{{ t('Travel data') }} :to="{ name: 'EntryBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" /> <QIcon name="open_in_new" />
</a> </router-link>
<VnLv :label="t('entry.summary.travelReference')"> <VnLv :label="t('entry.summary.travelReference')">
<template #value> <template #value>
@ -249,7 +235,7 @@ const fetchEntryBuys = async () => {
<QCheckbox <QCheckbox
:label="t('entry.summary.travelDelivered')" :label="t('entry.summary.travelDelivered')"
v-model="entry.isDelivered" v-model="entry.travel.isDelivered"
:disable="true" :disable="true"
/> />
<VnLv <VnLv
@ -264,7 +250,41 @@ const fetchEntryBuys = async () => {
<QCheckbox <QCheckbox
:label="t('entry.summary.travelReceived')" :label="t('entry.summary.travelReceived')"
v-model="entry.isReceived" v-model="entry.travel.isReceived"
:disable="true"
/>
</QCard>
<QCard class="vn-one">
<router-link
:to="{ name: 'TravelSummary', params: { id: entry.travel.id } }"
class="header header-link"
>
{{ t('Travel data') }}
<QIcon name="open_in_new" />
</router-link>
<QCheckbox
:label="t('entry.summary.ordered')"
v-model="entry.isOrdered"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.confirmed')"
v-model="entry.isConfirmed"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.booked')"
v-model="entry.isBooked"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.raid')"
v-model="entry.isRaid"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.excludedFromAvailable')"
v-model="entry.isExcludedFromAvailable"
:disable="true" :disable="true"
/> />
</QCard> </QCard>
@ -276,9 +296,9 @@ const fetchEntryBuys = async () => {
<QTable <QTable
:rows="entryBuys" :rows="entryBuys"
:columns="entriesTableColumns" :columns="entriesTableColumns"
hide-bottom
row-key="index" row-key="index"
class="full-width q-mt-md" class="full-width q-mt-md"
:no-data-label="t('globals.noResults')"
> >
<template #body="{ cols, row, rowIndex }"> <template #body="{ cols, row, rowIndex }">
<QTr no-hover> <QTr no-hover>
@ -324,11 +344,8 @@ const fetchEntryBuys = async () => {
</QTd> </QTd>
</QTr> </QTr>
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys --> <!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
<QTr <QTr v-if="rowIndex !== entryBuys.length - 1">
v-if="rowIndex !== entryBuys.length - 1" <QTd colspan="10" class="vn-table-separation-row" />
class="separation-row"
>
<QTd colspan="10" style="height: 24px" />
</QTr> </QTr>
</template> </template>
</QTable> </QTable>
@ -337,13 +354,7 @@ const fetchEntryBuys = async () => {
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss" scoped>
.separation-row {
background-color: var(--vn-gray) !important;
}
</style>
<i18n> <i18n>
es: es:
Travel data: 'Datos envío' Travel data: Datos envío
</i18n> </i18n>

View File

@ -74,7 +74,7 @@ onMounted(async () => {
</QIcon> </QIcon>
<QIcon <QIcon
v-if="row.isRaid" v-if="row.isRaid"
name="vn:web" name="vn:net"
color="primary" color="primary"
size="xs" size="xs"
> >