diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 9059605ca..3598f96a5 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -202,7 +202,7 @@ function formatValue(value) { function sanitizer(params) { for (const [key, value] of Object.entries(params)) { - if (typeof value == 'object') { + if (value && typeof value === 'object') { const param = Object.values(value)[0]; if (typeof param == 'string') params[key] = param.replaceAll('%', ''); } diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue index bf4000fdf..45bd8fd39 100644 --- a/src/pages/Ticket/TicketAdvance.vue +++ b/src/pages/Ticket/TicketAdvance.vue @@ -448,7 +448,7 @@ const handleCloseProgressDialog = () => { const handleCancelProgress = () => (cancelProgress.value = true); onMounted(async () => { - let today = Date.vnNew(); + let today = Date.vnNew().toISOString(); const tomorrow = new Date(today); tomorrow.setDate(tomorrow.getDate() + 1); userParams.dateFuture = tomorrow; diff --git a/src/pages/Ticket/TicketAdvanceFilter.vue b/src/pages/Ticket/TicketAdvanceFilter.vue index c4548763a..ed61d9447 100644 --- a/src/pages/Ticket/TicketAdvanceFilter.vue +++ b/src/pages/Ticket/TicketAdvanceFilter.vue @@ -55,7 +55,7 @@ onMounted(async () => await getItemPackingTypes()); :data-key="props.dataKey" :search-button="true" :hidden-tags="['search']" - :unremovable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']" + :un-removable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']" > + + + +import { ref } from 'vue'; +import { useI18n } from 'vue-i18n'; + +import FetchData from 'components/FetchData.vue'; +import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; +import VnSelect from 'components/common/VnSelect.vue'; +import VnInputDate from 'src/components/common/VnInputDate.vue'; +import VnInput from 'src/components/common/VnInput.vue'; + +import axios from 'axios'; +import { onMounted } from 'vue'; + +const { t } = useI18n(); +const props = defineProps({ + dataKey: { + type: String, + required: true, + }, +}); + +const warehousesOptions = ref([]); +const itemPackingTypes = ref([]); +const stateOptions = ref([]); + +const getItemPackingTypes = async () => { + try { + const filter = { + where: { isActive: true }, + }; + const { data } = await axios.get('ItemPackingTypes', { + params: { filter: JSON.stringify(filter) }, + }); + itemPackingTypes.value = data.map((ipt) => ({ + description: t(ipt.description), + code: ipt.code, + })); + } catch (error) { + console.error(error); + } +}; + +const getGroupedStates = async () => { + try { + const { data } = await axios.get('AlertLevels'); + stateOptions.value = data.map((state) => ({ + id: state.id, + name: t(`futureTickets.${state.code}`), + code: state.code, + })); + } catch (error) { + console.error(error); + } +}; + +onMounted(async () => { + getItemPackingTypes(); + getGroupedStates(); +}); + + + + + +en: + iptInfo: IPT + params: + originDated: Origin date + futureDated: Destination date + futureIpt: Destination IPT + ipt: Origin IPT + warehouseFk: Warehouse + litersMax: Max liters + linesMax: Max lines + state: Origin grouped state + futureState: Destination grouped state + problems: With problems +es: + Horizontal: Horizontal + Vertical: Vertical + iptInfo: Encajado + params: + originDated: Fecha origen + futureDated: Fecha destino + futureIpt: IPT destino + ipt: IPT Origen + warehouseFk: Almacén + litersMax: Litros máx. + linesMax: Líneas máx. + state: Estado agrupado origen + futureState: Estado agrupado destino + problems: Con problemas + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml index 10a8e1fa4..305228669 100644 --- a/src/pages/Ticket/locale/en.yml +++ b/src/pages/Ticket/locale/en.yml @@ -93,6 +93,11 @@ futureTickets: moveTicketSuccess: Tickets moved successfully! searchInfo: Search future tickets by date futureTicket: Future tickets + FREE: Free + ON_PREVIOUS: ON_PREVIOUS + ON_PREPARATION: On preparation + PACKED: Packed + DELIVERED: Delivered expedition: id: Expedition item: Item diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index a80692bfe..20b4edf16 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -140,6 +140,11 @@ futureTickets: moveTicketSuccess: Tickets movidos correctamente searchInfo: Buscar tickets por fecha futureTicket: Tickets a futuro + FREE: Libre + ON_PREVIOUS: ON_PREVIOUS + ON_PREPARATION: En preparación + PACKED: Encajado + DELIVERED: Servido ticketSale: id: Id visible: Visible