forked from verdnatura/hedera-web
Handle minQuantity
This commit is contained in:
parent
202c22b8a9
commit
0f5014088d
|
@ -105,6 +105,7 @@ export default {
|
||||||
modify: 'Modificar',
|
modify: 'Modificar',
|
||||||
shoppingCart: 'Cistella de la compra',
|
shoppingCart: 'Cistella de la compra',
|
||||||
available: 'Disponible',
|
available: 'Disponible',
|
||||||
|
minQuantity: 'Quantitat mínima',
|
||||||
// Image related translations
|
// Image related translations
|
||||||
'Cant lock cache': 'No es pot bloquejar la memòria cau',
|
'Cant lock cache': 'No es pot bloquejar la memòria cau',
|
||||||
'Bad file format': 'Format de fitxer no reconegut',
|
'Bad file format': 'Format de fitxer no reconegut',
|
||||||
|
|
|
@ -138,6 +138,7 @@ export default {
|
||||||
modify: 'Modify',
|
modify: 'Modify',
|
||||||
shoppingCart: 'Shopping cart',
|
shoppingCart: 'Shopping cart',
|
||||||
available: 'Available',
|
available: 'Available',
|
||||||
|
minQuantity: 'Minimum quantity',
|
||||||
// Image related translations
|
// Image related translations
|
||||||
'Cant lock cache': 'The cache could not be blocked',
|
'Cant lock cache': 'The cache could not be blocked',
|
||||||
'Bad file format': 'Unrecognized file format',
|
'Bad file format': 'Unrecognized file format',
|
||||||
|
|
|
@ -137,6 +137,7 @@ export default {
|
||||||
modify: 'Modificar',
|
modify: 'Modificar',
|
||||||
shoppingCart: 'Cesta de la compra',
|
shoppingCart: 'Cesta de la compra',
|
||||||
available: 'Disponible',
|
available: 'Disponible',
|
||||||
|
minQuantity: 'Cantidad mínima',
|
||||||
// Image related translations
|
// Image related translations
|
||||||
'Cant lock cache': 'La caché no pudo ser bloqueada',
|
'Cant lock cache': 'La caché no pudo ser bloqueada',
|
||||||
'Bad file format': 'Formato de archivo no reconocido',
|
'Bad file format': 'Formato de archivo no reconocido',
|
||||||
|
|
|
@ -105,6 +105,7 @@ export default {
|
||||||
modify: 'Modifier',
|
modify: 'Modifier',
|
||||||
shoppingCart: 'Panier',
|
shoppingCart: 'Panier',
|
||||||
available: 'Disponible',
|
available: 'Disponible',
|
||||||
|
minQuantity: 'Quantité minimum',
|
||||||
// Image related translations
|
// Image related translations
|
||||||
'Cant lock cache': "Le cache n'a pas pu être verrouillé",
|
'Cant lock cache': "Le cache n'a pas pu être verrouillé",
|
||||||
'Bad file format': 'Format de fichier non reconnu',
|
'Bad file format': 'Format de fichier non reconnu',
|
||||||
|
|
|
@ -103,6 +103,7 @@ export default {
|
||||||
modify: 'Modificar',
|
modify: 'Modificar',
|
||||||
shoppingCart: 'Cesta da compra',
|
shoppingCart: 'Cesta da compra',
|
||||||
available: 'Disponível',
|
available: 'Disponível',
|
||||||
|
minQuantity: 'Quantidade mínima',
|
||||||
// Image related translations
|
// Image related translations
|
||||||
'Cant lock cache': 'O cache não pôde ser bloqueado',
|
'Cant lock cache': 'O cache não pôde ser bloqueado',
|
||||||
'Bad file format': 'Formato de arquivo inválido',
|
'Bad file format': 'Formato de arquivo inválido',
|
||||||
|
|
|
@ -48,6 +48,20 @@ const { t } = useI18n();
|
||||||
<span class="col ellipsis">{{ tag.value }}</span>
|
<span class="col ellipsis">{{ tag.value }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="item.minQuantity" class="row justify-end">
|
||||||
|
<QIcon
|
||||||
|
name="production_quantity_limits"
|
||||||
|
size="xs"
|
||||||
|
color="negative"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('minQuantity') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<span class="text-negative text-caption">{{
|
||||||
|
item.minQuantity
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-between items-cente q-gutter-x-xs">
|
<div class="row justify-between items-cente q-gutter-x-xs">
|
||||||
<QBadge
|
<QBadge
|
||||||
|
@ -113,6 +127,20 @@ const { t } = useI18n();
|
||||||
{{ tag.value }}
|
{{ tag.value }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="item.minQuantity" class="row justify-end">
|
||||||
|
<QIcon
|
||||||
|
name="production_quantity_limits"
|
||||||
|
size="xs"
|
||||||
|
color="negative"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('minQuantity') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<span class="text-negative text-caption">{{
|
||||||
|
item.minQuantity
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
<div class="row justify-end items-center q-gutter-x-xs q-mt-sm">
|
<div class="row justify-end items-center q-gutter-x-xs q-mt-sm">
|
||||||
<QBadge
|
<QBadge
|
||||||
:label="`x${item.grouping}`"
|
:label="`x${item.grouping}`"
|
||||||
|
|
|
@ -170,9 +170,10 @@
|
||||||
@click="showItem(_item)"
|
@click="showItem(_item)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<QDialog v-model="showItemDialog">
|
<QDialog v-model="showItemDialog" @hide="resetAmounts()">
|
||||||
<QCard style="width: 25em" class="column">
|
<QCard style="width: 25em" class="column">
|
||||||
<div class="q-pa-md" style="display: flex">
|
<div class="q-pa-md relative-position">
|
||||||
|
<div class="q-mb-md" style="display: flex">
|
||||||
<VnImg
|
<VnImg
|
||||||
storage="catalog"
|
storage="catalog"
|
||||||
size="200x200"
|
size="200x200"
|
||||||
|
@ -186,23 +187,44 @@
|
||||||
<div class="text-subtitle2">
|
<div class="text-subtitle2">
|
||||||
{{ selectedItem.item }}
|
{{ selectedItem.item }}
|
||||||
</div>
|
</div>
|
||||||
<span class="text-subtitle2 text-grey-7 text-uppercase">
|
<span
|
||||||
|
class="text-subtitle2 text-grey-7 text-uppercase"
|
||||||
|
>
|
||||||
{{ selectedItem.subName }}
|
{{ selectedItem.subName }}
|
||||||
</span>
|
</span>
|
||||||
<span class="text-grey-7"> #{{ selectedItem.id }}</span>
|
<span class="text-grey-7">
|
||||||
|
#{{ selectedItem.id }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-caption">
|
||||||
<div class="tags q-px-md text-caption">
|
|
||||||
<div
|
<div
|
||||||
v-for="(tag, index) in selectedItem.tags"
|
v-for="(tag, index) in selectedItem.tags"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="full-width row"
|
class="row"
|
||||||
>
|
>
|
||||||
<span class="text-grey-7 col-5">
|
<span class="text-grey-7" style="width: 35%">
|
||||||
{{ tag.name }}
|
{{ tag.name }}
|
||||||
</span>
|
</span>
|
||||||
<span class="col">{{ tag.value }}</span>
|
<span>{{ tag.value }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="selectedItem.minQuantity"
|
||||||
|
class="row justify-end q-px-md absolute-bottom-right q-pa-md"
|
||||||
|
>
|
||||||
|
<QIcon
|
||||||
|
name="production_quantity_limits"
|
||||||
|
size="xs"
|
||||||
|
color="negative"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('minQuantity') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<span class="text-negative text-caption">{{
|
||||||
|
selectedItem.minQuantity
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -808,6 +830,7 @@ const addItemToOrder = async params => {
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error adding item to basket:', error);
|
console.error('Error adding item to basket:', error);
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -831,17 +854,14 @@ const onConfirmClick = async params => {
|
||||||
|
|
||||||
if (amountSum > 0) {
|
if (amountSum > 0) {
|
||||||
await Promise.all(addItemPromises);
|
await Promise.all(addItemPromises);
|
||||||
|
|
||||||
notify(
|
notify(
|
||||||
`${t('added')} ${amountSum} ${selectedItem.value.item}`,
|
`${t('added')} ${amountSum} ${selectedItem.value.item}`,
|
||||||
'positive'
|
'positive'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
showItemDialog.value = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error adding item to basket:', error);
|
console.error('Error adding item to basket:', error);
|
||||||
} finally {
|
|
||||||
showItemDialog.value = false;
|
|
||||||
resetAmounts();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -907,9 +927,6 @@ onBeforeMount(async () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.search {
|
|
||||||
max-width: 250px;
|
|
||||||
}
|
|
||||||
.basket-info {
|
.basket-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -919,6 +936,7 @@ onBeforeMount(async () => {
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.categories {
|
.categories {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
Loading…
Reference in New Issue