- aggiornato la visualoizzazione per scaricare il PDF e per aprirlo
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
:prop_mytable="table"
|
||||
:options="tools.optionsTable(table)"
|
||||
:prop_mytitlenew="tools.getTitleAnnuncio(table)"
|
||||
prop_mytitle="Cataloghi"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="col"
|
||||
:prop_colkey="prop_colkey"
|
||||
:col_title="col_title"
|
||||
|
||||
@@ -524,6 +524,7 @@
|
||||
row: opt.rowclass,
|
||||
'items-stretch': opt.rowclass,
|
||||
'justify-evenly': opt.rowclass,
|
||||
'q-col-gutter-y-md': opt.rowclass,
|
||||
}"
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
<q-card
|
||||
v-if="myrec"
|
||||
bordered
|
||||
class="full-height flex flex-column justify-evenly"
|
||||
:style="`width: ` + opt.widthcard + `; ` + (opt.heightcard ? `height: ` + opt.heightcard + `;` : '')"
|
||||
class="full-height justify-evenly catalog-card"
|
||||
:style="
|
||||
`width: ` +
|
||||
opt.widthcard +
|
||||
`; ` +
|
||||
(opt.heightcard ? `height: ` + opt.heightcard + `;` : '')
|
||||
"
|
||||
>
|
||||
<q-img
|
||||
:width="opt.widthimg"
|
||||
@@ -14,29 +19,38 @@
|
||||
:src="tools.getFullFileName([myrec.foto_collana], table, '', myrec._id)"
|
||||
>
|
||||
<template v-slot:error>
|
||||
<div class="absolute-full flex flex-center text-white">immagine non impostata</div>
|
||||
<div class="absolute-full flex flex-center text-white">
|
||||
immagine non impostata
|
||||
</div>
|
||||
</template>
|
||||
<!--<div class="text-h6 absolute-bottom text-left">
|
||||
{{ myrec.title }}
|
||||
</div>-->
|
||||
</q-img>
|
||||
|
||||
<q-card-section class="q-px-sm" style="margin-top: 0; flex-grow: 0; align-self: flex-start;">
|
||||
|
||||
<q-card-section
|
||||
class="q-px-sm"
|
||||
style="margin-top: 0; flex-grow: 0; align-self: flex-start"
|
||||
>
|
||||
<div
|
||||
class="q-mb-md text-center text-bold"
|
||||
style="font-size: 1.15rem"
|
||||
>
|
||||
<a
|
||||
:href="pagina_collegata"
|
||||
target="_blank"
|
||||
>{{ myrec.title }}</a
|
||||
>
|
||||
<div class="q-mb-md text-center text-bold">
|
||||
<span
|
||||
class="text-link"
|
||||
@click="naviga(pagina_collegata)"
|
||||
>
|
||||
{{ myrec.title }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-px-md">
|
||||
<div class="text-caption text-h7 text-grey q-pb-xs">
|
||||
<q-icon name="fas fa-list-ol" /> {{ $t('cataloglist.numprodotti') }}:
|
||||
<span :class="`text-` + (numprodottistr === 0 ? 'red' : 'blue')">{{ numprodottistr }}</span>
|
||||
<q-icon name="fas fa-list-ol" /> {{ $t('cataloglist.numprodotti') }}:
|
||||
<span :class="`text-` + (numprodottistr === 0 ? 'red' : 'blue')">{{
|
||||
numprodottistr
|
||||
}}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="!tools.isUtente() && dettagli"
|
||||
@@ -45,7 +59,11 @@
|
||||
<q-icon name="fas fa-user" /> {{ $t('cataloglist.referenti') }}:
|
||||
<span
|
||||
v-if="myrec.referenti && myrec.referenti.length > 0"
|
||||
:class="`text-bold ` + myrec.referenti && myrec.referenti.length > 0 ? 'text-blue' : 'text-red'"
|
||||
:class="
|
||||
`text-bold ` + myrec.referenti && myrec.referenti.length > 0
|
||||
? 'text-blue'
|
||||
: 'text-red'
|
||||
"
|
||||
>
|
||||
{{ myrec.referenti ? myrec.referenti.join(', ') : '' }}
|
||||
</span>
|
||||
@@ -103,18 +121,14 @@
|
||||
</div>
|
||||
<div
|
||||
v-if="myrec.pdf_online"
|
||||
class="text-caption text-h7 text-blue q-pb-xs"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-book" />
|
||||
<a
|
||||
:href="myrec.pdf_online"
|
||||
target="_blank"
|
||||
>PDF OnLine</a
|
||||
>
|
||||
aggiornato al ({{ tools.getstrDate(myrec.data_online) }})
|
||||
<q-icon name="fas fa-book" /> Aggiornato al ({{
|
||||
tools.getstrDate(myrec.data_online)
|
||||
}})
|
||||
</div>
|
||||
<div
|
||||
v-if="!tools.isUtente() && myrec.pdf_online_stampa && dettagli"
|
||||
v-if="!tools.isUtente() && myrec.pdf_online_stampa && dettagli"
|
||||
class="text-caption text-h7 text-blue q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-print" />
|
||||
@@ -130,8 +144,12 @@
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-list" /> Lista generata il:
|
||||
<span :class="`text-` + (tools.isDateValid(myrec.data_lista_generata) ? 'blue' : 'red')"
|
||||
>{{ tools.getstrDate(myrec.data_lista_generata) || '(non ancora generata)' }} da
|
||||
<span
|
||||
:class="
|
||||
`text-` + (tools.isDateValid(myrec.data_lista_generata) ? 'blue' : 'red')
|
||||
"
|
||||
>{{ tools.getstrDate(myrec.data_lista_generata) || '(non ancora generata)' }}
|
||||
da
|
||||
{{ myrec.username_lista_generata }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -140,11 +158,34 @@
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions
|
||||
v-if="!tools.isUtente() && dettagli"
|
||||
align="center"
|
||||
class="q-mt-auto q-mx-auto q-mb-sm"
|
||||
>
|
||||
<q-btn
|
||||
v-if="myrec.pdf_online"
|
||||
unelevated
|
||||
rounded
|
||||
color="primary"
|
||||
icon="fas fa-file-pdf"
|
||||
:label="`Apri PDF`"
|
||||
:href="tools.getURLByHostAndFilePath(myrec.pdf_online)"
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="myrec.pdf_online"
|
||||
unelevated
|
||||
rounded
|
||||
color="primary"
|
||||
icon="download"
|
||||
:label="`Scarica PDF`"
|
||||
:href="tools.getURLByHostAndFilePath(myrec.pdf_online)"
|
||||
download
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
/>
|
||||
<q-fab
|
||||
v-if="!tools.isUtente() && dettagli"
|
||||
color="primary"
|
||||
icon="fas fa-caret-down"
|
||||
label="Menu"
|
||||
@@ -182,13 +223,13 @@
|
||||
icon="fas fa-pencil-alt"
|
||||
/>
|
||||
</q-fab>
|
||||
<q-btn
|
||||
<!--<q-btn
|
||||
flat
|
||||
color="primary"
|
||||
label="Info"
|
||||
icon="fas fa-info"
|
||||
@click="apriInfo = true"
|
||||
/>
|
||||
/>-->
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
|
||||
@@ -214,9 +255,15 @@
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:value="myrec.referenti && myrec.referenti.length > 0 ? myrec.referenti.join(', ') : '[Non Assegnato]'"
|
||||
:value="
|
||||
myrec.referenti && myrec.referenti.length > 0
|
||||
? myrec.referenti.join(', ')
|
||||
: '[Non Assegnato]'
|
||||
"
|
||||
:label="$t('cataloglist.referenti') + `:`"
|
||||
:color="myrec.referenti && myrec.referenti.length > 0 ? 'text-blue' : 'text-red'"
|
||||
:color="
|
||||
myrec.referenti && myrec.referenti.length > 0 ? 'text-blue' : 'text-red'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -256,8 +303,9 @@
|
||||
>
|
||||
<CLabel
|
||||
:value="
|
||||
tools.getstrDate(myrec.data_lista_generata) + ' da ' + myrec.username_lista_generata ||
|
||||
'ancora non è stata generata'
|
||||
tools.getstrDate(myrec.data_lista_generata) +
|
||||
' da ' +
|
||||
myrec.username_lista_generata || 'ancora non è stata generata'
|
||||
"
|
||||
label="Lista generata"
|
||||
:color="myrec.pdf_generato ? 'green' : 'red'"
|
||||
|
||||
@@ -422,7 +422,6 @@ export default defineComponent({
|
||||
label: 'Magazz.',
|
||||
field: 'quantity',
|
||||
align: 'right',
|
||||
visu: costanti.VISUCAMPI.PER_EDITORE,
|
||||
},
|
||||
{
|
||||
name: 'actions',
|
||||
@@ -437,7 +436,7 @@ export default defineComponent({
|
||||
|
||||
const allColumnsComputed = computed(() => {
|
||||
return allColumns.value.filter(
|
||||
(col) => !col.visu || col.visu === costanti.VISUCAMPI.PER_TUTTI
|
||||
(col) => !col.visu || col.visu === costanti.VISUCAMPI.PER_TUTTI || (col.visu === costanti.VISUCAMPI.PER_EDITORE && tools.isCollaboratore())
|
||||
);
|
||||
});
|
||||
|
||||
@@ -448,6 +447,7 @@ export default defineComponent({
|
||||
if (props.table === shared_consts.TABLES_CATALOG) {
|
||||
selectedColumns.value = selectedColumns_Catalogs.value;
|
||||
} else {
|
||||
// "products"
|
||||
selectedColumns.value = tools.isUtente()
|
||||
? selectedColumns_Utenti.value
|
||||
: selectedColumns_Editori.value;
|
||||
|
||||
@@ -10351,6 +10351,22 @@ export const tools = {
|
||||
);
|
||||
},
|
||||
|
||||
isCollStampa() {
|
||||
const userStore = useUserStore();
|
||||
return (userStore.isGrafico || userStore.isAdmin)
|
||||
},
|
||||
|
||||
isCollaboratore() {
|
||||
const userStore = useUserStore();
|
||||
|
||||
return (
|
||||
userStore.isEditor ||
|
||||
userStore.isCommerciale ||
|
||||
userStore.isAdmin ||
|
||||
userStore.isManager || userStore.isGrafico
|
||||
);
|
||||
},
|
||||
|
||||
getsearchList_RaccoltaCataloghi() {
|
||||
const lista = [
|
||||
{
|
||||
|
||||
@@ -186,4 +186,61 @@ body {
|
||||
font-weight: 600;
|
||||
border-color: #5c8ef4 !important;
|
||||
box-shadow: 0 0 0 2px rgba(92, 142, 244, 0.3);
|
||||
}
|
||||
|
||||
.pdf-link {
|
||||
font-family: 'Arial', sans-serif;
|
||||
font-size: 1.1rem;
|
||||
color: #1a3f8a;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
color: #5c8ef4;
|
||||
}
|
||||
}
|
||||
|
||||
.intestaz-col {
|
||||
font-size: 1.10rem;
|
||||
}
|
||||
|
||||
.catalog-download-section {
|
||||
padding: 2rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.catalog-card {
|
||||
border-radius: 16px;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
transition: transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.catalog-card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.hover-lift {
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.hover-lift:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.text-link{
|
||||
font-family: 'Arial', sans-serif;
|
||||
font-size: 1.1rem;
|
||||
color: #1a3f8a;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
color: #5c8ef4;
|
||||
}
|
||||
}
|
||||
@@ -124,8 +124,13 @@ export default defineComponent({
|
||||
{ name: 'azioni', label: 'Azioni', field: 'azioni', align: 'center' },
|
||||
];
|
||||
|
||||
const pdfRows = computed(() => [
|
||||
const pdfRows = computed(() => {
|
||||
return pdfRowsall.value.filter((row) => row.visible);
|
||||
});
|
||||
|
||||
const pdfRowsall = computed(() => [
|
||||
{
|
||||
visible: true,
|
||||
name: 'PDF Generato',
|
||||
pdf: myCatalog.value.pdf_generato,
|
||||
data: myCatalog.value.data_generato,
|
||||
@@ -135,15 +140,17 @@ export default defineComponent({
|
||||
action: () => pubblicaPDF(false),
|
||||
},
|
||||
{
|
||||
visible: true,
|
||||
name: 'PDF Generato (Compresso)',
|
||||
pdf: myCatalog.value.pdf_generato_compressed,
|
||||
data: myCatalog.value.data_generato,
|
||||
showButton: true,
|
||||
buttonLabel: 'Pubblica PDF OnLine (Compr)',
|
||||
buttonLabel: 'Pubblica PDF Compresso',
|
||||
size: myCatalog.value.pdf_generato_compr_size,
|
||||
action: () => pubblicaPDF(true),
|
||||
},
|
||||
{
|
||||
visible: tools.isCollStampa(),
|
||||
name: 'PDF Generato Stampa',
|
||||
pdf: myCatalog.value.pdf_generato_stampa,
|
||||
data: myCatalog.value.data_generato_stampa,
|
||||
@@ -153,11 +160,12 @@ export default defineComponent({
|
||||
action: () => pubblicaPDFStampa(false),
|
||||
},
|
||||
{
|
||||
visible: tools.isCollStampa(),
|
||||
name: 'PDF Generato Stampa (Compresso)',
|
||||
pdf: myCatalog.value.pdf_generato_stampa_compressed,
|
||||
data: myCatalog.value.data_generato_stampa,
|
||||
showButton: true,
|
||||
buttonLabel: 'Pubblica PDF Stampa (Compr)',
|
||||
buttonLabel: 'Pubblica PDF Stampa (Compresso)',
|
||||
size: myCatalog.value.pdf_generato_stampa_compr_size,
|
||||
action: () => pubblicaPDFStampa(true),
|
||||
},
|
||||
@@ -326,7 +334,8 @@ export default defineComponent({
|
||||
() => tabcatalogo.value,
|
||||
() => {
|
||||
if (!onlyCatalogoPDF.value) {
|
||||
tools.setCookie('TAB_CAT', tabcatalogo.value);
|
||||
if (tabcatalogo.value === 'lista' || tabcatalogo.value === 'visu')
|
||||
tools.setCookie('TAB_CAT', tabcatalogo.value);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -2534,7 +2543,6 @@ export default defineComponent({
|
||||
idCatalog: myCatalog.value._id,
|
||||
stampa: instampa,
|
||||
comprimi: true,
|
||||
compressione: 'printer',
|
||||
path: 'upload/cataloghi/',
|
||||
// idtag_pdfcontent: 'tag-catalogo',
|
||||
compressione: 'printer',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user