diff --git a/CHANGELOG.md b/CHANGELOG.md index 243d67a34..3316aa441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2352.01] - 2023-12-28 + +### Added +- (carros) => Se añade contador de carros. #6545 +- (Reclamaciones) => Se añade la sección para hacer acciones sobre una reclamación. #5654 +### Changed +### Fixed +- (Reclamaciones) => Se corrige el color de la barra según el tema y el evento de actualziar cantidades #6334 + + ## [2253.01] - 2023-01-05 ### Added diff --git a/package.json b/package.json index 799401c08..583233204 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "23.48.01", + "version": "23.52.01", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -53,4 +53,4 @@ "vite": "^4.3.5", "vitest": "^0.31.1" } -} \ No newline at end of file +} diff --git a/quasar.config.js b/quasar.config.js index cbcbae4dc..3a7dc1f1e 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -66,7 +66,9 @@ module.exports = configure(function (/* ctx */) { // publicPath: '/', // analyze: true, // env: {}, - // rawDefine: {} + rawDefine: { + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) + }, // ignorePublicFolder: true, // minify: false, // polyfillModulePreload: true, @@ -89,11 +91,12 @@ module.exports = configure(function (/* ctx */) { vitePlugins: [ [ - VueI18nPlugin, + VueI18nPlugin({ + runtimeOnly: false + }), { // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` // compositionOnly: false, - // you need to set i18n resource including paths ! include: path.resolve(__dirname, './src/i18n/**'), }, diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 26d37ae5a..01ed554d1 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -514,6 +514,7 @@ export default { typesList: 'Types List', typeCreate: 'Create type', typeEdit: 'Edit type', + wagonCounter: 'Trolley counter', }, type: { name: 'Name', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 791ba85f0..c14527adb 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -512,6 +512,7 @@ export default { typesList: 'Listado tipos', typeCreate: 'Crear tipo', typeEdit: 'Editar tipo', + wagonCounter: 'Contador de carros', }, type: { name: 'Nombre', diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index ce46d1d47..3c240d5c2 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -172,7 +172,7 @@ async function changeState(value) { :label="t('ticket.summary.agency')" :value="ticket.agencyMode.name" /> - + +import { ref, onMounted } from 'vue'; +import { useSession } from 'src/composables/useSession'; +import { useI18n } from 'vue-i18n'; +import { useQuasar } from 'quasar'; +import VnConfirm from 'components/ui/VnConfirm.vue'; + +const quasar = useQuasar(); +const { t } = useI18n(); +const session = useSession(); +const token = session.getToken(); + +const counters = ref({ + alquilerBandeja: { count: 0, id: 96001, title: 'CC Bandeja', isTray: true }, + bandejaRota: { count: 0, id: 88381, title: 'CC Bandeja Rota', isTray: true }, + carryOficial: { count: 0, id: 96000, title: 'CC Carry OFICIAL TAG5' }, + candadoRojo: { count: 0, id: 96002, title: 'CC Carry NO OFICIAL' }, + sacadores: { count: 0, id: 142260, title: 'CC Sacadores' }, + sinChapa: { count: 0, id: 2214, title: 'DC Carry Sin Placa CC' }, + carroRoto: { count: 0, id: 142251, title: 'Carro Roto' }, +}); + +const actions = { + add: (counter) => counter + 1, + subtract: (counter) => (counter ? counter - 1 : 0), + flush: () => 0, + addSpecific: (counter, amount) => counter + amount, +}; + +onMounted(() => { + const types = Object.keys(counters.value); + for (let type of types) { + const counter = localStorage.getItem(type); + counters.value[type].count = counter ? parseInt(counter) : 0; + } +}); + +function getUrl(id) { + return `/api/Images/catalog/200x200/${id}/download?access_token=${token}`; +} + +async function handleEvent(type, action, amount) { + const counter = counters.value[type].count; + let isOk = true; + + if (action == 'flush') isOk = await confirm(); + + if (isOk) { + counters.value[type].count = actions[action](counter, amount); + localStorage.setItem(type, counters.value[type].count); + } +} + +function confirm() { + return new Promise((resolve) => { + quasar + .dialog({ + component: VnConfirm, + componentProps: { + title: t('Are you sure?'), + message: t('The counter will be reset to zero'), + }, + }) + .onOk(() => resolve(true)) + .onCancel(() => resolve(false)); + }); +} + + + + +es: + Subtract 1: Quitar 1 + Add 30: Añadir 30 + Add 10: Añadir 10 + Flush: Vaciar + Are you sure?: ¿Estás seguro? + It will set to 0: Se pondrá a 0 + The counter will be reset to zero: Se pondrá el contador a cero + diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js index 3fb808778..238e482dd 100644 --- a/src/router/modules/wagon.js +++ b/src/router/modules/wagon.js @@ -10,7 +10,7 @@ export default { component: RouterView, redirect: { name: 'WagonMain' }, menus: { - main: ['WagonList', 'WagonTypeList'], + main: ['WagonList', 'WagonTypeList', 'WagonCounter'], card: [], }, children: [ @@ -47,6 +47,15 @@ export default { }, component: () => import('src/pages/Wagon/WagonCreate.vue'), }, + { + path: 'counter', + name: 'WagonCounter', + meta: { + title: 'wagonCounter', + icon: 'add_circle', + }, + component: () => import('src/pages/Wagon/WagonCounter.vue'), + }, ], }, {