possibilità di modificare un ordine, e anche i totali
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.22"
|
||||
APP_VERSION="1.0.23"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.22"
|
||||
APP_VERSION="1.0.23"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="17"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.22"
|
||||
APP_VERSION="1.0.23"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="17"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.22"
|
||||
APP_VERSION="1.0.23"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.22"
|
||||
APP_VERSION="1.0.23"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1066,12 +1066,14 @@ export const shared_consts = {
|
||||
RECEIVED: 7,
|
||||
COMPLETED: 6,
|
||||
CANCELED: 10,
|
||||
PREPARED: 15,
|
||||
DELETE_REALLY: 20,
|
||||
},
|
||||
|
||||
OrderStat: {
|
||||
// IN_CART: { label: 'In Carrello', value: 1 }, //IN_CART
|
||||
IN_CORSO: { label: 'In Corso', value: 2, icon: 'fas fa-tasks', color: 'text-black' }, //CHECKOUT_SENT
|
||||
PREPARED: { label: 'Preparati', value: 15, icon: 'fas fa-archive', color: 'text-orange' },
|
||||
CONFERMATI: { label: 'Confermati', value: 3, icon: 'fas fa-calendar', color: 'text-blue' }, //ORDER_CONFIRMED
|
||||
PAGATI: { label: 'Pagati', value: 4, icon: 'money', color: 'text-green' }, //PAYED
|
||||
DELIVERED: { label: 'Consegnato', value: 5, icon: 'fas fa-calendar', color: 'text-blue' }, //DELIVERED
|
||||
@@ -1081,14 +1083,6 @@ export const shared_consts = {
|
||||
CANCELLATI: { label: 'Cancellati', value: 10, icon: 'delete', color: 'text-red' }, //CANCELED
|
||||
},
|
||||
|
||||
OrderStatusView: [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
6,
|
||||
10,
|
||||
],
|
||||
|
||||
REACTIONS_FIELD:
|
||||
{
|
||||
numseen: 1,
|
||||
@@ -1110,6 +1104,10 @@ export const shared_consts = {
|
||||
label: 'Ordine in Lavorazione',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: 'Preparato',
|
||||
value: 15,
|
||||
},
|
||||
{
|
||||
label: 'Ordine Confermato',
|
||||
value: 3,
|
||||
@@ -1149,23 +1147,29 @@ export const shared_consts = {
|
||||
color: 'secondary',
|
||||
},
|
||||
{
|
||||
label: 'Conferma Ordine Evaso (e aggiorna Qta in Stock)', //ORDER_CONFIRMED
|
||||
label: '📩 Conferma Ordine Evaso (e aggiorna Qta in Stock)', //ORDER_CONFIRMED
|
||||
value: 3,
|
||||
icon: 'fas fa-calendar-check',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
label: '📩 Imposta come Consegnato', //DELIVERED
|
||||
value: 5,
|
||||
icon: 'fas fa-shipping-fast',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
label: 'Imposta come Preparato', //PREPARED
|
||||
value: 15,
|
||||
icon: 'fas fa-archive',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
label: 'Imposta come Pagato', //PAYED
|
||||
value: 4,
|
||||
icon: 'money',
|
||||
color: 'positive',
|
||||
},
|
||||
{
|
||||
label: 'Imposta come Consegnato', //DELIVERED
|
||||
value: 5,
|
||||
icon: 'fas fa-shipping-fast',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
label: 'Imposta come Spedito', //DELIVERED
|
||||
value: 5,
|
||||
|
||||
@@ -230,7 +230,7 @@ export default defineComponent({
|
||||
if (myprod && myprod.active) {
|
||||
let myorder: IOrder = {
|
||||
quantity: 1, quantitypreordered: 0,
|
||||
TotalPriceProduct: 0, price: 0,
|
||||
TotalPriceProduct: 0, TotalPriceProductCalc: 0, price: 0,
|
||||
idStorehouse: getActualIdStorehouse(myprod),
|
||||
idGasordine: getActualGasordine(myprod),
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ export default defineComponent({
|
||||
|
||||
|
||||
async function mounted() {
|
||||
console.log(' ## INIZIO MOUNT ')
|
||||
// console.log(' ## INIZIO MOUNT ')
|
||||
username.value = userStore.my.username
|
||||
await loadCircuits()
|
||||
console.log(' -- FINE MOUNT ')
|
||||
// console.log(' -- FINE MOUNT ')
|
||||
}
|
||||
|
||||
function updateValue(val: number) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineComponent, onMounted, ref, computed } from 'vue'
|
||||
import { defineComponent, onMounted, ref, computed, watch } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -15,6 +15,7 @@ import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { CSingleCart } from '../CSingleCart'
|
||||
import { CTitleBanner } from '@components'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'COrdersCart',
|
||||
props: {
|
||||
@@ -46,6 +47,17 @@ export default defineComponent({
|
||||
const recOrderCart = ref(<IOrderCart>{})
|
||||
|
||||
const search = ref('')
|
||||
const editOn = ref(false)
|
||||
|
||||
const allTotalPrice = ref(<number | undefined>undefined);
|
||||
|
||||
watch(allTotalPrice, (newValue: any) => {
|
||||
if (!newValue)
|
||||
recOrderCart.value.totalPrice = 0
|
||||
else
|
||||
recOrderCart.value.totalPrice = parseFloat(newValue);
|
||||
});
|
||||
|
||||
|
||||
const statusnow = computed(() => (): number => {
|
||||
if (recOrderCart.value) {
|
||||
@@ -57,6 +69,8 @@ export default defineComponent({
|
||||
function mounted() {
|
||||
// Inizializza
|
||||
load()
|
||||
|
||||
allTotalPrice.value = recOrderCart.value.totalPrice
|
||||
}
|
||||
|
||||
function getItems(): IBaseOrder[] | [] {
|
||||
@@ -93,6 +107,14 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function myTotalPriceCalc(): string {
|
||||
if (recOrderCart.value) {
|
||||
return recOrderCart.value.totalPriceCalc ? recOrderCart.value.totalPriceCalc.toFixed(2) : ''
|
||||
} else {
|
||||
return '0'
|
||||
}
|
||||
}
|
||||
|
||||
function myTotalQty(): number {
|
||||
if (recOrderCart.value) {
|
||||
return recOrderCart.value.totalQty
|
||||
@@ -108,6 +130,7 @@ export default defineComponent({
|
||||
oldrec.value = myrec.value
|
||||
note.value = recOrderCart.value.note!
|
||||
}
|
||||
allTotalPrice.value = recOrderCart.value.totalPrice
|
||||
endload.value = true
|
||||
}
|
||||
|
||||
@@ -172,7 +195,7 @@ export default defineComponent({
|
||||
if (myprod && myprod.active) {
|
||||
let myorder: IOrder = {
|
||||
quantity: 1, quantitypreordered: 0,
|
||||
TotalPriceProduct: 0, price: 0,
|
||||
TotalPriceProduct: 0, TotalPriceProductCalc: 0, price: 0,
|
||||
idStorehouse: getActualIdStorehouse(myprod),
|
||||
idGasordine: getActualGasordine(myprod),
|
||||
}
|
||||
@@ -182,8 +205,9 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function updateOrdersCart(paramstoupdate: any) {
|
||||
productStore.updateOrdersCartById(props.idOrdersCart, paramstoupdate)
|
||||
async function updateOrdersCart(paramstoupdate: any) {
|
||||
await productStore.updateOrdersCartById(props.idOrdersCart, paramstoupdate)
|
||||
|
||||
}
|
||||
|
||||
function ordersUpdated() {
|
||||
@@ -191,6 +215,17 @@ export default defineComponent({
|
||||
load()
|
||||
}
|
||||
|
||||
function changeTotalPrice() {
|
||||
|
||||
|
||||
change_field('totalPrice')
|
||||
}
|
||||
|
||||
function updateTotalPrice() {
|
||||
updateOrdersCart({totalPrice: allTotalPrice.value})
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
@@ -214,6 +249,11 @@ export default defineComponent({
|
||||
updateOrdersCart,
|
||||
ordersUpdated,
|
||||
t,
|
||||
editOn,
|
||||
allTotalPrice,
|
||||
changeTotalPrice,
|
||||
updateTotalPrice,
|
||||
myTotalPriceCalc,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
|
||||
<div v-if="endload && recOrderCart.numorder > 0">
|
||||
<div v-if="recOrderCart" class="panel">
|
||||
<q-toggle
|
||||
v-if="tools.isManager()"
|
||||
v-model="editOn"
|
||||
class="absolute-top-left"
|
||||
color="green"
|
||||
icon="fas fa-pencil-alt"
|
||||
dense
|
||||
>
|
||||
</q-toggle>
|
||||
<div class="numorder">
|
||||
{{ t('orderscart.numero_ordine') }}: {{ recOrderCart.numorder }}
|
||||
</div>
|
||||
@@ -26,17 +35,51 @@
|
||||
:order="itemorder.order"
|
||||
:showall="false"
|
||||
:idOrdersCart="recOrderCart._id"
|
||||
:editmode="tools.isManager()"
|
||||
:editmode="editOn"
|
||||
:nomodif="true"
|
||||
@update="ordersUpdated()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator></q-separator>
|
||||
|
||||
<div
|
||||
v-if="myTotalPriceCalc() !== myTotalPrice() && myTotalPriceCalc() !== ''"
|
||||
class="col-6 q-mr-sm"
|
||||
style="text-align: right"
|
||||
>
|
||||
<span class="text-grey q-mr-xs">{{ t('ecomm.calcolato') }}:</span>
|
||||
<span class="text-subtitle1 q-mr-sm"
|
||||
>€ {{ myTotalPriceCalc() }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="col-6 q-mr-sm" style="text-align: right">
|
||||
<span class="text-grey q-mr-xs">{{ t('ecomm.totale') }}:</span>
|
||||
<span class="text-subtitle1 q-mr-sm">€ {{ myTotalPrice() }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<q-input
|
||||
v-if="editOn && getNumItems() > 0"
|
||||
v-model="allTotalPrice"
|
||||
:label="t('ecomm.totalPrice')"
|
||||
filled
|
||||
dense
|
||||
debounce="1000"
|
||||
@change="changeTotalPrice"
|
||||
>
|
||||
</q-input>
|
||||
<q-btn
|
||||
v-if="editOn"
|
||||
outline
|
||||
rounded
|
||||
dense
|
||||
color="green"
|
||||
icon="fas fa-redo"
|
||||
:label="t('orderscart.update_TotalPrice')"
|
||||
@click="updateTotalPrice"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<q-input
|
||||
v-if="tools.isManager() && getNumItems() > 0"
|
||||
|
||||
@@ -3,11 +3,12 @@ import { CCardState } from '../CCardState'
|
||||
import { CCopyBtn } from '../CCopyBtn'
|
||||
|
||||
import { IOperators, IOrder, IProduct } from '@src/model'
|
||||
import { defineComponent, PropType, toRef } from 'vue'
|
||||
import { defineComponent, PropType, toRef, ref, watch, onMounted } from 'vue'
|
||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { loadRouteLocation } from 'vue-router'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSingleCart',
|
||||
@@ -45,6 +46,47 @@ export default defineComponent({
|
||||
|
||||
const $q = useQuasar()
|
||||
|
||||
const orderQuantity = ref(<number | undefined>undefined);
|
||||
const orderQuantityPreordered = ref(<number | undefined>undefined);
|
||||
const orderTotalPriceProduct = ref(<number | undefined>undefined);
|
||||
|
||||
const enableQty = ref(false)
|
||||
const endload = ref(false)
|
||||
const enableQtyPreordered = ref(false)
|
||||
const enableChangeTotalPrice = ref(false)
|
||||
|
||||
watch(orderQuantity, (newValue: any) => {
|
||||
if (!newValue)
|
||||
order.value.quantity = 0
|
||||
else
|
||||
order.value.quantity = parseFloat(newValue);
|
||||
|
||||
enableChangeTotalPrice.value = false
|
||||
});
|
||||
|
||||
watch(orderQuantityPreordered, (newValue: any) => {
|
||||
if (!newValue)
|
||||
order.value.quantitypreordered = 0
|
||||
else
|
||||
order.value.quantitypreordered = parseFloat(newValue);
|
||||
|
||||
enableChangeTotalPrice.value = false
|
||||
});
|
||||
|
||||
watch(orderTotalPriceProduct, (newValue: any) => {
|
||||
if (!newValue)
|
||||
order.value.TotalPriceProduct = 0
|
||||
else
|
||||
order.value.TotalPriceProduct = parseFloat(newValue);
|
||||
});
|
||||
|
||||
watch(() => props.order.TotalPriceProduct, (newValue: any) => {
|
||||
if (!newValue)
|
||||
orderTotalPriceProduct.value = 0
|
||||
else
|
||||
orderTotalPriceProduct.value = parseFloat(newValue);
|
||||
});
|
||||
|
||||
function myimgclass() {
|
||||
if (props.showall) {
|
||||
return 'imgNormal'
|
||||
@@ -102,23 +144,46 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function removeFromCard() {
|
||||
if (props.idOrdersCart) {
|
||||
//
|
||||
} else {
|
||||
products.removeFromCart({ order: order.value })
|
||||
}
|
||||
|
||||
products.removeFromCart({ order: order.value })
|
||||
|
||||
}
|
||||
|
||||
async function updateOrder(paramstoupdate: any) {
|
||||
await products.updateOrderByOrder(props.idOrdersCart, order.value._id, paramstoupdate)
|
||||
endload.value = false
|
||||
if (enableChangeTotalPrice.value) {
|
||||
paramstoupdate = { ...paramstoupdate, TotalPriceProduct: order.value.TotalPriceProduct }
|
||||
}
|
||||
const myOrdersCart = await products.updateOrderByOrder(props.idOrdersCart, order.value._id, paramstoupdate)
|
||||
emit('update')
|
||||
mounted()
|
||||
}
|
||||
|
||||
function getRisparmio(): string {
|
||||
return ((order.value.product!.price * order.value.quantity) - order.value.TotalPriceProduct).toFixed(2)
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
endload.value = false
|
||||
if (props.order.quantity !== 0) {
|
||||
orderQuantity.value = props.order.quantity
|
||||
enableQty.value = true
|
||||
}
|
||||
if (props.order.quantitypreordered !== 0) {
|
||||
orderQuantityPreordered.value = props.order.quantitypreordered
|
||||
enableQtyPreordered.value = true
|
||||
}
|
||||
|
||||
orderTotalPriceProduct.value = props.order.TotalPriceProduct
|
||||
endload.value = true
|
||||
}
|
||||
|
||||
function changeTotalPrice() {
|
||||
console.log('changeTotalPrice')
|
||||
enableChangeTotalPrice.value = true
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
myimgclass,
|
||||
addsubqty,
|
||||
@@ -129,6 +194,13 @@ export default defineComponent({
|
||||
products,
|
||||
t,
|
||||
updateOrder,
|
||||
orderQuantity,
|
||||
orderQuantityPreordered,
|
||||
enableQty,
|
||||
enableQtyPreordered,
|
||||
changeTotalPrice,
|
||||
orderTotalPriceProduct,
|
||||
endload,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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()">
|
||||
<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
|
||||
>
|
||||
</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
|
||||
|
||||
@@ -222,7 +222,7 @@ export default defineComponent({
|
||||
|
||||
function setLangAtt(mylang: string) {
|
||||
|
||||
console.log('LANG =', mylang)
|
||||
// console.log('LANG =', mylang)
|
||||
// console.log('PRIMA $q.lang.isoName', $q.lang.isoName)
|
||||
|
||||
// dynamic import, so loading on demand only
|
||||
|
||||
@@ -77,6 +77,7 @@ export interface IOrder {
|
||||
idStorehouse?: string
|
||||
idGasordine?: string
|
||||
TotalPriceProduct: number
|
||||
TotalPriceProductCalc: number
|
||||
price: number
|
||||
after_price?: string
|
||||
quantity: number
|
||||
@@ -227,6 +228,7 @@ export interface IOrderCart {
|
||||
user: IUserFields | null,
|
||||
totalQty: number
|
||||
totalPrice: number
|
||||
totalPriceCalc: number
|
||||
department?: string
|
||||
items?: IBaseOrder[]
|
||||
nameSurname?: string
|
||||
|
||||
@@ -1388,7 +1388,7 @@ const msg_it = {
|
||||
ask: 'Entra nel Circuito',
|
||||
ask_italia: 'Apri Circuito RIS Italia',
|
||||
exit: 'Esci dal Circuito',
|
||||
accept: 'Accetta la Fiducia Concessa',
|
||||
accept: 'Abilita Fiducia',
|
||||
add_to_circuit: 'Aggiungi al Circuito',
|
||||
exit_circuit: 'Esci dal Circuito',
|
||||
domanda_cancel_req: 'Annullare la richiesta d\'invito di {username} al {circuitname}?',
|
||||
@@ -1696,6 +1696,7 @@ const msg_it = {
|
||||
carrello_vuoto: 'Il Carrello è Vuoto',
|
||||
note: 'Scrivi qui per eventuali note o chiarimenti:',
|
||||
totale: 'Totale',
|
||||
calcolato: 'Calcolato',
|
||||
carrello: 'Carrello',
|
||||
settings: 'Impostazioni',
|
||||
qta_in_attesa: '(Ordinati In attesa {qty})',
|
||||
@@ -1741,6 +1742,8 @@ const msg_it = {
|
||||
email_sent: '{inviate} email inviate !',
|
||||
email_not_send: 'Email non inviata',
|
||||
update_order: 'Aggiorna Ordine',
|
||||
update_TotalPrice: 'Aggiorna Totale',
|
||||
TotalPriceProduct: 'Prezzo Totale',
|
||||
},
|
||||
cash: {
|
||||
creatorUserId: 'Creatore',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Api } from '@api'
|
||||
import * as Types from '@src/store/Api/ApiTypes'
|
||||
|
||||
async function sendRequest(url: string, method: string, mydata: any) {
|
||||
if (process.env.DEBUG) console.log('sendRequest', method, url)
|
||||
// if (process.env.DEBUG) console.log('sendRequest', method, url)
|
||||
|
||||
let request
|
||||
if (method === 'GET') request = Api.get(url, mydata)
|
||||
|
||||
@@ -357,6 +357,8 @@ export const getcolorderscart = [
|
||||
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: 'preparato', label_trans: 'order.preparato', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'date_preparato', label_trans: 'order.date_preparato', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'pagato', label_trans: 'order.pagato', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'date_pagato', label_trans: 'order.date_pagato', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'spedito', label_trans: 'order.spedito', fieldtype: costanti.FieldType.boolean }),
|
||||
|
||||
@@ -3864,19 +3864,19 @@ export const tools = {
|
||||
},
|
||||
|
||||
setLangAtt($q: any, $router: Router, mylang: string) {
|
||||
console.log('setLangAtt =', mylang)
|
||||
// console.log('setLangAtt =', mylang)
|
||||
// console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName)
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
// dynamic import, so loading on demand only
|
||||
import(`quasar/lang/${this.getlangforQuasar(mylang)}`).then((lang) => {
|
||||
console.log(' Import dinamically lang =', lang)
|
||||
// console.log(' Import dinamically lang =', lang)
|
||||
if ($q.lang)
|
||||
$q.lang.set(this.getlangforQuasar(lang.default.isoName))
|
||||
|
||||
import('../../statics/i18n').then(() => {
|
||||
console.log(' *** MY LANG DOPO=', $q.lang.isoName)
|
||||
// console.log(' *** MY LANG DOPO=', $q.lang.isoName)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -143,16 +143,16 @@ export const toolsext = {
|
||||
setLangAtt($q: any, $router: Router, mylang: string) {
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
console.log('setLangAtt =', mylang)
|
||||
// console.log('setLangAtt =', mylang)
|
||||
// console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName)
|
||||
|
||||
// dynamic import, so loading on demand only
|
||||
import(`quasar/lang/${this.getlangforQuasar(mylang)}`).then((lang) => {
|
||||
console.log(' Import dinamically lang =', lang)
|
||||
// console.log(' Import dinamically lang =', lang)
|
||||
|
||||
$q.lang.set(this.getlangforQuasar(lang.default.isoName))
|
||||
import('../../statics/i18n').then(() => {
|
||||
console.log(' *** MY LANG DOPO=', $q.lang.isoName)
|
||||
// console.log(' *** MY LANG DOPO=', $q.lang.isoName)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ function getRecordOrdersCartEmpty(): IOrderCart {
|
||||
user: null,
|
||||
totalQty: 0,
|
||||
totalPrice: 0,
|
||||
totalPriceCalc: 0,
|
||||
status: 0,
|
||||
confermato: false,
|
||||
consegnato: false,
|
||||
@@ -198,6 +199,9 @@ export const useProducts = defineStore('Products', {
|
||||
if (tipoord === shared_consts.OrderStat.IN_CORSO.value)
|
||||
return state.orders.filter((rec: IOrderCart) => ((rec.status ? rec.status : 0) <= shared_consts.OrderStatus.CHECKOUT_SENT)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.PREPARED.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.PREPARED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.CONFERMATI.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.ORDER_CONFIRMED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
@@ -356,6 +360,7 @@ export const useProducts = defineStore('Products', {
|
||||
idapp: process.env.APP_ID,
|
||||
status: shared_consts.OrderStatus.IN_CART,
|
||||
TotalPriceProduct: 0,
|
||||
TotalPriceProductCalc: 0,
|
||||
idProduct: product._id,
|
||||
product, // Copia tutto l'oggetto Product !
|
||||
|
||||
@@ -391,12 +396,12 @@ export const useProducts = defineStore('Products', {
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
// console.log('loadProducts')
|
||||
//console.log('loadProducts')
|
||||
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
console.log('getProducts', 'userid=', userStore.my._id)
|
||||
// console.log('getProducts', 'userid=', userStore.my._id)
|
||||
|
||||
// if (userStore.my._id === '') {
|
||||
// return new Types.AxiosError(0, null, 0, '')
|
||||
@@ -407,7 +412,7 @@ 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')
|
||||
// console.log('aggiorna prodotti')
|
||||
this.products = []
|
||||
this.products = res.data.products
|
||||
} else {
|
||||
@@ -460,7 +465,7 @@ export const useProducts = defineStore('Products', {
|
||||
const idord = this.orders.findIndex((ord: IOrderCart) => ord._id === myorderscart._id)
|
||||
if (idord >= 0) {
|
||||
console.log('aggiorna ordine')
|
||||
this.orders[idord] = {...myorderscart}
|
||||
this.orders[idord] = { ...myorderscart }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -551,7 +556,7 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
async loadOrders() {
|
||||
|
||||
console.log('loadOrders')
|
||||
// console.log('loadOrders')
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
|
||||
@@ -1134,7 +1134,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
},
|
||||
|
||||
setlang($q: any, router: Router, newstr: string) {
|
||||
console.log('SETLANG', newstr)
|
||||
// console.log('SETLANG', newstr)
|
||||
this.lang = newstr
|
||||
toolsext.setLangAtt($q, router, newstr)
|
||||
toolsext.setLangAtt($q, router, newstr)
|
||||
|
||||
@@ -488,7 +488,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
addDynamicPages($router: Router | null) {
|
||||
// console.log('this.mypage', this.mypage)
|
||||
console.log('addDynamicPages.........')
|
||||
/// console.log('addDynamicPages.........')
|
||||
const arrpagesroute: IListRoutes[] = []
|
||||
|
||||
for (const page of this.mypage) {
|
||||
@@ -907,7 +907,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
async loadAfterLogin() {
|
||||
console.log('loadAfterLogin')
|
||||
// console.log('loadAfterLogin')
|
||||
this.clearDataAfterLoginOnlyIfActiveConnection()
|
||||
|
||||
let isok = false
|
||||
|
||||
@@ -289,6 +289,11 @@
|
||||
color="negative"
|
||||
@click="EseguiFunz('dropAllCarts')"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
label="CopyPriceToCalc"
|
||||
color="positive"
|
||||
@click="EseguiFunz('CopyPriceToCalc')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -108,6 +108,14 @@ export default defineComponent({
|
||||
field: 'apri',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
name: 'comandi',
|
||||
align: 'center',
|
||||
required: false,
|
||||
label: 'Comandi',
|
||||
field: 'comandi',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
name: 'numorder',
|
||||
required: true,
|
||||
@@ -154,14 +162,6 @@ export default defineComponent({
|
||||
field: 'status',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
name: 'comandi',
|
||||
align: 'center',
|
||||
required: false,
|
||||
label: 'Comandi',
|
||||
field: 'comandi',
|
||||
sortable: false
|
||||
}
|
||||
])
|
||||
|
||||
watch(() => cosa.value, (newval, oldval) => {
|
||||
@@ -197,6 +197,7 @@ export default defineComponent({
|
||||
status: 0,
|
||||
// Add other properties as needed
|
||||
totalPrice: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice, 0),
|
||||
totalPriceCalc: orderscart.reduce((total: number, rec: any) => total + rec.totalPriceCalc, 0),
|
||||
};
|
||||
|
||||
let rowsWithTotals: any = [...orderscart];
|
||||
@@ -227,12 +228,14 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const allorders = getAllOrdersCart()
|
||||
for (const status of [2, 3, 4, 5, 6, 7, 8, 10]) {
|
||||
for (const status of [15, 2, 3, 4, 5, 6, 7, 8, 10]) {
|
||||
arrnumstatus.value[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0)
|
||||
}
|
||||
|
||||
selectfirstavailable()
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function selectfirstavailable() {
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
<q-item-label v-else-if="col.name === 'totalPrice'" caption>
|
||||
{{ props.row.totalPrice }} €
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'totalPriceCalc'" caption>
|
||||
{{ props.row.totalPriceCalc }} €
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'status'" caption>
|
||||
{{ shared_consts.getStatusStr(props.row.status) }}
|
||||
</q-item-label>
|
||||
@@ -137,14 +140,14 @@
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label v-else-if="col.name === 'apri'" caption>
|
||||
<q-item-label v-else-if="col.name === 'apri' && props.row._id" caption>
|
||||
<div class="q-pa-sm">
|
||||
<q-btn
|
||||
size="sm"
|
||||
dense
|
||||
icon="fas fa-filter"
|
||||
:label="t('ecomm.apriordine')"
|
||||
:to="`/orderscart/{$idOrdersCart}`"
|
||||
:to="`/orderscart/${props.row._id}`"
|
||||
></q-btn>
|
||||
</div>
|
||||
</q-item-label>
|
||||
@@ -162,6 +165,7 @@
|
||||
<q-td key="apri" :props="props">
|
||||
<div class="q-pa-sm">
|
||||
<q-btn
|
||||
v-if="props.row._id"
|
||||
color="primary"
|
||||
size="sm"
|
||||
dense
|
||||
@@ -171,6 +175,23 @@
|
||||
></q-btn>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="comandi" :props="props">
|
||||
<div v-if="tools.isManager() && props.row.user.name !== 'TOTALI'" class="q-pa-sm">
|
||||
<q-btn-dropdown rounded dense label="Azioni">
|
||||
<q-list class="text-primary">
|
||||
<q-item v-for="(cmd, index) of shared_consts.OrderCmdStr" :key="index" clickable v-close-popup
|
||||
@click="clickFunz(props.row, cmd.value)">
|
||||
<q-item-section avatar>
|
||||
<q-avatar :icon="cmd.icon" :color="cmd.color" text-color="white" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ cmd.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="numorder" :props="props">
|
||||
<span v-if="props.row.numorder">
|
||||
n. {{ props.row.numorder }}</span>
|
||||
@@ -235,6 +256,10 @@
|
||||
{{ tools.getstrDateTime(props.row.date_consegnato) }}:
|
||||
<span class="ordstat">{{ $t('ecomm.consegnato') }}</span>
|
||||
</div>
|
||||
<div v-if="props.row.preparato" class="ordstat">
|
||||
{{ tools.getstrDateTime(props.row.date_preparato) }}:
|
||||
<span class="ordstat">{{ $t('ecomm.preparato') }}</span>
|
||||
</div>
|
||||
<div v-if="props.row.spedito">
|
||||
{{ tools.getstrDateTime(props.row.date_spedito) }}:
|
||||
<span class="ordstat">{{ $t('ecomm.spedito') }}</span>
|
||||
@@ -244,23 +269,6 @@
|
||||
<span class="ordstat">{{ $t('ecomm.ricevuto') }}</span>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="comandi" :props="props">
|
||||
<div v-if="tools.isManager() && props.row.user.name !== 'TOTALI'" class="q-pa-sm">
|
||||
<q-btn-dropdown rounded dense label="Azioni">
|
||||
<q-list class="text-primary">
|
||||
<q-item v-for="(cmd, index) of shared_consts.OrderCmdStr" :key="index" clickable v-close-popup
|
||||
@click="clickFunz(props.row, cmd.value)">
|
||||
<q-item-section avatar>
|
||||
<q-avatar :icon="cmd.icon" :color="cmd.color" text-color="white" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ cmd.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
|
||||
Reference in New Issue
Block a user