- Seleziona l'ordine GAS e compare sulla email
- img logo
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
public/images/pcb-android-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
public/images/pcb-android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
public/images/pcb-android-icon-36x36.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/pcb-android-icon-48x48.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
public/images/pcb-android-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/pcb-android-icon-96x96.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
public/images/pcb-apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
public/images/pcb-apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
public/images/pcb-apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
public/images/pcb-apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
public/images/pcb-apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
public/images/pcb-apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
public/images/pcb-apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
public/images/pcb-apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/pcb-apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/images/pcb-apple-icon.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
@@ -317,54 +317,54 @@ module.exports = configure((ctx) => ({
|
||||
start_url: "/?homescreen=1",
|
||||
icons: [
|
||||
{
|
||||
src: 'images/fv-android-icon-512x512.png',
|
||||
src: 'images/pcb-android-icon-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-android-icon-384x384.png',
|
||||
src: 'images/pcb-android-icon-384x384.png',
|
||||
sizes: '384x384',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-android-icon-192x192.png',
|
||||
src: 'images/pcb-android-icon-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-android-icon-144x144.png',
|
||||
src: 'images/pcb-android-icon-144x144.png',
|
||||
sizes: '144x144',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-android-icon-96x96.png',
|
||||
src: 'images/pcb-android-icon-96x96.png',
|
||||
sizes: '96x96',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-apple-icon-120x120.png',
|
||||
src: 'images/pcb-apple-icon-120x120.png',
|
||||
sizes: '120x120',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-apple-icon-144x144.png',
|
||||
src: 'images/pcb-apple-icon-144x144.png',
|
||||
sizes: '144x144',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-apple-icon-152x152.png',
|
||||
src: 'images/pcb-apple-icon-152x152.png',
|
||||
sizes: '152x152',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/fv-apple-icon-180x180.png',
|
||||
src: 'images/pcb-apple-icon-180x180.png',
|
||||
sizes: '180x180',
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
related_applications: [{
|
||||
"platform": "webapp",
|
||||
"url": "https://www.riso.app/manifest.json"
|
||||
"url": "https://www.piuchebuono.app/manifest.json"
|
||||
}]
|
||||
},
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ import { CCopyBtn } from '../CCopyBtn'
|
||||
|
||||
import { func_tools, toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
import { IBaseOrder, IOrder, IOrderCart, IProduct } from '@src/model'
|
||||
import { IBaseOrder, IGasordine, IOrder, IOrderCart, IProduct } from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useProducts } from '@store/Products'
|
||||
|
||||
@@ -29,6 +29,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
cosa: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
complete: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -57,6 +62,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const storeSelected = ref('')
|
||||
const gasordineSelected = ref('')
|
||||
const arrordersCart = ref(<IOrderCart[]>[])
|
||||
|
||||
const openlistorders = ref(false)
|
||||
@@ -120,6 +126,19 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function getSingleGasordine(gasordine: IGasordine) {
|
||||
try {
|
||||
const mygas = gasordine
|
||||
if (mygas)
|
||||
return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
|
||||
+ ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)
|
||||
else
|
||||
return ''
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function updateproduct() {
|
||||
myproduct.value = products.getProductByCode(props.code)
|
||||
// products.updateQuantityAvailable(myproduct.value._id)
|
||||
@@ -146,6 +165,26 @@ export default defineComponent({
|
||||
return myarr
|
||||
}
|
||||
|
||||
function getGasordines() {
|
||||
if (!myproduct.value)
|
||||
return []
|
||||
|
||||
const myarr: any = []
|
||||
let ind = 1
|
||||
myproduct.value.gasordines.forEach((gasordine: IGasordine) => {
|
||||
myarr.push(
|
||||
{
|
||||
id: ind,
|
||||
label: getSingleGasordine(gasordine),
|
||||
value: gasordine._id
|
||||
})
|
||||
|
||||
ind++
|
||||
})
|
||||
|
||||
return myarr
|
||||
}
|
||||
|
||||
function checkifCartDisable() {
|
||||
// return !myorder.idStorehouse
|
||||
return false
|
||||
@@ -184,6 +223,10 @@ export default defineComponent({
|
||||
myorder.idStorehouse = newval
|
||||
})
|
||||
|
||||
watch(() => gasordineSelected.value, (newval, oldval) => {
|
||||
myorder.idGasordine = newval
|
||||
})
|
||||
|
||||
function load() {
|
||||
updateproduct()
|
||||
// console.log('Load', myproduct.value.name)
|
||||
@@ -196,10 +239,19 @@ export default defineComponent({
|
||||
myorder.idStorehouse = myproduct.value.storehouses[0]._id
|
||||
}
|
||||
|
||||
if (myproduct.value.gasordines && myproduct.value.gasordines.length === 1) {
|
||||
myorder.idGasordine = myproduct.value.gasordines[0]._id
|
||||
}
|
||||
|
||||
|
||||
const ord = products.getOrderProductInCart(myproduct.value._id)
|
||||
if (ord) {
|
||||
myorder.quantity = ord.quantity
|
||||
myorder.quantitypreordered = ord.quantitypreordered
|
||||
|
||||
if (ord.idGasordine)
|
||||
gasordineSelected.value = ord.idGasordine!
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +310,7 @@ export default defineComponent({
|
||||
getclimgproduct,
|
||||
getnumstore,
|
||||
getSingleStorehouse,
|
||||
getSingleGasordine,
|
||||
getStorehouses,
|
||||
checkifCartDisable,
|
||||
myproduct,
|
||||
@@ -265,6 +318,7 @@ export default defineComponent({
|
||||
tools,
|
||||
t,
|
||||
storeSelected,
|
||||
gasordineSelected,
|
||||
enableSubQty,
|
||||
enableAddQty,
|
||||
getQtyAvailable,
|
||||
@@ -281,6 +335,7 @@ export default defineComponent({
|
||||
getQtyBookableAvailable,
|
||||
listord,
|
||||
sumval,
|
||||
getGasordines,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
<q-item>
|
||||
<div v-if="complete" class="row items-center">
|
||||
<q-item v-if="complete">
|
||||
<div class="row items-center">
|
||||
<div class="text-title text-grey-9">
|
||||
<span class="text-grey-7" v-html="myproduct.description"></span>
|
||||
</div>
|
||||
@@ -66,6 +66,52 @@
|
||||
</div>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section avatar v-if="myproduct.weight">
|
||||
<q-icon
|
||||
name="fas fa-balance-scale"
|
||||
style="padding-right: 16px !important"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section v-if="myproduct.weight">
|
||||
<q-item-label>
|
||||
{{ t('products.weight') }}
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="text-black q-ml-xs text-h8" v-if="myproduct.unit">
|
||||
{{ myproduct.weight }}
|
||||
{{ tools.getUnitsMeasure(myproduct.unit, true) }}</span
|
||||
>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-if="myproduct.gasordines && myproduct.gasordines.length >= 1">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="blue" name="fas fa-shipping-fast" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
{{ t('products.gasordine') }}
|
||||
</q-item-label>
|
||||
<q-item-label
|
||||
v-if="(tools.isArray(myproduct.gasordines) && myproduct.gasordines.length > 1) && (!myorder.idGasordine || ((myorder.quantity + myorder.quantitypreordered) === 0 ))">
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
outlined
|
||||
v-model="gasordineSelected"
|
||||
:options="getGasordines()"
|
||||
:label="t('products.select_gasordine') + `:`"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
</q-item-label>
|
||||
<q-item-label v-else>
|
||||
<span class="text-title text-center">{{
|
||||
getSingleGasordine(myproduct.gasordines[0])
|
||||
}}</span>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div v-if="true">
|
||||
@@ -90,17 +136,6 @@
|
||||
{{ myproduct.producer.name }}</span
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-if="myproduct.weight"
|
||||
class="text-grey text-title row items-center"
|
||||
>
|
||||
<q-icon name="fas fa-balance-scale" class="q-mr-xs" />
|
||||
{{ t('products.weight') }}:
|
||||
<span class="text-black q-ml-xs text-h8" v-if="myproduct.unit">
|
||||
{{ myproduct.weight }}
|
||||
{{ tools.getUnitsMeasure(myproduct.unit, true) }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<q-rating v-model="myproduct.stars" :max="5" size="32px" readonly/>-->
|
||||
@@ -108,14 +143,15 @@
|
||||
<div>
|
||||
<q-list>
|
||||
<q-item
|
||||
v-if="
|
||||
cosa === shared_consts.PROD.BOTTEGA ||
|
||||
(cosa === shared_consts.PROD.GAS && getQtyAvailable() > 0)
|
||||
"
|
||||
:clickable="tools.isManager()"
|
||||
@click="tools.isManager() ? (visuListDisponibili()) : null"
|
||||
@click="tools.isManager() ? visuListDisponibili() : null"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon
|
||||
color="green"
|
||||
name="fas fa-store"
|
||||
/>
|
||||
<q-icon color="green" name="fas fa-store" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
@@ -146,9 +182,9 @@
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="getQtyBookableAvailable() > 0 || (myproduct.bookableQty > 0)"
|
||||
v-if="getQtyBookableAvailable() > 0 || myproduct.bookableQty > 0"
|
||||
:clickable="tools.isManager()"
|
||||
@click="tools.isManager() ? (visuListBookable()) : null"
|
||||
@click="tools.isManager() ? visuListBookable() : null"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="blue" name="fas fa-edit" />
|
||||
@@ -183,48 +219,6 @@
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div class="row q-mb-sm no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
icon="fas fa-cart-arrow-down"
|
||||
:color="enableSubQty() ? 'negative' : 'grey'"
|
||||
:disable="checkifCartDisable() || !enableSubQty()"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.subcart', { qta: 1 })"
|
||||
@click="addtoCart(false)"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-field
|
||||
outlined
|
||||
dense
|
||||
style="width: 40px; height: 30px"
|
||||
class="q-mx-xs"
|
||||
>
|
||||
<template v-slot:control>
|
||||
<div class="self-center no-outline" tabindex="0">
|
||||
{{ myorder.quantity }}
|
||||
</div>
|
||||
<div
|
||||
v-if="myorder.quantitypreordered"
|
||||
class="self-center no-outline"
|
||||
tabindex="0"
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</q-field>
|
||||
|
||||
<q-btn
|
||||
icon-right="fas fa-cart-plus"
|
||||
color="positive"
|
||||
:disable="checkifCartDisable() || !enableAddQty()"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.addcart', { qta: 1 })"
|
||||
@click="addtoCart(true)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-if="complete || getnumstore() > 1">
|
||||
<div
|
||||
class="text-blue text-title row items-center q-mr-md centeritems"
|
||||
@@ -254,6 +248,42 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-mb-sm no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
icon="fas fa-cart-arrow-down"
|
||||
:color="enableSubQty() ? 'negative' : 'grey'"
|
||||
:disable="checkifCartDisable() || !enableSubQty()"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.subcart', { qta: 1 })"
|
||||
@click="addtoCart(false)"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-field
|
||||
outlined
|
||||
dense
|
||||
style="width: 40px; height: 30px"
|
||||
class="q-mx-xs"
|
||||
>
|
||||
<template v-slot:control>
|
||||
<div class="self-center no-outline" tabindex="0">
|
||||
{{ myorder.quantity + myorder.quantitypreordered }}
|
||||
</div>
|
||||
</template>
|
||||
</q-field>
|
||||
|
||||
<q-btn
|
||||
icon-right="fas fa-cart-plus"
|
||||
color="positive"
|
||||
:disable="checkifCartDisable() || !enableAddQty()"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.addcart', { qta: 1 })"
|
||||
@click="addtoCart(true)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<q-card-actions vertical align="center">
|
||||
<q-btn
|
||||
@@ -345,9 +375,7 @@
|
||||
<td> </td>
|
||||
<td class="text-center">
|
||||
Totali:
|
||||
<span class="totali">{{
|
||||
sumval
|
||||
}}</span>
|
||||
<span class="totali">{{ sumval }}</span>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
@@ -31,3 +31,7 @@
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
.gasordine {
|
||||
font-style: italic;
|
||||
color: blue;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export default defineComponent({
|
||||
function addsubqty(addqty: boolean, subqty: boolean) {
|
||||
if (products.isQtyAvailableByOrder(props.order)) {
|
||||
if (addqty) {
|
||||
if (props.order.quantity >= 20)
|
||||
if (props.order.quantity >= 100)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export default defineComponent({
|
||||
|
||||
if (products.isInPreorderByOrder(props.order)) {
|
||||
if (addqty) {
|
||||
if (props.order.quantitypreordered >= 20)
|
||||
if (props.order.quantitypreordered >= 100)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -99,6 +99,8 @@ export default defineComponent({
|
||||
removeFromCard,
|
||||
isApplicatoSconto,
|
||||
getRisparmio,
|
||||
tools,
|
||||
products,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -11,10 +11,15 @@
|
||||
</q-img>
|
||||
</div>
|
||||
<div class="col-4 q-ml-xs">
|
||||
<div v-if="order.idGasordine" class="gasordine">
|
||||
{{ products.getSingleGasordine(order, true) }}<br>
|
||||
</div>
|
||||
{{ order.product.name }}
|
||||
<div v-if="showall">
|
||||
|
||||
<!--<div v-if="showalle">
|
||||
<br /><span class="text-grey">{{ order.product.description }}</span>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row q-mb-xs no-wrap items-center centeritems">
|
||||
@@ -48,6 +53,13 @@
|
||||
@click="addsubqty(true, false)"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div
|
||||
class="text-black q-ml-xs text-h8 text-center"
|
||||
v-if="order.product.unit"
|
||||
>
|
||||
{{ tools.getWeightTotalByOrder(order) }}
|
||||
{{ tools.getUnitsMeasure(order.product.unit, true) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 no-wrap text-subtitle3_short q-mr-sm">
|
||||
<span :class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''"
|
||||
|
||||
@@ -82,6 +82,8 @@ const msg_it = {
|
||||
barcode: 'BarCode',
|
||||
price_acquistato: 'Prezzo Acquistato',
|
||||
vegan: 'Vegano',
|
||||
gasordine: 'Ordine Gas',
|
||||
select_gasordine: 'Scegli l\'Ordine del GAS'
|
||||
},
|
||||
storehouses: {
|
||||
name: 'Magazzino',
|
||||
@@ -1654,7 +1656,7 @@ const msg_it = {
|
||||
ord_not_confirmed: 'E\' avvenuto un errore. Ordine non Confermato. Ricaricare la pagina e riprovare.',
|
||||
btn_cassa: 'Vai alla Cassa',
|
||||
available: 'Disponibili',
|
||||
preorders: 'Pre-Ordinabili',
|
||||
preorders: 'Quantità Pre-Ordinabili',
|
||||
preord: 'Pre-Ordinate',
|
||||
di_cui_x_in_carrello: '(nel tuo carrello: {qty})',
|
||||
evaso: 'Ordine Evaso',
|
||||
@@ -1676,13 +1678,16 @@ const msg_it = {
|
||||
code_add_to_cart: 'Aggiungi un codice al carrello',
|
||||
qta_prenotate_in_attesa: '(Preordinate In attesa {qty})',
|
||||
},
|
||||
},
|
||||
|
||||
gas: {
|
||||
name: 'Ordine Gas',
|
||||
dataora_chiusura_ordini: 'Data Chiusura Ordini',
|
||||
dataora_ritiro: 'Data Ritiro Prodotti',
|
||||
dataora_ritiro: 'Data Ritiro',
|
||||
ordina_sul_gas: 'Gruppo di Acquisto',
|
||||
bottega: 'Bottega',
|
||||
x_prodotti_gas: '{qta} prodotti',
|
||||
x_prodotti_bottega: '{qta} prodotti',
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
export default msg_it;
|
||||
|
||||
@@ -1979,7 +1979,7 @@ export const colTableProducts = [
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idGasordines',
|
||||
label_trans: 'gasordine.name',
|
||||
label_trans: 'gas.name',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'gasordines',
|
||||
}),
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
IProject,
|
||||
ITimeLineMain,
|
||||
ITodo,
|
||||
IOrder,
|
||||
IUserFields,
|
||||
Privacy,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu, INotif, IMyElem, IMyCard, ILabelValue, ILabelValueStr, IAnim, ILang, IGroupShort, IPagination, IFavorite, IBookmark,
|
||||
@@ -66,6 +67,7 @@ export const tools = {
|
||||
|
||||
COOK_SEARCH: 'SEARCH_',
|
||||
COOK_TAB_CIRCUIT: 'TAB_CIRC',
|
||||
COOK_COSA_PRODOTTI: 'PROD',
|
||||
|
||||
FRIENDS_SEARCH: 'FR_SE',
|
||||
GROUP_SEARCH: 'GR_SE',
|
||||
@@ -8250,6 +8252,10 @@ export const tools = {
|
||||
return unitrec ? (short ? unitrec.short : unitrec.label) : ''
|
||||
},
|
||||
|
||||
getWeightTotalByOrder(order: IOrder) {
|
||||
return (order.product && order.product.weight ? order.product.weight : 1) * (order.quantitypreordered | 0 + order.quantity | 0)
|
||||
},
|
||||
|
||||
isPartecipero(myrec: any) {
|
||||
const userStore = useUserStore()
|
||||
if (myrec && myrec.mybookings && myrec.mybookings.length > 0) {
|
||||
|
||||
@@ -12,6 +12,8 @@ import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from './globalStore'
|
||||
import { ref } from 'vue'
|
||||
|
||||
import translate from '@src/globalroutines/util'
|
||||
|
||||
export const useProducts = defineStore('Products', {
|
||||
state: (): IProductsState => ({
|
||||
products: [],
|
||||
@@ -285,11 +287,12 @@ export const useProducts = defineStore('Products', {
|
||||
quantity: order.quantity,
|
||||
quantitypreordered: order.quantitypreordered,
|
||||
idStorehouse: order.idStorehouse,
|
||||
idGasordine: order.idGasordine,
|
||||
idScontisticas: product.idScontisticas,
|
||||
}
|
||||
|
||||
if (product.storehouses.length === 1) {
|
||||
order.idStorehouse = product.storehouses[0]._id
|
||||
myorder.idStorehouse = product.storehouses[0]._id
|
||||
}
|
||||
|
||||
return myorder
|
||||
@@ -731,7 +734,25 @@ export const useProducts = defineStore('Products', {
|
||||
return false;
|
||||
},
|
||||
|
||||
getSingleGasordine(order: IOrder, short: boolean): string {
|
||||
try {
|
||||
const mygas = order.gasordine
|
||||
if (mygas) {
|
||||
if (short)
|
||||
return mygas.name!
|
||||
else
|
||||
return mygas.name + ' (' + mygas.city + ') ' + translate('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
|
||||
+ ' ' + translate('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)
|
||||
} else
|
||||
return ''
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineComponent, onMounted, ref } from 'vue'
|
||||
import { defineComponent, onMounted, ref, watch } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -28,9 +28,14 @@ export default defineComponent({
|
||||
|
||||
const search = ref('')
|
||||
|
||||
const cosa = ref(shared_consts.PROD.GAS)
|
||||
const cosa = ref(0)
|
||||
|
||||
watch(() => cosa.value, (newval, oldval) => {
|
||||
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString())
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.BOTTEGA, true)
|
||||
// Inizializza
|
||||
productStore.loadProducts()
|
||||
}
|
||||
@@ -48,6 +53,16 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
function getNumQtaGas() {
|
||||
const arrprod = productStore.getProducts(shared_consts.PROD.GAS)
|
||||
return arrprod.length
|
||||
}
|
||||
|
||||
function getNumQtaBottega() {
|
||||
const arrprod = productStore.getProducts(shared_consts.PROD.BOTTEGA)
|
||||
return arrprod.length
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -59,6 +74,8 @@ export default defineComponent({
|
||||
search,
|
||||
cosa,
|
||||
shared_consts,
|
||||
getNumQtaGas,
|
||||
getNumQtaBottega,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,14 +3,24 @@
|
||||
<div class="panel">
|
||||
<div>
|
||||
<div class="q-gutter-md text-center q-mb-md">
|
||||
<q-btn-toggle v-model="cosa" push rounded glossy toggle-color="purple" :options="[
|
||||
{ value: shared_consts.PROD.GAS, slot: 'gas' },
|
||||
<q-btn-toggle
|
||||
v-model="cosa"
|
||||
push
|
||||
:size="cosa === 0 ? 'lg' : 'md'"
|
||||
rounded
|
||||
glossy
|
||||
toggle-color="purple"
|
||||
:options="[
|
||||
{ value: shared_consts.PROD.BOTTEGA, slot: 'bottega' },
|
||||
]">
|
||||
{ value: shared_consts.PROD.GAS, slot: 'gas' },
|
||||
]"
|
||||
>
|
||||
<template v-slot:gas>
|
||||
<div class="row items-center no-wrap">
|
||||
<div class="text-center">
|
||||
Ordina sul GAS
|
||||
{{ $t('gas.ordina_sul_gas') }}
|
||||
<br />
|
||||
{{ $t('gas.x_prodotti_gas', { qta: getNumQtaGas() }) }}
|
||||
</div>
|
||||
<q-icon right name="fas fa-user-friends" />
|
||||
</div>
|
||||
@@ -19,26 +29,42 @@
|
||||
<template v-slot:bottega>
|
||||
<div class="row items-center no-wrap">
|
||||
<div class="text-center">
|
||||
Vai alla Bottega
|
||||
{{ $t('gas.bottega') }}
|
||||
<br />
|
||||
{{
|
||||
$t('gas.x_prodotti_bottega', { qta: getNumQtaBottega() })
|
||||
}}
|
||||
</div>
|
||||
<q-icon right name="fas fa-store" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-btn-toggle>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="q-gutter-y-md column text-center q-mx-auto" style="width: 350px; max-width: 100%">
|
||||
<q-input filled stack-label :label="$t('ecomm.code_o_text_search')" v-model="search" class="q-ml-md">
|
||||
<div
|
||||
class="q-gutter-y-md column text-center q-mx-auto"
|
||||
style="width: 350px; max-width: 100%"
|
||||
>
|
||||
<q-input
|
||||
filledd
|
||||
stack-label
|
||||
:label="$t('ecomm.code_o_text_search')"
|
||||
v-model="search"
|
||||
class="q-ml-md"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="q-pa-md row items-start q-gutter-md" v-for="(product, index) in getProducts()" :key="index">
|
||||
<CProductCard :code="product.code" :complete="false" />
|
||||
<div
|
||||
class="q-pa-md row items-start q-gutter-md"
|
||||
v-for="(product, index) in getProducts()"
|
||||
:key="index"
|
||||
>
|
||||
<CProductCard :code="product.code" :complete="false" :cosa="cosa" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
BIN
upload/products/S0001.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |