- Aggiunto bottone Aggiungi al Carrello sulla lista dei libri dei cataloghi

This commit is contained in:
Surya Paolo
2025-06-06 00:07:47 +02:00
parent 06fe6eb861
commit 664975b1fd
36 changed files with 1110 additions and 751 deletions

View File

@@ -317,10 +317,12 @@ export default defineComponent({
const tabvisu = ref('categorie');
const tabcatalogo = ref('visu');
const tabgen = ref('condizioni');
const searchList = ref([] as ISearchList[]);
const arrProducts = ref<IProduct[]>([]);
const arrListaTemporanea = ref<IProduct[]>([]);
const arrProdToView = ref<IProdView[]>([]);
const numRecLoaded = ref(0);
@@ -1000,7 +1002,7 @@ export default defineComponent({
return arrris;
}
async function calcArrProducts(generalista?: boolean) {
async function calcArrProducts(generalista?: boolean, salva_listatemp: boolean) {
// console.log('calcArrProducts (generalista=' + generalista + ')');
if (generalista) {
@@ -1089,31 +1091,35 @@ export default defineComponent({
salva = true;
}
arrProducts.value = arrprod;
if (salva_listatemp) {
arrListaTemporanea.value = arrprod;
} else {
arrProducts.value = arrprod;
// console.log('arrprod', arrprod)
optcatalogo.value = productStore.populateDataWithlinkIdTemplate(
optcatalogo.value
);
optcatalogo.value = productStore.populateDataWithlinkIdTemplate(optcatalogo.value);
// Ordina la lista
generatearrProdToViewSorted(!generalista, salva, !showListaFiltrata.value);
loaddata();
// Ordina la lista
generatearrProdToViewSorted(!generalista, salva, !showListaFiltrata.value);
loaddata();
if (generalista) {
const catalog = myCatalog.value;
if (catalog && !showListaFiltrata.value) {
catalog.data_lista_generata = tools.getDateNow();
catalog.username_lista_generata = userStore.my.username;
await saveCatalog();
if (generalista) {
const catalog = myCatalog.value;
if (catalog && !showListaFiltrata.value) {
catalog.data_lista_generata = tools.getDateNow();
catalog.username_lista_generata = userStore.my.username;
await saveCatalog();
}
}
}
// console.log('***** FINE calcArrPROD');
// console.log('areadistampa FINITO...', optcatalogo.value.areadistampa)
generatinglist.value = false;
rigeneraLibri.value = false;
if (!salva_listatemp) {
rigeneraLibri.value = false;
} else {
tabgen.value = 'generato'
}
}
async function saveCatalog() {
@@ -1146,6 +1152,13 @@ export default defineComponent({
});
}
function generaListaTempLibri() {
// chiedi prima "Sei sicuro di rigenerare il catalogo?"
let risposta_si = false;
calcArrProducts(true, true);
}
function reSortList() {
let risposta_si = false;
@@ -1344,12 +1357,12 @@ export default defineComponent({
salva?: boolean,
salvasudb?: boolean
) {
console.log(
/*console.log(
'generatearrProdToViewSorted... usaprodottiSalvati=',
usaprodottiSalvati,
' salva=',
salva
);
);*/
try {
// Svuota
@@ -2922,6 +2935,7 @@ export default defineComponent({
componentToFixRef,
isFixed,
arrProducts,
arrListaTemporanea,
show_hide,
onLoadScroll,
numRecLoaded,
@@ -2996,6 +3010,8 @@ export default defineComponent({
isStampa,
onlyCatalogoPDF,
updatecatalogmodif,
tabgen,
generaListaTempLibri,
};
},
});