- Raccolte Cataloghi corretto e migliorato.
- Bottoni "Apri" e "PDF".
This commit is contained in:
@@ -180,37 +180,72 @@
|
||||
|
||||
<q-card-actions
|
||||
align="center"
|
||||
class="q-mt-auto q-mx-auto q-mb-sm"
|
||||
class="q-mt-auto q-mx-auto q-mb-xs"
|
||||
>
|
||||
<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, myrec.data_online ? (new Date(myrec.data_online)).getTime() : undefined)"
|
||||
icon="fas fa-external-link-alt"
|
||||
:label="`Apri`"
|
||||
@click="naviga(pagina_collegata)"
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
class="hover-lift q-mx-sm"
|
||||
padding="sm"
|
||||
/>
|
||||
<q-btn
|
||||
<q-fab
|
||||
v-if="myrec.pdf_online"
|
||||
unelevated
|
||||
rounded
|
||||
color="primary"
|
||||
icon="download"
|
||||
:label="`Scarica PDF`"
|
||||
:href="tools.getURLByHostAndFilePath(myrec.pdf_online, myrec.data_online ? (new Date(myrec.data_online)).getTime() : undefined)"
|
||||
download
|
||||
color="accent"
|
||||
icon="fas fa-file-pdf"
|
||||
label="PDF"
|
||||
direction="up"
|
||||
dense
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
/>
|
||||
padding="sm"
|
||||
>
|
||||
<a
|
||||
:href="
|
||||
tools.getURLByHostAndFilePath(
|
||||
myrec.pdf_online,
|
||||
myrec.data_online ? new Date(myrec.data_online).getTime() : undefined
|
||||
)
|
||||
"
|
||||
download
|
||||
>
|
||||
<q-fab-action
|
||||
icon="download"
|
||||
color="positive"
|
||||
label="Scarica PDF"
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
:href="
|
||||
tools.getURLByHostAndFilePath(
|
||||
myrec.pdf_online,
|
||||
myrec.data_online ? new Date(myrec.data_online).getTime() : undefined
|
||||
)
|
||||
"
|
||||
target="_blank"
|
||||
>
|
||||
<q-fab-action
|
||||
icon="fas fa-file-pdf"
|
||||
label="Leggi PDF"
|
||||
color="primary"
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
/>
|
||||
</a>
|
||||
</q-fab>
|
||||
<q-fab
|
||||
v-if="!tools.isUtente() && dettagli"
|
||||
color="primary"
|
||||
icon="fas fa-caret-down"
|
||||
label="Menu"
|
||||
direction="up"
|
||||
outlined
|
||||
flat
|
||||
dense
|
||||
>
|
||||
|
||||
@@ -62,26 +62,39 @@
|
||||
>
|
||||
aggiornato al ({{ tools.getstrDate(myrec.data_online_stampa) }})
|
||||
</div>
|
||||
<div
|
||||
v-if="!tools.isUtente() && dettagli"
|
||||
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
|
||||
{{ myrec.username_lista_generata }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="text-overline text-orange-9">{{collanestr}}</div>-->
|
||||
</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, myrec.data_online ? (new Date(myrec.data_online)).getTime() : undefined)"
|
||||
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, myrec.data_online ? (new Date(myrec.data_online)).getTime() : undefined)"
|
||||
download
|
||||
size="md"
|
||||
class="hover-lift"
|
||||
/>
|
||||
<q-fab
|
||||
v-if="!tools.isUtente() && dettagli"
|
||||
color="primary"
|
||||
icon="fas fa-caret-down"
|
||||
label="Menu"
|
||||
|
||||
@@ -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('|');
|
||||
}),
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
:key="index"
|
||||
>
|
||||
<CMySelect
|
||||
v-if="item.type === costanti.FieldType.select || item.type === costanti.FieldType.select_by_server"
|
||||
v-if="
|
||||
item.type === costanti.FieldType.select ||
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
|
||||
:label="item.value && item.value._id > 0 ? undefined : labelcombo(item)"
|
||||
v-model:value="item.value"
|
||||
@@ -29,7 +32,9 @@
|
||||
:addnone="item.addnone"
|
||||
:focus="focus"
|
||||
:addlast="true"
|
||||
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
|
||||
:tablesel="
|
||||
item.type === costanti.FieldType.select_by_server ? item.tablesel : ''
|
||||
"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
color="primary"
|
||||
myclass=""
|
||||
@@ -69,6 +74,27 @@
|
||||
dense
|
||||
/>
|
||||
</div>
|
||||
<div class="row justify-center q-ma-md">
|
||||
<div v-if="visu === shared_consts.VISU_SEARCHPROD_MODE.INSERT">
|
||||
<q-btn
|
||||
rounded
|
||||
class="q-ma-sm"
|
||||
color="secondary"
|
||||
icon="fas fa-plus"
|
||||
label="Inserisci"
|
||||
@click="insertProd"
|
||||
></q-btn>
|
||||
<!-- Button Close window -->
|
||||
<q-btn
|
||||
rounded
|
||||
class="q-ma-sm"
|
||||
color="primary"
|
||||
icon="fas fa-times-circle"
|
||||
label="Chiudi"
|
||||
@click="clickClose"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="myproduct?._id && optcatalogo.arrSchede?.length > 0"
|
||||
@@ -91,29 +117,6 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column text-center">
|
||||
<div class="row justify-center q-ma-md">
|
||||
<div v-if="visu === shared_consts.VISU_SEARCHPROD_MODE.INSERT">
|
||||
<q-btn
|
||||
rounded
|
||||
class="q-ma-sm"
|
||||
color="secondary"
|
||||
icon="fas fa-plus"
|
||||
label="Inserisci"
|
||||
@click="insertProd"
|
||||
></q-btn>
|
||||
<!-- Button Close window -->
|
||||
<q-btn
|
||||
rounded
|
||||
class="q-ma-sm"
|
||||
color="primary"
|
||||
icon="fas fa-times-circle"
|
||||
label="Chiudi"
|
||||
@click="clickClose"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user