- Raccolte Cataloghi corretto e migliorato.

- Bottoni "Apri" e "PDF".
This commit is contained in:
Surya Paolo
2025-07-06 23:12:56 +02:00
parent 9e95fe622b
commit e7ead2e66a
23 changed files with 612 additions and 324 deletions

View File

@@ -151,9 +151,12 @@ export default defineComponent({
),
{ deep: true };
watch(() => searchText.value, () => {
searchProducts();
});
watch(
() => searchText.value,
() => {
searchProducts();
}
);
const allColumns = ref([]);
@@ -178,6 +181,7 @@ export default defineComponent({
edit: true,
noexp: true,
notsortable: true,
visu: costanti.VISUCAMPI.PER_EDITORE,
},
{
name: 'drag',
@@ -188,6 +192,7 @@ export default defineComponent({
edit: true,
noexp: true,
notsortable: true,
visu: costanti.VISUCAMPI.PER_LOGGATI,
},
{
name: 'image',
@@ -296,6 +301,7 @@ export default defineComponent({
edit: true,
noexp: true,
notsortable: true,
visu: costanti.VISUCAMPI.PER_EDITORE,
},
{
name: 'drag',
@@ -306,6 +312,7 @@ export default defineComponent({
edit: true,
noexp: true,
notsortable: true,
visu: costanti.VISUCAMPI.PER_LOGGATI,
},
{
name: 'validato',
@@ -346,6 +353,7 @@ export default defineComponent({
align: 'center',
noexp: true,
notsortable: true,
visu: costanti.VISUCAMPI.PER_LOGGATI,
},
{ name: 'name', label: 'Titolo', field: 'name', align: 'left' },
{
@@ -396,13 +404,13 @@ export default defineComponent({
align: 'left',
},
{ name: 'pagine', label: 'Pag.', field: 'pagine', align: 'right' },
{ name: 'prezzo', label: '', field: 'prezzo', align: 'right' },
{
{ name: 'prezzo', label: 'Prezzo Intero', field: 'prezzo', align: 'right' },
/*{
name: 'prezzo_sconto',
label: '€ (sconto)',
field: 'prezzo_sconto',
align: 'right',
},
},*/
{
name: 'date_pub',
label: 'Pubblicato',
@@ -464,7 +472,7 @@ export default defineComponent({
},
{
name: 'quantity',
label: 'Magazz.',
label: 'Disponib.',
field: 'quantity',
align: 'right',
},
@@ -484,7 +492,8 @@ export default defineComponent({
(col) =>
!col.visu ||
col.visu === costanti.VISUCAMPI.PER_TUTTI ||
(col.visu === costanti.VISUCAMPI.PER_EDITORE && tools.isCollaboratore())
(col.visu === costanti.VISUCAMPI.PER_EDITORE && tools.isCollaboratore()) ||
(col.visu === costanti.VISUCAMPI.PER_LOGGATI && tools.isLogged())
);
});
@@ -542,7 +551,7 @@ export default defineComponent({
loading.value = false;
}
function getFieldValue(element: any, field: any): any {
function getFieldValue(element: any, field: any, colexport: boolean = false): any {
if (!element) return '';
try {
@@ -664,11 +673,13 @@ export default defineComponent({
case 'prezzo':
// return element.price ? '€ ' + element.price.toFixed(2) : '';
return '€ ' + element.arrvariazioni?.[0]?.price?.toFixed(2);
const add = colexport ? '' : ' '
return '€' + add + element.arrvariazioni?.[0]?.price?.toFixed(2);
case 'prezzo_sconto':
const add2 = colexport ? '' : ' '
// return element.sale_price ? '€ ' + element.sale_price.toFixed(2) : '';
return '€ ' + element.arrvariazioni?.[0]?.sale_price?.toFixed(2);
return '€' + add2 + element.arrvariazioni?.[0]?.sale_price?.toFixed(2);
case 'rank3M':
return element.productInfo?.rank3M;
@@ -884,10 +895,9 @@ export default defineComponent({
const faiConfronto = () => {
return (
Array.isArray(props.lista_prod_confronto) &&
props.lista_prod_confronto.length > 0
Array.isArray(props.lista_prod_confronto) && props.lista_prod_confronto.length > 0
);
}
};
// 3. Funzione per verificare se una colonna è visibile (isColumnVisible)
const isColumnVisible = (column: string, real?: boolean, element?: any) => {
@@ -915,7 +925,7 @@ export default defineComponent({
if (column === 'addtolist') {
if (!faiConfronto()) {
ok = false
ok = false;
}
}
@@ -923,7 +933,7 @@ export default defineComponent({
};
function isElementVisible(col: string, element: any) {
let ok = true
let ok = true;
if (col === 'addtolist') {
if (
@@ -935,7 +945,7 @@ export default defineComponent({
}
}
return ok
return ok;
}
const getColumnLabelByName = (name: string): string => {
@@ -1193,7 +1203,7 @@ export default defineComponent({
const field = { field: col };
return field.field === 'pos'
? internalProducts.value.indexOf(product) + 1
: getFieldValue(product, field);
: getFieldValue(product, field, true);
})
.join('|');
}),