- generazione del PDF riscritto totalmente

- ora è possibile generarlo anche da backend
- FIX: corretto la qualità del PDF e la dimensione non esatta in pixel...
This commit is contained in:
Surya Paolo
2025-05-29 18:23:02 +02:00
parent 884afe4eb5
commit 67aaf719f4
32 changed files with 2881 additions and 1748 deletions

View File

@@ -393,7 +393,7 @@ $grigioscuro: rgb(120, 120, 120);
.flex-details_and_barcode {
display: flex; /* Rende il div un container flex per allineare i contenuti */
align-items: center; /* Allineamento verticale al centro */
padding-top: calc(5 * var(--scalecatalog) * 1px);
padding-top: calc(5 * var(--scalecatalogy) * 1px);
justify-content: space-between !important;
flex-grow: 0; /* Opzionale: permette agli elementi di crescere uniformemente */
}

View File

@@ -137,9 +137,20 @@ export default defineComponent({
const field_updated_fromGM = ref('');
const dataextractedWeb = ref('');
const widthoggetto = ref(40)
const heightoggetto = ref(40)
// Crea una copia locale reattiva di modelValue
const optcatalogo = ref<IOptCatalogo>({ ...props.modelValue });
const mywidthogg = computed(() => {
return widthoggetto.value * tools.getScaleX(optcatalogo.value, props.scheda)
})
const myheightogg = computed(() => {
return heightoggetto.value * tools.getScaleY(optcatalogo.value, props.scheda)
})
const editOn = computed({
get(): boolean {
return globalStore.editOn ? globalStore.editOn : false;
@@ -694,12 +705,6 @@ export default defineComponent({
return false;
}
function getScale() {
if (optcatalogo.value.printable)
return optcatalogo.value.areadistampa!.scale_printable;
else return optcatalogo.value.areadistampa!.scale;
}
/*async function refreshDataFromGM() {
if (myproduct.value) {
loading.value = true
@@ -894,7 +899,6 @@ export default defineComponent({
getTesto_Right_attaccato,
getTesto_Bottom,
getTesto_Debug,
getScale,
updateCatalogo,
optcatalogo,
visufromgm,
@@ -911,6 +915,10 @@ export default defineComponent({
loading,
modifTrafiletto,
getDataExtracted,
widthoggetto,
heightoggetto,
mywidthogg,
myheightogg
};
},
});

View File

@@ -2,14 +2,16 @@
<div
v-if="optcatalogo"
:class="{
' items-start q-gutter-sm': true,
' items-start': true,
}"
:style="
scheda.dimensioni?.pagina?.dimensioni?.size?.height
? ' height: ' +
tools.adjustSize(
optcatalogo,
scheda.dimensioni?.pagina?.dimensioni?.size?.height
scheda.dimensioni?.pagina?.dimensioni?.size?.height,
scheda,
false
) +
'px !important; '
: ''
@@ -54,8 +56,7 @@
'flex', // Classi comuni
'image-container',
{ 'shadow-2': options.in_3d && !optcatalogo.pdf }, // Classe condizionale
scheda.testo_right_attaccato.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
? ''
: 'flex flex-row', // Layout flessibile
]"
@@ -63,16 +64,22 @@
gap:
tools.adjustSize(
optcatalogo,
scheda.dimensioni?.scheda_prodotto?.size?.gap
scheda.dimensioni?.scheda_prodotto?.size?.gap,
scheda,
true
) ?? '0.1rem',
width:
tools.adjustSize(
optcatalogo,
scheda.dimensioni?.scheda_prodotto?.size?.width
scheda.dimensioni?.scheda_prodotto?.size?.width,
scheda,
true
) ?? '100%',
height: tools.adjustSize(
optcatalogo,
scheda.dimensioni?.scheda_prodotto?.size?.height
scheda.dimensioni?.scheda_prodotto?.size?.height,
scheda,
false
),
}"
>
@@ -92,9 +99,7 @@
: myproduct.productInfo.image_link
"
:alt="myproduct.productInfo.name"
:fit="
scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'
"
:fit="scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'"
:class="{
'book-image-fixed': complete,
'cursor-pointer': !complete,
@@ -104,24 +109,29 @@
:style="{
zIndex: 2,
width:
scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
scheda.testo_right.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
? (scheda.testo_right.font?.perc_text ?? '50%')
: '45%',
...(tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.width
scheda.dimensioni?.immagine_prodotto?.size?.width,
scheda,
true
) && {
width:
tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto.size?.width
scheda.dimensioni?.immagine_prodotto.size?.width,
scheda,
true
) + ' !important',
}),
height: scheda.dimensioni?.immagine_prodotto?.size?.height
? tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.height
scheda.dimensioni?.immagine_prodotto?.size?.height,
scheda,
false
)
: undefined,
display: 'block',
@@ -129,7 +139,14 @@
@click="click_opendetail()"
/>
</a>
<div class="q-ma-sm no-print">
<div
v-if="
(tools.isManager() || tools.isEditor()) &&
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
"
class="no-print"
>
<div
class="row absolute-top-left semi-transparent"
style="z-index: 10"
@@ -212,8 +229,7 @@
</q-item>-->
<q-item
v-if="
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
!optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
"
clickable
v-close-popup
@@ -316,8 +332,7 @@
</q-item>
<q-item
v-if="
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
!optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
"
clickable
v-close-popup
@@ -331,10 +346,7 @@
/>
</q-item-section>
<q-item-section>
<q-item-label
>Visualizza dati Estrapolati (dal WEB
Esterno)</q-item-label
>
<q-item-label>Visualizza dati Estrapolati (dal WEB Esterno)</q-item-label>
</q-item-section>
</q-item>
@@ -380,10 +392,7 @@
/>
</q-item-section>
<q-item-section>
<q-item-label
>Visualizza su GM (con le Quantità in
Magazzino)</q-item-label
>
<q-item-label>Visualizza su GM (con le Quantità in Magazzino)</q-item-label>
</q-item-section>
</q-item>
</q-list>
@@ -401,19 +410,14 @@
:idPage="idPage"
>
<div
v-if="
scheda.testo_right_attaccato.font?.posiz_text !==
costanti.POSIZ_TESTO.IN_BASSO
"
v-if="scheda.testo_right_attaccato.font?.posiz_text !== costanti.POSIZ_TESTO.IN_BASSO"
:style="{
alignSelf:
scheda.testo_right_attaccato.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
? ''
: 'center',
marginTop:
scheda.testo_right_attaccato.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
? 'auto'
: '0',
}"
@@ -432,54 +436,37 @@
:value="myproduct.productInfo.code"
:format="scheda.barcode.format"
:fontsizeprop="scheda.barcode.font?.size"
:gap="
tools.adjustSize(optcatalogo, scheda.barcode.size?.gap)
"
:gap="tools.adjustSize(optcatalogo, scheda.barcode.size?.gap, scheda, true)"
:width="
parseInt(
tools.adjustSize(
optcatalogo,
scheda.barcode.size?.width
)
tools.adjustSize(optcatalogo, scheda.barcode.size?.width, scheda, true)
)
"
:widthlines="
tools.adjustSize(optcatalogo, scheda.barcode.widthlines)
tools.adjustSize(optcatalogo, scheda.barcode.widthlines, scheda, true)
"
:height="
tools.adjustSize(
optcatalogo,
scheda.barcode.size?.height
)
tools.adjustSize(optcatalogo, scheda.barcode.size?.height, scheda, false)
"
:show_at_right="scheda.barcode?.show_at_right"
>
</CBarCode>
</div>
<div
v-if="
scheda.etichette?.bestseller?.show &&
isProductBestseller()
"
>
<div v-if="scheda.etichette?.bestseller?.show && isProductBestseller()">
<q-img
src="/images/bestseller.png"
alt="Bestseller"
:width="40 * tools.getScale(optcatalogo) + 'px'"
:height="40 * tools.getScale(optcatalogo) + 'px'"
:width="mywidthogg + 'px'"
:height="myheightogg + 'px'"
fit="contain"
></q-img>
</div>
<div
v-else-if="
scheda.etichette?.novita?.show && isProductNovita()
"
>
<div v-else-if="scheda.etichette?.novita?.show && isProductNovita()">
<q-img
src="/images/novita.png"
alt="Novita"
:width="40 * tools.getScale(optcatalogo) + 'px'"
:height="40 * tools.getScale(optcatalogo) + 'px'"
:width="mywidthogg + 'px'"
:height="myheightogg + 'px'"
fit="contain"
></q-img>
</div>
@@ -488,10 +475,7 @@
</div>
</CText>
<div
v-if="
scheda.testo_right_attaccato.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
"
v-if="scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO"
class="flexible-width"
:style="{
marginTop: 'auto',
@@ -511,50 +495,37 @@
:value="myproduct.productInfo.code"
:format="scheda.barcode.format"
:fontsizeprop="scheda.barcode.font?.size"
:gap="
tools.adjustSize(optcatalogo, scheda.barcode.size?.gap)
"
:gap="tools.adjustSize(optcatalogo, scheda.barcode.size?.gap, scheda, true)"
:width="
parseInt(
tools.adjustSize(
optcatalogo,
scheda.barcode.size?.width
)
tools.adjustSize(optcatalogo, scheda.barcode.size?.width, scheda, true)
)
"
:widthlines="
tools.adjustSize(optcatalogo, scheda.barcode.widthlines)
tools.adjustSize(optcatalogo, scheda.barcode.widthlines, scheda, true)
"
:height="
tools.adjustSize(optcatalogo, scheda.barcode.size?.height)
tools.adjustSize(optcatalogo, scheda.barcode.size?.height, scheda, false)
"
:show_at_right="scheda.barcode.show_at_right"
>
</CBarCode>
</div>
<div
v-if="
scheda.etichette?.bestseller?.show && isProductBestseller()
"
>
<div v-if="scheda.etichette?.bestseller?.show && isProductBestseller()">
<q-img
src="/images/bestseller.png"
alt="Bestseller"
:width="40 * tools.getScale(optcatalogo) + 'px'"
:height="40 * tools.getScale(optcatalogo) + 'px'"
:width="mywidthogg + 'px'"
:height="myheightogg + 'px'"
fit="contain"
></q-img>
</div>
<div
v-else-if="
scheda.etichette?.novita?.show && isProductNovita()
"
>
<div v-else-if="scheda.etichette?.novita?.show && isProductNovita()">
<q-img
src="/images/novita.png"
alt="Novita"
:width="40 * tools.getScale(optcatalogo) + 'px'"
:height="40 * tools.getScale(optcatalogo) + 'px'"
:width="mywidthogg + 'px'"
:height="myheightogg + 'px'"
fit="contain"
></q-img>
</div>
@@ -570,7 +541,8 @@
>
<div
:style="{
'--scalecatalog': tools.getScale(optcatalogo),
'--scalecatalogx': tools.getScaleX(optcatalogo, scheda),
'--scalecatalogy': tools.getScaleY(optcatalogo, scheda),
'line-height': scheda.testo_bottom.font?.line_height,
}"
v-html="getTesto_Debug"
@@ -651,14 +623,10 @@
</div>
</td>
<td class="text-center">
<strong>{{
tools.getNomeUtenteEUsernameByRecUser(ordcart.user)
}}</strong>
<strong>{{ tools.getNomeUtenteEUsernameByRecUser(ordcart.user) }}</strong>
</td>
<td class="text-center">
<strong>{{
shared_consts.getStatusStr(ordcart.status)
}}</strong>
<strong>{{ shared_consts.getStatusStr(ordcart.status) }}</strong>
</td>
<td class="text-center">
<div
@@ -667,8 +635,7 @@
>
<span
v-if="
singleord.order.idProduct === myproduct._id &&
singleord.order.quantity > 0
singleord.order.idProduct === myproduct._id && singleord.order.quantity > 0
"
>
{{ singleord.order.quantity }}</span
@@ -703,12 +670,7 @@
</q-dialog>
<q-dialog
v-if="
true &&
myproduct &&
myproduct.productInfo &&
myproduct.productInfo.link_scheda
"
v-if="true && myproduct && myproduct.productInfo && myproduct.productInfo.link_scheda"
v-model="apriSchedaPDF"
maximized
>
@@ -745,12 +707,7 @@
</q-dialog>
<q-dialog
v-if="
false &&
myproduct &&
myproduct.productInfo &&
myproduct.productInfo.link_scheda
"
v-if="false && myproduct && myproduct.productInfo && myproduct.productInfo.link_scheda"
v-model="apriSchedaPDF"
fullscreen
>