diff --git a/.env b/.env
index 82fa333a..6a040730 100755
--- a/.env
+++ b/.env
@@ -1,6 +1,6 @@
-VITE_APP_VERSION="1.2.77"
+VITE_APP_VERSION="1.2.78"
VITE_LANG_DEFAULT="it"
VITE_PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
-VITE_SERVICE_WORKER_FILE="sw-1.2.77.js"
+VITE_SERVICE_WORKER_FILE="sw-1.2.78.js"
VITE_PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a"
VITE_VUE_ROUTER_MODE="history"
\ No newline at end of file
diff --git a/index.html b/index.html
index 5a8a8786..a55e3fe1 100755
--- a/index.html
+++ b/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/package.json b/package.json
index 624626bf..9209fb35 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gruppomacro",
- "version": "1.2.77",
+ "version": "1.2.78",
"productName": "Gruppo Macro",
"description": "Il Gruppo Editoriale Macro, attivo dal 1987, è leader europeo nella pubblicazione di libri per il benessere e la consapevolezza. Con oltre 1.500 titoli, promuove una visione armonica del mondo, offrendo opere di autori internazionali e italiani come Gregg Braden, Bruce Lipton, Joe Dispenza, Louise Hay, Eckhart Tolle e molti altri. Scopri un'editoria che abbraccia il corpo, la mente, lo spirito e l'ecologia.",
"author": "Surya",
@@ -9,20 +9,20 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "PORT=8089 APP_VERSION='1.2.77' quasar dev",
+ "dev": "PORT=8089 APP_VERSION='1.2.78' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
- "buildspa": "APP_VERSION='1.2.77' quasar build -m spa",
+ "buildspa": "APP_VERSION='1.2.78' quasar build -m spa",
"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/comunitanuovomondo.app/package.json b/scripts/_ALL_SITES/comunitanuovomondo.app/package.json
index f4c4884a..c0782f28 100755
--- a/scripts/_ALL_SITES/comunitanuovomondo.app/package.json
+++ b/scripts/_ALL_SITES/comunitanuovomondo.app/package.json
@@ -1,6 +1,6 @@
{
"name": "cnm",
- "version": "1.2.77",
+ "version": "1.2.78",
"description": "Comunita Nuovo Mondo",
"productName": "ComunitaNuovoMondo",
"author": "Surya",
@@ -9,7 +9,7 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "PORT=8083 APP_VERSION='1.2.77' quasar dev",
+ "dev": "PORT=8083 APP_VERSION='1.2.78' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
"buildpwa": "NODE_ENV=production quasar build -m pwa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/freeplanet.app/package.json b/scripts/_ALL_SITES/freeplanet.app/package.json
index c26fb23a..5880d65e 100755
--- a/scripts/_ALL_SITES/freeplanet.app/package.json
+++ b/scripts/_ALL_SITES/freeplanet.app/package.json
@@ -1,6 +1,6 @@
{
"name": "freeplanet",
- "version": "1.2.77",
+ "version": "1.2.78",
"description": "freeplanet",
"productName": "freeplanet",
"author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "PORT=8087 APP_VERSION='1.2.77' quasar dev",
+ "dev": "PORT=8087 APP_VERSION='1.2.78' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8097 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8097 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/gruppomacro.app/package.json b/scripts/_ALL_SITES/gruppomacro.app/package.json
index a3be9b9b..1279dc69 100755
--- a/scripts/_ALL_SITES/gruppomacro.app/package.json
+++ b/scripts/_ALL_SITES/gruppomacro.app/package.json
@@ -1,6 +1,6 @@
{
"name": "gruppomacro",
- "version": "1.2.77",
+ "version": "1.2.78",
"productName": "Gruppo Macro",
"description": "Il Gruppo Editoriale Macro, attivo dal 1987, è leader europeo nella pubblicazione di libri per il benessere e la consapevolezza. Con oltre 1.500 titoli, promuove una visione armonica del mondo, offrendo opere di autori internazionali e italiani come Gregg Braden, Bruce Lipton, Joe Dispenza, Louise Hay, Eckhart Tolle e molti altri. Scopri un'editoria che abbraccia il corpo, la mente, lo spirito e l'ecologia.",
"author": "Surya",
@@ -9,20 +9,20 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "PORT=8089 APP_VERSION='1.2.77' quasar dev",
+ "dev": "PORT=8089 APP_VERSION='1.2.78' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
- "buildspa": "APP_VERSION='1.2.77' quasar build -m spa",
+ "buildspa": "APP_VERSION='1.2.78' quasar build -m spa",
"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/nuovomondo.app/package.json b/scripts/_ALL_SITES/nuovomondo.app/package.json
index e729f373..bd64047e 100755
--- a/scripts/_ALL_SITES/nuovomondo.app/package.json
+++ b/scripts/_ALL_SITES/nuovomondo.app/package.json
@@ -1,6 +1,6 @@
{
"name": "nuovomondo",
- "version": "1.2.77",
+ "version": "1.2.78",
"description": "Nuovo Mondo",
"productName": "Nuovo Mondo",
"author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "APP_VERSION='1.2.77' PORT=8083 quasar dev",
+ "dev": "APP_VERSION='1.2.78' PORT=8083 quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json b/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json
index 2803560d..03e5a6e7 100755
--- a/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json
+++ b/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json
@@ -1,6 +1,6 @@
{
"name": "nutriben",
- "version": "1.2.77",
+ "version": "1.2.78",
"description": "Nutriben",
"productName": "Nutriben",
"author": "Surya",
@@ -9,20 +9,20 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "PORT=8093 APP_VERSION='1.2.77' quasar dev",
+ "dev": "PORT=8093 APP_VERSION='1.2.78' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
- "buildspa": "APP_VERSION='1.2.77' quasar build -m spa",
+ "buildspa": "APP_VERSION='1.2.78' quasar build -m spa",
"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/piuchebuono.app/package.json b/scripts/_ALL_SITES/piuchebuono.app/package.json
index f422af8c..2091abc3 100755
--- a/scripts/_ALL_SITES/piuchebuono.app/package.json
+++ b/scripts/_ALL_SITES/piuchebuono.app/package.json
@@ -1,6 +1,6 @@
{
"name": "piuchebuono",
- "version": "1.2.77",
+ "version": "1.2.78",
"description": "PiuCheBuono",
"productName": "PiuCheBuono",
"author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "PORT=8085 APP_VERSION='1.2.77' quasar dev",
+ "dev": "PORT=8085 APP_VERSION='1.2.78' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/scripts/_ALL_SITES/riso.app/package.json b/scripts/_ALL_SITES/riso.app/package.json
index 9f763bc6..55e2941f 100755
--- a/scripts/_ALL_SITES/riso.app/package.json
+++ b/scripts/_ALL_SITES/riso.app/package.json
@@ -1,6 +1,6 @@
{
"name": "riso",
- "version": "1.2.77",
+ "version": "1.2.78",
"productName": "Riso 💚 - Rete Italiana Scambi Orizzontali",
"description": "Progetto RISO (Rete Italiana Scambi Orizzontali) promuove una rete di comunità locali che favoriscono scambi di beni, servizi e ospitalità. Con l'App RISO, sviluppata per facilitare il baratto, il dono e l'uso di monete alternative come i RIS, il progetto crea legami autentici basati sulla fiducia e sostenibilità. Partecipa agli scambi e costruisci una comunità più consapevole e autosufficiente.",
"author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT",
"type": "module",
"scripts": {
- "dev": "APP_VERSION='1.2.77' PORT=8084 quasar dev",
+ "dev": "APP_VERSION='1.2.78' PORT=8084 quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build",
- "buildpwa": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
- "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.77' quasar build -m pwa",
+ "buildpwa": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
+ "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.78' quasar build -m pwa",
"type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt",
- "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.77' quasar dev -m pwa",
- "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.77' quasar dev",
+ "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.78' quasar dev -m pwa",
+ "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.78' quasar dev",
"debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js",
diff --git a/src-pwa/custom-service-worker.js b/src-pwa/custom-service-worker.js
index db7ed905..fd252f9d 100755
--- a/src-pwa/custom-service-worker.js
+++ b/src-pwa/custom-service-worker.js
@@ -3,7 +3,7 @@
/* global workbox */
/* global cfgenv */
-const VITE_APP_VERSION = '1.2.77';
+const VITE_APP_VERSION = '1.2.78';
// Costanti di configurazione
const DYNAMIC_CACHE = 'dynamic-cache-v2';
diff --git a/src/components/CProductTable/CProductTable.ts b/src/components/CProductTable/CProductTable.ts
index 6a120d2e..1effe2f0 100755
--- a/src/components/CProductTable/CProductTable.ts
+++ b/src/components/CProductTable/CProductTable.ts
@@ -38,7 +38,7 @@ import * as XLSX from 'xlsx';
export default defineComponent({
name: 'CProductTable',
- emits: ['update:lista_prodotti', 'update:optcatalogo', 'rigenera', 'addtolist'],
+ emits: ['update:lista_prodotti', 'update:optcatalogo', 'rigenera', 'addtolist', 'addarraytolist'],
components: {
draggable,
CSearchProduct,
@@ -1434,9 +1434,7 @@ export default defineComponent({
function addArrayTitlesToList(myarr: IProduct[]) {
console.log('addArrayTitlesToList');
- for (const elem of myarr) {
- addtolist(elem);
- }
+ emit('addarraytolist', myarr);
showDialogImport.value = false; // chiudi dialog
}
diff --git a/src/views/ecommerce/catalogo/catalogo.ts b/src/views/ecommerce/catalogo/catalogo.ts
index 88efcbd1..86c2c3fb 100755
--- a/src/views/ecommerce/catalogo/catalogo.ts
+++ b/src/views/ecommerce/catalogo/catalogo.ts
@@ -263,7 +263,6 @@ export default defineComponent({
() => props.modelValue.selectedVersionStampabile,
async () => {
if (loadpage.value) {
-
//nascondi.value = true;
arrProducts.value = [];
console.log('aggiorna... ');
@@ -1297,7 +1296,6 @@ export default defineComponent({
sort_dir: number
): IProduct[] {
if (sort_field) {
-
// Crea una copia dell'array per non modificare l'originale
const sortedArr = [...arrprod].sort((a: IProduct, b: IProduct) => {
const valA =
@@ -1596,12 +1594,22 @@ export default defineComponent({
async function mounted() {
// console.log('mounted Catalogo')
+ caricatutto();
+
+ const instampa = globalStore.inStampa;
+
+ window.addEventListener('scroll', handleScroll);
+
+ if (onlyCatalogoPDF.value) {
+ setTimeout(async () => {
+ preparePDF(instampa, true);
+ }, 2000);
+ }
+ }
+
+ async function caricatutto(forzaagg?: boolean) {
let mycat = null;
- let instampa = false;
-
- instampa = globalStore.inStampa;
-
if (optcatalogo.value.idCatalogSel) {
// controlla se è stato passato l'id dalla pagina:
let idcatsel = '';
@@ -1619,7 +1627,7 @@ export default defineComponent({
// console.log('instampa... ', instampa)
- if (mycat && !mycat.lista_prodotti) {
+ if ((mycat && !mycat.lista_prodotti) || forzaagg) {
mycat = await catalogStore.fetchCatalogById(mycat._id);
}
myCatalog.value = mycat;
@@ -1704,17 +1712,10 @@ export default defineComponent({
// Inizializza
loadpage.value = true;
- window.addEventListener('scroll', handleScroll);
calcArrProducts();
ismounting.value = false;
-
- if (onlyCatalogoPDF.value) {
- setTimeout(async () => {
- preparePDF(instampa, true);
- }, 2000);
- }
}
function loaddata() {
@@ -2370,7 +2371,7 @@ export default defineComponent({
}
async function updateProducts(arr: any, aggiorna?: boolean) {
- console.log('UpdateProducts', arr.length)
+ console.log('UpdateProducts', arr.length);
if (myCatalog.value && myCatalog.value?.lista_prodotti) {
if (
myCatalog.value.lista_prodotti?.length !== arr.length ||
@@ -2390,8 +2391,33 @@ export default defineComponent({
}
}
+ async function addArrayProductsToList(arrayprod: IProduct[]) {
+ if (arrayprod && arrayprod.length > 0) {
+ const arr = myCatalog.value?.lista_prodotti || [];
+
+ // add this record to lista_prodotti
+ for (const element of arrayprod) {
+ if (
+ myCatalog.value &&
+ !myCatalog.value?.lista_prodotti?.some((p) => p._id === element._id)
+ ) {
+ // inserire il record
+ arr.push(element);
+ }
+ }
+
+ // Ricarica tutto
+ await updateProducts(arr, true);
+
+ // Ricarica tutto
+ await caricatutto(true)
+
+ addnewProd.value = false;
+ }
+ }
+
async function addProductToList(element: IProduct, where: string) {
- console.log('addProductToList', element)
+ console.log('addProductToList', element);
if (element) {
// add this record to lista_prodotti
@@ -2415,6 +2441,28 @@ export default defineComponent({
addnewProd.value = true;
}
+ async function clickdeleteAllBooks() {
+ const confirm = await $q
+ .dialog({
+ title: 'Elimina Lista',
+ message: 'Sicuro di ELIMINARE tutta la lista ?',
+ ok: {
+ label: 'Elimina Tutto',
+ push: true,
+ },
+ cancel: {
+ label: 'Annulla',
+ },
+ })
+ .onOk(async () => {
+ if (!confirm) return;
+
+ myCatalog.value.lista_prodotti = [];
+
+ salvaListaProdotti(true);
+ });
+ }
+
function toggleDebug() {
optcatalogo.value.indebug = !optcatalogo.value.indebug;
}
@@ -2742,6 +2790,11 @@ export default defineComponent({
}
}
+ async function refreshProducts() {
+ // calcArrProducts(true);
+ await generatearrProdToViewSorted(true, false);
+ }
+
onMounted(mounted);
return {
@@ -2801,6 +2854,7 @@ export default defineComponent({
updateProducts,
clickaddNewBook,
addProductToList,
+ addArrayProductsToList,
addnewProd,
showListaFiltrata,
rigeneraLibri,
@@ -2841,6 +2895,8 @@ export default defineComponent({
showColorPicker,
mostraTuttiITab,
esistePagIntroduttiva,
+ clickdeleteAllBooks,
+ refreshProducts,
};
},
});
diff --git a/src/views/ecommerce/catalogo/catalogo.vue b/src/views/ecommerce/catalogo/catalogo.vue
index eb43c4b4..d3f86890 100755
--- a/src/views/ecommerce/catalogo/catalogo.vue
+++ b/src/views/ecommerce/catalogo/catalogo.vue
@@ -202,6 +202,14 @@
@click="reSortList"
>-->
+
addProductToList(elem, shared_consts.WHERE_INSERT.ONBOTTOM)"
+ @addarraytolist="(arrayprod: any) => addArrayProductsToList(arrayprod)"
/>
addProductToList(elem, shared_consts.WHERE_INSERT.ONTOP)"
+ @addarraytolist="(arrayprod: any) => addArrayProductsToList(arrayprod)"
/>