- Export Lista
- Ordinamento - PDF Risolto Salvataggio ed invio al server direttamente.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
:finder="finder"
|
||||
labelElemFind="trovati"
|
||||
:choose_visutype="visuType"
|
||||
:butt_modif_new="tools.isAdmin()"
|
||||
:butt_modif_new="!tools.isUtente()"
|
||||
:noresultLabel="t('grid.nosearchfound')"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
|
||||
@@ -97,9 +97,9 @@
|
||||
@click="click_opendetail()"
|
||||
/>
|
||||
</a>
|
||||
<div class="q-ma-sm">
|
||||
<div class="q-ma-sm no-print">
|
||||
<div
|
||||
class="row absolute-top-left semi-transparent"
|
||||
class="row absolute-top-left semi-transparent "
|
||||
style="z-index: 10"
|
||||
>
|
||||
<q-btn-dropdown
|
||||
|
||||
@@ -69,6 +69,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
enableExport: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CMyFieldDb, CGridTableRec, CTitlePage,
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
:heightcarousel="heightcarousel"
|
||||
@clickButtBar="clickButtBar"
|
||||
:tablesList="gettablesList()"
|
||||
:enableExport="enableExport"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
|
||||
@@ -2606,16 +2606,17 @@ export default defineComponent({
|
||||
// console.log('row', serverData.value)
|
||||
// console.log('mycolumns.value', mycolumns.value)
|
||||
// naive encoding to csv format
|
||||
const content = [mycolumns.value.map((col: any) => wrapCsvValue(col.label))].concat(
|
||||
serverData.value.map((row: any) => mycolumns.value.map((col: any) => wrapCsvValue(
|
||||
typeof col.field === 'function'
|
||||
const headers = mycolumns.value.map((col: any) => wrapCsvValue(col.label));
|
||||
const rows = serverData.value.map((row: any) =>
|
||||
mycolumns.value.map((col: any) => {
|
||||
const value = typeof col.field === 'function'
|
||||
? col.field(row)
|
||||
: tools.getValue(row, col.field, col.subfield),
|
||||
col.format,
|
||||
row,
|
||||
col
|
||||
)).join(','))
|
||||
).join('\r\n')
|
||||
: tools.getValue(row, col.field, col.subfield);
|
||||
return wrapCsvValue(value, col.format, row, col);
|
||||
}).join('|')
|
||||
);
|
||||
|
||||
const content = [headers.join('|'), ...rows].join('\r\n');
|
||||
|
||||
const status = exportFile(
|
||||
'export-' + mytable.value + '_' + tools.getstrYYMMDDHHMMDateTime(tools.getDateNow()) + '.csv',
|
||||
|
||||
@@ -2264,7 +2264,7 @@ export default defineComponent({
|
||||
col.format,
|
||||
row,
|
||||
col
|
||||
)).join(','))
|
||||
)).join('|'))
|
||||
).join('\r\n')
|
||||
|
||||
const status = exportFile(
|
||||
|
||||
@@ -1595,6 +1595,14 @@
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.showListaCollane"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
label="Mostra Lista Collane"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.pdf"
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
<q-tab-panel name="lista">
|
||||
<CGridOriz table="catalogs" :tipovisu="costanti.VISUTABLE_TABLELIST" :prop_search="true" :finder="true"
|
||||
:isCatalogoGenerale="myel.parambool3"
|
||||
:showMap="false" :prop_modif="tools.isAdmin()"></CGridOriz>
|
||||
:showMap="false" :prop_modif="tools.isAdmin()" :enableExport="true"></CGridOriz>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="griglia">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<q-card
|
||||
v-if="myrec"
|
||||
bordered
|
||||
class="full-height flex flex-column"
|
||||
class="full-height flex flex-column justify-evenly"
|
||||
:style="`width: ` + opt.widthcard + `; ` + (opt.heightcard ? `height: ` + opt.heightcard + `;` : '')"
|
||||
>
|
||||
<q-img
|
||||
|
||||
@@ -93,35 +93,6 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
|
||||
async function mounted() {
|
||||
console.log('mounted CProductTable')
|
||||
loading.value = true
|
||||
|
||||
optionscatalogo.value = {
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
}
|
||||
|
||||
const savedColumns = tools.getCookie("selColCat_2");
|
||||
if (savedColumns) {
|
||||
selectedColumns.value = savedColumns;
|
||||
}
|
||||
|
||||
const savedSortAttribute = tools.getCookie("sortAttr");
|
||||
if (savedSortAttribute) {
|
||||
if (isColumnVisible(savedSortAttribute)) {
|
||||
sortAttribute.value = savedSortAttribute;
|
||||
|
||||
const savedSortDir = tools.getCookie("sortDir");
|
||||
if (savedSortDir) {
|
||||
sortDirection.value = savedSortDir;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
// Aggiorna la copia locale quando il prop cambia
|
||||
watch(
|
||||
() => props.lista_prodotti,
|
||||
@@ -167,6 +138,36 @@ export default defineComponent({
|
||||
{ name: "actions", label: "Azioni", field: "", align: "center", visu: costanti.VISUCAMPI.PER_EDITORE, noexp: true, notsortable: true },
|
||||
];
|
||||
|
||||
async function mounted() {
|
||||
console.log('mounted CProductTable')
|
||||
loading.value = true
|
||||
|
||||
optionscatalogo.value = {
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
}
|
||||
|
||||
const savedColumns = tools.getCookie("selColCat_2");
|
||||
if (savedColumns) {
|
||||
selectedColumns.value = savedColumns;
|
||||
}
|
||||
|
||||
const savedSortAttribute = tools.getCookie("sortAttr");
|
||||
if (savedSortAttribute && props.optcatalogo.showListaArgomenti) {
|
||||
if (isColumnVisible(savedSortAttribute)) {
|
||||
sortAttribute.value = savedSortAttribute;
|
||||
|
||||
const savedSortDir = tools.getCookie("sortDir");
|
||||
if (savedSortDir) {
|
||||
sortDirection.value = savedSortDir;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
||||
function getFieldValue(element: any, field: any): any {
|
||||
if (!element)
|
||||
return ''
|
||||
|
||||
@@ -249,7 +249,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function collabel(rec: any) {
|
||||
console.log('Record:', rec)
|
||||
|
||||
let label = ''
|
||||
if (rec && rec.productInfo) {
|
||||
if (productStore.isNovitaById(rec.productInfo.date_pub))
|
||||
|
||||
@@ -2563,4 +2563,8 @@ body.body--dark {
|
||||
.mybadge {
|
||||
border-radius: 10px !important;
|
||||
text-shadow: .05rem .05rem .15rem #878787;
|
||||
}
|
||||
|
||||
.no-print {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -893,6 +893,7 @@ export interface IOptCatalogo {
|
||||
indebug?: boolean
|
||||
maxnumlibri?: number
|
||||
showListaArgomenti?: boolean
|
||||
showListaCollane?: boolean
|
||||
generazionePDFInCorso?: boolean
|
||||
|
||||
first_page?: IDimensioni
|
||||
|
||||
@@ -256,7 +256,7 @@ export interface ICatPrTotali {
|
||||
}
|
||||
export interface ICollaneTotali {
|
||||
_id: string,
|
||||
name: string,
|
||||
title: string,
|
||||
quanti?: number,
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const msg_it = {
|
||||
guida_passopasso: 'Guida Passo Passo',
|
||||
},
|
||||
export: {
|
||||
csv: 'Esporta Movimenti',
|
||||
csv: 'Esporta Lista',
|
||||
},
|
||||
grid: {
|
||||
show_campi_avanzati: 'Visualizza campi aggiuntivi',
|
||||
|
||||
@@ -102,6 +102,7 @@ export const tools = {
|
||||
COOK_MAP_CENTER_LONG: 'MAP_LONG',
|
||||
COOK_MAP_ZOOM: 'MAP_Z',
|
||||
COOK_CATEGORIA: 'CATEG',
|
||||
COOK_COLLANA: 'COLL',
|
||||
COOK_MAPBOUNDS: 'MAP-B',
|
||||
COOK_LAST_PROD_SEARCH: 'LPR',
|
||||
|
||||
|
||||
@@ -129,6 +129,10 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
},
|
||||
|
||||
getCollane: (state: IProductsState) => (): ICollana[] => {
|
||||
return state.collane
|
||||
},
|
||||
|
||||
isDisponibile: (state: IProductsState) => (product: IProduct): boolean => {
|
||||
return product?.arrvariazioni?.[0]?.quantita > 1
|
||||
},
|
||||
@@ -365,7 +369,7 @@ export const useProducts = defineStore('Products', {
|
||||
},
|
||||
|
||||
getTotaliProdottiByIdCollana: (state: IProductsState) => (idCollana: string): number => {
|
||||
const myfirstcat = state.collanetotali!.find((rec: ICollaneTotali) => rec._id === idCollana)
|
||||
const myfirstcat = state.collane.find((rec: ICollaneTotali) => rec._id === idCollana)
|
||||
|
||||
if (myfirstcat) {
|
||||
return myfirstcat.quanti!
|
||||
@@ -1759,6 +1763,8 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
let arr: any = []
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
arr.push({ label: '[Nessuna]', value: '' })
|
||||
|
||||
if (arrschede) {
|
||||
@@ -1766,7 +1772,8 @@ export const useProducts = defineStore('Products', {
|
||||
let pagename = ''
|
||||
if (recscheda.scheda) {
|
||||
if (recscheda.idPageOrig) {
|
||||
const page = this.mypage?.find((page) => (`${page._id}`) === recscheda.idPageOrig)
|
||||
const page = globalStore.getPageById(recscheda.idPageOrig)
|
||||
// const page = this.mypage?.find((page) => (`${page._id}`) === recscheda.idPageOrig)
|
||||
pagename = page ? page.title! : ''
|
||||
}
|
||||
if (pagename)
|
||||
|
||||
@@ -2525,7 +2525,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
})
|
||||
},
|
||||
|
||||
async convertPdf(pdfFile: any, width: string, height: string, compressione: string) {
|
||||
async convertPdf(pdfFile: any, width: string, height: string, compressione: string, dir_out: string, file_out: string) {
|
||||
try {
|
||||
|
||||
if (!pdfFile) {
|
||||
@@ -2542,6 +2542,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
formData.append('width', width); // Dimensione del PDF in cm
|
||||
formData.append('height', height); // Dimensione del PDF in cm
|
||||
formData.append('compressione', compressione);
|
||||
formData.append('dir_out', dir_out);
|
||||
formData.append('file_out', file_out);
|
||||
formData.append('idapp', tools.getEnv('VITE_APP_ID'));
|
||||
|
||||
const response = await this.execConvertPDF(formData)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -98,11 +98,14 @@
|
||||
</q-inner-loading>
|
||||
|
||||
<q-tab-panel
|
||||
v-if="showListaArgomenti"
|
||||
v-if="showListaFiltrata"
|
||||
name="categorie"
|
||||
>
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div class="categories">
|
||||
<div
|
||||
class="categories"
|
||||
v-if="optcatalogo.showListaArgomenti"
|
||||
>
|
||||
<div
|
||||
v-for="(reccat, index) in getCatProds()"
|
||||
:key="index"
|
||||
@@ -113,6 +116,20 @@
|
||||
{{ reccat.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="categories"
|
||||
v-else-if="optcatalogo.showListaCollane"
|
||||
>
|
||||
<div
|
||||
v-for="(reccollana, index) in getCollane()"
|
||||
:key="index"
|
||||
class="category"
|
||||
:class="{ category_sel: collana === reccollana.value }"
|
||||
@click="collana = reccollana.value"
|
||||
>
|
||||
{{ reccollana.label }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -120,10 +137,10 @@
|
||||
class="text-center q-py-sm prod_trov"
|
||||
>
|
||||
<div
|
||||
v-if="cat === '' && arrProducts.length === 0 && showListaArgomenti"
|
||||
v-if="cat === '' && arrProducts.length === 0 && showListaFiltrata"
|
||||
class="row justify-center text-h6"
|
||||
>
|
||||
Seleziona un Argomento
|
||||
Seleziona {{ filtroStrApplicato }}
|
||||
</div>
|
||||
<span
|
||||
v-else
|
||||
@@ -151,7 +168,7 @@
|
||||
</q-inner-loading>
|
||||
|
||||
<q-btn
|
||||
v-if="!showListaArgomenti"
|
||||
v-if="!showListaFiltrata"
|
||||
rounded
|
||||
icon="fas fa-redo"
|
||||
label="Rigenera Lista"
|
||||
@@ -159,8 +176,8 @@
|
||||
@click="rigeneraLibri = true"
|
||||
></q-btn>
|
||||
|
||||
<!--<q-btn
|
||||
v-if="!showListaArgomenti"
|
||||
<!--<q-bcctn
|
||||
v-if="!showListaFiltrata"
|
||||
rounded
|
||||
label="Riordina"
|
||||
color="primary"
|
||||
@@ -168,7 +185,7 @@
|
||||
></q-btn>-->
|
||||
|
||||
<q-btn
|
||||
v-if="!showListaArgomenti"
|
||||
v-if="!showListaFiltrata"
|
||||
rounded
|
||||
label="Aggiungi"
|
||||
icon="fas fa-plus"
|
||||
@@ -178,7 +195,7 @@
|
||||
<div
|
||||
class="q-ma-sm row"
|
||||
style="border-radius: 10px; border: 1px solid #ccc"
|
||||
v-if="showListaArgomenti"
|
||||
v-if="showListaFiltrata"
|
||||
>
|
||||
<q-select
|
||||
v-model="optrigenera.visibilitaDisp"
|
||||
@@ -247,12 +264,12 @@
|
||||
>
|
||||
<div class="container">
|
||||
<q-tabs
|
||||
v-if="showListaArgomenti"
|
||||
v-model="tabvisu"
|
||||
dense
|
||||
class="bg-indigo text-white"
|
||||
>
|
||||
<q-tab
|
||||
v-if="showListaFiltrata"
|
||||
name="categorie"
|
||||
icon="fas fa-folder-open"
|
||||
label="Categorie"
|
||||
@@ -265,7 +282,7 @@
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
v-if="showListaArgomenti"
|
||||
v-if="showListaFiltrata"
|
||||
name="autori"
|
||||
icon="fas fa-user"
|
||||
label="Autori"
|
||||
@@ -278,7 +295,7 @@
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
v-if="showListaArgomenti && false"
|
||||
v-if="showListaFiltrata && false"
|
||||
name="ricerca"
|
||||
icon="fas fa-search"
|
||||
label="Cerca"
|
||||
@@ -291,7 +308,7 @@
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
v-if="showListaArgomenti"
|
||||
v-if="!tools.isUtente()"
|
||||
name="genera"
|
||||
icon="fas fa-book"
|
||||
label="Genera"
|
||||
@@ -305,11 +322,14 @@
|
||||
keep-alive
|
||||
>
|
||||
<q-tab-panel
|
||||
v-if="showListaArgomenti"
|
||||
v-if="showListaFiltrata"
|
||||
name="categorie"
|
||||
>
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div class="categories">
|
||||
<div
|
||||
class="categories"
|
||||
v-if="optcatalogo.showListaArgomenti"
|
||||
>
|
||||
<div
|
||||
v-for="(reccat, index) in getCatProds()"
|
||||
:key="index"
|
||||
@@ -320,6 +340,20 @@
|
||||
{{ reccat.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="categories"
|
||||
v-else-if="optcatalogo.showListaCollane"
|
||||
>
|
||||
<div
|
||||
v-for="(reccollana, index) in getCollane()"
|
||||
:key="index"
|
||||
class="category"
|
||||
:class="{ category_sel: collana === reccollana.value }"
|
||||
@click="collana = reccollana.value"
|
||||
>
|
||||
{{ reccollana.label }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="autori">
|
||||
@@ -373,7 +407,8 @@
|
||||
</q-toolbar>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="genera">
|
||||
<div v-if="tools.isEditor() || tools.isCommerciale()">
|
||||
<div v-if="!tools.isUtente()" class="row justify-center">
|
||||
|
||||
<q-btn
|
||||
v-if="optcatalogo.pdf && !optcatalogo.generazionePDFInCorso"
|
||||
:label="`Prepara PDF`"
|
||||
@@ -435,7 +470,7 @@
|
||||
</q-tab-panels>
|
||||
|
||||
<div
|
||||
v-if="showListaArgomenti"
|
||||
v-if="showListaFiltrata"
|
||||
class="row justify-center q-mx-auto"
|
||||
>
|
||||
<q-select
|
||||
@@ -464,10 +499,10 @@
|
||||
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<div
|
||||
v-if="cat === '' && arrProducts.length === 0 && showListaArgomenti"
|
||||
v-if="cat === '' && arrProducts.length === 0 && showListaFiltrata"
|
||||
class="row justify-center text-h6"
|
||||
>
|
||||
Seleziona un Argomento
|
||||
Seleziona {{ filtroStrApplicato }}
|
||||
</div>
|
||||
<span
|
||||
v-else
|
||||
@@ -579,6 +614,7 @@
|
||||
<div
|
||||
v-for="(page, pageIndex) in groupedPages(recscheda)"
|
||||
:key="pageIndex"
|
||||
class="pdf-section"
|
||||
>
|
||||
<div
|
||||
v-if="containsProducts(page)"
|
||||
|
||||
Reference in New Issue
Block a user