diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 83886991c..0ba63a32d 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -332,299 +332,280 @@ defineExpose({ -
- - - - - -
+ + + + + + + + + + + diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue index 6e57a8a53..f94130da4 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -3,7 +3,7 @@ import { onMounted, watch, computed, ref } from 'vue'; import { date } from 'quasar'; import { useI18n } from 'vue-i18n'; -const model = defineModel({ type: String }); +const model = defineModel({ type: [String, Date] }); const $props = defineProps({ isOutlined: { type: Boolean, diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index b6dc226cc..1e3a32f48 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -77,6 +77,10 @@ const $props = defineProps({ type: Object, default: null, }, + noOne: { + type: Boolean, + default: false, + }, }); const { t } = useI18n(); @@ -89,6 +93,11 @@ const myOptionsOriginal = ref([]); const vnSelectRef = ref(); const dataRef = ref(); const lastVal = ref(); +const noOneText = t('globals.noOne'); +const noOneOpt = ref({ + [optionValue.value]: false, + [optionLabel.value]: noOneText, +}); const value = computed({ get() { @@ -104,9 +113,11 @@ watch(options, (newValue) => { setOptions(newValue); }); -watch(modelValue, (newValue) => { +watch(modelValue, async (newValue) => { if (!myOptions.value.some((option) => option[optionValue.value] == newValue)) - fetchFilter(newValue); + await fetchFilter(newValue); + + if ($props.noOne) myOptions.value.unshift(noOneOpt.value); }); onMounted(() => { @@ -169,6 +180,7 @@ async function fetchFilter(val) { const fetchOptions = { where, include, limit }; if (fields) fetchOptions.fields = fields; if (sortBy) fetchOptions.order = sortBy; + return dataRef.value.fetch(fetchOptions); } @@ -189,6 +201,9 @@ async function filterHandler(val, update) { } else newOptions = filter(val, myOptionsOriginal.value); update( () => { + if ($props.noOne && noOneText.toLowerCase().includes(val.toLowerCase())) + newOptions.unshift(noOneOpt.value); + myOptions.value = newOptions; }, (ref) => { diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 3598f96a5..d0a31223d 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -24,7 +24,7 @@ const $props = defineProps({ type: Boolean, default: true, }, - unRemovableParams: { + unremovableParams: { type: Array, required: false, default: () => [], @@ -148,7 +148,7 @@ async function clearFilters() { arrayData.reset(['skip', 'filter.skip', 'page']); // Filtrar los params no removibles const removableFilters = Object.keys(userParams.value).filter((param) => - $props.unRemovableParams.includes(param) + $props.unremovableParams.includes(param) ); const newParams = {}; // Conservar solo los params que no son removibles @@ -180,10 +180,10 @@ const tagsList = computed(() => { }); const tags = computed(() => { - return tagsList.value.filter((tag) => !($props.customTags || []).includes(tag.key)); + return tagsList.value.filter((tag) => !($props.customTags || []).includes(tag.label)); }); const customTags = computed(() => - tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.key)) + tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.label)) ); async function remove(key) { @@ -268,7 +268,7 @@ function sanitizer(params) { diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 0df719c66..22edfe869 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -10,6 +10,10 @@ const props = defineProps({ type: String, required: true, }, + class: { + type: String, + default: '', + }, autoLoad: { type: Boolean, default: false, @@ -215,7 +219,7 @@ defineExpose({ fetch, addFilter, paginate }); v-if="store.data" @load="onLoad" :offset="offset" - class="full-width" + :class="['full-width', props.class]" :disable="disableInfiniteScroll || !store.hasMoreData" v-bind="$attrs" > diff --git a/src/css/app.scss b/src/css/app.scss index 357c9ecdb..41d3df795 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -253,7 +253,6 @@ input::-webkit-inner-spin-button { } td { font-size: 11pt; - border-top: 1px solid var(--vn-page-color); border-collapse: collapse; } } diff --git a/src/filters/date.js b/src/filters/date.js index f9fd1e0b2..058c90060 100644 --- a/src/filters/date.js +++ b/src/filters/date.js @@ -20,21 +20,21 @@ export function isValidDate(date) { * Converts a given date to a specific format. * * @param {number|string|Date} date - The date to be formatted. + * @param {Object} opts - Optional parameters to customize the output format. * @returns {string} The formatted date as a string in 'dd/mm/yyyy' format. If the provided date is not valid, an empty string is returned. * * @example * // returns "02/12/2022" * toDateFormat(new Date(2022, 11, 2)); */ -export function toDateFormat(date, locale = 'es-ES') { - if (!isValidDate(date)) { - return ''; - } - return new Date(date).toLocaleDateString(locale, { - year: 'numeric', - month: '2-digit', - day: '2-digit', - }); +export function toDateFormat(date, locale = 'es-ES', opts = {}) { + if (!isValidDate(date)) return ''; + + const format = Object.assign( + { year: 'numeric', month: '2-digit', day: '2-digit' }, + opts + ); + return new Date(date).toLocaleDateString(locale, format); } /** diff --git a/src/filters/dateRange.js b/src/filters/dateRange.js index 7aa2869e5..4c0cfe654 100644 --- a/src/filters/dateRange.js +++ b/src/filters/dateRange.js @@ -1,7 +1,7 @@ export default function dateRange(value) { const minHour = new Date(value); minHour.setHours(0, 0, 0, 0); - const maxHour = new Date(); + const maxHour = new Date(value); maxHour.setHours(23, 59, 59, 59); return [minHour, maxHour]; diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 30d92f0c1..4abaeeb5b 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -94,6 +94,7 @@ globals: from: From to: To notes: Notes + refresh: Refresh pageTitles: logIn: Login summary: Summary @@ -255,6 +256,8 @@ globals: twoFactor: Two factor recoverPassword: Recover password resetPassword: Reset password + ticketsMonitor: Tickets monitor + clientsActionsMonitor: Clients and actions serial: Serial created: Created worker: Worker @@ -269,6 +272,7 @@ globals: subtitle: Are you sure exit without saving? createInvoiceIn: Create invoice in myAccount: My account + noOne: No one errors: statusUnauthorized: Access denied statusInternalServerError: An internal server error has ocurred diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 6a9c3294c..335c2d651 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -94,6 +94,7 @@ globals: from: Desde to: Hasta notes: Notas + refresh: Actualizar pageTitles: logIn: Inicio de sesión summary: Resumen @@ -257,6 +258,8 @@ globals: twoFactor: Doble factor recoverPassword: Recuperar contraseña resetPassword: Restablecer contraseña + ticketsMonitor: Monitor de tickets + clientsActionsMonitor: Clientes y acciones serial: Facturas por serie created: Fecha creación worker: Trabajador @@ -271,6 +274,7 @@ globals: subtitle: ¿Seguro que quiere salir sin guardar? createInvoiceIn: Crear factura recibida myAccount: Mi cuenta + noOne: Nadie errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor diff --git a/src/pages/Monitor/MonitorClients.vue b/src/pages/Monitor/MonitorClients.vue new file mode 100644 index 000000000..ff51e4464 --- /dev/null +++ b/src/pages/Monitor/MonitorClients.vue @@ -0,0 +1,145 @@ + + + + diff --git a/src/pages/Monitor/MonitorClientsActions.vue b/src/pages/Monitor/MonitorClientsActions.vue new file mode 100644 index 000000000..821773bbf --- /dev/null +++ b/src/pages/Monitor/MonitorClientsActions.vue @@ -0,0 +1,26 @@ + + diff --git a/src/pages/Monitor/MonitorList.vue b/src/pages/Monitor/MonitorList.vue deleted file mode 100644 index 4906247e8..000000000 --- a/src/pages/Monitor/MonitorList.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/pages/Monitor/MonitorOrders.vue b/src/pages/Monitor/MonitorOrders.vue new file mode 100644 index 000000000..eb455a239 --- /dev/null +++ b/src/pages/Monitor/MonitorOrders.vue @@ -0,0 +1,203 @@ + + + diff --git a/src/pages/Monitor/SalesClientsTable.vue b/src/pages/Monitor/SalesClientsTable.vue deleted file mode 100644 index 2fb9e8e2f..000000000 --- a/src/pages/Monitor/SalesClientsTable.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - diff --git a/src/pages/Monitor/SalesOrdersTable.vue b/src/pages/Monitor/SalesOrdersTable.vue deleted file mode 100644 index f0c389aa6..000000000 --- a/src/pages/Monitor/SalesOrdersTable.vue +++ /dev/null @@ -1,204 +0,0 @@ - - - - diff --git a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue new file mode 100644 index 000000000..167a10465 --- /dev/null +++ b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue @@ -0,0 +1,286 @@ + + + +en: + params: + clientFk: Client id + orderFk: Order id + scopeDays: Days onward + nickname: Nickname + salesPersonFk: Sales person + refFk: Invoice + agencyModeFk: Agency + stateFk: State + groupedStates: Grouped State + warehouseFk: Warehouse + provinceFk: Province + myTeam: My team + problems: With problems + pending: Pending + from: From + to: To + alertLevel: Grouped State + FREE: Free + DELIVERED: Delivered + ON_PREPARATION: On preparation + ON_PREVIOUS: On previous + PACKED: Packed + No one: No one + +es: + params: + clientFk: Id cliente + orderFk: Id cesta + scopeDays: Días en adelante + nickname: Nombre mostrado + salesPersonFk: Comercial + refFk: Factura + agencyModeFk: Agencia + stateFk: Estado + groupedStates: Estado agrupado + warehouseFk: Almacén + provinceFk: Provincia + myTeam: Mi equipo + problems: Con problemas + pending: Pendiente + from: Desde + To: Hasta + alertLevel: Estado agrupado + FREE: Libre + DELIVERED: Servido + ON_PREPARATION: En preparación + ON_PREVIOUS: En previa + PACKED: Encajado + diff --git a/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue b/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue new file mode 100644 index 000000000..4950ab381 --- /dev/null +++ b/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue @@ -0,0 +1,12 @@ + + diff --git a/src/pages/Monitor/SalesTicketsTable.vue b/src/pages/Monitor/Ticket/MonitorTickets.vue similarity index 69% rename from src/pages/Monitor/SalesTicketsTable.vue rename to src/pages/Monitor/Ticket/MonitorTickets.vue index b301c1145..258b5022f 100644 --- a/src/pages/Monitor/SalesTicketsTable.vue +++ b/src/pages/Monitor/Ticket/MonitorTickets.vue @@ -1,37 +1,38 @@ -