This commit is contained in:
Surya Paolo
2024-01-13 16:21:19 +01:00
parent 3ffa2893e5
commit 8979cd807a
10 changed files with 230 additions and 187 deletions

View File

@@ -12,6 +12,20 @@
v-if="!!myproduct && endload && !!myproduct.productInfo"
bordered
>
<q-toggle
v-if="tools.isManager()"
v-model="editOn"
class="absolute-top-right"
color="green"
icon="fas fa-pencil-alt"
dense
>
</q-toggle>
<div v-if="!myproduct.active">
<span class="text-bold text-white bg-red text-h6">{{
t('ecomm.not_active')
}}</span>
</div>
<q-card-section horizontal class="image-section">
<div class="image-container">
<q-img
@@ -34,7 +48,7 @@
style="bottom: -10px; right: 0px; transform: translateY(-50%)"
/>
</div>
<q-btn
<!--<q-btn
v-if="!complete"
fab
color="primary"
@@ -43,6 +57,7 @@
style="top: 0; right: -15px; transform: translateY(-66%)"
:to="`/product/` + myproduct._id + '/' + cosa"
/>
-->
<q-list>
<q-item>
<q-item-section avatar>
@@ -129,9 +144,22 @@
{{ t('ecomm.available') }}
</q-item-label>
<q-item-label>
<span class="prod_disp">
<span v-if="!editOn" class="prod_disp">
{{ products.getQtyAvailable(myproduct) }}
</span>
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('products.stockQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="stockQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<div class="prod_qtywarn">
<div
v-if="
@@ -167,10 +195,23 @@
>
<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
<span v-if="!editOn" class="text-black q-ml-xs text-h8">
{{ myproduct.stockBloccatiQty }}</span
>
</q-item-label>
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('products.stockBloccatiQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="stockBloccatiQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</q-item-section>
</q-item-section>
</q-item>
@@ -288,7 +329,17 @@
<q-item-section>
<q-item-label class="">
<span v-html="myproduct.note"></span>
<CMyValueDb
:editOn="editOn"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="note"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.string"
>
</CMyValueDb>
</q-item-label>
</q-item-section>
</q-item>
@@ -296,7 +347,7 @@
<q-card-section v-if="isOrdGas()">
<q-item
v-if="
products.getQtyBookableAvailable(myproduct) > 0 ||
myproduct.bookableAvailableQty > 0 ||
myproduct.maxbookableGASQty > 0
"
:clickable="tools.isManager()"
@@ -317,9 +368,22 @@
{{ t('ecomm.preorders') }}
</q-item-label>
<q-item-label>
<span class="prod_preorder">
{{ products.getQtyBookableAvailable(myproduct) }}
<span v-if="!editOn" class="prod_preorder">
{{ myproduct.bookableAvailableQty }}
</span>
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('products.maxbookableGASQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="maxbookableGASQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<div class="prod_qtywarn">
<div
v-if="
@@ -352,11 +416,34 @@
{{ t('ecomm.bloccati') }}:
</q-item-label>
<q-item-label>
<span class="text-black q-ml-xs text-h8">
{{
products.getQtyBloccataBookableAvailable(myproduct)
}}</span
<span v-if="!editOn" class="text-black q-ml-xs text-h8">
{{ myproduct.bookableGASBloccatiQty }}</span
>
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('products.bookableGASBloccatiQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookableGASBloccatiQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:editOn="editOn"
:title="t('products.bookedGASQtyConfirmed')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedGASQtyConfirmed"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</q-item-label>
</q-item-section>
</q-item-section>
@@ -457,6 +544,34 @@
})
}}</span>
</q-item-label>
<div class="row">
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('ecomm.bookedGASQtyOrdered')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedGASQtyOrdered"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('ecomm.qtyToReachForGas')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="qtyToReachForGas"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</div>
<q-item-label>
<span class="prod_disp">
{{
@@ -515,20 +630,13 @@
</q-item-section>
<q-item-section v-if="!!recgasordineSelected.dataora_chiusura_ordini">
<q-item-label class="subtit_prod">
{{ t('gas.dataora_chiusura_ordini') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
<span v-if="timerLabelScadenza">{{ timerLabelScadenza }}</span>
<span v-else-if="isOrdineChiuso()">{{
t('ecomm.ordine_scaduto', {
date: tools.getstrshortDateTime(
recgasordineSelected.dataora_chiusura_ordini
),
})
t('ecomm.ordine_scaduto')
}}</span>
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('gas.dataora_chiusura_ordini')"
table="gasordines"
:id="recgasordineSelected._id"
@@ -537,6 +645,7 @@
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.date"
:justifycenter="false"
>
</CMyValueDb>
</q-item-label>
@@ -548,12 +657,9 @@
</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">
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('gas.data_arrivo_merce')"
table="gasordines"
:id="recgasordineSelected._id"
@@ -562,11 +668,9 @@
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.date"
:justifycenter="false"
>
</CMyValueDb>
<div v-else>
{{ labelDataArrivoMerce }}
</div>
</q-item-label>
</q-item-section>
</q-item>
@@ -576,25 +680,20 @@
</q-item-section>
<q-item-section>
<q-item-label class="subtit_prod">
{{ t('gas.dataora_ritiro') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('gas.dataora_ritiro')"
table="gasordines"
:id="recgasordineSelected._id"
:rec="recgasordineSelected"
mykey="dataora_ritiro"
:justifycenter="false"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.date"
:type="costanti.FieldType.onlydate"
>
</CMyValueDb>
<div v-else>
{{ labelDataRitiro }}
</div>
</q-item-label>
</q-item-section>
</q-item>
@@ -628,122 +727,6 @@
<div class="no-outline label-qta text-center" tabindex="0">
{{ myorder.quantity + myorder.quantitypreordered }}
</div>
<div v-if="editOn">
<CMyValueDb
:title="t('products.note')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="note"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.string"
>
</CMyValueDb>
<div v-if="!isOrdGas()">
<CMyValueDb
:title="t('products.stockQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="stockQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:title="t('products.stockBloccatiQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="stockBloccatiQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:title="t('products.bookedQtyOrdered')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedQtyOrdered"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:title="t('products.bookedQtyConfirmed')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedQtyConfirmed"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</div>
<q-separator> </q-separator>
<div v-if="isOrdGas()">
<CMyValueDb
:title="t('products.maxbookableGASQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="maxbookableGASQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:title="t('products.bookableGASBloccatiQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookableGASBloccatiQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:title="t('ecomm.bookedGASQtyOrdered')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedGASQtyOrdered"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:title="t('products.bookedGASQtyConfirmed')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedGASQtyConfirmed"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</div>
<div class="text-center">
<q-btn
rounded
icon="fas fa-sync-alt"
color="primary"
:label="t('ecomm.ricarica')"
@click="ricarica()"
></q-btn>
</div>
</div>
</template>
</q-field>
@@ -778,17 +761,48 @@
></q-btn>
</div>
</q-card-section>
<q-toggle
v-if="tools.isManager()"
v-model="editOn"
color="green"
icon="fas fa-pencil-alt"
dense
>
</q-toggle>
<div v-if="editOn">
<div v-if="!isOrdGas()" class="row">
<CMyValueDb
:editOn="editOn"
:title="t('products.bookedQtyOrdered')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedQtyOrdered"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CMyValueDb
:editOn="editOn"
:title="t('products.bookedQtyConfirmed')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="bookedQtyConfirmed"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</div>
<q-separator> </q-separator>
<div class="text-center">
<q-btn
rounded
icon="fas fa-sync-alt"
color="primary"
:label="t('ecomm.ricarica')"
@click="ricarica()"
></q-btn>
</div>
</div>
<div v-if="editOn">{{ t('ecomm.active') }}:</div>
<CMyValueDb
v-if="editOn"
:title="t('ecomm.active')"
:editOn="editOn"
table="products"
:id="myproduct._id"
:rec="myproduct"