- prima bozza catalogo
This commit is contained in:
@@ -512,6 +512,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function click_opendetail(id: any, autore: any) {
|
function click_opendetail(id: any, autore: any) {
|
||||||
|
if (!props.optcatalogo.pdf)
|
||||||
emit('opendetail')
|
emit('opendetail')
|
||||||
}
|
}
|
||||||
function escludiArticolo(variazione: IVariazione) {
|
function escludiArticolo(variazione: IVariazione) {
|
||||||
|
|||||||
@@ -104,6 +104,7 @@
|
|||||||
),
|
),
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
<a :href="myproduct.productInfo.link_macro" target="_blank">
|
||||||
<q-img
|
<q-img
|
||||||
v-if="myproduct.productInfo"
|
v-if="myproduct.productInfo"
|
||||||
:src="
|
:src="
|
||||||
@@ -149,6 +150,23 @@
|
|||||||
}"
|
}"
|
||||||
@click="click_opendetail()"
|
@click="click_opendetail()"
|
||||||
/>
|
/>
|
||||||
|
</a>
|
||||||
|
<span v-if="false && !optcatalogo.generazionePDFInCorso && editOn" class="prod_disp">
|
||||||
|
<CMyValueDb
|
||||||
|
v-if="editOn"
|
||||||
|
:editOn="editOn"
|
||||||
|
:title="t('products.stockQty')"
|
||||||
|
table="products"
|
||||||
|
:id="myproduct._id"
|
||||||
|
:rec="myproduct"
|
||||||
|
mykey="stockQty"
|
||||||
|
debounce="1000"
|
||||||
|
:save="updateproductmodif()"
|
||||||
|
:type="costanti.FieldType.number"
|
||||||
|
>
|
||||||
|
</CMyValueDb>
|
||||||
|
</span>
|
||||||
|
|
||||||
<!-- Testo associato all'immagine -->
|
<!-- Testo associato all'immagine -->
|
||||||
<div
|
<div
|
||||||
:style="{
|
:style="{
|
||||||
@@ -209,21 +227,29 @@
|
|||||||
>
|
>
|
||||||
</CBarCode>
|
</CBarCode>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="scheda.etichette?.bestseller?.show && isProductBestseller()">
|
<div
|
||||||
|
v-if="
|
||||||
|
scheda.etichette?.bestseller?.show && isProductBestseller()
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-img
|
<q-img
|
||||||
src="images/bestseller.png"
|
src="images/bestseller.png"
|
||||||
alt="Bestseller"
|
alt="Bestseller"
|
||||||
width="40px"
|
:width="(40 * optcatalogo.areadistampa.scale) + 'px'"
|
||||||
height="40px"
|
:height="(40 * optcatalogo.areadistampa.scale) + 'px'"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
></q-img>
|
></q-img>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="scheda.etichette?.novita?.show && isProductNovita()">
|
<div
|
||||||
|
v-else-if="
|
||||||
|
scheda.etichette?.novita?.show && isProductNovita()
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-img
|
<q-img
|
||||||
src="images/novita.png"
|
src="images/novita.png"
|
||||||
alt="Novita"
|
alt="Novita"
|
||||||
width="40px"
|
:width="(40 * optcatalogo.areadistampa.scale) + 'px'"
|
||||||
height="40px"
|
:height="(40 * optcatalogo.areadistampa.scale) + 'px'"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
></q-img>
|
></q-img>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
Parole Chiave: {autore} {titolo} {descrizione} {date_pub} {ranking}
|
Parole Chiave: {autore} {titolo} {descrizione} {date_pub} {ranking}
|
||||||
{descrizione_breve_macro} {descrizione_completa_macro} {sottotitolo} {prezzo}
|
{sottotitolo} {prezzo} {descrizione_estesa}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
|
|||||||
@@ -819,6 +819,7 @@ export interface ICatalogo {
|
|||||||
pdf?: boolean
|
pdf?: boolean
|
||||||
pdf_filename?: string
|
pdf_filename?: string
|
||||||
printable?: boolean
|
printable?: boolean
|
||||||
|
generazionePDFInCorso?: boolean
|
||||||
|
|
||||||
first_page?: IDimensioni
|
first_page?: IDimensioni
|
||||||
last_page?: IDimensioni
|
last_page?: IDimensioni
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export interface IProductInfo {
|
|||||||
_id?: any
|
_id?: any
|
||||||
code?: string
|
code?: string
|
||||||
id_wp?: string
|
id_wp?: string
|
||||||
|
sku?: string
|
||||||
name?: string
|
name?: string
|
||||||
description?: string
|
description?: string
|
||||||
department?: string
|
department?: string
|
||||||
|
|||||||
@@ -1310,13 +1310,16 @@ export const useProducts = defineStore('Products', {
|
|||||||
const formato = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].formato : ''
|
const formato = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].formato : ''
|
||||||
const pagine = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].pagine : ''
|
const pagine = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].pagine : ''
|
||||||
|
|
||||||
|
|
||||||
const scale = optcatalogo.printable ? optcatalogo.areadistampa?.scale : 1
|
const scale = optcatalogo.printable ? optcatalogo.areadistampa?.scale : 1
|
||||||
// Crea una mappa di sostituzioni
|
// Crea una mappa di sostituzioni
|
||||||
const replacements = {
|
const replacements = {
|
||||||
'{autore}': autori || '',
|
'{autore}': autori || '',
|
||||||
'{titolo}': myproduct.productInfo.name || '',
|
'{titolo}': myproduct.productInfo.name || '',
|
||||||
'{descrizione}': truncatedDescription || '',
|
'{sottotitolo}': sottotitolo || '',
|
||||||
'{descrizione_estesa}': truncatedlongDescription || '',
|
'{descrizione_da_fdv}': truncatedDescription || '',
|
||||||
|
'{descrizione_estesa_fdv}': truncatedlongDescription || '',
|
||||||
|
'{descrizione_estesa}': descrizione_completa_macro || '',
|
||||||
'{pagine}': pagine || '',
|
'{pagine}': pagine || '',
|
||||||
'{misure}': misure || '',
|
'{misure}': misure || '',
|
||||||
'{date_pub}': date_pub || '',
|
'{date_pub}': date_pub || '',
|
||||||
@@ -1330,7 +1333,6 @@ export const useProducts = defineStore('Products', {
|
|||||||
'{descrizione_completa_macro}': descrizione_completa_macro || '',
|
'{descrizione_completa_macro}': descrizione_completa_macro || '',
|
||||||
'{descrizione_breve_macro}': descrizione_breve_macro || '',
|
'{descrizione_breve_macro}': descrizione_breve_macro || '',
|
||||||
'{link_macro}': link_macro || '',
|
'{link_macro}': link_macro || '',
|
||||||
'{sottotitolo}': sottotitolo || '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Esegue le sostituzioni
|
// Esegue le sostituzioni
|
||||||
|
|||||||
@@ -75,19 +75,25 @@ body {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
margin-top: calc(5 * var(--scalecatalog) * 1px);
|
margin-top: calc(5 * var(--scalecatalog) * 1px);
|
||||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||||
|
font-size: calc(18 * var(--scalecatalog) * 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.book-author {
|
.book-author {
|
||||||
font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
|
font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
|
||||||
|
font-size: calc(16 * var(--scalecatalog) * 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.book-descr {
|
.book-descr {
|
||||||
font-family: 'DINPro-BoldItalic', sans-serif;
|
font-family: 'DINPro-BoldItalic', sans-serif;
|
||||||
|
font-size: calc(12 * var(--scalecatalog) * 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.book-details {
|
.book-details {
|
||||||
font-family: 'DINPro', sans-serif;
|
font-family: 'DINPro', sans-serif;
|
||||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||||
|
font-size: calc(12 * var(--scalecatalog) * 1px);
|
||||||
|
text-align: left !important;
|
||||||
|
margin-left: calc(8 * var(--scalecatalog) * 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -96,6 +102,11 @@ body {
|
|||||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.book-link{
|
||||||
|
font-style: italic;
|
||||||
|
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||||
|
}
|
||||||
|
|
||||||
.book-novita {
|
.book-novita {
|
||||||
font-size: calc(20 * var(--scalecatalog) * 1px);
|
font-size: calc(20 * var(--scalecatalog) * 1px);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getProductsSorted(arrprod: IProduct[], sort: number) {
|
function getProductsSorted(arrprod: IProduct[], sort: number) {
|
||||||
console.log('getProductsSorted', sort)
|
// console.log('getProductsSorted', sort)
|
||||||
if (sort === costanti.SORT_PUBDATE) {
|
if (sort === costanti.SORT_PUBDATE) {
|
||||||
|
|
||||||
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
||||||
@@ -546,7 +546,7 @@ export default defineComponent({
|
|||||||
recscheda.arrProdToShow[pagina][riga] = [];
|
recscheda.arrProdToShow[pagina][riga] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('RANKING: ', result.myrec.indiceRanking!)
|
// console.log('RANKING: ', result.myrec.indiceRanking!)
|
||||||
|
|
||||||
recscheda.arrProdToShow[pagina][riga][col] = result.myrec
|
recscheda.arrProdToShow[pagina][riga][col] = result.myrec
|
||||||
|
|
||||||
@@ -726,12 +726,15 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const generatePDF = async () => {
|
const generatePDF = async () => {
|
||||||
|
//props.optcatalogo.generazionePDFInCorso = true
|
||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
$q.loading.show({
|
$q.loading.show({
|
||||||
message: 'Caricamento immagini e generazione PDF in corso...'
|
message: 'Caricamento immagini e generazione PDF in corso...'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let defaultMargin = 0.1
|
let defaultMargin = 0.1
|
||||||
@@ -795,6 +798,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
await html2pdf().set(opt).from(element).save()
|
await html2pdf().set(opt).from(element).save()
|
||||||
|
|
||||||
|
// props.optcatalogo.generazionePDFInCorso = false
|
||||||
|
|
||||||
$q.loading.hide()
|
$q.loading.hide()
|
||||||
$q.notify({
|
$q.notify({
|
||||||
color: 'positive',
|
color: 'positive',
|
||||||
@@ -987,6 +992,10 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function containsProducts(page: IProduct[][]) {
|
||||||
|
return page && page.length > 0 && page[0] && page[0].length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
|
|
||||||
@@ -1037,6 +1046,7 @@ export default defineComponent({
|
|||||||
getHeightPagina,
|
getHeightPagina,
|
||||||
getStyleRowSeparator,
|
getStyleRowSeparator,
|
||||||
generateStyleByPageDim,
|
generateStyleByPageDim,
|
||||||
|
containsProducts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -282,6 +282,9 @@
|
|||||||
<div
|
<div
|
||||||
v-for="(page, pageIndex) in groupedPages(recscheda)"
|
v-for="(page, pageIndex) in groupedPages(recscheda)"
|
||||||
:key="pageIndex"
|
:key="pageIndex"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="containsProducts(page)"
|
||||||
:class="{
|
:class="{
|
||||||
'fixed-width': getWidthPagina(
|
'fixed-width': getWidthPagina(
|
||||||
optcatalogo,
|
optcatalogo,
|
||||||
@@ -383,7 +386,9 @@
|
|||||||
>
|
>
|
||||||
<q-separator
|
<q-separator
|
||||||
inset
|
inset
|
||||||
:size="tools.adjustSize(optcatalogo, '1px')"
|
:size="
|
||||||
|
tools.adjustSize(optcatalogo, '1px')
|
||||||
|
"
|
||||||
></q-separator>
|
></q-separator>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -391,6 +396,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Righe (row) -->
|
<!-- Righe (row) -->
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<!-- Pagine -->
|
<!-- Pagine -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user