- Gestore Ordini GAS (aggiornato)

- Possibilità di modificare un record, click sulla matita rossa.
- corretto altre sistemazioni sui valori di minimo e massimo quantità.
This commit is contained in:
Surya Paolo
2025-10-03 16:28:46 +02:00
parent fc1e9d4666
commit b07d4c822f
73 changed files with 1767 additions and 3592866 deletions

View File

@@ -306,8 +306,8 @@ export default defineComponent({
let index = 1
for (const itemorder of getItemsCart.value) {
const productCode = itemorder.order.product?.productInfo.code || '';
const productName = itemorder.order.product?.productInfo.name || '';
const productCode = itemorder.order.product?.productInfo?.code || '';
const productName = itemorder.order.product?.productInfo?.name || '';
const quantity = itemorder.order.quantity + itemorder.order.quantitypreordered;
const price = Number(itemorder.order.price).toFixed(2);
const totalPrice = (parseFloat(price) * quantity).toFixed(2);

View File

@@ -23,7 +23,7 @@
>
<CSingleCart
:order="itemorder.order"
:idOrdersCart="recOrderCart._id"
:idOrdersCart="recOrderCart?._id"
:showall="true"
/>
</div>
@@ -36,7 +36,7 @@
<table class="table-price">
<tbody>
<tr>
<td class="label-price">{{ t('ecomm.prezzointero') }}:</td>
<td class="label-price">{{ myTotalPrice !== totalPriceIntero ? t('ecomm.prezzointero') : t('ecomm.totale') }}:</td>
<td
class="value-price text-subtitle1"
:class="{ 'text-strike': myTotalPrice !== totalPriceIntero }"
@@ -44,7 +44,7 @@
{{ totalPriceIntero }}
</td>
</tr>
<tr v-if="recOrderCart.codice_sconto">
<tr v-if="recOrderCart?.codice_sconto">
<td class="label-price">{{ t('ecomm.sconto_appl') }}:</td>
<td>
<div class="column items-center">
@@ -69,7 +69,7 @@
</td>
</tr>
<tr v-if="!recOrderCart.codice_sconto">
<tr v-if="!recOrderCart?.codice_sconto">
<td class="label">{{ t('ecomm.codice_sconto') }}:</td>
<td>
<q-input
@@ -91,7 +91,7 @@
</td>
</tr>
<tr>
<tr v-if="myTotalPrice !== totalPriceIntero">
<td class="label">{{ t('ecomm.totale_scontato') }}:</td>
<td class="ordine_scontato_nuovo text-center"> {{ myTotalPrice }}</td>
</tr>
@@ -114,7 +114,7 @@
</q-input>
<div
v-if="recOrderCart.note_ordine_gas"
v-if="recOrderCart?.note_ordine_gas"
class="note_ordine_gas"
v-html="recOrderCart.note_ordine_gas"
></div>

View File

@@ -1773,6 +1773,10 @@ export default defineComponent({
return userStore.isFacilitatore;
}
function enableToEdit() {
return isFacilitatore() || userStore.isAdmin || userStore.isManager;
}
function isAdmin() {
return userStore.isAdmin;
}
@@ -2378,6 +2382,12 @@ export default defineComponent({
}
}
}
if (enableToEdit()) {
colVisib.value.push('deleterec');
colVisib.value.push('copyrec');
colVisib.value.unshift('modifrec');
}
}
// console.log('REFRR - changetable')

View File

@@ -27,7 +27,7 @@
<table class="table">
<tbody>
<tr>
<td class="label">{{ t('ecomm.prezzointero') }}:</td>
<td class="label-price">{{ myTotalPrice !== totalPriceIntero ? t('ecomm.prezzointero') : t('ecomm.totale') }}:</td>
<td
class="value text-subtitle1 text-right"
:class="{ 'text-strike': myTotalPrice !== totalPriceIntero }"
@@ -35,7 +35,7 @@
{{ totalPriceIntero }}
</td>
</tr>
<tr v-if="recOrderCart.codice_sconto">
<tr v-if="recOrderCart?.codice_sconto">
<td class="label">{{ t('ecomm.sconto_appl') }}:</td>
<td>
<div class="column items-center">
@@ -52,7 +52,7 @@
</td>
</tr>
<tr v-if="!recOrderCart.codice_sconto">
<tr v-if="!recOrderCart?.codice_sconto">
<td class="label">{{ t('ecomm.codice_sconto') }}:</td>
<td>
<q-input
@@ -74,7 +74,7 @@
</td>
</tr>
<tr>
<tr v-if="myTotalPrice !== totalPriceIntero">
<td class="label">{{ t('ecomm.totale_scontato') }}:</td>
<td class="ordine_scontato_nuovo text-right"> {{ myTotalPrice }}</td>
</tr>

View File

@@ -1,6 +1,6 @@
<template>
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
<div v-if="endload && recOrderCart.numorder > 0">
<div v-if="endload && recOrderCart?.numorder > 0">
<div v-if="recOrderCart" class="panel">
<q-toggle
v-if="tools.isManager()"

View File

@@ -139,7 +139,7 @@
(cosa === shared_consts.PROD.GAS && Products.getQtyAvailable(myproduct) > 0)
"
:clickable="tools.isManager()"
style="padding: 16px !important;"
style="padding: 16px !important"
@click="
tools.isManager() &&
!editOn &&
@@ -239,7 +239,10 @@
<div class="text-h7 boldhigh titolo_prod">
{{ myproduct.productInfo.name }}
</div>
<div v-if="myproduct?.productInfo?.authors" class="text-h8 text-italic titolo_prod q-mb-sm">
<div
v-if="myproduct?.productInfo?.authors"
class="text-h8 text-italic titolo_prod q-mb-sm"
>
{{ Products.getAutoriByArrayAuthors(myproduct.productInfo.authors) }}
</div>
<div class="product_code">
@@ -419,8 +422,9 @@
:editOn="editOn"
table="products"
:id="myproduct._id"
:rec="myproduct.productInfo"
mykey="note"
:rec="myproduct"
mykey="productInfo"
mysubkey="note"
debounce="1000"
@save="updateproductmodif"
:type="costanti.FieldType.string"
@@ -452,8 +456,9 @@
:title="t('products.imagefile')"
table="products"
:id="myproduct._id"
:rec="myproduct.productInfo"
mykey="imagefile"
:rec="myproduct"
mykey="productInfo"
mysubkey="imagefile"
debounce="1000"
@save="updateproductmodif"
:type="costanti.FieldType.imagerec"
@@ -513,10 +518,10 @@
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
<!--<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('products.maxbookableGASQty')"
:title="t('ecomm.maxbookableGASQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
@@ -525,7 +530,7 @@
@save="updateproductmodif"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</CMyValueDb>-->
<div class="prod_qtywarn">
<div v-if="tools.isManager() && !!myproduct.QuantitaPrenotateInAttesa">
{{
@@ -679,8 +684,8 @@
{{
t('ecomm.bookedGASQtyOrdered_str', {
qta:
(myproduct.bookableGASBloccatiQty +
myproduct.QuantitaPrenotateInAttesa) *
(Products.getQtyBloccataBookableAvailable(myproduct) +
Products.getQuantitaPrenotateInAttesa(myproduct)) *
myproduct.productInfo.weight,
qtatot: myproduct.qtyToReachForGas * myproduct.productInfo.weight,
})

View File

@@ -9,7 +9,7 @@
(site.confpages?.enableRegMultiChoice || !site.confpages?.enabledRegNeedTelegram)
"
>
<CVerifyEmail v-if="!tools.isEmailVerified() && !tools.TelegVerificato()">
<CVerifyEmail v-if="tools.isLogged() && !tools.isEmailVerified() && !tools.TelegVerificato()">
</CVerifyEmail>
</div>