possibilità di modificare un ordine, e anche i totali

This commit is contained in:
Surya Paolo
2024-01-15 22:19:33 +01:00
parent 8979cd807a
commit c8a4be65c1
25 changed files with 315 additions and 94 deletions

View File

@@ -24,7 +24,13 @@
v-if="order.product.productInfo.unit"
>
{{ tools.getWeightTotalByOrder(order) }}
{{ tools.getUnitsMeasure(order.product.productInfo.unit, true, order.product.productInfo.weight) }}
{{
tools.getUnitsMeasure(
order.product.productInfo.unit,
true,
order.product.productInfo.weight
)
}}
</div>
<div class="row q-mb-xs no-wrap items-center centeritems">
<q-btn
@@ -43,7 +49,8 @@
></q-btn>
<div v-if="editmode">
<q-input
v-model="order.quantity"
v-if="enableQty"
v-model="orderQuantity"
autofocus
debounce="500"
borderless
@@ -52,16 +59,28 @@
:label="t('products.quantity')"
></q-input>
<q-input
v-model="order.quantitypreordered"
v-if="enableQtyPreordered"
v-model="orderQuantityPreordered"
autofocus
debounce="500"
borderless
rounded
densep
:label="t('ecomm.preord')"
></q-input>
</div>
<div v-if="editmode">
<q-input
v-model="orderTotalPriceProduct"
autofocus
debounce="500"
borderless
rounded
dense
:label="t('ecomm.preord')"
@change="changeTotalPrice"
:label="t('orderscart.TotalPriceProduct')"
></q-input>
</div>
<div v-if="tools.isManager">
<q-btn
outline
rounded
@@ -69,7 +88,12 @@
color="green"
icon="fas fa-redo"
:label="t('orderscart.update_order')"
@click="updateOrder({quantitypreordered: order.quantitypreordered, quantity: order.quantity})"
@click="
updateOrder({
quantitypreordered: order.quantitypreordered,
quantity: order.quantity,
})
"
>
</q-btn>
</div>
@@ -108,30 +132,40 @@
: 0
}}
</span>
<span v-if="tools.isManager() && order.TotalPriceProduct !== order.TotalPriceProductCalc"
:class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''">
(Calc:
{{
order.TotalPriceProductCalc
? order.TotalPriceProductCalc.toFixed(2)
: 0
}})
</span>
<span v-if="isApplicatoSconto()">
&nbsp;<span class="ordine_scontato"
>(<span class="barrato"
>
{{
(
order.price * order.quantity +
order.price * order.quantitypreordered
(order.price * order.quantity) +
(order.price * order.quantitypreordered)
).toFixed(2)
}}</span
>)</span
>&nbsp;
</span>
<span v-if="isApplicatoSconto()" class="ordine_scritta_sconto">{{
<span v-if="isApplicatoSconto() && !editmode" class="ordine_scritta_sconto">{{
$t('ecomm.sconto_applicato', { risparmio: getRisparmio() })
}}</span>
</div>
</q-item-label>
</q-item-section>
<q-item-section side top>
<q-item-section side>
<q-item-label>
<div class="col-1">
<div class="col-2">
<q-btn
v-if="!nomodif && editmode"
v-if="!nomodif"
icon="fas fa-trash"
color="negative"
round