- aggiornamento cataloghi.

possibilità di estrapolare i dati da GM direttamente
- migrazione delle tabelle di GM in locale
- corretto l'ordinamento del Catalogo
This commit is contained in:
Surya Paolo
2025-04-18 13:23:52 +02:00
parent 14375d6b15
commit 6d0efaadb9
16 changed files with 452 additions and 73 deletions

View File

@@ -648,7 +648,7 @@ export default defineComponent({
loading.value = true
updatefromgm.value = true
field_updated_fromGM.value = ''
const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!)
const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!, myproduct.value.isbn)
if (ris) {
field_updated_fromGM.value = t('dbgm.updateLocalDb_OK')
@@ -659,12 +659,28 @@ export default defineComponent({
}
}
async function refreshAllDataBookFromGM() {
async function refreshAllDataBookFromGM(options: any) {
if (myproduct.value) {
loading.value = true
updatefromgm.value = true
field_updated_fromGM.value = ''
const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!)
const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: myproduct.value.productInfo.sku!, isbn: myproduct.value.productInfo.code, ...options, caricatutti: true })
if (ris) {
field_updated_fromGM.value = t('dbgm.updateLocalDb_OK')
await updateproduct(false)
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
}
loading.value = false
}
}
async function refreshSingleBookFromGM(options: any) {
if (myproduct.value) {
loading.value = true
updatefromgm.value = true
field_updated_fromGM.value = ''
const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: myproduct.value.productInfo.sku!, isbn: myproduct.value.productInfo.code, ...options })
if (ris) {
field_updated_fromGM.value = t('dbgm.updateLocalDb_OK')
@@ -760,6 +776,7 @@ export default defineComponent({
updatetogm,
refreshDataFromGM,
refreshAllDataBookFromGM,
refreshSingleBookFromGM,
loading,
}
}

View File

@@ -163,7 +163,7 @@
"
clickable
v-close-popup
@click="refreshAllDataBookFromGM()"
@click="refreshSingleBookFromGM({usaDBGMLocale: false})"
>
<q-item-section avatar>
<q-avatar
@@ -173,9 +173,67 @@
/>
</q-item-section>
<q-item-section>
<q-item-label>Riaggiorna Tutto il Libro da GM</q-item-label>
<q-item-label>Riaggiorna il Libro da GM</q-item-label>
</q-item-section>
</q-item>
<q-item
v-if="
tools.isManager() && !optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
"
clickable
v-close-popup
@click="refreshSingleBookFromGM({usaDBGMLocale: true})"
>
<q-item-section avatar>
<q-avatar
icon="fas fa-pencil-alt"
color="accent"
text-color="white"
/>
</q-item-section>
<q-item-section>
<q-item-label>Riaggiorna il Libro da DBLocale</q-item-label>
</q-item-section>
</q-item>
<!--<q-item
v-if="
tools.isManager() && !optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
"
clickable
v-close-popup
@click="refreshAllDataBookFromGM({usaDBGMLocale: false})"
>
<q-item-section avatar>
<q-avatar
icon="fas fa-pencil-alt"
color="accent"
text-color="white"
/>
</q-item-section>
<q-item-section>
<q-item-label>Riaggiorna TUTTI da GM</q-item-label>
</q-item-section>
</q-item>
<q-item
v-if="
tools.isManager() && !optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
"
clickable
v-close-popup
@click="refreshAllDataBookFromGM({usaDBGMLocale: true})"
>
<q-item-section avatar>
<q-avatar
icon="fas fa-pencil-alt"
color="accent"
text-color="white"
/>
</q-item-section>
<q-item-section>
<q-item-label>Riaggiorna TUTTI da GM (da DB Locale)</q-item-label>
</q-item-section>
</q-item>
-->
<q-item
v-if="
tools.isManager() && !optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
@@ -618,7 +676,7 @@
nameTable: 'T_Web_Articoli',
campispeciali: true,
numrec: 1,
where: 'T.IdArticolo =' + myproduct.productInfo.sku,
where: 'T.IdArticolo =' + myproduct.productInfo.sku + ' AND T.Ean13 = ' + myproduct.productInfo.code,
showQtaDisponibile,
outhtml: true,
}"

View File

@@ -102,6 +102,7 @@ export default defineComponent({
// Colonne della tabella
const allColumns = [
{ name: "pos", label: "Pos", field: "pos", align: "left", style: "width: 50px" },
{ name: "drag", label: "Ordinam.", field: "", align: "left", style: "width: 50px" },
{ name: "image", label: "Foto", field: "image", align: "center" },
{ name: "name", label: "Titolo del Libro", field: "name", align: "left" },
@@ -109,6 +110,7 @@ export default defineComponent({
{ name: "trafiletto", label: "Trafiletto", field: "trafiletto", align: "left" },
{ name: "catprods", label: "Argomento", field: "catprods", align: "left" },
{ name: "idCollana", label: "Collana", field: "idCollana", align: "left" },
{ name: "stato", label: "Stato", field: "stato", align: "left" },
{ name: "date_pub", label: "Pubblicato", field: "date_pub", align: "left" },
{ name: "ranking", label: "Class.", field: "ranking", align: "right" },
{ name: "rank3M", label: "Class. 3M", field: "rank3M", align: "right" },
@@ -134,7 +136,7 @@ export default defineComponent({
cookieValue = []; // In caso di errore, inizializza come array vuoto
}
const selectedColumns = ref(cookieValue.length > 0 ? cookieValue : ["drag", "image", "name", "authors", "catprods", "isbn", "actions"]);
const selectedColumns = ref(cookieValue.length > 0 ? cookieValue : ["pos", "drag", "image", "name", "authors", "catprods", "isbn", "actions"]);
// 3. Funzione per verificare se una colonna è visibile (isColumnVisible)

View File

@@ -40,8 +40,22 @@
@end="onDragEnd"
>
<template #item="{ element }">
<tr :key="element._id">
<tr
:key="element._id"
:class="{
'bg-yellow': products.isPubblicato(element.productInfo) && products.isQtaLimitata(element),
'bg-orange': products.isPubblicato(element.productInfo) && products.isInEsaurendo(element),
'text-white bg-red-10': products.isPubblicato(element.productInfo) && products.isEsaurito(element),
'bg-grey': !products.isPubblicato(element.productInfo),
}"
>
<!-- Icona Drag Handle -->
<td v-if="isColumnVisible('pos')">
{{
// put index in the first column
internalProducts.indexOf(element) + 1
}}
</td>
<td
v-if="isColumnVisible('drag')"
class="drag-handle"
@@ -85,6 +99,9 @@
<td v-if="isColumnVisible('catprods')">{{ tools.formatCatProds(element.productInfo?.catprods) }}</td>
<!-- Collana -->
<td v-if="isColumnVisible('idCollana')">{{ tools.formatCollane(element.productInfo?.idCollana) }}</td>
<td v-if="isColumnVisible('stato')">
{{ products.getDescrStatiProdottoByIdStatoProdotto(element.productInfo.idStatoProdotto || '') }}
</td>
<td v-if="isColumnVisible('date_pub')">{{ tools.getstrDate(element.productInfo?.date_pub) }}</td>
@@ -240,7 +257,10 @@
nameTable: 'T_Web_Articoli',
campispeciali: true,
numrec: 1,
where: 'T.IdArticolo =' + selProd.productInfo.sku + ' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;',
where:
'T.IdArticolo =' +
selProd.productInfo.sku +
' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;',
showQtaDisponibile,
outhtml: true,
}"

View File

@@ -419,7 +419,7 @@ export default defineComponent({
async function refreshDataFromGM() {
if (myproduct.value) {
loading.value = true
const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!)
const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!, myproduct.value.isbn)
if (ris) {
await updateproduct(false)