forked from verdnatura/salix-front
Merge branch 'test' into dev
This commit is contained in:
commit
dfabdeb706
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -11,19 +11,20 @@ const session = useSession();
|
|||
const token = session.getToken();
|
||||
|
||||
const counters = ref({
|
||||
alquilerBandeja: { count: 0, id: 1, title: 'Alquiler de CC Bandeja' },
|
||||
bandejaRota: { count: 0, id: 2, title: 'CC Bandeja Rota' },
|
||||
carryOficial: { count: 0, id: 3, title: ' Alquiler de CC Carry OFICIAL' },
|
||||
candadoRojo: { count: 0, id: 4, title: 'CC Candado rojo' },
|
||||
sacadores: { count: 0, id: 5, title: 'CC Sacadores' },
|
||||
sinChapa: { count: 0, id: 6, title: 'CC Sin Chapa' },
|
||||
carroRoto: { count: 0, id: 7, title: 'Carro Roto' },
|
||||
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: (value) => value + 1,
|
||||
substract: (value) => (value ? value - 1 : 0),
|
||||
add: (counter) => counter + 1,
|
||||
subtract: (counter) => (counter ? counter - 1 : 0),
|
||||
flush: () => 0,
|
||||
addSpecific: (counter, amount) => counter + amount,
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
@ -38,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);
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +58,7 @@ function confirm() {
|
|||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('Are you sure?'),
|
||||
message: t('Se pondrá el contador a cero'),
|
||||
message: t('The counter will be reset to zero'),
|
||||
},
|
||||
})
|
||||
.onOk(() => resolve(true))
|
||||
|
@ -86,9 +87,31 @@ function confirm() {
|
|||
color="warning"
|
||||
dense
|
||||
size="sm"
|
||||
@click="handleEvent(name, 'substract')"
|
||||
v-if="props.isTray"
|
||||
@click="handleEvent(name, 'addSpecific', 30)"
|
||||
>
|
||||
{{ t('Substract 1') }}
|
||||
{{ 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"
|
||||
|
@ -121,8 +144,11 @@ function confirm() {
|
|||
</style>
|
||||
<i18n>
|
||||
es:
|
||||
Substract 1: Quitar 1
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue