2021-09-04 15:05:34 +02:00
|
|
|
<template>
|
2024-02-13 18:13:36 +01:00
|
|
|
<div
|
|
|
|
|
v-if="order && order.product && order.product.productInfo"
|
|
|
|
|
class="q-pa-xs q-gutter-xs"
|
|
|
|
|
>
|
2023-12-28 00:50:42 +01:00
|
|
|
<div v-if="order.product">
|
|
|
|
|
<q-item>
|
2025-06-03 01:01:40 +02:00
|
|
|
<q-item-section
|
|
|
|
|
top
|
|
|
|
|
thumbnail
|
|
|
|
|
class="q-ml-none"
|
|
|
|
|
>
|
2023-12-28 00:50:42 +01:00
|
|
|
<img
|
2024-02-13 18:13:36 +01:00
|
|
|
v-if="
|
|
|
|
|
order.product &&
|
|
|
|
|
order.product.productInfo &&
|
2024-10-02 23:26:52 +02:00
|
|
|
order.product.productInfo.imagefile
|
2024-02-13 18:13:36 +01:00
|
|
|
"
|
2025-06-03 01:01:40 +02:00
|
|
|
:src="
|
|
|
|
|
tools.getFullFileNameByImageFile(
|
|
|
|
|
'productInfos',
|
|
|
|
|
order.product.productInfo.imagefile
|
|
|
|
|
)
|
|
|
|
|
"
|
2023-12-28 00:50:42 +01:00
|
|
|
:alt="order.product.productInfo.name"
|
|
|
|
|
:class="myimgclass()"
|
|
|
|
|
/>
|
|
|
|
|
</q-item-section>
|
2023-12-24 00:56:05 +01:00
|
|
|
|
2023-12-28 00:50:42 +01:00
|
|
|
<q-item-section>
|
|
|
|
|
<q-item-label>
|
2025-06-03 01:01:40 +02:00
|
|
|
<div
|
|
|
|
|
v-if="order.idGasordine"
|
|
|
|
|
class="gasordine"
|
|
|
|
|
>
|
2023-12-28 00:50:42 +01:00
|
|
|
{{ products.getSingleGasordine(order, true) }}<br />
|
|
|
|
|
</div>
|
|
|
|
|
{{ order.product.productInfo.name }}
|
2025-06-03 01:01:40 +02:00
|
|
|
<span
|
|
|
|
|
class="autori"
|
|
|
|
|
v-if="order.product.productInfo.idAuthors"
|
|
|
|
|
>
|
|
|
|
|
- {{ products.getAutoriByIdAuthors(order.product.productInfo.idAuthors) }}
|
|
|
|
|
</span>
|
|
|
|
|
</q-item-label>
|
|
|
|
|
<q-item-label>
|
|
|
|
|
{{ order.product.productInfo.code }}
|
2023-12-28 00:50:42 +01:00
|
|
|
</q-item-label>
|
2024-02-15 18:59:13 +01:00
|
|
|
|
2023-12-28 00:50:42 +01:00
|
|
|
<q-item-label caption>
|
|
|
|
|
<div
|
|
|
|
|
class="text-black text-h8"
|
|
|
|
|
v-if="order.product.productInfo.unit"
|
|
|
|
|
>
|
|
|
|
|
{{ tools.getWeightTotalByOrder(order) }}
|
2024-01-15 22:19:33 +01:00
|
|
|
{{
|
|
|
|
|
tools.getUnitsMeasure(
|
|
|
|
|
order.product.productInfo.unit,
|
|
|
|
|
true,
|
|
|
|
|
order.product.productInfo.weight
|
|
|
|
|
)
|
|
|
|
|
}}
|
2023-12-28 00:50:42 +01:00
|
|
|
</div>
|
2024-02-13 18:13:36 +01:00
|
|
|
<div class="row q-mb-xs no-wrap items-center centeritems">
|
|
|
|
|
<q-input
|
|
|
|
|
v-if="editmode"
|
|
|
|
|
v-model="weight"
|
|
|
|
|
autofocus
|
|
|
|
|
debounce="500"
|
|
|
|
|
borderless
|
|
|
|
|
rounded
|
|
|
|
|
dense
|
|
|
|
|
:label="t('products.weight')"
|
|
|
|
|
></q-input>
|
|
|
|
|
<q-input
|
|
|
|
|
v-if="editmode"
|
|
|
|
|
v-model="price"
|
|
|
|
|
autofocus
|
|
|
|
|
debounce="500"
|
|
|
|
|
borderless
|
|
|
|
|
rounded
|
|
|
|
|
dense
|
|
|
|
|
:label="t('products.price')"
|
|
|
|
|
></q-input>
|
|
|
|
|
</div>
|
2023-12-28 00:50:42 +01:00
|
|
|
<div class="row q-mb-xs no-wrap items-center centeritems">
|
|
|
|
|
<q-btn
|
2024-02-15 18:59:13 +01:00
|
|
|
v-if="showall && !nomodif && products.CanDeleteIfSub(order)"
|
2025-06-09 09:48:34 +02:00
|
|
|
icon="fas fa-trash-alt"
|
2024-02-15 18:59:13 +01:00
|
|
|
round
|
2025-06-09 09:48:34 +02:00
|
|
|
size="sm"
|
|
|
|
|
class="elimina-btn"
|
2024-02-15 18:59:13 +01:00
|
|
|
@click="removeFromCard"
|
|
|
|
|
>
|
|
|
|
|
</q-btn>
|
2025-06-09 09:48:34 +02:00
|
|
|
<!--
|
|
|
|
|
:label="
|
2023-12-28 00:50:42 +01:00
|
|
|
t('products.subcart', {
|
|
|
|
|
qta: products.qtaNextSub(order, order.product),
|
|
|
|
|
})
|
|
|
|
|
"
|
2025-06-09 09:48:34 +02:00
|
|
|
-->
|
|
|
|
|
<q-btn
|
|
|
|
|
v-else-if="!nomodif"
|
|
|
|
|
:disable="!products.enableSubQty(order)"
|
|
|
|
|
size="sm"
|
|
|
|
|
class="quantity-btn"
|
|
|
|
|
data-gradiente="negative"
|
|
|
|
|
:icon="qtyInCart() === 1 ? 'fas fa-trash': 'fas fa-minus'"
|
|
|
|
|
:color="products.enableSubQty(order) ? undefined : 'grey'"
|
|
|
|
|
@click="qtyInCart() === 1 ? removeFromCard(): addsubqty(false, true)"
|
|
|
|
|
rounded
|
2023-12-28 00:50:42 +01:00
|
|
|
></q-btn>
|
2024-01-09 15:32:21 +01:00
|
|
|
<div v-if="editmode">
|
|
|
|
|
<q-input
|
2024-01-15 22:19:33 +01:00
|
|
|
v-if="enableQty"
|
|
|
|
|
v-model="orderQuantity"
|
2024-01-09 15:32:21 +01:00
|
|
|
autofocus
|
|
|
|
|
debounce="500"
|
|
|
|
|
borderless
|
|
|
|
|
rounded
|
2025-06-09 09:48:34 +02:00
|
|
|
class="quantity-display"
|
2024-01-09 15:32:21 +01:00
|
|
|
dense
|
2024-01-13 00:29:02 +01:00
|
|
|
:label="t('products.quantity')"
|
2024-01-09 15:32:21 +01:00
|
|
|
></q-input>
|
|
|
|
|
<q-input
|
2024-01-15 22:19:33 +01:00
|
|
|
v-if="enableQtyPreordered"
|
|
|
|
|
v-model="orderQuantityPreordered"
|
2024-01-09 15:32:21 +01:00
|
|
|
autofocus
|
|
|
|
|
debounce="500"
|
|
|
|
|
borderless
|
2025-06-09 09:48:34 +02:00
|
|
|
class="quantity-display"
|
2024-01-09 15:32:21 +01:00
|
|
|
rounded
|
2024-01-15 22:19:33 +01:00
|
|
|
densep
|
2024-01-13 00:29:02 +01:00
|
|
|
:label="t('ecomm.preord')"
|
2024-01-09 15:32:21 +01:00
|
|
|
></q-input>
|
|
|
|
|
</div>
|
2024-01-15 22:19:33 +01:00
|
|
|
<div v-if="editmode">
|
|
|
|
|
<q-input
|
|
|
|
|
v-model="orderTotalPriceProduct"
|
|
|
|
|
autofocus
|
|
|
|
|
debounce="500"
|
|
|
|
|
borderless
|
|
|
|
|
rounded
|
|
|
|
|
dense
|
|
|
|
|
@change="changeTotalPrice"
|
|
|
|
|
:label="t('orderscart.TotalPriceProduct')"
|
|
|
|
|
></q-input>
|
|
|
|
|
|
2024-01-13 00:29:02 +01:00
|
|
|
<q-btn
|
|
|
|
|
outline
|
|
|
|
|
rounded
|
|
|
|
|
dense
|
|
|
|
|
color="green"
|
|
|
|
|
icon="fas fa-redo"
|
|
|
|
|
:label="t('orderscart.update_order')"
|
2024-01-15 22:19:33 +01:00
|
|
|
@click="
|
|
|
|
|
updateOrder({
|
|
|
|
|
quantitypreordered: order.quantitypreordered,
|
2024-02-13 18:13:36 +01:00
|
|
|
quantity: order.quantity,
|
2024-02-15 18:59:13 +01:00
|
|
|
price: order.price,
|
2024-01-15 22:19:33 +01:00
|
|
|
})
|
|
|
|
|
"
|
2024-01-13 00:29:02 +01:00
|
|
|
>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
2025-06-03 01:01:40 +02:00
|
|
|
<div
|
2025-06-09 09:48:34 +02:00
|
|
|
v-else
|
2025-06-03 01:01:40 +02:00
|
|
|
:class="`q-mx-sm text-blue-14 qta`"
|
|
|
|
|
>
|
2023-12-28 15:53:16 +01:00
|
|
|
{{ order.quantity + order.quantitypreordered }}
|
2023-12-28 00:50:42 +01:00
|
|
|
</div>
|
|
|
|
|
|
2025-06-09 09:48:34 +02:00
|
|
|
<!-- :label="
|
2023-12-28 00:50:42 +01:00
|
|
|
t('products.addcart', {
|
|
|
|
|
qta: products.qtaNextAdd(order, order.product),
|
|
|
|
|
})
|
|
|
|
|
"
|
2025-06-09 09:48:34 +02:00
|
|
|
-->
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="!nomodif"
|
|
|
|
|
icon-right="fas fa-plus"
|
|
|
|
|
class="quantity-btn"
|
|
|
|
|
:disable="!products.enableAddQty(order, order.product)"
|
|
|
|
|
rounded
|
|
|
|
|
size="sm"
|
2023-12-28 00:50:42 +01:00
|
|
|
@click="addsubqty(true, false)"
|
|
|
|
|
>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
</q-item-label>
|
|
|
|
|
<q-item-label>
|
|
|
|
|
<div class="col-2 no-wrap text-subtitle3_short q-mr-sm">
|
|
|
|
|
<span class="prezzo_singolo">
|
2024-01-13 00:29:02 +01:00
|
|
|
{{ order.quantity + order.quantitypreordered }} x €
|
2023-12-28 00:50:42 +01:00
|
|
|
{{ order.price ? order.price : 0 }}
|
|
|
|
|
</span>
|
|
|
|
|
<span :class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''">
|
|
|
|
|
= €
|
2025-06-03 01:01:40 +02:00
|
|
|
{{ order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0 }}
|
2023-12-28 00:50:42 +01:00
|
|
|
</span>
|
2024-02-13 18:13:36 +01:00
|
|
|
<span
|
|
|
|
|
v-if="
|
|
|
|
|
tools.isManager() &&
|
2024-02-15 18:59:13 +01:00
|
|
|
order.TotalPriceProduct.toFixed(2) !==
|
|
|
|
|
order.TotalPriceProductCalc.toFixed(2)
|
2024-02-13 18:13:36 +01:00
|
|
|
"
|
|
|
|
|
:class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''"
|
|
|
|
|
>
|
2024-01-15 22:19:33 +01:00
|
|
|
(Calc: €
|
|
|
|
|
{{
|
|
|
|
|
order.TotalPriceProductCalc
|
|
|
|
|
? order.TotalPriceProductCalc.toFixed(2)
|
|
|
|
|
: 0
|
|
|
|
|
}})
|
|
|
|
|
</span>
|
|
|
|
|
|
2023-12-28 00:50:42 +01:00
|
|
|
<span v-if="isApplicatoSconto()">
|
|
|
|
|
<span class="ordine_scontato"
|
|
|
|
|
>(<span class="barrato"
|
|
|
|
|
>€
|
|
|
|
|
{{
|
|
|
|
|
(
|
2024-02-13 18:13:36 +01:00
|
|
|
order.price * order.quantity +
|
|
|
|
|
order.price * order.quantitypreordered
|
2023-12-28 00:50:42 +01:00
|
|
|
).toFixed(2)
|
|
|
|
|
}}</span
|
|
|
|
|
>)</span
|
|
|
|
|
>
|
|
|
|
|
</span>
|
2024-02-13 18:13:36 +01:00
|
|
|
<span
|
|
|
|
|
v-if="isApplicatoSconto() && !editmode"
|
|
|
|
|
class="ordine_scritta_sconto"
|
2025-06-03 01:01:40 +02:00
|
|
|
>{{ $t('ecomm.sconto_applicato', { risparmio: getRisparmio() }) }}</span
|
2024-02-13 18:13:36 +01:00
|
|
|
>
|
2023-12-28 00:50:42 +01:00
|
|
|
</div>
|
|
|
|
|
</q-item-label>
|
|
|
|
|
</q-item-section>
|
2025-06-09 09:48:34 +02:00
|
|
|
<!--<q-item-section side>
|
2023-12-28 00:50:42 +01:00
|
|
|
<q-item-label>
|
2024-01-15 22:19:33 +01:00
|
|
|
<div class="col-2">
|
2023-12-28 00:50:42 +01:00
|
|
|
<q-btn
|
2024-01-15 22:19:33 +01:00
|
|
|
v-if="!nomodif"
|
2023-12-28 00:50:42 +01:00
|
|
|
icon="fas fa-trash"
|
|
|
|
|
color="negative"
|
|
|
|
|
round
|
|
|
|
|
size="xs"
|
|
|
|
|
@click="removeFromCard"
|
|
|
|
|
>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
</q-item-label>
|
2025-06-09 09:48:34 +02:00
|
|
|
</q-item-section>-->
|
2023-12-21 01:34:39 +01:00
|
|
|
|
2023-12-28 00:50:42 +01:00
|
|
|
<!--<q-item-section side top>
|
|
|
|
|
<q-item-label caption>meta</q-item-label>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
-->
|
|
|
|
|
</q-item>
|
2021-09-04 15:05:34 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2025-06-03 01:01:40 +02:00
|
|
|
<script lang="ts" src="./CSingleCart.ts"></script>
|
2021-09-04 15:05:34 +02:00
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import './CSingleCart.scss';
|
|
|
|
|
</style>
|