Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 5835-migrateInvoiceIn
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
2f63a7f1fb
10
CHANGELOG.md
10
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
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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/**'),
|
||||
},
|
||||
|
|
|
@ -514,6 +514,7 @@ export default {
|
|||
typesList: 'Types List',
|
||||
typeCreate: 'Create type',
|
||||
typeEdit: 'Edit type',
|
||||
wagonCounter: 'Trolley counter',
|
||||
},
|
||||
type: {
|
||||
name: 'Name',
|
||||
|
|
|
@ -512,6 +512,7 @@ export default {
|
|||
typesList: 'Listado tipos',
|
||||
typeCreate: 'Crear tipo',
|
||||
typeEdit: 'Editar tipo',
|
||||
wagonCounter: 'Contador de carros',
|
||||
},
|
||||
type: {
|
||||
name: 'Nombre',
|
||||
|
|
|
@ -172,7 +172,7 @@ async function changeState(value) {
|
|||
:label="t('ticket.summary.agency')"
|
||||
:value="ticket.agencyMode.name"
|
||||
/>
|
||||
<VnLv :label="t('ticket.summary.zone')" :value="ticket.zone.name" />
|
||||
<VnLv :label="t('ticket.summary.zone')" :value="ticket?.zone?.name" />
|
||||
<VnLv
|
||||
:label="t('ticket.summary.warehouse')"
|
||||
:value="ticket.warehouse?.name"
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
<script setup>
|
||||
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));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QList class="row q-mx-auto q-mt-xl">
|
||||
<QItem v-for="(props, name) in counters" :key="name" class="col-6">
|
||||
<QItemSection>
|
||||
<QImg
|
||||
:src="getUrl(props.id)"
|
||||
width="130px"
|
||||
@click="handleEvent(name, 'add')"
|
||||
/>
|
||||
<p class="title">{{ props.title }}</p>
|
||||
</QItemSection>
|
||||
<QItemSection class="q-ma-none">
|
||||
<QItemLabel class="text-h4">
|
||||
{{ props.count }}
|
||||
</QItemLabel>
|
||||
<QItemLabel>
|
||||
<QBtn
|
||||
class="text-center q-mr-xs"
|
||||
color="warning"
|
||||
dense
|
||||
size="sm"
|
||||
v-if="props.isTray"
|
||||
@click="handleEvent(name, 'addSpecific', 30)"
|
||||
>
|
||||
{{ t('Add 30') }}
|
||||
</QBtn>
|
||||
<QBtn
|
||||
class="text-center q-mr-xs"
|
||||
color="warning"
|
||||
dense
|
||||
size="sm"
|
||||
v-else
|
||||
@click="handleEvent(name, 'addSpecific', 10)"
|
||||
>
|
||||
{{ t('Add 10') }}
|
||||
</QBtn>
|
||||
</QItemLabel>
|
||||
<QItemLabel>
|
||||
<QBtn
|
||||
class="text-center q-mr-xs"
|
||||
color="warning"
|
||||
dense
|
||||
size="sm"
|
||||
@click="handleEvent(name, 'subtract')"
|
||||
>
|
||||
{{ t('Subtract 1') }}
|
||||
</QBtn>
|
||||
<QBtn
|
||||
class="text-center q-ml-xs"
|
||||
color="red"
|
||||
dense
|
||||
size="sm"
|
||||
@click="handleEvent(name, 'flush')"
|
||||
>
|
||||
{{ t('Flush') }}
|
||||
</QBtn>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
<QSeparator class="q-mt-sm q-mx-none" color="primary" />
|
||||
</QItem>
|
||||
</QList>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.q-list {
|
||||
max-width: 50em;
|
||||
}
|
||||
@media (max-width: $breakpoint-sm) {
|
||||
.q-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.title {
|
||||
min-height: 3em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
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
|
||||
</i18n>
|
|
@ -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'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue