- Aggiornamento dal DB di GM al DB Locale

This commit is contained in:
Surya Paolo
2025-04-16 23:28:21 +02:00
parent 383e0bb484
commit 14375d6b15
13 changed files with 118 additions and 21 deletions

View File

@@ -115,7 +115,6 @@ export default defineComponent({
const apriSchedaPDF = ref(false)
const visufromgm = ref(false)
const updatelocaldb = ref(false)
const updatefromgm = ref(false)
const updatetogm = ref(false)
const showQtaDisponibile = ref(false)
@@ -659,6 +658,22 @@ export default defineComponent({
loading.value = false
}
}
async function refreshAllDataBookFromGM() {
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!)
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 refreshFieldFromGM(field: string) {
if (myproduct.value) {
@@ -744,8 +759,8 @@ export default defineComponent({
refreshFieldFromGM,
updatetogm,
refreshDataFromGM,
refreshAllDataBookFromGM,
loading,
updatelocaldb,
}
}
})

View File

@@ -157,6 +157,25 @@
<q-item-label>Carica 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()"
>
<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 Tutto 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)
@@ -209,7 +228,6 @@
@click="
showQtaDisponibile = true;
visufromgm = true;
updatelocaldb = false;
"
>
<q-item-section avatar>
@@ -599,7 +617,7 @@
:options="{
nameTable: 'T_Web_Articoli',
campispeciali: true,
numrec: 100,
numrec: 1,
where: 'T.IdArticolo =' + myproduct.productInfo.sku,
showQtaDisponibile,
outhtml: true,

View File

@@ -1713,7 +1713,7 @@
multiple
emit-value
map-options
option-value="idCollana"
option-value="_id"
option-label="title"
>
</q-select>

View File

@@ -111,8 +111,9 @@ export default defineComponent({
collanestr.value = ''
if (myrec.value.idCollane) {
for (const idcollana of myrec.value.idCollane) {
const reccoll: ICollana = products.collane!.find((coll: ICollana) => coll.idCollana === idcollana)
collanestr.value += reccoll.title + ' '
const reccoll: ICollana = products.collane!.find((coll: ICollana) => coll._id === idcollana)
if (reccoll)
collanestr.value += reccoll.title + ' '
}
}
argomentistr.value = ''

View File

@@ -52,7 +52,7 @@ export default defineComponent({
},
setup(props, { emit }) {
// Copia locale della lista_prodotti per manipolazione interna
const internalProducts = ref([...props.lista_prodotti]);
const internalProducts = ref([...props.lista_prodotti || []]);
const { t } = useI18n()
@@ -108,6 +108,7 @@ export default defineComponent({
{ name: "authors", label: "Autore", field: "authors", align: "left" },
{ 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: "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" },
@@ -116,6 +117,7 @@ export default defineComponent({
{ name: "pagine", label: "Pag.", field: "pagine", align: "right" },
{ name: "totVen", label: "Venduti", field: "totVen", align: "right" },
{ name: "totFat", label: "Fattur.", field: "totFat", align: "right" },
{ name: "fatLast6M", label: "Fat 6M", field: "fatLast6M", align: "right" },
{ name: "ult_ord", label: "Ult. Ordine", field: "ult_ord", align: "left" },
{ name: "quantity", label: "Magazz.", field: "quantity", align: "right" },
{ name: "isbn", label: "ISBN", field: "isbn", align: "left" },

View File

@@ -83,6 +83,8 @@
<!-- Argomento -->
<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('date_pub')">{{ tools.getstrDate(element.productInfo?.date_pub) }}</td>
@@ -124,6 +126,12 @@
>
{{ element.productInfo?.totFat }}
</td>
<td
v-if="isColumnVisible('fatLast6M')"
style="text-align: right"
>
{{ element.productInfo?.fatLast6M }}
</td>
<td v-if="isColumnVisible('ult_ord')">{{ tools.getstrDate(element.productInfo?.dataUltimoOrdine) }}</td>
<!-- Quantità -->
@@ -231,8 +239,8 @@
:options="{
nameTable: 'T_Web_Articoli',
campispeciali: true,
numrec: 100,
where: 'T.IdArticolo =' + selProd.productInfo.sku,
numrec: 1,
where: 'T.IdArticolo =' + selProd.productInfo.sku + ' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;',
showQtaDisponibile,
outhtml: true,
}"