- Raccolte Cataloghi corretto e migliorato.
- Bottoni "Apri" e "PDF".
This commit is contained in:
@@ -213,7 +213,11 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
const onlyCatalogoPDF = computed(() => {
|
||||
return optcatalogo.value.showOnlyCatalogoPDF;
|
||||
return optcatalogo.value.showOnlyCatalogoPDF || $route.query?.hideHeader;
|
||||
});
|
||||
|
||||
const mostraTuttiITab = computed(() => {
|
||||
return !onlyCatalogoPDF.value;
|
||||
});
|
||||
|
||||
const showListaFiltrata = computed(() => {
|
||||
@@ -577,6 +581,15 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function esistePagIntroduttiva(): boolean {
|
||||
for (const recscheda of optcatalogo.value.arrSchede!) {
|
||||
if (recscheda.scheda?.isPagIntro) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const getImgIntroCatalogo = (scheda: IMyScheda): IImg => {
|
||||
const trovatocatalogo = myCatalog.value;
|
||||
|
||||
@@ -1003,7 +1016,7 @@ export default defineComponent({
|
||||
return arrris;
|
||||
}
|
||||
|
||||
async function calcArrProducts(generalista?: boolean, salva_listatemp: boolean) {
|
||||
async function calcArrProducts(generalista?: boolean, salva_listatemp?: boolean) {
|
||||
// console.log('calcArrProducts (generalista=' + generalista + ')');
|
||||
|
||||
if (generalista) {
|
||||
@@ -1139,7 +1152,7 @@ export default defineComponent({
|
||||
await globalStore.saveTable(mydata);
|
||||
}
|
||||
|
||||
function generaListaLibri() {
|
||||
async function generaListaLibri() {
|
||||
// chiedi prima "Sei sicuro di rigenerare il catalogo?"
|
||||
let risposta_si = false;
|
||||
|
||||
@@ -1154,16 +1167,27 @@ export default defineComponent({
|
||||
message: msg,
|
||||
cancel: true,
|
||||
persistent: false,
|
||||
}).onOk(() => {
|
||||
calcArrProducts(true);
|
||||
}).onOk(async () => {
|
||||
$q.loading.show({
|
||||
message: `Rigenera lista in corso, attendere ...`,
|
||||
});
|
||||
|
||||
await calcArrProducts(true);
|
||||
$q.loading.hide();
|
||||
});
|
||||
}
|
||||
|
||||
function generaListaTempLibri() {
|
||||
async function generaListaTempLibri() {
|
||||
// chiedi prima "Sei sicuro di rigenerare il catalogo?"
|
||||
let risposta_si = false;
|
||||
|
||||
calcArrProducts(true, true);
|
||||
$q.loading.show({
|
||||
message: `Mostra lista, attendere ...`,
|
||||
});
|
||||
|
||||
await calcArrProducts(true, true);
|
||||
|
||||
$q.loading.hide();
|
||||
}
|
||||
|
||||
function reSortList() {
|
||||
@@ -1586,9 +1610,13 @@ export default defineComponent({
|
||||
// controlla se è stato passato l'id dalla pagina:
|
||||
let idcatsel = '';
|
||||
|
||||
if ($route.query.id) idcatsel = $route.query.id as string;
|
||||
if ($route.query.stampa) instampa = $route.query.stampa === '1';
|
||||
else idcatsel = optcatalogo.value.idCatalogSel;
|
||||
if ($route.query.id) {
|
||||
idcatsel = $route.query.id as string;
|
||||
} else {
|
||||
idcatsel = optcatalogo.value.idCatalogSel;
|
||||
}
|
||||
|
||||
instampa = $route.query?.stampa === '1';
|
||||
|
||||
mycat = catalogStore.getCatalogById(idcatsel);
|
||||
} else {
|
||||
@@ -2399,7 +2427,7 @@ export default defineComponent({
|
||||
generaPdfCatalogo(true);
|
||||
};
|
||||
|
||||
const preparePDF = (instampa: boolean, senzachiedere: boolean) => {
|
||||
async function preparePDF(instampa: boolean, senzachiedere = false) {
|
||||
let str = '';
|
||||
if (instampa) {
|
||||
str = 'per la stampa';
|
||||
@@ -2416,7 +2444,7 @@ export default defineComponent({
|
||||
label: t('dialog.cancel'),
|
||||
},
|
||||
title: 'Generazione PDF',
|
||||
}).onOk(async () => {
|
||||
}).onOk(() => {
|
||||
parti = true;
|
||||
});
|
||||
}
|
||||
@@ -2427,8 +2455,8 @@ export default defineComponent({
|
||||
: shared_consts.PREPARA_PDF.WEB;
|
||||
|
||||
arrProducts.value = [];
|
||||
console.log('aggiorna... ');
|
||||
calcArrProducts(false);
|
||||
console.log('aggiorna... ', optcatalogo.value.selectedVersionStampabile);
|
||||
await calcArrProducts(false);
|
||||
updateCatalogoPadre();
|
||||
|
||||
optcatalogo.value.generazionePDFInCorso = true;
|
||||
@@ -2444,10 +2472,15 @@ export default defineComponent({
|
||||
optcatalogo.value.selectedVersionStampabile = instampa
|
||||
? shared_consts.PREPARA_PDF.STAMPA
|
||||
: shared_consts.PREPARA_PDF.WEB;
|
||||
|
||||
console.log(
|
||||
'selectedVersionStampabile',
|
||||
optcatalogo.value.selectedVersionStampabile
|
||||
);
|
||||
}, 500);
|
||||
}, 200);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const terminaPDF = () => {
|
||||
optcatalogo.value.generazionePDFInCorso = false;
|
||||
@@ -2806,6 +2839,8 @@ export default defineComponent({
|
||||
generaListaTempLibri,
|
||||
globalStore,
|
||||
showColorPicker,
|
||||
mostraTuttiITab,
|
||||
esistePagIntroduttiva,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user