- aggiunta campi Gas data + fix
This commit is contained in:
@@ -70,6 +70,8 @@ export default defineComponent({
|
||||
|
||||
const timerInterval = ref(<any>null)
|
||||
const timerLabelScadenza = ref('')
|
||||
const labelDataRitiro = ref('')
|
||||
const labelDataArrivoMerce = ref('')
|
||||
|
||||
const openlistorders = ref(false)
|
||||
const endload = ref(false)
|
||||
@@ -137,6 +139,7 @@ export default defineComponent({
|
||||
const mygas = gasordine
|
||||
if (mygas)
|
||||
return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
|
||||
+ ' ' + t('gas.data_arrivo_merce') + ': ' + tools.getstrDateShort(mygas.data_arrivo_merce)
|
||||
+ ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)
|
||||
else
|
||||
return ''
|
||||
@@ -220,11 +223,19 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
watch(() => gasordineSelected.value, (newval, oldval) => {
|
||||
myorder.idGasordine = newval
|
||||
recgasordineSelected.value = myproduct.value.gasordines.find((rec: any) => rec._id === gasordineSelected.value)
|
||||
|
||||
if (newval) {
|
||||
myorder.idGasordine = newval
|
||||
recgasordineSelected.value = myproduct.value.gasordines.find((rec: any) => rec._id === gasordineSelected.value)
|
||||
updateLabel()
|
||||
}
|
||||
})
|
||||
|
||||
function updateLabel() {
|
||||
//labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
labelDataArrivoMerce.value = tools.getstrDateShort(recgasordineSelected.value.data_arrivo_merce)
|
||||
labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
load()
|
||||
// Start the timer when the component is mounted
|
||||
@@ -274,6 +285,7 @@ export default defineComponent({
|
||||
if (ord.idGasordine) {
|
||||
gasordineSelected.value = ord.idGasordine!
|
||||
recgasordineSelected.value = myproduct.value.gasordines.find((rec: IGasordine) => rec._id === ord.idGasordine!)
|
||||
updateLabel()
|
||||
}
|
||||
|
||||
// Seleziona il Negozio che avevo già scelto nell'ordine !
|
||||
@@ -284,6 +296,7 @@ export default defineComponent({
|
||||
|
||||
if (gasordineSelected.value) {
|
||||
recgasordineSelected.value = myproduct.value.gasordines.find((rec: IGasordine) => rec._id === gasordineSelected.value)
|
||||
updateLabel()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -355,6 +368,8 @@ export default defineComponent({
|
||||
getGasordines,
|
||||
recgasordineSelected,
|
||||
timerLabelScadenza,
|
||||
labelDataRitiro,
|
||||
labelDataArrivoMerce,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -145,6 +145,34 @@
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-if="labelDataArrivoMerce">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="red" name="fas fa-shipping-fast" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
{{ t('gas.data_arrivo_merce') }}
|
||||
</q-item-label>
|
||||
<q-item-label class="countdown_scadenza">
|
||||
{{ labelDataArrivoMerce }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-if="labelDataRitiro">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="green" name="fas fa-people-carry" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
{{ t('gas.dataora_ritiro') }}
|
||||
</q-item-label>
|
||||
<q-item-label class="countdown_scadenza">
|
||||
{{ labelDataRitiro }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div v-if="true">
|
||||
<div v-if="complete && myproduct.producer && myproduct.producer.city">
|
||||
@@ -249,7 +277,7 @@
|
||||
<div
|
||||
class="text-blue text-title row items-center q-mr-md centeritems"
|
||||
>
|
||||
<q-icon size="sm" name="fas fa-shipping-fast" class="q-mr-sm" />
|
||||
<q-icon size="sm" name="fas fa-people-carry" class="q-mr-sm" />
|
||||
{{ t('products.ritiro_presso') }}:
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -32,6 +32,7 @@ const msg_website_it = {
|
||||
orderinfo: 'Ordini Effettuati',
|
||||
products: 'Prodotti',
|
||||
productInfos: 'Info Prodotti',
|
||||
listinoprodotti: 'Listino Prodotti',
|
||||
productslist: 'Lista Prodotti',
|
||||
collabora: 'Collabora',
|
||||
categories: 'Categorie',
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function () {
|
||||
const arrcart = products.cart
|
||||
if (!!arrcart) {
|
||||
if (!!arrcart.items) {
|
||||
const total = arrcart.items.reduce((sum, item) => sum + item.order.quantity + item.order.quantitypreordered , 0)
|
||||
const total = arrcart.items.reduce((sum, item) => sum + (item.order ? (item.order.quantity + item.order.quantitypreordered) : 0) , 0)
|
||||
return total
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ export interface IGasordine {
|
||||
city?: string,
|
||||
img?: string,
|
||||
dataora_chiusura_ordini?: Date,
|
||||
data_arrivo_merce?: Date,
|
||||
dataora_ritiro?: Date,
|
||||
}
|
||||
|
||||
|
||||
@@ -407,11 +407,12 @@ export default defineComponent({
|
||||
strris += addfield(col, 'link', rec, false); col++;
|
||||
strris += addfield(col, 'perc_iva', rec, false); col++;
|
||||
strris += addfield(col, 'price_acquistato', rec, true); col++;
|
||||
strris += addfield(col, 'minBuyQty', rec, true); col++;
|
||||
strris += addfield(col, 'minBuyQty', rec, false, true); col++;
|
||||
strris += addfield(col, 'cat_name', rec, false); col++;
|
||||
strris += addfield(col, 'producer_name', rec, false); col++;
|
||||
strris += addfield(col, 'provider_name', rec, false); col++;
|
||||
strris += addfield(col, 'magazzino_name', rec, false); col++;
|
||||
strris += addfield(col, 'bookableQty', rec, false, true); col++;
|
||||
strris += '} '
|
||||
|
||||
} else if (cmd === shared_consts.Cmd.CITIES_SERVER) {
|
||||
|
||||
@@ -7,7 +7,7 @@ function getRoutesEcomm(site: ISites) {
|
||||
active: true,
|
||||
order: 30,
|
||||
path: '/products',
|
||||
materialIcon: 'fas fa-shopping-cart',
|
||||
materialIcon: 'fas fa-lemon',
|
||||
name: 'pages.productslist',
|
||||
component: () => import('@/views/ecommerce/productsList/productsList.vue'),
|
||||
inmenu: true,
|
||||
@@ -31,7 +31,7 @@ function getRoutesEcomm(site: ISites) {
|
||||
active: true,
|
||||
order: 30,
|
||||
path: '/orderinfo',
|
||||
materialIcon: 'fas fa-shopping-cart',
|
||||
materialIcon: 'fas fa-file-alt',
|
||||
name: 'pages.orderinfo',
|
||||
component: () => import('@/views/ecommerce/orderInfo/orderInfo.vue'),
|
||||
inmenu: true,
|
||||
@@ -88,7 +88,7 @@ function getRoutesEcomm(site: ISites) {
|
||||
order: 30,
|
||||
path: '/admin/ecommerce/products',
|
||||
materialIcon: 'fas fa-lemon',
|
||||
name: 'pages.products',
|
||||
name: 'pages.listinoprodotti',
|
||||
component: () => import('@/rootgen/admin/products/products.vue'),
|
||||
inmenu: true,
|
||||
submenu: true,
|
||||
@@ -115,7 +115,7 @@ function getRoutesEcomm(site: ISites) {
|
||||
active: true,
|
||||
order: 30,
|
||||
path: '/admin/ecommerce/storehouses',
|
||||
materialIcon: 'fas fa-file-alt',
|
||||
materialIcon: 'fas fa-store',
|
||||
name: 'pages.storehouses',
|
||||
component: () => import('@/rootgen/admin/storehouses/storehouses.vue'),
|
||||
inmenu: true,
|
||||
|
||||
@@ -1689,6 +1689,7 @@ const msg_it = {
|
||||
gas: {
|
||||
name: 'Ordine Gas',
|
||||
dataora_chiusura_ordini: 'Data Chiusura Ordini',
|
||||
data_arrivo_merce: 'Data Arrivo Merce',
|
||||
dataora_ritiro: 'Data Ritiro',
|
||||
ordina_sul_gas: 'Gruppo di Acquisto',
|
||||
bottega: 'Bottega',
|
||||
|
||||
@@ -461,6 +461,7 @@ export const colTableGasordine = [
|
||||
AddCol({ name: 'city', label_trans: 'store.city' }),
|
||||
AddCol({ name: 'img', label_trans: 'store.img' }),
|
||||
AddCol({ name: 'dataora_chiusura_ordini', label_trans: 'gas.dataora_chiusura_ordini', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'data_arrivo_merce', label_trans: 'gas.data_arrivo_merce', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'dataora_ritiro', label_trans: 'gas.dataora_ritiro', fieldtype: costanti.FieldType.date }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
|
||||
@@ -179,7 +179,7 @@ export const useProducts = defineStore('Products', {
|
||||
getOrderProductInCart: (state: IProductsState) => (idproduct: string): IOrder | null => {
|
||||
// console.log('.cart.items', this.cart.items)
|
||||
if (state.cart.items) {
|
||||
const ris = state.cart.items.find((item: IBaseOrder) => item.order.idProduct === idproduct)
|
||||
const ris = state.cart.items.find((item: IBaseOrder) => item.order ? (item.order.idProduct === idproduct) : false)
|
||||
return ris ? ris.order : null
|
||||
}
|
||||
return null
|
||||
@@ -803,6 +803,7 @@ export const useProducts = defineStore('Products', {
|
||||
return mygas.name!
|
||||
else
|
||||
return mygas.name + ' (' + mygas.city + ') ' + translate('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
|
||||
+ ' ' + translate('gas.data_arrivo_merce') + ': ' + tools.getstrDateShort(mygas.data_arrivo_merce)
|
||||
+ ' ' + translate('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)
|
||||
} else
|
||||
return ''
|
||||
|
||||
|
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 158 KiB |
Reference in New Issue
Block a user