diff --git a/src/pages/Wagon/WagonCounter.vue b/src/pages/Wagon/WagonCounter.vue index 1c4d9e371..eb0a705e8 100644 --- a/src/pages/Wagon/WagonCounter.vue +++ b/src/pages/Wagon/WagonCounter.vue @@ -14,17 +14,17 @@ const counters = ref({ alquilerBandeja: { count: 0, id: 96001, title: 'CC Bandeja' }, bandejaRota: { count: 0, id: 88381, title: 'CC Bandeja Rota' }, carryOficial: { count: 0, id: 96000, title: 'CC Carry OFICIAL TAG5' }, - candadoRojo: { count: 0, id: 142252, title: 'CC Candado rojo' }, + candadoRojo: { count: 0, id: 96002, title: 'CC Carry NO OFICIAL' }, sacadores: { count: 0, id: 142260, title: 'CC Sacadores' }, - sinChapa: { count: 0, id: 142258, title: 'CC Sin Chapa' }, + sinChapa: { count: 0, id: 2214, title: 'DC Carry Sin Placa CC' }, carroRoto: { count: 0, id: 142251, title: 'Carro Roto' }, }); const actions = { - add: (value) => value + 1, - subtract: (value) => (value ? value - 1 : 0), + add: (counter) => counter + 1, + subtract: (counter) => (counter ? counter - 1 : 0), flush: () => 0, - addSpecific: (value) => value + 30, + addSpecific: (counter, amount) => counter + amount, }; onMounted(() => { @@ -39,14 +39,14 @@ function getUrl(id) { return `/api/Images/catalog/200x200/${id}/download?access_token=${token}`; } -async function handleEvent(type, action) { +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); + counters.value[type].count = actions[action](counter, amount); localStorage.setItem(type, counters.value[type].count); } } @@ -87,10 +87,21 @@ function confirm() { color="warning" dense size="sm" - @click="handleEvent(name, 'addSpecific')" + v-if="props.title === 'CC Bandeja'" + @click="handleEvent(name, 'addSpecific', 30)" > {{ t('Add 30') }} + + {{ t('Add 10') }} +