- Uscita PRIMA VERSIONE PiuCheBuono.app

This commit is contained in:
Surya Paolo
2023-12-30 21:34:09 +01:00
parent 632d05bbfb
commit a32ba4ec7a
16 changed files with 341 additions and 201 deletions

View File

@@ -352,6 +352,17 @@ export default defineComponent({
}, 0))
}
function isOrdGas(): boolean {
return myproduct.value && myproduct.value.idGasordines ? myproduct.value.idGasordines.length > 0 : false
}
function getpercqtaraggiunta(): number {
if (myproduct.value)
return tools.calcperc(myproduct.value.bookedGASQtyOrdered, myproduct.value.qtyToReachForGas) / 100
else
return 0
}
onMounted(mounted)
onBeforeUnmount(beforeDestroy)
@@ -389,6 +400,8 @@ export default defineComponent({
timerLabelScadenza,
labelDataRitiro,
labelDataArrivoMerce,
getpercqtaraggiunta,
isOrdGas,
}
}
})

View File

@@ -136,6 +136,120 @@
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="myproduct.note">
<q-item-section avatar>
<q-icon color="black" name="fas fa-book" />
</q-item-section>
<q-item-section>
<q-item-label class="">
<span v-html="myproduct.note"></span>
</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="isOrdGas() && myproduct.qtyToReachForGas > 0">
<q-item-section avatar>
<q-icon
v-if="getpercqtaraggiunta() < 1"
color="orange"
name="fas fa-lightbulb"
/>
<q-icon v-else color="green" name="fas fa-check" />
</q-item-section>
<q-item-section>
<q-item-label class="subtit_prod text-blue text-bold">
<span v-if="getpercqtaraggiunta() >= 1">{{
t('ecomm.offerta_gas_raggiunta', {
qta: myproduct.qtyToReachForGas,
unit: tools.getUnitsMeasure(myproduct.productInfo.unit, true),
})
}}</span>
<span v-else>{{
t('ecomm.offerta_gas', {
qta: myproduct.qtyToReachForGas,
unit: tools.getUnitsMeasure(myproduct.productInfo.unit, true),
})
}}</span>
</q-item-label>
<q-item-label>
<span class="prod_disp">
{{
t('ecomm.bookedGASQtyOrdered_str', {
qta: myproduct.bookedGASQtyOrdered,
qtatot: myproduct.qtyToReachForGas,
})
}}
<q-linear-progress size="10px" :value="getpercqtaraggiunta()" />
</span>
<div class="prod_qtywarn">
<div
v-if="
tools.isManager() && !!myproduct.QuantitaOrdinateInAttesa
"
>
{{
t('ecomm.qta_in_attesa', {
qty: myproduct.QuantitaOrdinateInAttesa,
})
}}
</div>
</div>
</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="myproduct.gasordines && myproduct.gasordines.length >= 1">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-hourglass-half" />
@@ -207,79 +321,10 @@
<div>
<q-list>
<q-item
v-if="
cosa === shared_consts.PROD.BOTTEGA ||
(cosa === shared_consts.PROD.GAS &&
products.getQtyAvailable(myproduct) > 0)
"
:clickable="tools.isManager()"
@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 class="subtit_prod">
{{ t('ecomm.available') }}
</q-item-label>
<q-item-label>
<span class="prod_disp">
{{ products.getQtyAvailable(myproduct) }}
</span>
<div class="prod_qtywarn">
<div
v-if="
tools.isManager() && !!myproduct.QuantitaOrdinateInAttesa
"
>
{{
t('ecomm.qta_in_attesa', {
qty: myproduct.QuantitaOrdinateInAttesa,
})
}}
</div>
</div>
</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
myproduct.maxbookableGASQty > 0
"
:clickable="tools.isManager()"
@click="
@@ -330,10 +375,14 @@
/>
</q-item-section>
<q-item-section>
<q-item-label class="subtit_prod"> {{ t('ecomm.bloccati') }}: </q-item-label>
<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
{{
products.getQtyBloccataBookableAvailable(myproduct)
}}</span
>
</q-item-label>
</q-item-section>

View File

@@ -12,7 +12,7 @@ export interface IProductInfo {
color?: string,
size?: string,
weight?: number,
unit?: number,
unit: number,
stars?: number,
date?: Date,
icon?: string,
@@ -40,15 +40,22 @@ export interface IProduct {
bookableAvailableQty?: number,
QuantitaOrdinateInAttesa?: number,
QuantitaPrenotateInAttesa?: number,
stockQty: number,
stockBloccatiQty: number,
minBuyQty: number,
minStepQty: number,
maxBookableQty: number,
bookableQty: number,
bookableBloccatiQty: number,
canBeShipped?: boolean,
canBeBuyOnline?: boolean,
note?: string
stockQty: number, // UPDATING
stockBloccatiQty: number, // UPDATING
bookedQtyConfirmed: number // UPDATING
qtyToReachForGas: number
maxbookableGASQty: number
bookedGASQtyOrdered: number // UPDATING
bookableGASBloccatiQty: number // UPDATING
minBuyQty: number
minStepQty: number
maxBookableSinglePersQty: number
canBeShipped?: boolean
canBeBuyOnline?: boolean
}
export interface IBaseOrder {
@@ -136,8 +143,11 @@ export interface IStorehouse {
email_html_header?: string,
email_html_footer?: string,
email_html_makeorder?: string,
email_html_GAS_makeorder?: string,
email_html_order_confirmed?: string,
email_html_GAS_order_confirmed?: string,
email_html_order_consegnato?: string,
email_html_GAS_order_consegnato?: string,
}
export interface IProvider {
@@ -204,8 +214,8 @@ export interface IOrderCart {
nameSurname?: string
status: number
modify_at?: Date
evaso: boolean
date_evaso?: Date
confermato: boolean
date_confermato?: Date
consegnato: boolean
date_consegnato?: Date
pagato: boolean

View File

@@ -337,21 +337,28 @@ export default defineComponent({
return importNoSpazi(cmd, testo);
}
function addfield(col: number, field: string, rec: any, conv_euro: boolean, isnumero?: boolean, strinput?: string, primo?: boolean) {
function addfield(col: number, field: string, rec: any, opt: any) {
let risultato = ''
let valstr = strinput ? strinput : rec[col]
if (isnumero) {
try {
let valstr = opt.strinput ? opt.strinput : rec[col]
if (opt.isnumero) {
if (valstr === '')
valstr = '0';
valstr = valstr.replace(',', '.');
}
if (conv_euro) {
if (opt.iseuro) {
valstr = tools.convertPriceEurToValue(valstr)
}
valstr = tools.removeescape(tools.addslashes(valstr))
if (!primo)
if (!opt.primo)
risultato += ', '
risultato += '"' + field + '":"' + valstr + '"'
return risultato;
} catch (e) {
console.error('err', e);
}
}
const myarr = tools.CSVToArray(testo, delim)
@@ -395,29 +402,32 @@ export default defineComponent({
if (!primo) {
strris += ', '
}
strris += '{ '
let col = 0;
strris += addfield(col, 'idapp', rec, false, false, tools.appid(), true);
strris += addfield(col, 'code', rec, false); col++;
strris += addfield(col, 'name', rec, false); col++;
strris += addfield(col, 'price', rec, true); col++;
strris += addfield(col, 'stockQty', rec, true); col++;
strris += addfield(col, 'idapp', rec, { strinput: tools.appid(), primo: true });
strris += addfield(col, 'code', rec, {}); col++;
strris += addfield(col, 'name', rec, {}); col++;
strris += addfield(col, 'price', rec, { iseuro: true }); col++;
strris += addfield(col, 'stockQty', rec, { isnumero: true }); col++;
col++;
strris += addfield(col, 'weight', rec, false, true); col++;
strris += addfield(col, 'unit', rec, false); col++;
strris += addfield(col, 'link', rec, false); col++;
strris += addfield(col, 'perc_iva', rec, false); col++;
strris += addfield(col, 'price_acquistato', rec, true); col++;
strris += addfield(col, 'minBuyQty', rec, false, true); col++;
strris += addfield(col, 'minStepQty', rec, false, true); col++;
strris += addfield(col, 'cat_name', rec, false); col++;
strris += addfield(col, 'producer_name', rec, false); col++;
strris += addfield(col, 'provider_name', rec, false); col++;
strris += addfield(col, 'magazzino_name', rec, false); col++;
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 += addfield(col, 'weight', rec, { isnumero: true }); col++;
strris += addfield(col, 'unit', rec, {}); col++;
strris += addfield(col, 'link', rec, {}); col++;
strris += addfield(col, 'perc_iva', rec, {}); col++;
strris += addfield(col, 'price_acquistato', rec, { isnumero: true }); col++;
strris += addfield(col, 'minBuyQty', rec, { isnumero: true }); col++;
strris += addfield(col, 'minStepQty', rec, { isnumero: true }); col++;
strris += addfield(col, 'cat_name', rec,{}); col++;
strris += addfield(col, 'producer_name', rec, {}); col++;
strris += addfield(col, 'provider_name', rec, {}); col++;
strris += addfield(col, 'magazzino_name', rec, {}); col++;
strris += addfield(col, 'qtyToReachForGas', rec, { isnumero: true }); col++;
strris += addfield(col, 'maxbookableGASQty', rec, { isnumero: true }); col++;
strris += addfield(col, 'sconto1', rec, {}); col++;
strris += addfield(col, 'sconto2', rec, {}); col++;
strris += addfield(col, 'gas_name', rec, {}); col++;
strris += addfield(col, 'note', rec, {}); col++;
strris += '} '
} else if (cmd === shared_consts.Cmd.CITIES_SERVER) {

View File

@@ -65,8 +65,9 @@ const msg_it = {
stockBloccatiQty: 'Bloccati In Magazzino',
minBuyQty: 'Qta minima acquistabile',
minStepQty: 'Step Minimo',
maxBookableQty: 'Qtà massima prenotabile singolarm.',
bookableQty: 'Prenotabili',
maxBookableSinglePersQty: 'Qtà massima prenotabile singolarm.',
maxbookableGASQty: 'Prenotabili',
bookedQtyConfirmed: 'Quantità Confermate',
bookableAvailableQty: 'Disponib. Prenotabili',
weight: 'Peso',
unit: 'Unità di Misura',
@@ -367,7 +368,7 @@ const msg_it = {
incorrect_input: 'Inserimento incorretto.',
link_sent: 'Apri la tua casella di posta, trova la email "Confermare la Registrazione: {sitename}" e clicca su "Verifica Registrazione"',
reg_ok: 'Registrazione Avvenuta. Esegui il Login inserendo le tue credenziali',
se_non_ricevo: 'Se non ricevi la email, prova a controllare nella spam, oppure contattaci',
se_non_ricevo: 'Se non ricevi la email, <strong>prova a controllare nella spam</strong>, oppure contattaci',
title_unsubscribe: 'Disiscrizione alla newsletter',
title_unsubscribe_done: 'Disiscrizione completata correttamente',
},
@@ -1123,8 +1124,11 @@ const msg_it = {
email_html_header: 'Instestazione',
email_html_footer: 'Footer',
email_html_makeorder: '1) Ordine Ricevuto',
email_html_GAS_makeorder: '1) Ordine GAS Ricevuto',
email_html_order_confirmed: '2) Ordine Confermato da noi',
email_html_order_consegnato: '3) Ordine Completato Correttamente',
email_html_GAS_order_confirmed: '2) Ordine GAS Confermato da noi',
email_html_order_consegnato: '3) Ordine Consegnato',
email_html_GAS_order_consegnato: '3) Ordine GAS Consegnato',
},
sectors: {
name: 'Settore',
@@ -1664,13 +1668,13 @@ const msg_it = {
order: 'Ordine',
ord_confirmed: 'Ordine Confermato',
ord_not_confirmed: 'E\' avvenuto un errore. Ordine non Confermato. Ricaricare la pagina e riprovare.',
btn_cassa: 'Vai alla Cassa',
btn_ordini: 'Vai agli Ordini',
btn_cassa: 'Procedi all\'Ordine',
btn_ordini: 'I tuoi Ordini',
available: 'Disponibili',
preorders: 'Quantità Pre-Ordinabili',
preorders: 'Quantità Massima Pre-Ordinabili',
preord: 'Pre-Ordinate',
di_cui_x_in_carrello: '(nel tuo carrello: {qty})',
evaso: 'Ordine Evaso',
confermato: 'Ordine Confermato',
consegnato: 'Ordine Consegnato',
pagato: 'Ordine Pagato',
spedito: 'Ordine Spedito',
@@ -1689,6 +1693,13 @@ const msg_it = {
qta_prenotate_in_attesa: '(Preordinate In attesa {qty})',
prodotti_trovati: '{qta} Prodotti trovati su {qtatot}',
bloccati: 'Bloccati',
bookedGASQtyOrdered: 'Prenotate',
bookedGASQtyOrdered_str: 'Prenotati {qta} su {qtatot} {unit}',
booked_su_str: '{qta} su {qtatot}',
qtyToReachForGas: 'Qta da raggiungere',
offerta_gas: 'Offerta valida al raggiungimento di {qta} {unit}',
offerta_gas_raggiunta: 'Complimenti! Gli ordini hanno superato il minimo quantitativo di {qta} {unit}',
note: 'Note',
},
gas: {
name: 'Ordine Gas',

View File

@@ -352,8 +352,8 @@ export const getcolorderscart = [
AddCol({ name: 'items', label_trans: 'order.items' }),
AddCol({ name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users' }),
AddCol({ name: 'note', label_trans: 'order.note' }),
AddCol({ name: 'evaso', label_trans: 'order.evaso', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'date_evaso', label_trans: 'order.date_evaso', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'confermato', label_trans: 'order.confermato', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'date_confermato', label_trans: 'order.date_confermato', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'consegnato', label_trans: 'order.consegnato', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'date_consegnato', label_trans: 'order.date_consegnato', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'pagato', label_trans: 'order.pagato', fieldtype: costanti.FieldType.boolean }),
@@ -438,8 +438,11 @@ export const colTableStorehouse = [
AddCol({ name: 'email_html_header', label_trans: 'store.email_html_header', fieldtype: costanti.FieldType.html }),
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_GAS_makeorder', label_trans: 'store.email_html_GAS_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_GAS_order_confirmed', label_trans: 'store.email_html_GAS_order_confirmed', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'email_html_order_consegnato', label_trans: 'store.email_html_order_consegnato', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'email_html_GAS_order_consegnato', label_trans: 'store.email_GAS_html_order_consegnato', fieldtype: costanti.FieldType.html }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
@@ -2057,8 +2060,8 @@ export const colTableProducts = [
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'maxBookableQty',
label_trans: 'products.maxBookableQty',
name: 'maxBookableSinglePersQty',
label_trans: 'products.maxBookableSinglePersQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
@@ -2066,21 +2069,43 @@ export const colTableProducts = [
label_trans: 'products.stockQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'bookableQty',
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',
name: 'bookedQtyConfirmed',
label_trans: 'products.bookedQtyConfirmed',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'qtyToReachForGas',
label_trans: 'ecomm.qtyToReachForGas',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'note',
label_trans: 'ecomm.note',
fieldtype: costanti.FieldType.html
}),
AddCol({
name: 'maxbookableGASQty',
label_trans: 'ecomm.maxbookableGASQty',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'bookedGASQtyOrdered',
label_trans: 'ecomm.bookedGASQtyOrdered',
fieldtype: costanti.FieldType.number
}),
AddCol({
name: 'bookableGASBloccatiQty',
label_trans: 'ecomm.bookableGASBloccatiQty',
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

@@ -8274,7 +8274,8 @@ export const tools = {
},
convertPriceEurToValue(inputString: string): string {
if (inputString === '')
return '0';
// Rimuovi il simbolo della valuta (€) e sostituisci la virgola con un punto
return inputString.replace(/[^\d.,]/g, '').replace(',', '.');
},
@@ -8316,6 +8317,13 @@ export const tools = {
return (`${strgg} ${this.pad(hours)}:${this.pad(minutes)}:${this.pad(seconds)}`);
},
calcperc(val1: number, valmax: number): number {
if (valmax > 0)
return (val1 / valmax * 100)
else
return 0
}
// FINE !

View File

@@ -32,18 +32,45 @@ function getRecordProductInfoEmpty(): IProductInfo {
}
}
function getRecordProductEmpty() {
return {
active: false,
productInfo: {
img: '', code: '', name: '',
function getRecordProductEmpty(): IProduct {
},
storehouses: [], scontisticas: [],
price: 0, stockQty: 0, bookableQty: 0, gasordines: [],
stockBloccatiQty: 0, bookableBloccatiQty: 0,
idGasordines: [], minBuyQty: 1, maxBookableQty: 0,
const tomorrow = tools.getDateNow()
tomorrow.setDate(tomorrow.getDate() + 1)
return {
productInfo: getRecordProductInfoEmpty(),
// _id: tools.getDateNow().toISOString(), // Create NEW
active: false,
idProducer: '',
idStorehouses: [],
idGasordines: [],
idScontisticas: [],
scontisticas: [],
gasordines: [],
idProvider: '',
producer: {},
storehouses: [],
provider: {},
price: 0.0,
quantityAvailable: 0,
bookableAvailableQty: 0,
minBuyQty: 1,
minStepQty: 1,
maxBookableSinglePersQty: 0,
stockQty: 0,
stockBloccatiQty: 0,
bookedQtyConfirmed: 0,
qtyToReachForGas: 0,
maxbookableGASQty: 0,
bookedGASQtyOrdered: 0,
bookableGASBloccatiQty: 0,
canBeShipped: false,
QuantitaOrdinateInAttesa: 0,
QuantitaPrenotateInAttesa: 0,
canBeBuyOnline: false,
}
}
@@ -283,39 +310,7 @@ export const useProducts = defineStore('Products', {
getRecordEmpty: (state: IProductsState) => (): IProduct => {
const tomorrow = tools.getDateNow()
tomorrow.setDate(tomorrow.getDate() + 1)
return {
productInfo: getRecordProductInfoEmpty(),
// _id: tools.getDateNow().toISOString(), // Create NEW
active: false,
idProducer: '',
idStorehouses: [],
idGasordines: [],
idScontisticas: [],
scontisticas: [],
gasordines: [],
idProvider: '',
producer: {},
storehouses: [],
provider: {},
price: 0.0,
quantityAvailable: 0,
bookableAvailableQty: 0,
stockQty: 0,
stockBloccatiQty: 0,
minBuyQty: 1,
minStepQty: 1,
maxBookableQty: 0,
bookableQty: 0,
bookableBloccatiQty: 0,
canBeShipped: false,
QuantitaOrdinateInAttesa: 0,
QuantitaPrenotateInAttesa: 0,
canBeBuyOnline: false,
}
return getRecordProductEmpty()
},
},
@@ -380,12 +375,15 @@ export const useProducts = defineStore('Products', {
ris = await Api.SendReq('/products', 'POST', { userId: userStore.my._id })
.then((res) => {
if (res.data.products) {
console.log('aggiorna prodotti')
this.products = []
this.products = res.data.products
} else {
this.products = []
}
if (res.data.orders) {
this.orders = []
this.orders = res.data.orders
} else {
this.orders = []
@@ -831,7 +829,7 @@ export const useProducts = defineStore('Products', {
},
getQtyBloccataBookableAvailable(myproduct: IProduct): number {
let qty = myproduct.bookableBloccatiQty
let qty = myproduct.bookableGASBloccatiQty
return qty
},
@@ -844,17 +842,17 @@ export const useProducts = defineStore('Products', {
const globalStore = useGlobalStore()
if (globalStore.site.ecomm && globalStore.site.ecomm.enablePreOrders) {
return (this.getQtyBookableAvailable(myproduct) > 0
&& (myproduct.maxBookableQty === 0
|| (myorder.quantitypreordered + 1 < myproduct.maxBookableQty))
&& (myproduct.maxBookableSinglePersQty === 0
|| (myorder.quantitypreordered + 1 < myproduct.maxBookableSinglePersQty))
)
|| (this.getQtyAvailable(myproduct) > 0)
&& (myproduct.maxBookableQty === 0
|| (myorder.quantity + 1 < myproduct.maxBookableQty))
&& (myproduct.maxBookableSinglePersQty === 0
|| (myorder.quantity + 1 < myproduct.maxBookableSinglePersQty))
} else {
return (this.getQtyAvailable(myproduct) > 0)
&& (myproduct.maxBookableQty === 0
|| (myorder.quantity + 1 < myproduct.maxBookableQty))
&& (myproduct.maxBookableSinglePersQty === 0
|| (myorder.quantity + 1 < myproduct.maxBookableSinglePersQty))
}
},

View File

@@ -261,6 +261,14 @@
></q-btn>
<br />
</div>
<div class="row">
<q-btn
label="10. Elimina la Tabella CATPROD !)"
color="negative"
@click="EseguiFunz('dropCatProd')"
></q-btn>
<br />
</div>
<div class="row">
<q-btn

View File

@@ -20,7 +20,7 @@ $heightBtn: 100%;
padding: 5px;
}
.evaso {
.confermato {
font-weight: bold;
color: green;
}

View File

@@ -67,7 +67,7 @@ export default defineComponent({
{
name: 'items',
required: true,
label: 'Articoli',
label: '',
field: 'items',
sortable: true
},
@@ -157,7 +157,6 @@ export default defineComponent({
function getOrdersCart(): IOrderCart[] | undefined {
const hasGasordine: any = (cosa.value === shared_consts.PROD.TUTTI) ? undefined : (cosa.value === shared_consts.PROD.GAS)
console.log('hasgas', hasGasordine)
const ris = productStore.getOrdersCart(taborders.value, hasGasordine)
return ris
@@ -180,8 +179,12 @@ export default defineComponent({
totalPrice: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice, 0),
};
let rowsWithTotals: any = [...orderscart];
if (tools.isManager()) {
// Combine orders and totals
const rowsWithTotals = [...orderscart, totals];
rowsWithTotals.push(totals);
}
return rowsWithTotals;
} else {

View File

@@ -210,9 +210,9 @@
shared_consts.getStatusStr(props.row.status)
}}</span>
<br />
<div v-if="props.row.evaso" class="ordstat">
{{ tools.getstrDateTime(props.row.date_evaso) }}:
<span class="ordstat evaso">{{ $t('ecomm.evaso') }}</span>
<div v-if="props.row.confermato" class="ordstat">
{{ tools.getstrDateTime(props.row.date_confermato) }}:
<span class="ordstat confermato">{{ $t('ecomm.confermato') }}</span>
</div>
<div v-if="props.row.pagato" class="ordstat">
{{ tools.getstrDateTime(props.row.date_pagato) }}:

View File

@@ -30,6 +30,7 @@ export default defineComponent({
const cosa = ref(0)
const cat = ref('')
const loadpage = ref(false)
watch(() => cosa.value, (newval, oldval) => {
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString())
@@ -67,10 +68,12 @@ export default defineComponent({
});
}*/
function mounted() {
async function mounted() {
loadpage.value = false
await productStore.loadProducts()
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.BOTTEGA, true)
// Inizializza
productStore.loadProducts()
loadpage.value = true
}
function getCatProds() {
@@ -99,6 +102,7 @@ export default defineComponent({
cat,
productStore,
t,
loadpage,
}
}
})

View File

@@ -1,6 +1,7 @@
<template>
<q-page>
<div class="panel">
<q-spinner v-if="!loadpage" color="primary" size="3em" :thickness="2" />
<div v-if="loadpage" class="panel">
<div>
<div class="q-gutter-md text-center q-mb-md">
<q-btn-toggle

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB