Merge branch 'test' into dev
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-08-05 11:59:15 +02:00
commit 59b709b57d
9 changed files with 73 additions and 19 deletions

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { ref, onUnmounted } from 'vue'; import { ref, onUnmounted, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
import { date } from 'quasar'; import { date } from 'quasar';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -19,6 +19,7 @@ const stateStore = useStateStore();
const validationsStore = useValidator(); const validationsStore = useValidator();
const { models } = validationsStore; const { models } = validationsStore;
const route = useRoute(); const route = useRoute();
const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
model: { model: {
@ -381,6 +382,13 @@ setLogTree();
onUnmounted(() => { onUnmounted(() => {
stateStore.rightDrawer = false; stateStore.rightDrawer = false;
}); });
watch(
() => router.currentRoute.value.params.id,
() => {
applyFilter();
}
);
</script> </script>
<template> <template>
<FetchData <FetchData

View File

@ -20,11 +20,17 @@ const $props = defineProps({
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const entriesTableColumns = computed(() => [ const entriesTableColumns = computed(() => [
{
align: 'left',
name: 'id',
field: 'id',
label: t('globals.id'),
},
{ {
align: 'left', align: 'left',
name: 'itemFk', name: 'itemFk',
field: 'itemFk', field: 'itemFk',
label: t('globals.id'), label: t('entry.latestBuys.tableVisibleColumns.itemFk'),
}, },
{ {
align: 'left', align: 'left',
@ -76,11 +82,11 @@ const entriesTableColumns = computed(() => [
</QCardSection> </QCardSection>
<QCardActions align="right"> <QCardActions align="right">
<QBtn <QBtn
:label="t('Print buys')" :label="t('printLabels')"
color="primary" color="primary"
icon="print" icon="print"
:loading="isLoading" :loading="isLoading"
@click="openReport(`Entries/${entityId}/buy-label`)" @click="openReport(`Entries/${entityId}/print`)"
unelevated unelevated
autofocus autofocus
/> />
@ -109,6 +115,19 @@ const entriesTableColumns = computed(() => [
<QTd v-for="col in props.cols" :key="col.name"> <QTd v-for="col in props.cols" :key="col.name">
{{ col.value }} {{ col.value }}
</QTd> </QTd>
<QBtn
icon="print"
v-if="props.row.stickers > 0"
:loading="isLoading"
@click="
openReport(
`Entries/${props.row.id}/buy-label`
)
"
unelevated
>
<QTooltip>{{ t('printLabel') }}</QTooltip>
</QBtn>
</QTr> </QTr>
</template> </template>
</QTable> </QTable>

View File

@ -86,7 +86,7 @@ const columns = computed(() => [
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{ {
title: t('printBuys'), title: t('printLabels'),
icon: 'print', icon: 'print',
action: (row) => printBuys(row.id), action: (row) => printBuys(row.id),
}, },

View File

@ -10,4 +10,5 @@ landed: Landed
shipped: Shipped shipped: Shipped
fromShipped: Shipped(from) fromShipped: Shipped(from)
toShipped: Shipped(to) toShipped: Shipped(to)
printBuys: Print buys printLabels: Print stickers
printLabel: Print sticker

View File

@ -14,4 +14,5 @@ landed: F. llegada
shipped: F. salida shipped: F. salida
fromShipped: F. salida(desde) fromShipped: F. salida(desde)
toShipped: F. salida(hasta) toShipped: F. salida(hasta)
Print buys: Imprimir etiquetas printLabels: Imprimir etiquetas
printLabel: Imprimir etiqueta

View File

@ -48,7 +48,6 @@ const entityId = computed(() => {
return $props.id || route.params.id; return $props.id || route.params.id;
}); });
const regularizeStockFormDialog = ref(null); const regularizeStockFormDialog = ref(null);
const item = ref(null);
const available = ref(null); const available = ref(null);
const visible = ref(null); const visible = ref(null);
const _warehouseFk = ref(null); const _warehouseFk = ref(null);
@ -131,12 +130,7 @@ const openCloneDialog = async () => {
:subtitle="data.subtitle" :subtitle="data.subtitle"
:summary="$props.summary" :summary="$props.summary"
:url="`Items/${entityId}/getCard`" :url="`Items/${entityId}/getCard`"
@on-fetch=" @on-fetch="setData"
(data) => {
item = data;
setData(data);
}
"
> >
<template #menu="{}"> <template #menu="{}">
<QItem v-ripple clickable @click="openRegularizeStockForm()"> <QItem v-ripple clickable @click="openRegularizeStockForm()">

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { onMounted, computed, onUnmounted, reactive, ref, nextTick } from 'vue'; import { onMounted, computed, onUnmounted, reactive, ref, nextTick, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
@ -21,6 +21,7 @@ import axios from 'axios';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter();
const stateStore = useStateStore(); const stateStore = useStateStore();
const state = useState(); const state = useState();
@ -169,6 +170,14 @@ onMounted(async () => {
}); });
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.rightDrawer = false));
watch(
() => router.currentRoute.value.params.id,
(newId) => {
itemsBalanceFilter.where.itemFk = newId;
itemBalancesRef.value.fetch();
}
);
</script> </script>
<template> <template>

View File

@ -391,7 +391,7 @@ async function changeState(value) {
<QTd>{{ props.row.quantity }}</QTd> <QTd>{{ props.row.quantity }}</QTd>
<QTd class="description-cell"> <QTd class="description-cell">
<div class="row full-width justify-between"> <div class="row full-width justify-between">
{{ props.row.item.name }} {{ props.row.concept }}
<div v-if="props.row.item.subName" class="subName"> <div v-if="props.row.item.subName" class="subName">
{{ props.row.item.subName.toUpperCase() }} {{ props.row.item.subName.toUpperCase() }}
</div> </div>

View File

@ -1,6 +1,7 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { computed, ref } from 'vue'; import { computed, ref, onMounted } from 'vue';
import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { toDate, toCurrency } from 'src/filters/index'; import { toDate, toCurrency } from 'src/filters/index';
import TicketSummary from './Card/TicketSummary.vue'; import TicketSummary from './Card/TicketSummary.vue';
@ -10,6 +11,8 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnRow from 'src/components/ui/VnRow.vue'; import VnRow from 'src/components/ui/VnRow.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import TicketFilter from './TicketFilter.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
@ -18,6 +21,15 @@ const clientsOptions = ref([]);
const addressesOptions = ref([]); const addressesOptions = ref([]);
const agenciesOptions = ref([]); const agenciesOptions = ref([]);
const selectedClient = ref(); const selectedClient = ref();
const stateStore = useStateStore();
const from = Date.vnNew();
const to = Date.vnNew();
to.setDate(to.getDate() + 1);
const userParams = {
from: from.toISOString(),
to: to.toISOString(),
};
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -187,6 +199,8 @@ const fetchAddresses = async (formData) => {
const getColor = (row) => { const getColor = (row) => {
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange'; return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
}; };
onMounted(() => (stateStore.rightDrawer = true));
</script> </script>
<template> <template>
@ -195,6 +209,11 @@ const getColor = (row) => {
:label="t('Search ticket')" :label="t('Search ticket')"
:info="t('You can search by ticket id or alias')" :info="t('You can search by ticket id or alias')"
/> />
<RightMenu>
<template #right-panel>
<TicketFilter data-key="Tickets" />
</template>
</RightMenu>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="Tickets" data-key="Tickets"
@ -206,7 +225,10 @@ const getColor = (row) => {
formInitialData: {}, formInitialData: {},
}" }"
default-mode="table" default-mode="table"
order="id DESC"
:columns="columns" :columns="columns"
:user-params="userParams"
:right-search="false"
redirect="ticket" redirect="ticket"
auto-load auto-load
> >