- preordinabili corretti + altro

This commit is contained in:
Surya Paolo
2023-12-29 21:17:25 +01:00
parent c0998753c2
commit 632d05bbfb
13 changed files with 192 additions and 67 deletions

View File

@@ -1039,6 +1039,7 @@ export const shared_consts = {
RECEIVED: 7,
COMPLETED: 6,
CANCELED: 10,
DELETE_REALLY: 20,
},
OrderStat: {
@@ -1102,14 +1103,14 @@ export const shared_consts = {
label: 'Ricevuto',
value: 7,
},
{
label: 'Completato',
value: 8,
},
{
label: 'Cancellato',
value: 10,
},
{
label: 'Elimina Definitivamente !!',
value: 20,
},
],
@@ -1150,6 +1151,12 @@ export const shared_consts = {
icon: 'delete',
color: 'red',
},
{
label: 'Cancella Definitivamente', //DELETE_REALLY
value: 20,
icon: 'delete',
color: 'red',
},
],
ConfSite: {

View File

@@ -57,4 +57,8 @@
.countdown_scadenza{
font-size: 1.15rem;
font-weight: bold;
}
.subtit_prod {
font-style: italic;
}

View File

@@ -60,7 +60,7 @@ export default defineComponent({
idStorehouse: '',
idGasordine: '',
storehouse: {},
gasordine: {active: false},
gasordine: { active: false },
})
const storeSelected = ref('')
@@ -138,9 +138,11 @@ export default defineComponent({
try {
const mygas = gasordine
if (mygas)
return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
/*return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
+ ' ' + t('gas.data_arrivo_merce') + ': ' + tools.getstrDateShort(mygas.data_arrivo_merce)
+ ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)
+ ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)*/
return mygas.name
else
return ''
} catch (e) {
@@ -157,13 +159,13 @@ export default defineComponent({
gasordineSelected.value = ''
recgasordineSelected.value = null
}
function updateproduct() {
myproduct.value = products.getProductById(props.id)
// products.updateQuantityAvailable(myproduct.value._id)
}
@@ -327,10 +329,6 @@ export default defineComponent({
endload.value = true
}
function getmycardcl() {
return (props.complete) ? 'my-card-big' : 'my-card-prod'
}
function getclimgproduct() {
return 'myimgproduct centermydiv'
}
@@ -362,7 +360,6 @@ export default defineComponent({
visuListBookable,
addtoCart,
iconWhishlist,
getmycardcl,
getclimgproduct,
getnumstore,
getSingleStorehouse,

View File

@@ -3,7 +3,12 @@
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
<q-card
:class="getmycardcl()"
:class="{
'my-card-big': complete,
'my-card-prod': !complete,
'my-card-selected':
myorder && myorder.quantity + myorder.quantitypreordered > 0,
}"
v-if="!!myproduct && endload && !!myproduct.productInfo"
bordered
>
@@ -21,7 +26,7 @@
color="primary"
icon="fas fa-info"
class="absolute semi-transparent"
style="top: 0; right: 12px; transform: translateY(-50%)"
style="top: 0; right: 12px; transform: translateY(-90%)"
:to="`/product/` + myproduct._id + '/' + cosa"
/>
@@ -50,7 +55,7 @@
</q-item-section>
<q-item-section>
<q-item-label>
<q-item-label class="subtit_prod">
{{ t('products.price') }}
</q-item-label>
<q-item-label>
@@ -102,7 +107,7 @@
</q-item-section>
<q-item-section>
<q-item-label>
<q-item-label class="subtit_prod">
{{ t('products.gasordine') }}
</q-item-label>
<q-item-label
@@ -137,11 +142,11 @@
</q-item-section>
<q-item-section>
<q-item-label>
<q-item-label class="subtit_prod">
{{ t('gas.dataora_chiusura_ordini') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
{{ timerLabelScadenza }}
<q-item-label class="countdown_scadenza">
{{ timerLabelScadenza }}
</q-item-label>
</q-item-section>
</q-item>
@@ -150,12 +155,12 @@
<q-icon color="red" name="fas fa-shipping-fast" />
</q-item-section>
<q-item-section>
<q-item-section class="subtit_prod">
<q-item-label>
{{ t('gas.data_arrivo_merce') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
{{ labelDataArrivoMerce }}
<q-item-label class="countdown_scadenza">
{{ labelDataArrivoMerce }}
</q-item-label>
</q-item-section>
</q-item>
@@ -165,11 +170,11 @@
</q-item-section>
<q-item-section>
<q-item-label>
<q-item-label class="subtit_prod">
{{ t('gas.dataora_ritiro') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
{{ labelDataRitiro }}
<q-item-label class="countdown_scadenza">
{{ labelDataRitiro }}
</q-item-label>
</q-item-section>
</q-item>
@@ -205,17 +210,24 @@
<q-item
v-if="
cosa === shared_consts.PROD.BOTTEGA ||
(cosa === shared_consts.PROD.GAS && products.getQtyAvailable(myproduct) > 0)
(cosa === shared_consts.PROD.GAS &&
products.getQtyAvailable(myproduct) > 0)
"
:clickable="tools.isManager()"
@click="tools.isManager() && (myproduct.QuantitaOrdinateInAttesa && myproduct.QuantitaOrdinateInAttesa > 0) ? visuListDisponibili() : null"
@click="
tools.isManager() &&
myproduct.QuantitaOrdinateInAttesa &&
myproduct.QuantitaOrdinateInAttesa > 0
? visuListDisponibili()
: null
"
>
<q-item-section avatar>
<q-icon color="green" name="fas fa-store" />
</q-item-section>
<q-item-section>
<q-item-label>
<q-item-label class="subtit_prod">
{{ t('ecomm.available') }}
</q-item-label>
<q-item-label>
@@ -236,20 +248,54 @@
</div>
</div>
</q-item-label>
<q-item-label> </q-item-label>
</q-item-section>
<q-item-section
v-if="
tools.isManager() &&
products.getQtyBloccataAvailable(myproduct) > 0
"
>
<q-item-section avatar>
<q-icon
name="fas fa-store"
style="padding-right: 16px !important"
/>
</q-item-section>
<q-item-section
v-if="
tools.isManager() &&
products.getQtyBloccataAvailable(myproduct) > 0
"
>
<q-item-label> {{ t('ecomm.bloccati') }}: </q-item-label>
<q-item-label>
<span class="text-black q-ml-xs text-h8">
{{ products.getQtyBloccataAvailable(myproduct) }}</span
>
</q-item-label>
</q-item-section>
</q-item-section>
</q-item>
<q-item
v-if="products.getQtyBookableAvailable(myproduct) > 0 || myproduct.bookableQty > 0"
v-if="
products.getQtyBookableAvailable(myproduct) > 0 ||
myproduct.bookableQty > 0
"
:clickable="tools.isManager()"
@click="tools.isManager() && (myproduct.QuantitaPrenotateInAttesa && myproduct.QuantitaPrenotateInAttesa > 0) ? visuListBookable() : null"
@click="
tools.isManager() &&
myproduct.QuantitaPrenotateInAttesa &&
myproduct.QuantitaPrenotateInAttesa > 0
? visuListBookable()
: null
"
>
<q-item-section avatar>
<q-icon color="blue" name="fas fa-edit" />
</q-item-section>
<q-item-section>
<q-item-label>
<q-item-label class="subtit_prod">
{{ t('ecomm.preorders') }}
</q-item-label>
<q-item-label>
@@ -271,6 +317,27 @@
</div>
</q-item-label>
</q-item-section>
<q-item-section
v-if="
tools.isManager() &&
products.getQtyBloccataBookableAvailable(myproduct) > 0
"
>
<q-item-section avatar>
<q-icon
name="fas fa-store"
style="padding-right: 16px !important"
/>
</q-item-section>
<q-item-section>
<q-item-label class="subtit_prod"> {{ t('ecomm.bloccati') }}: </q-item-label>
<q-item-label>
<span class="text-black q-ml-xs text-h8">
{{ products.getQtyBloccataBookableAvailable(myproduct) }}</span
>
</q-item-label>
</q-item-section>
</q-item-section>
</q-item>
</q-list>
<div v-if="complete || getnumstore() > 1">
@@ -309,16 +376,16 @@
:disable="checkifCartDisable() || !products.enableSubQty(myorder)"
rounded
size="md"
:label="t('products.subcart', { qta: products.qtaNextSub(myorder, myproduct) })"
:label="
t('products.subcart', {
qta: products.qtaNextSub(myorder, myproduct),
})
"
@click="addtoCart(false)"
>
</q-btn>
<q-field
outlined
dense
class="q-mx-xs"
>
<q-field outlined dense class="q-mx-xs">
<template v-slot:control>
<div class="no-outline label-qta text-center" tabindex="0">
{{ myorder.quantity + myorder.quantitypreordered }}
@@ -329,10 +396,16 @@
<q-btn
icon-right="fas fa-cart-plus"
color="positive"
:disable="checkifCartDisable() || !products.enableAddQty(myorder, myproduct)"
:disable="
checkifCartDisable() || !products.enableAddQty(myorder, myproduct)
"
rounded
size="md"
:label="t('products.addcart', { qta: products.qtaNextAdd(myorder, myproduct) })"
:label="
t('products.addcart', {
qta: products.qtaNextAdd(myorder, myproduct),
})
"
@click="addtoCart(true)"
>
</q-btn>

View File

@@ -375,6 +375,18 @@ h3 {
}
}
.my-card-selected {
transition: box-shadow 0.3s; /* Add a transition for a smooth effect */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
color: blue;
background-color: lightblue;
}
.my-card-prod:hover {
transition: transform .2s;
transform: scale(1.02);
}
.my-card-prod {
width: 100%;
max-width: 300px;

View File

@@ -9,6 +9,7 @@ const msg_website_enUs = {
quantity: 'Quantità',
quantityAvailable: 'Disponibili',
stockQty: 'In Magazzino',
stockBloccatiQty: 'Bloccati In Magazzino',
weight: 'Peso',
stars: 'Voto',
color: 'Colore',

View File

@@ -41,10 +41,12 @@ export interface IProduct {
QuantitaOrdinateInAttesa?: number,
QuantitaPrenotateInAttesa?: number,
stockQty: number,
stockBloccatiQty: number,
minBuyQty: number,
minStepQty?: number,
minStepQty: number,
maxBookableQty: number,
bookableQty: number,
bookableBloccatiQty: number,
canBeShipped?: boolean,
canBeBuyOnline?: boolean,
}
@@ -135,6 +137,7 @@ export interface IStorehouse {
email_html_footer?: string,
email_html_makeorder?: string,
email_html_order_confirmed?: string,
email_html_order_consegnato?: string,
}
export interface IProvider {
@@ -211,8 +214,6 @@ export interface IOrderCart {
date_spedito?: Date
ricevuto: boolean
date_ricevuto?: Date
completato: boolean
date_completato?: Date
created_at: Date
note: string
}

View File

@@ -417,6 +417,7 @@ export default defineComponent({
strris += addfield(col, 'bookableQty', rec, false, true); col++;
strris += addfield(col, 'sconto1', rec, false, true); col++;
strris += addfield(col, 'sconto2', rec, false, true); col++;
strris += addfield(col, 'gas_name', rec, false, true); col++;
strris += '} '
} else if (cmd === shared_consts.Cmd.CITIES_SERVER) {
@@ -440,7 +441,7 @@ export default defineComponent({
if (cmd === shared_consts.Cmd.CITIES_SERVER) {
userStore.importToServerCmd($q, t, cmd, null)
} else if (cmd === shared_consts.Cmd.PRODUCTS) {
let options = { aggiornaStockQta: checkAggiornaQta.value }
let options = { aggiornaStockQty: checkAggiornaQta.value }
if (importasulserver.value)
userStore.importToServerCmd($q, t, cmd, { arrdata: strris, options })
}
@@ -471,7 +472,7 @@ export default defineComponent({
}
function eseguiCmdProduct() {
let options = { aggiornaStockQta: checkAggiornaQta.value }
let options = { aggiornaStockQty: checkAggiornaQta.value }
userStore.importToServerCmd($q, t, cosafare.value, { arrdata: risultato.value, options })
}

View File

@@ -62,7 +62,9 @@ const msg_it = {
quantity: 'Quantità',
quantityAvailable: 'Disponibili',
stockQty: 'In Magazzino',
stockBloccatiQty: 'Bloccati In Magazzino',
minBuyQty: 'Qta minima acquistabile',
minStepQty: 'Step Minimo',
maxBookableQty: 'Qtà massima prenotabile singolarm.',
bookableQty: 'Prenotabili',
bookableAvailableQty: 'Disponib. Prenotabili',
@@ -1120,8 +1122,9 @@ const msg_it = {
icon: 'Icona',
email_html_header: 'Instestazione',
email_html_footer: 'Footer',
email_html_makeorder: 'Ordine Inviato',
email_html_order_confirmed: 'Ordine Confermato',
email_html_makeorder: '1) Ordine Ricevuto',
email_html_order_confirmed: '2) Ordine Confermato da noi',
email_html_order_consegnato: '3) Ordine Completato Correttamente',
},
sectors: {
name: 'Settore',
@@ -1671,7 +1674,6 @@ const msg_it = {
consegnato: 'Ordine Consegnato',
pagato: 'Ordine Pagato',
spedito: 'Ordine Spedito',
completed: 'Ordine Completato',
ricevuto: 'Prodotti Ricevuti',
listaord: 'Lista Ordini',
carrello_vuoto: 'Il Carrello è Vuoto',
@@ -1686,6 +1688,7 @@ const msg_it = {
code_add_to_cart: 'Aggiungi un codice al carrello',
qta_prenotate_in_attesa: '(Preordinate In attesa {qty})',
prodotti_trovati: '{qta} Prodotti trovati su {qtatot}',
bloccati: 'Bloccati',
},
gas: {
name: 'Ordine Gas',

View File

@@ -439,6 +439,7 @@ export const colTableStorehouse = [
AddCol({ name: 'email_html_footer', label_trans: 'store.email_html_footer', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'email_html_makeorder', label_trans: 'store.email_html_makeorder', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'email_html_order_confirmed', label_trans: 'store.email_html_order_confirmed', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'email_html_order_consegnato', label_trans: 'store.email_html_order_consegnato', fieldtype: costanti.FieldType.html }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
@@ -2050,6 +2051,11 @@ export const colTableProducts = [
label_trans: 'products.minBuyQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'minStepQty',
label_trans: 'products.minStepQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'maxBookableQty',
label_trans: 'products.maxBookableQty',
@@ -2065,6 +2071,16 @@ export const colTableProducts = [
label_trans: 'products.bookableQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'stockBloccatiQty',
label_trans: 'products.stockBloccatiQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'bookableBloccatiQty',
label_trans: 'products.bookableBloccatiQty',
fieldtype: costanti.FieldType.number
}),
AddCol({ name: 'canBeShipped', label_trans: 'products.canBeShipped', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'canBeBuyOnline', label_trans: 'products.canBeBuyOnline', fieldtype: costanti.FieldType.boolean }),
AddCol(DeleteRec),

View File

@@ -41,7 +41,9 @@ function getRecordProductEmpty() {
},
storehouses: [], scontisticas: [],
price: 0, stockQty: 0, bookableQty: 0, gasordines: [],
stockBloccatiQty: 0, bookableBloccatiQty: 0,
idGasordines: [], minBuyQty: 1, maxBookableQty: 0,
minStepQty: 1,
}
}
@@ -303,10 +305,12 @@ export const useProducts = defineStore('Products', {
quantityAvailable: 0,
bookableAvailableQty: 0,
stockQty: 0,
stockBloccatiQty: 0,
minBuyQty: 1,
minStepQty: 1,
maxBookableQty: 0,
bookableQty: 0,
bookableBloccatiQty: 0,
canBeShipped: false,
QuantitaOrdinateInAttesa: 0,
QuantitaPrenotateInAttesa: 0,
@@ -821,6 +825,16 @@ export const useProducts = defineStore('Products', {
return qty
},
getQtyBloccataAvailable(myproduct: IProduct): number {
let qty = myproduct.stockBloccatiQty
return qty
},
getQtyBloccataBookableAvailable(myproduct: IProduct): number {
let qty = myproduct.bookableBloccatiQty
return qty
},
enableSubQty(myorder: IOrder): boolean {
let qty = myorder.quantity + myorder.quantitypreordered
return qty ? qty > 0 : false
@@ -846,21 +860,21 @@ export const useProducts = defineStore('Products', {
},
qtaNextAdd(myorder: IOrder, myproduct: IProduct): number {
let step = 1
let step = myproduct.minStepQty
if (this.getQtyAvailable(myproduct) > 0) {
if (myorder.quantity === 0)
step = myproduct.minBuyQty | 1
step = myproduct.minBuyQty
} else {
if (myorder.quantitypreordered === 0)
step = myproduct.minBuyQty | 1
step = myproduct.minBuyQty
}
return step
},
qtaNextSub(myorder: IOrder, myproduct: IProduct) {
let step = 1
let minqta = myproduct.minBuyQty | 1
let step = myproduct.minStepQty
let minqta = myproduct.minBuyQty
if (this.getQtyAvailable(myproduct) > 0) {
if (myorder.quantity === minqta)
step = minqta

View File

@@ -183,8 +183,8 @@
<q-td key="created_at" :props="props">
{{ tools.getstrDateTime(props.row.created_at) }}
<span v-if="taborders === shared_consts.OrderStat.COMPLETATI">
<br />Completato il:<br />{{
tools.getstrDateTime(props.row.date_completato)
<br />Consegnato il:<br />{{
tools.getstrDateTime(props.row.date_consegnato)
}}
</span>
</q-td>
@@ -214,22 +214,18 @@
{{ tools.getstrDateTime(props.row.date_evaso) }}:
<span class="ordstat evaso">{{ $t('ecomm.evaso') }}</span>
</div>
<div v-if="props.row.consegnato" class="ordstat">
{{ tools.getstrDateTime(props.row.date_consegnato) }}:
<span class="ordstat">{{ $t('ecomm.consegnato') }}</span>
</div>
<div v-if="props.row.pagato" class="ordstat">
{{ tools.getstrDateTime(props.row.date_pagato) }}:
<span class="ordstat">{{ $t('ecomm.pagato') }}</span>
</div>
<div v-if="props.row.consegnato" class="ordstat">
{{ tools.getstrDateTime(props.row.date_consegnato) }}:
<span class="ordstat">{{ $t('ecomm.consegnato') }}</span>
</div>
<div v-if="props.row.spedito">
{{ tools.getstrDateTime(props.row.date_spedito) }}:
<span class="ordstat">{{ $t('ecomm.spedito') }}</span>
</div>
<div v-if="props.row.completato">
{{ tools.getstrDateTime(props.row.date_completato) }}:
<span class="ordstat">{{ $t('ecomm.completed') }}</span>
</div>
<div v-if="props.row.ricevuto">
{{ tools.getstrDateTime(props.row.date_ricevuto) }}:
<span class="ordstat">{{ $t('ecomm.ricevuto') }}</span>

View File

@@ -1,8 +1,8 @@
<template>
<q-page>
<q-page class="q-pa-md">
<div class="panel">
<div class="container">
<div class="row">
<div class="row justify-center">
<CProductCard :id="id" :cosa="cosa" :complete="true"/>
</div>
</div>