- Aggiunto bottone Aggiungi al Carrello sulla lista dei libri dei cataloghi

This commit is contained in:
Surya Paolo
2025-06-06 00:07:47 +02:00
parent 06fe6eb861
commit 664975b1fd
36 changed files with 1110 additions and 751 deletions

4
.env
View File

@@ -1,6 +1,6 @@
VITE_APP_VERSION="1.2.52" VITE_APP_VERSION="1.2.53"
VITE_LANG_DEFAULT="it" VITE_LANG_DEFAULT="it"
VITE_PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" VITE_PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
VITE_SERVICE_WORKER_FILE="sw-1.2.52.js" VITE_SERVICE_WORKER_FILE="sw-1.2.53.js"
VITE_PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" VITE_PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a"
VITE_VUE_ROUTER_MODE="history" VITE_VUE_ROUTER_MODE="history"

View File

@@ -10,7 +10,7 @@
<meta name="description" content="<%= productDescription %>"> <meta name="description" content="<%= productDescription %>">
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no"> <meta name="msapplication-tap-highlight" content="no">
<meta name="version" content="1.2.52"> <meta name="version" content="1.2.53">
<meta name="viewport" <meta name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"> content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">

View File

@@ -1,6 +1,6 @@
{ {
"name": "gruppomacro", "name": "gruppomacro",
"version": "1.2.52", "version": "1.2.53",
"description": "Gruppo Macro", "description": "Gruppo Macro",
"productName": "Gruppo Macro", "productName": "Gruppo Macro",
"author": "Surya", "author": "Surya",
@@ -9,20 +9,20 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "PORT=8089 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8089 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "APP_VERSION='1.2.52' quasar build -m spa", "buildspa": "APP_VERSION='1.2.53' quasar build -m spa",
"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"", "lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "cnm", "name": "cnm",
"version": "1.2.52", "version": "1.2.53",
"description": "Comunita Nuovo Mondo", "description": "Comunita Nuovo Mondo",
"productName": "ComunitaNuovoMondo", "productName": "ComunitaNuovoMondo",
"author": "Surya", "author": "Surya",
@@ -9,7 +9,7 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "PORT=8083 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8083 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production quasar build -m pwa", "buildpwa": "NODE_ENV=production quasar build -m pwa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "freeplanet", "name": "freeplanet",
"version": "1.2.52", "version": "1.2.53",
"description": "freeplanet", "description": "freeplanet",
"productName": "freeplanet", "productName": "freeplanet",
"author": "Surya", "author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "PORT=8087 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8087 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa", "buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8097 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "gruppomacro", "name": "gruppomacro",
"version": "1.2.52", "version": "1.2.53",
"description": "Gruppo Macro", "description": "Gruppo Macro",
"productName": "Gruppo Macro", "productName": "Gruppo Macro",
"author": "Surya", "author": "Surya",
@@ -9,20 +9,20 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "PORT=8089 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8089 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "APP_VERSION='1.2.52' quasar build -m spa", "buildspa": "APP_VERSION='1.2.53' quasar build -m spa",
"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"", "lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "kolibrilab", "name": "kolibrilab",
"version": "1.2.52", "version": "1.2.53",
"description": "kolibrilab", "description": "kolibrilab",
"productName": "kolibrilab", "productName": "kolibrilab",
"author": "Surya Paolo", "author": "Surya Paolo",
@@ -8,11 +8,11 @@
"keywords": [], "keywords": [],
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "PORT=8083 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8083 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa", "buildspa": "quasar build -m spa",
@@ -20,8 +20,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt", "fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt",
"pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.53' quasar dev",
"spanorefresh": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m spa", "spanorefresh": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m spa",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js" "generate-sw": "workbox generateSW workbox-config.js"

View File

@@ -1,6 +1,6 @@
{ {
"name": "nutriben", "name": "nutriben",
"version": "1.2.52", "version": "1.2.53",
"description": "Nutriben", "description": "Nutriben",
"productName": "Nutriben", "productName": "Nutriben",
"author": "Surya", "author": "Surya",
@@ -9,20 +9,20 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "PORT=8093 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8093 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "APP_VERSION='1.2.52' quasar build -m spa", "buildspa": "APP_VERSION='1.2.53' quasar build -m spa",
"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"", "lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "piuchebuono", "name": "piuchebuono",
"version": "1.2.52", "version": "1.2.53",
"description": "PiuCheBuono", "description": "PiuCheBuono",
"productName": "PiuCheBuono", "productName": "PiuCheBuono",
"author": "Surya", "author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "PORT=8085 APP_VERSION='1.2.52' quasar dev", "dev": "PORT=8085 APP_VERSION='1.2.53' quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa", "buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "riso", "name": "riso",
"version": "1.2.52", "version": "1.2.53",
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
"productName": "Riso", "productName": "Riso",
"author": "Surya", "author": "Surya",
@@ -9,11 +9,11 @@
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "APP_VERSION='1.2.52' PORT=8084 quasar dev", "dev": "APP_VERSION='1.2.53' PORT=8084 quasar dev",
"dev_noCheck": "SKIP_TSC=true quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev",
"build": "quasar build", "build": "quasar build",
"buildpwa": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"buildpwatest": "NODE_ENV=production APP_VERSION='1.2.52' quasar build -m pwa", "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.53' quasar build -m pwa",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"type-check:watch": "vue-tsc --noEmit --watch", "type-check:watch": "vue-tsc --noEmit --watch",
"buildspa": "quasar build -m spa", "buildspa": "quasar build -m spa",
@@ -21,8 +21,8 @@
"lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt",
"lintfileNoJS": "eslint --ext .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", "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.52' quasar dev -m pwa", "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.53' quasar dev -m pwa",
"spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.52' quasar dev", "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.53' quasar dev",
"debug": "quasar dev --mode debug", "debug": "quasar dev --mode debug",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"generate-sw": "workbox generateSW workbox-config.js", "generate-sw": "workbox generateSW workbox-config.js",

View File

@@ -3,7 +3,7 @@
/* global workbox */ /* global workbox */
/* global cfgenv */ /* global cfgenv */
const VITE_APP_VERSION = '1.2.52'; const VITE_APP_VERSION = '1.2.53';
// Costanti di configurazione // Costanti di configurazione
const DYNAMIC_CACHE = 'dynamic-cache-v2'; const DYNAMIC_CACHE = 'dynamic-cache-v2';

View File

@@ -328,6 +328,7 @@ export const shared_consts = {
TABLES_MYGROUPS: 'mygroups', TABLES_MYGROUPS: 'mygroups',
TABLES_ATTIVITAS: 'attivitas', TABLES_ATTIVITAS: 'attivitas',
TABLES_CATALOG: 'catalogs', TABLES_CATALOG: 'catalogs',
TABLES_PRODUCTS: 'products',
TABLES_LISTA_EDITORI: 'lista_editori', TABLES_LISTA_EDITORI: 'lista_editori',
TABLES_RACCOLTACATALOGHIS: 'raccoltacataloghis', TABLES_RACCOLTACATALOGHIS: 'raccoltacataloghis',

View File

@@ -112,7 +112,7 @@ export default defineComponent({
const { t } = useI18n(); const { t } = useI18n();
const userStore = useUserStore(); const userStore = useUserStore();
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
const products = useProducts(); const Products = useProducts();
const listord = ref(<IOrderCart[]>[]); const listord = ref(<IOrderCart[]>[]);
const sumval = ref(0); const sumval = ref(0);
@@ -137,19 +137,19 @@ export default defineComponent({
const field_updated_fromGM = ref(''); const field_updated_fromGM = ref('');
const dataextractedWeb = ref(''); const dataextractedWeb = ref('');
const widthoggetto = ref(40) const widthoggetto = ref(40);
const heightoggetto = ref(40) const heightoggetto = ref(40);
// Crea una copia locale reattiva di modelValue // Crea una copia locale reattiva di modelValue
const optcatalogo = ref<IOptCatalogo>({ ...props.modelValue }); const optcatalogo = ref<IOptCatalogo>({ ...props.modelValue });
const mywidthogg = computed(() => { const mywidthogg = computed(() => {
return widthoggetto.value * tools.getScaleX(optcatalogo.value, props.scheda) return widthoggetto.value * tools.getScaleX(optcatalogo.value, props.scheda);
}) });
const myheightogg = computed(() => { const myheightogg = computed(() => {
return heightoggetto.value * tools.getScaleY(optcatalogo.value, props.scheda) return heightoggetto.value * tools.getScaleY(optcatalogo.value, props.scheda);
}) });
const editOn = computed({ const editOn = computed({
get(): boolean { get(): boolean {
@@ -213,7 +213,7 @@ export default defineComponent({
const scale = ref(1); const scale = ref(1);
const getTesto_Right = computed(() => { const getTesto_Right = computed(() => {
return products.replaceKeyWordsByProduct( return Products.replaceKeyWordsByProduct(
optcatalogo.value, optcatalogo.value,
myproduct.value!, myproduct.value!,
props.scheda.testo_right!, props.scheda.testo_right!,
@@ -221,7 +221,7 @@ export default defineComponent({
); );
}); });
const getTesto_Right_attaccato = computed(() => { const getTesto_Right_attaccato = computed(() => {
return products.replaceKeyWordsByProduct( return Products.replaceKeyWordsByProduct(
optcatalogo.value, optcatalogo.value,
myproduct.value!, myproduct.value!,
props.scheda.testo_right_attaccato!, props.scheda.testo_right_attaccato!,
@@ -229,7 +229,7 @@ export default defineComponent({
); );
}); });
const getTesto_Debug = computed(() => { const getTesto_Debug = computed(() => {
return products.replaceKeyWordsByProduct( return Products.replaceKeyWordsByProduct(
optcatalogo.value, optcatalogo.value,
myproduct.value!, myproduct.value!,
{ contenuto: '{debug}', maxlength: 10000 }, { contenuto: '{debug}', maxlength: 10000 },
@@ -238,7 +238,7 @@ export default defineComponent({
}); });
const getTesto_Bottom = computed(() => { const getTesto_Bottom = computed(() => {
return products.replaceKeyWordsByProduct( return Products.replaceKeyWordsByProduct(
optcatalogo.value, optcatalogo.value,
myproduct.value!, myproduct.value!,
props.scheda.testo_bottom!, props.scheda.testo_bottom!,
@@ -255,7 +255,7 @@ export default defineComponent({
/*const myproduct = computed((): IProduct => { /*const myproduct = computed((): IProduct => {
console.log('getproduct computed') console.log('getproduct computed')
const ris = products.getProduct(props.code) const ris = Products.getProduct(props.code)
console.log(' received', ris) console.log(' received', ris)
return ris return ris
})*/ })*/
@@ -271,7 +271,7 @@ export default defineComponent({
} }
if (myproduct.value) { if (myproduct.value) {
const ris = await products.addtoCartBase({ const ris = await Products.addtoCartBase({
$q, $q,
t, t,
id: myproduct.value._id, id: myproduct.value._id,
@@ -286,8 +286,7 @@ export default defineComponent({
function getnumstore() { function getnumstore() {
if (myproduct.value) { if (myproduct.value) {
if (myproduct.value.storehouses) if (myproduct.value.storehouses) return myproduct.value.storehouses.length;
return myproduct.value.storehouses.length;
else return 0; else return 0;
} }
return 0; return 0;
@@ -320,13 +319,6 @@ export default defineComponent({
} }
} }
function initproduct() {
myorder.quantity = 0;
myorder.quantitypreordered = 0;
myorder.idStorehouse = '';
myorder.idGasordine = '';
}
async function updateproduct(atload: boolean, forza?: boolean) { async function updateproduct(atload: boolean, forza?: boolean) {
let carica = true; let carica = true;
@@ -343,13 +335,13 @@ export default defineComponent({
updateproductmodif(null, forza); updateproductmodif(null, forza);
} }
// products.updateQuantityAvailable(myproduct.value._id) // Products.updateQuantityAvailable(myproduct.value._id)
} }
async function ricarica() { async function ricarica() {
endload.value = false; endload.value = false;
if (myproduct.value) { if (myproduct.value) {
const prod = await products.loadProductById(myproduct.value._id); const prod = await Products.loadProductById(myproduct.value._id);
if (prod) { if (prod) {
myproduct.value = prod; myproduct.value = prod;
} }
@@ -361,9 +353,9 @@ export default defineComponent({
console.log('CCATALOGOCARD: updateproductmodif'); console.log('CCATALOGOCARD: updateproductmodif');
try { try {
if (element?._id) { if (element?._id) {
myproduct.value = await products.getProductById(element?._id, forza); myproduct.value = await Products.getProductById(element?._id, forza);
} else { } else {
myproduct.value = await products.getProductById(props.id, forza); myproduct.value = await Products.getProductById(props.id, forza);
} }
updateLabel(); updateLabel();
@@ -441,9 +433,7 @@ export default defineComponent({
myproduct.value.gasordine.data_arrivo_merce myproduct.value.gasordine.data_arrivo_merce
); );
if (myproduct.value.gasordine.dataora_ritiro) if (myproduct.value.gasordine.dataora_ritiro)
dataRitiro = tools.getstrDateTime( dataRitiro = tools.getstrDateTime(myproduct.value.gasordine.dataora_ritiro);
myproduct.value.gasordine.dataora_ritiro
);
} else { } else {
dataArrivoMerce = ''; dataArrivoMerce = '';
dataRitiro = ''; dataRitiro = '';
@@ -451,8 +441,7 @@ export default defineComponent({
} catch (e) {} } catch (e) {}
if (labelDataArrivoMerce.value !== dataArrivoMerce) if (labelDataArrivoMerce.value !== dataArrivoMerce)
labelDataArrivoMerce.value = dataArrivoMerce; labelDataArrivoMerce.value = dataArrivoMerce;
if (labelDataRitiro.value !== dataRitiro) if (labelDataRitiro.value !== dataRitiro) labelDataRitiro.value = dataRitiro;
labelDataRitiro.value = dataRitiro;
updateTimerLabel(); updateTimerLabel();
} }
@@ -487,9 +476,7 @@ export default defineComponent({
return ( return (
myproduct.value.gasordine && myproduct.value.gasordine &&
myproduct.value.gasordine.dataora_chiusura_ordini && myproduct.value.gasordine.dataora_chiusura_ordini &&
tools.getCountDown( tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) === ''
myproduct.value.gasordine.dataora_chiusura_ordini
) === ''
); );
} else return false; } else return false;
} }
@@ -501,7 +488,7 @@ export default defineComponent({
async function load() { async function load() {
indvariazSel.value = -1; indvariazSel.value = -1;
initproduct(); Products.initproduct(myorder);
await updateproduct(true, true); await updateproduct(true, true);
labelDataArrivoMerce.value = ''; labelDataArrivoMerce.value = '';
labelDataRitiro.value = ''; labelDataRitiro.value = '';
@@ -509,30 +496,9 @@ export default defineComponent({
// console.log('Load', myproduct.value.name) // console.log('Load', myproduct.value.name)
if (myproduct.value) { if (myproduct.value) {
arrordersCart.value = products.getOrdersCartInAttesaByIdProduct( Products.setMyOrder(myorder, myproduct.value, storeSelected.value, {
myproduct.value._id setstore: true,
); });
if (
myproduct.value.storehouses &&
myproduct.value.storehouses.length === 1
) {
// Se solo 1 presente, metto fisso l'unico negozio !
myorder.idStorehouse = myproduct.value.storehouses[0]._id;
}
if (myproduct.value.gasordine) {
myorder.idGasordine = myproduct.value.gasordine._id;
}
const ord = products.getOrderProductInCart(myproduct.value._id);
if (ord) {
myorder.quantity = ord.quantity;
myorder.quantitypreordered = ord.quantitypreordered;
// Seleziona il Negozio che avevo già scelto nell'ordine !
if (ord.idStorehouse) storeSelected.value = ord.idStorehouse;
}
} }
updateLabel(); updateLabel();
@@ -554,9 +520,7 @@ export default defineComponent({
function visuListDisponibili() { function visuListDisponibili() {
if (myproduct.value) { if (myproduct.value) {
openlistorders.value = true; openlistorders.value = true;
sumval.value = products.getSumQtyOrderProductInOrdersCart( sumval.value = Products.getSumQtyOrderProductInOrdersCart(myproduct.value._id);
myproduct.value._id
);
listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => listord.value = arrordersCart.value.filter((orderscart: IOrderCart) =>
orderscart.items!.reduce((accumulator, item) => { orderscart.items!.reduce((accumulator, item) => {
@@ -569,9 +533,7 @@ export default defineComponent({
function visuListBookable() { function visuListBookable() {
if (myproduct.value) { if (myproduct.value) {
openlistorders.value = true; openlistorders.value = true;
sumval.value = products.getSumQtyPreOrderInOrdersCart( sumval.value = Products.getSumQtyPreOrderInOrdersCart(myproduct.value._id);
myproduct.value._id
);
listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => listord.value = arrordersCart.value.filter((orderscart: IOrderCart) =>
orderscart.items!.reduce((accumulator, item) => { orderscart.items!.reduce((accumulator, item) => {
@@ -601,8 +563,7 @@ export default defineComponent({
(myproduct.value.bookableGASBloccatiQty + (myproduct.value.bookableGASBloccatiQty +
myproduct.value.QuantitaPrenotateInAttesa!) * myproduct.value.QuantitaPrenotateInAttesa!) *
myproduct.value.productInfo.weight!, myproduct.value.productInfo.weight!,
myproduct.value.qtyToReachForGas * myproduct.value.qtyToReachForGas * myproduct.value.productInfo.weight!
myproduct.value.productInfo.weight!
) / 100 ) / 100
); );
else return 0; else return 0;
@@ -770,8 +731,7 @@ export default defineComponent({
loading.value = true; loading.value = true;
updatefromgm.value = true; updatefromgm.value = true;
field_updated_fromGM.value = ''; field_updated_fromGM.value = '';
field_updated_fromGM.value = field_updated_fromGM.value = await globalStore.getGM_FieldOf_T_Web_Articoli(
await globalStore.getGM_FieldOf_T_Web_Articoli(
myproduct.value.productInfo.sku!, myproduct.value.productInfo.sku!,
field, field,
shared_consts.CmdQueryMs.GET shared_consts.CmdQueryMs.GET
@@ -798,7 +758,7 @@ export default defineComponent({
} }
if (!dataupdated) { if (!dataupdated) {
tools.showNegativeNotif($q, t('dbgm.dati_non_estratti')); tools.showNegativeNotif($q, t('dbgm.dati_non_estratti'));
visudataextracted.value = false visudataextracted.value = false;
} }
return dataupdated; return dataupdated;
}) })
@@ -858,7 +818,7 @@ export default defineComponent({
openlistorders, openlistorders,
func_tools, func_tools,
toolsext, toolsext,
products, Products,
arrordersCart, arrordersCart,
endload, endload,
shared_consts, shared_consts,
@@ -918,7 +878,7 @@ export default defineComponent({
widthoggetto, widthoggetto,
heightoggetto, heightoggetto,
mywidthogg, mywidthogg,
myheightogg myheightogg,
}; };
}, },
}); });

View File

@@ -82,15 +82,16 @@ export default defineComponent({
// console.log('options', props.options) // console.log('options', props.options)
if (props.options.length > 0) { if (props.options.length > 0) {
props.options.forEach((rec: any, index) => { props.options.forEach((rec: any, index) => {
// console.log('rec', rec)
if (props.type === costanti.FieldType.multiselect) { if (props.type === costanti.FieldType.multiselect) {
if (!!myval.value) { if (!!myval.value) {
/* /*
console.log('rec', rec) console.log('rec', rec)
console.log('optval', props.optval) console.log('optval', props.optval)
console.log('optlab', props.optlab) console.log('optlab', props.optlab)
console.log('myval.value', myval.value) console.log('myval.value', myval.value)
console.log('rec[props.optval]', rec[props.optval]) console.log('rec[props.optval]', rec[props.optval])
*/ */
let trovato = false let trovato = false

View File

@@ -28,7 +28,7 @@ export default defineComponent({
// console.log('$route.path', $route.path) // console.log('$route.path', $route.path)
rec.value = globalStore.getPage(props.path) rec.value = globalStore.getPage(props.path)
console.log('rec', rec) // console.log('rec', rec)
} }
onMounted(mounted) onMounted(mounted)

View File

@@ -74,7 +74,7 @@ export default defineComponent({
const argomentistr = ref('') const argomentistr = ref('')
const numprodtot = ref(0) const numprodtot = ref(0)
const editorestr = ref('') const editorestr = ref('')
const editore_escludi_str = ref('') const editorestr_escludi = ref('')
const products = useProducts() const products = useProducts()
@@ -142,11 +142,11 @@ export default defineComponent({
editorestr.value += rectrovato?.name + ' ' editorestr.value += rectrovato?.name + ' '
} }
} }
editore_escludi_str.value = '' editorestr_escludi.value = ''
if (myrec.value.editore_escludi) { if (myrec.value.editore_escludi) {
for (const receditore of myrec.value.editore_escludi) { for (const receditore of myrec.value.editore_escludi) {
const rectrovato: IPublisher = products.publishers.find((editore: IPublisher) => editore._id === receditore) const rectrovato: IPublisher = products.publishers.find((editore: IPublisher) => editore._id === receditore)
editores_escludi_tr.value += rectrovato?.name + ' ' editorestr_escludi.value += rectrovato?.name + ' '
} }
} }

View File

@@ -93,7 +93,7 @@
<span class="text-blue">{{ editorestr }}</span> <span class="text-blue">{{ editorestr }}</span>
</div> </div>
<div <div
v-if="!tools.isUtente() && editore_escludi_str && dettagli" v-if="!tools.isUtente() && editorestr_escludi && dettagli"
class="text-caption text-h7 text-grey q-pb-xs" class="text-caption text-h7 text-grey q-pb-xs"
> >
<q-icon name="fas fa-book-open" /> {{ $t('cataloglist.editore_escludi') }}: <q-icon name="fas fa-book-open" /> {{ $t('cataloglist.editore_escludi') }}:

View File

@@ -1,30 +1,38 @@
import type { PropType} from 'vue'; import type { PropType } from 'vue';
import { defineComponent, ref, toRef, computed, watch, onMounted, reactive, onBeforeUnmount } from 'vue' import {
import { useI18n } from 'vue-i18n' defineComponent,
import { useUserStore } from '@store/UserStore' ref,
import { useGlobalStore } from '@store/globalStore' toRef,
import { useQuasar } from 'quasar' computed,
watch,
onMounted,
reactive,
onBeforeUnmount,
} from 'vue';
import { useI18n } from 'vue-i18n';
import { useUserStore } from '@store/UserStore';
import { useGlobalStore } from '@store/globalStore';
import { useQuasar } from 'quasar';
import { CTitleBanner } from '../CTitleBanner' import { CTitleBanner } from '../CTitleBanner';
import { CCardState } from '../CCardState' import { CCardState } from '../CCardState';
import { CCopyBtn } from '../CCopyBtn' import { CCopyBtn } from '../CCopyBtn';
import { CMyFieldRec } from '../CMyFieldRec' import { CMyFieldRec } from '../CMyFieldRec';
import { CBarCode } from '../CBarCode' import { CBarCode } from '../CBarCode';
import { CText } from '../CText' import { CText } from '../CText';
import { CMyValueDb } from '../CMyValueDb' import { CMyValueDb } from '../CMyValueDb';
import { func_tools, toolsext } from '@store/Modules/toolsext' import { func_tools, toolsext } from '@store/Modules/toolsext';
import type { IGasordine, IOrder, IOrderCart, IProduct } from '@src/model'; import type { IGasordine, IOrder, IOrderCart, IProduct } from '@src/model';
import { IBaseOrder } from '@src/model' import { IBaseOrder } from '@src/model';
import { tools } from '@tools' import { tools } from '@tools';
import { useProducts } from '@store/Products' import { useProducts } from '@store/Products';
import { shared_consts } from '@src/common/shared_vuejs' import { shared_consts } from '@src/common/shared_vuejs';
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router';
import { costanti } from '@costanti'
import { costanti } from '@costanti';
export default defineComponent({ export default defineComponent({
name: 'CProductCard', name: 'CProductCard',
@@ -51,27 +59,32 @@ export default defineComponent({
}, },
}, },
components: { components: {
CTitleBanner, CCardState, CCopyBtn, CTitleBanner,
CMyFieldRec, CMyValueDb, CBarCode, CText, CCardState,
CCopyBtn,
CMyFieldRec,
CMyValueDb,
CBarCode,
CText,
}, },
setup(props, { emit }) { setup(props, { emit }) {
const $q = useQuasar() const $q = useQuasar();
const { t } = useI18n() const { t } = useI18n();
const userStore = useUserStore() const userStore = useUserStore();
const globalStore = useGlobalStore() const globalStore = useGlobalStore();
const products = useProducts() const Products = useProducts();
const listord = ref(<IOrderCart[]>[]) const listord = ref(<IOrderCart[]>[]);
const sumval = ref(0) const sumval = ref(0);
const editOn = ref(false) const editOn = ref(false);
const site = ref(globalStore.site) const site = ref(globalStore.site);
const $router = useRouter() const $router = useRouter();
const fullscreenImage = ref(<any>null) const fullscreenImage = ref(<any>null);
const apriSchedaPDF = ref(false) const apriSchedaPDF = ref(false);
let myorder = reactive(<IOrder>{ let myorder = reactive(<IOrder>{
idapp: tools.getEnv('VITE_APP_ID'), idapp: tools.getEnv('VITE_APP_ID'),
@@ -81,219 +94,209 @@ export default defineComponent({
idGasordine: '', idGasordine: '',
storehouse: {}, storehouse: {},
gasordine: { active: false }, gasordine: { active: false },
}) });
const storeSelected = ref('') const storeSelected = ref('');
const arrordersCart = ref(<IOrderCart[]>[]) const arrordersCart = ref(<IOrderCart[]>[]);
const timerInterval = ref(<any>null) const timerInterval = ref(<any>null);
const timerLabelScadenza = ref('') const timerLabelScadenza = ref('');
const labelDataRitiro = ref('') const labelDataRitiro = ref('');
const labelDataArrivoMerce = ref('') const labelDataArrivoMerce = ref('');
const openlistorders = ref(false) const openlistorders = ref(false);
const endload = ref(false) const endload = ref(false);
const myproduct = ref(<IProduct>{}) const myproduct = ref(<IProduct>{});
const isFullScreen = ref(false) const isFullScreen = ref(false);
const imageSrc = ref('URL_DEL_TUO_FILE_IMMAGINE') const imageSrc = ref('URL_DEL_TUO_FILE_IMMAGINE');
const startX = ref(0) const startX = ref(0);
const startY = ref(0) const startY = ref(0);
const scale = ref(1) const scale = ref(1);
watch(() => editOn.value, (to: any, from: any) => {
if (!editOn.value)
ricarica()
})
watch(
() => editOn.value,
(to: any, from: any) => {
if (!editOn.value) ricarica();
}
);
/*const myproduct = computed((): IProduct => { /*const myproduct = computed((): IProduct => {
console.log('getproduct computed') console.log('getproduct computed')
const ris = products.getProduct(props.code) const ris = Products.getProduct(props.code)
console.log(' received', ris) console.log(' received', ris)
return ris return ris
})*/ })*/
function iconWhishlist(order: IProduct) { function iconWhishlist(order: IProduct) {
if (true) { if (true) {
return 'far fa-heart' return 'far fa-heart';
} else { } else {
return 'fas fa-heart' return 'fas fa-heart';
} }
} }
async function addtoCart(add: boolean) { async function addtoCart(add: boolean) {
if (!userStore.isLogged) { if (!userStore.isLogged) {
tools.showNeutralNotif($q, t('ecomm.area_personale')) tools.showNeutralNotif($q, t('ecomm.area_personale'));
globalStore.rightDrawerOpen = true globalStore.rightDrawerOpen = true;
return false return false;
} }
const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add }) const ris = await Products.addtoCartBase({
updateproduct() $q,
t,
id: myproduct.value._id,
order: myorder,
addqty: add,
});
updateproduct();
if (ris && ris.myord) { if (ris && ris.myord) {
} }
} }
function getnumstore() { function getnumstore() {
if (myproduct.value) { if (myproduct.value) {
if (myproduct.value.storehouses) if (myproduct.value.storehouses) return myproduct.value.storehouses.length;
return myproduct.value.storehouses.length else return 0;
else
return 0
} }
return 0 return 0;
} }
function getSingleStorehouse() { function getSingleStorehouse() {
try { try {
const mystore = myproduct.value.storehouses[0] const mystore = myproduct.value.storehouses[0];
if (mystore) if (mystore) return mystore.name + ' (' + mystore.city + ')';
return mystore.name + ' (' + mystore.city + ')' else return '';
else
return ''
} catch (e) { } catch (e) {
return '' return '';
} }
} }
function getSingleGasordine(gasordine: IGasordine) { function getSingleGasordine(gasordine: IGasordine) {
try { try {
const mygas = gasordine const mygas = gasordine;
if (mygas) if (mygas)
/*return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini) /*return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
+ ' ' + t('gas.data_arrivo_merce') + ': ' + tools.getstrDateShort(mygas.data_arrivo_merce) + ' ' + t('gas.data_arrivo_merce') + ': ' + tools.getstrDateShort(mygas.data_arrivo_merce)
+ ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)*/ + ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)*/
return mygas.name return mygas.name;
else else return '';
return ''
} catch (e) { } catch (e) {
return '' return '';
} }
} }
function initproduct() {
myorder.quantity = 0
myorder.quantitypreordered = 0
myorder.idStorehouse = ''
myorder.idGasordine = ''
}
async function updateproduct() { async function updateproduct() {
// console.log('props.id', props.id) // console.log('props.id', props.id)
myproduct.value = await products.getProductById(props.id) myproduct.value = await Products.getProductById(props.id);
// products.updateQuantityAvailable(myproduct.value._id) // Products.updateQuantityAvailable(myproduct.value._id)
} }
async function ricarica() { async function ricarica() {
endload.value = false endload.value = false;
const prod = await products.loadProductById(myproduct.value._id) const prod = await Products.loadProductById(myproduct.value._id);
if (prod) { if (prod) {
myproduct.value = prod myproduct.value = prod;
} }
await load() await load();
endload.value = true endload.value = true;
} }
async function updateproductmodif(element: any) { async function updateproductmodif(element: any) {
// console.log('updateproductmodif') // console.log('updateproductmodif')
try { try {
if (element?._id) { if (element?._id) {
myproduct.value = await products.getProductById(element?._id) myproduct.value = await Products.getProductById(element?._id);
} else { } else {
myproduct.value = await products.getProductById(props.id) myproduct.value = await Products.getProductById(props.id);
} }
updateLabel() updateLabel();
} catch (e) { } catch (e) {
console.error('err', e) console.error('err', e);
} }
} }
function getStorehouses() { function getStorehouses() {
if (!myproduct.value) if (!myproduct.value) return [];
return []
const myarr: any = [] const myarr: any = [];
let ind = 1 let ind = 1;
myproduct.value.storehouses.forEach((store) => { myproduct.value.storehouses.forEach((store) => {
myarr.push( myarr.push({
{
id: ind, id: ind,
label: store.name + ' (' + store.city + ')', label: store.name + ' (' + store.city + ')',
value: store._id value: store._id,
}) });
ind++ ind++;
}) });
// console.log('arraystore', myarr) // console.log('arraystore', myarr)
return myarr return myarr;
} }
function checkifCartDisable() { function checkifCartDisable() {
// return !myorder.idStorehouse // return !myorder.idStorehouse
return isOrdineChiuso() return isOrdineChiuso();
} }
function getQtyWarn() { function getQtyWarn() {
if (myorder.quantity > 0) { if (myorder.quantity > 0) {
return t('ecomm.di_cui_x_in_carrello', { qty: myorder.quantity }) return t('ecomm.di_cui_x_in_carrello', { qty: myorder.quantity });
} }
return '' return '';
} }
function getQtyWarnPreOrdered() { function getQtyWarnPreOrdered() {
if (myorder.quantitypreordered > 0) { if (myorder.quantitypreordered > 0) {
return t('ecomm.di_cui_x_in_carrello', { qty: myorder.quantitypreordered }) return t('ecomm.di_cui_x_in_carrello', { qty: myorder.quantitypreordered });
} }
return '' return '';
} }
watch(() => props.id, async (newval, oldval) => { watch(
() => props.id,
async (newval, oldval) => {
// console.log('change code') // console.log('change code')
await load() await load();
}) }
);
watch(() => storeSelected.value, (newval, oldval) => { watch(
myorder.idStorehouse = newval () => storeSelected.value,
}) (newval, oldval) => {
myorder.idStorehouse = newval;
}
);
function updateLabel() { function updateLabel() {
let dataArrivoMerce = '' let dataArrivoMerce = '';
let dataRitiro = '' let dataRitiro = '';
try { try {
if (myproduct.value && myproduct.value.gasordine) { if (myproduct.value && myproduct.value.gasordine) {
if (myproduct.value.gasordine.data_arrivo_merce) if (myproduct.value.gasordine.data_arrivo_merce)
dataArrivoMerce = tools.getstrDateShort(myproduct.value.gasordine.data_arrivo_merce) dataArrivoMerce = tools.getstrDateShort(
myproduct.value.gasordine.data_arrivo_merce
);
if (myproduct.value.gasordine.dataora_ritiro) if (myproduct.value.gasordine.dataora_ritiro)
dataRitiro = tools.getstrDateTime(myproduct.value.gasordine.dataora_ritiro) dataRitiro = tools.getstrDateTime(myproduct.value.gasordine.dataora_ritiro);
} else { } else {
dataArrivoMerce = '' dataArrivoMerce = '';
dataRitiro = '' dataRitiro = '';
}
} catch (e) {
} }
} catch (e) {}
if (labelDataArrivoMerce.value !== dataArrivoMerce) if (labelDataArrivoMerce.value !== dataArrivoMerce)
labelDataArrivoMerce.value = dataArrivoMerce labelDataArrivoMerce.value = dataArrivoMerce;
if (labelDataRitiro.value !== dataRitiro) if (labelDataRitiro.value !== dataRitiro) labelDataRitiro.value = dataRitiro;
labelDataRitiro.value = dataRitiro
updateTimerLabel() updateTimerLabel();
} }
async function mounted() { async function mounted() {
await load() await load();
// Start the timer when the component is mounted // Start the timer when the component is mounted
startTimer(); startTimer();
@@ -305,15 +308,24 @@ export default defineComponent({
} }
function updateTimerLabel() { function updateTimerLabel() {
if (myproduct.value && myproduct.value.gasordine && myproduct.value.gasordine._id && myproduct.value.gasordine.dataora_chiusura_ordini) if (
timerLabelScadenza.value = tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) myproduct.value &&
else myproduct.value.gasordine &&
timerLabelScadenza.value = '' myproduct.value.gasordine._id &&
myproduct.value.gasordine.dataora_chiusura_ordini
)
timerLabelScadenza.value = tools.getCountDown(
myproduct.value.gasordine.dataora_chiusura_ordini
);
else timerLabelScadenza.value = '';
} }
function isOrdineChiuso() { function isOrdineChiuso() {
return myproduct.value.gasordine && myproduct.value.gasordine.dataora_chiusura_ordini && return (
myproduct.value.gasordine &&
myproduct.value.gasordine.dataora_chiusura_ordini &&
tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) === '' tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) === ''
);
} }
function startTimer() { function startTimer() {
@@ -322,76 +334,74 @@ export default defineComponent({
} }
async function load() { async function load() {
initproduct() Products.initproduct(myorder);
await updateproduct() await updateproduct();
labelDataArrivoMerce.value = ''
labelDataRitiro.value = ''
// console.log('Load', myproduct.value.name) labelDataArrivoMerce.value = '';
// console.log('created Cproductcard', code) labelDataRitiro.value = '';
arrordersCart.value = products.getOrdersCartInAttesaByIdProduct(myproduct.value._id) arrordersCart.value = Products.getOrdersCartInAttesaByIdProduct(
myproduct.value._id
);
if (!!myproduct.value) { if (!!myproduct.value) {
if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) { Products.setMyOrder(myorder, myproduct.value, storeSelected.value, {
// Se solo 1 presente, metto fisso l'unico negozio ! setstore: true,
myorder.idStorehouse = myproduct.value.storehouses[0]._id });
} }
if (myproduct.value.gasordine) { updateLabel();
myorder.idGasordine = myproduct.value.gasordine._id
}
const ord = products.getOrderProductInCart(myproduct.value._id)
if (ord) {
myorder.quantity = ord.quantity
myorder.quantitypreordered = ord.quantitypreordered
// Seleziona il Negozio che avevo già scelto nell'ordine !
if (ord.idStorehouse)
storeSelected.value = ord.idStorehouse
}
}
updateLabel()
// console.log('°°° ENDLOAD °°°') // console.log('°°° ENDLOAD °°°')
endload.value = true endload.value = true;
} }
function getclimgproduct() { function getclimgproduct() {
return 'myimgproduct centermydiv' return 'myimgproduct centermydiv';
} }
function visuListDisponibili() { function visuListDisponibili() {
openlistorders.value = true openlistorders.value = true;
sumval.value = products.getSumQtyOrderProductInOrdersCart(myproduct.value._id) sumval.value = Products.getSumQtyOrderProductInOrdersCart(myproduct.value._id);
listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => orderscart.items!.reduce((accumulator, item) => { listord.value = arrordersCart.value.filter((orderscart: IOrderCart) =>
return accumulator + item.order.quantity orderscart.items!.reduce((accumulator, item) => {
}, 0)) return accumulator + item.order.quantity;
}, 0)
);
} }
function visuListBookable() { function visuListBookable() {
openlistorders.value = true openlistorders.value = true;
sumval.value = products.getSumQtyPreOrderInOrdersCart(myproduct.value._id) sumval.value = Products.getSumQtyPreOrderInOrdersCart(myproduct.value._id);
listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => orderscart.items!.reduce((accumulator, item) => { listord.value = arrordersCart.value.filter((orderscart: IOrderCart) =>
return accumulator + item.order.quantitypreordered orderscart.items!.reduce((accumulator, item) => {
}, 0)) return accumulator + item.order.quantitypreordered;
}, 0)
);
} }
function isOrdGas(): boolean { function isOrdGas(): boolean {
return (myproduct.value && !!myproduct.value.idGasordine && myproduct.value.gasordine! && myproduct.value.gasordine.active) return (
myproduct.value &&
!!myproduct.value.idGasordine &&
myproduct.value.gasordine! &&
myproduct.value.gasordine.active
);
} }
function getpercqtaraggiunta(): number { function getpercqtaraggiunta(): number {
if (myproduct.value) if (myproduct.value)
return tools.calcperc((myproduct.value.bookableGASBloccatiQty + myproduct.value.QuantitaPrenotateInAttesa!) * myproduct.value.productInfo.weight!, myproduct.value.qtyToReachForGas * myproduct.value.productInfo.weight!) / 100 return (
else tools.calcperc(
return 0 (myproduct.value.bookableGASBloccatiQty +
myproduct.value.QuantitaPrenotateInAttesa!) *
myproduct.value.productInfo.weight!,
myproduct.value.qtyToReachForGas * myproduct.value.productInfo.weight!
) / 100
);
else return 0;
} }
function toggleFullScreen() { function toggleFullScreen() {
@@ -430,7 +440,7 @@ export default defineComponent({
} }
function naviga(path: string) { function naviga(path: string) {
$router.push(path) $router.push(path);
} }
function hasImage(): boolean { function hasImage(): boolean {
@@ -439,11 +449,11 @@ export default defineComponent({
} }
const { imagefile, image_link } = myproduct.value.productInfo; const { imagefile, image_link } = myproduct.value.productInfo;
return ((!!imagefile && imagefile !== '') || (!!image_link && image_link !== '')) return (!!imagefile && imagefile !== '') || (!!image_link && image_link !== '');
} }
onMounted(mounted) onMounted(mounted);
onBeforeUnmount(beforeDestroy) onBeforeUnmount(beforeDestroy);
return { return {
visuListDisponibili, visuListDisponibili,
@@ -465,7 +475,7 @@ export default defineComponent({
openlistorders, openlistorders,
func_tools, func_tools,
toolsext, toolsext,
products, Products,
arrordersCart, arrordersCart,
endload, endload,
shared_consts, shared_consts,
@@ -493,6 +503,6 @@ export default defineComponent({
ricarica, ricarica,
apriSchedaPDF, apriSchedaPDF,
hasImage, hasImage,
} };
} },
}) });

View File

@@ -136,7 +136,7 @@
v-if=" v-if="
(cosa === shared_consts.PROD.TUTTI && !isOrdGas()) || (cosa === shared_consts.PROD.TUTTI && !isOrdGas()) ||
cosa === shared_consts.PROD.BOTTEGA || cosa === shared_consts.PROD.BOTTEGA ||
(cosa === shared_consts.PROD.GAS && products.getQtyAvailable(myproduct) > 0) (cosa === shared_consts.PROD.GAS && Products.getQtyAvailable(myproduct) > 0)
" "
:clickable="tools.isManager()" :clickable="tools.isManager()"
style="padding: 16px !important;" style="padding: 16px !important;"
@@ -166,7 +166,7 @@
v-if="!editOn" v-if="!editOn"
class="prod_disp" class="prod_disp"
> >
{{ products.getQtyAvailable(myproduct) }} {{ Products.getQtyAvailable(myproduct) }}
</span> </span>
<CMyValueDb <CMyValueDb
v-if="editOn" v-if="editOn"
@@ -193,7 +193,7 @@
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
<q-item-section <q-item-section
v-if="tools.isManager() && products.getQtyBloccataAvailable(myproduct) > 0" v-if="tools.isManager() && Products.getQtyBloccataAvailable(myproduct) > 0"
> >
<q-item-section avatar> <q-item-section avatar>
<q-icon <q-icon
@@ -203,7 +203,7 @@
</q-item-section> </q-item-section>
<q-item-section <q-item-section
v-if=" v-if="
tools.isManager() && products.getQtyBloccataAvailable(myproduct) > 0 tools.isManager() && Products.getQtyBloccataAvailable(myproduct) > 0
" "
> >
<q-item-label> {{ t('ecomm.bloccati') }}: </q-item-label> <q-item-label> {{ t('ecomm.bloccati') }}: </q-item-label>
@@ -240,7 +240,7 @@
{{ myproduct.productInfo.name }} {{ myproduct.productInfo.name }}
</div> </div>
<div v-if="myproduct?.productInfo?.authors" class="text-h8 text-italic titolo_prod q-mb-sm"> <div v-if="myproduct?.productInfo?.authors" class="text-h8 text-italic titolo_prod q-mb-sm">
{{ products.getAutoriByArrayAuthors(myproduct.productInfo.authors) }} {{ Products.getAutoriByArrayAuthors(myproduct.productInfo.authors) }}
</div> </div>
<div class="product_code"> <div class="product_code">
&nbsp; {{ t('ecomm.codice') }}: {{ myproduct.productInfo.code }} &nbsp; {{ t('ecomm.codice') }}: {{ myproduct.productInfo.code }}
@@ -552,7 +552,7 @@
</q-item-section> </q-item-section>
<q-item-section <q-item-section
v-if=" v-if="
tools.isManager() && products.getQtyBloccataBookableAvailable(myproduct) > 0 tools.isManager() && Products.getQtyBloccataBookableAvailable(myproduct) > 0
" "
> >
<q-item-section avatar> <q-item-section avatar>
@@ -715,7 +715,7 @@
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
<q-item-section <q-item-section
v-if="tools.isManager() && products.getQtyBloccataAvailable(myproduct) > 0" v-if="tools.isManager() && Products.getQtyBloccataAvailable(myproduct) > 0"
> >
<q-item-section avatar> <q-item-section avatar>
<q-icon <q-icon
@@ -724,12 +724,12 @@
/> />
</q-item-section> </q-item-section>
<q-item-section <q-item-section
v-if="tools.isManager() && products.getQtyBloccataAvailable(myproduct) > 0" v-if="tools.isManager() && Products.getQtyBloccataAvailable(myproduct) > 0"
> >
<q-item-label> {{ t('ecomm.bloccati') }}: </q-item-label> <q-item-label> {{ t('ecomm.bloccati') }}: </q-item-label>
<q-item-label> <q-item-label>
<span class="text-black q-ml-xs text-h8"> <span class="text-black q-ml-xs text-h8">
{{ products.getQtyBloccataAvailable(myproduct) }}</span {{ Products.getQtyBloccataAvailable(myproduct) }}</span
> >
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
@@ -843,16 +843,16 @@
<q-btn <q-btn
icon="fas fa-cart-arrow-down" icon="fas fa-cart-arrow-down"
:color=" :color="
checkifCartDisable() || !products.enableSubQty(myorder) checkifCartDisable() || !Products.enableSubQty(myorder)
? 'grey' ? 'grey'
: 'negative' : 'negative'
" "
:disable="checkifCartDisable() || !products.enableSubQty(myorder)" :disable="checkifCartDisable() || !Products.enableSubQty(myorder)"
rounded rounded
size="md" size="md"
:label=" :label="
t('products.subcart', { t('products.subcart', {
qta: products.qtaNextSub(myorder, myproduct), qta: Products.qtaNextSub(myorder, myproduct),
}) })
" "
@click="addtoCart(false)" @click="addtoCart(false)"
@@ -877,16 +877,16 @@
<q-btn <q-btn
icon-right="fas fa-cart-plus" icon-right="fas fa-cart-plus"
:color=" :color="
checkifCartDisable() || !products.enableAddQty(myorder, myproduct) checkifCartDisable() || !Products.enableAddQty(myorder, myproduct)
? 'grey' ? 'grey'
: 'positive' : 'positive'
" "
:disable="checkifCartDisable() || !products.enableAddQty(myorder, myproduct)" :disable="checkifCartDisable() || !Products.enableAddQty(myorder, myproduct)"
rounded rounded
size="md" size="md"
:label=" :label="
t('products.addcart', { t('products.addcart', {
qta: products.qtaNextAdd(myorder, myproduct), qta: Products.qtaNextAdd(myorder, myproduct),
}) })
" "
@click="addtoCart(true)" @click="addtoCart(true)"

View File

@@ -1,4 +1,12 @@
import { PropType, computed, defineComponent, onMounted, ref, watch } from 'vue'; import {
PropType,
computed,
defineComponent,
onMounted,
ref,
watch,
reactive,
} from 'vue';
import draggable from 'vuedraggable'; import draggable from 'vuedraggable';
import { tools } from '@tools'; import { tools } from '@tools';
@@ -7,7 +15,8 @@ import { useQuasar } from 'quasar';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useGlobalStore } from '@src/store/globalStore'; import { useGlobalStore } from '@src/store/globalStore';
import { useProducts } from '@src/store/productStore'; import { useProducts } from '@src/store/Products';
import { useUserStore } from '@src/store/UserStore';
import { CMyValueDb } from '@src/components/CMyValueDb'; import { CMyValueDb } from '@src/components/CMyValueDb';
import { CSchedaProdotto } from '@src/components/CSchedaProdotto'; import { CSchedaProdotto } from '@src/components/CSchedaProdotto';
@@ -20,7 +29,6 @@ import { IAuthor, ICatProd } from 'app/src/model';
import type { IMyScheda, IOptCatalogo, IProduct } from '@src/model'; import type { IMyScheda, IOptCatalogo, IProduct } from '@src/model';
import { shared_consts } from 'app/src/common/shared_vuejs'; import { shared_consts } from 'app/src/common/shared_vuejs';
import { useProducts } from 'app/src/store/Products';
import { CViewTable } from '../CViewTable'; import { CViewTable } from '../CViewTable';
import { CLabel } from '../CLabel'; import { CLabel } from '../CLabel';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@@ -67,16 +75,17 @@ export default defineComponent({
// Copia locale della lista_prodotti per manipolazione interna // Copia locale della lista_prodotti per manipolazione interna
const internalProducts = ref([...(props.lista_prodotti || [])]); const internalProducts = ref([...(props.lista_prodotti || [])]);
const productStore = useProducts();
const $router = useRouter(); const $router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const $q = useQuasar(); const $q = useQuasar();
const arrordersCart = ref(<IOrderCart[]>[]);
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
const products = useProducts(); const ProductStore = useProducts();
const userStore = useUserStore();
const showProd = ref(false); const showProd = ref(false);
const selProd = ref(<IProduct | null>null); const selProd = ref(<IProduct | null>null);
@@ -97,6 +106,7 @@ export default defineComponent({
const addstr = ref(''); const addstr = ref('');
const optionscatalogo = ref(<any>{ maxlength: 0 }); const optionscatalogo = ref(<any>{ maxlength: 0 });
function handleUpdate(newList) { function handleUpdate(newList) {
@@ -302,6 +312,14 @@ export default defineComponent({
noexp: true, noexp: true,
notsortable: true, notsortable: true,
}, },
{
name: 'addtocart',
label: 'Carrello',
field: 'addtocart',
align: 'center',
noexp: true,
notsortable: true,
},
{ name: 'name', label: 'Titolo', field: 'name', align: 'left' }, { name: 'name', label: 'Titolo', field: 'name', align: 'left' },
{ {
name: 'sottotitolo', name: 'sottotitolo',
@@ -436,18 +454,28 @@ export default defineComponent({
const allColumnsComputed = computed(() => { const allColumnsComputed = computed(() => {
return allColumns.value.filter( return allColumns.value.filter(
(col) => !col.visu || col.visu === costanti.VISUCAMPI.PER_TUTTI || (col.visu === costanti.VISUCAMPI.PER_EDITORE && tools.isCollaboratore()) (col) =>
!col.visu ||
col.visu === costanti.VISUCAMPI.PER_TUTTI ||
(col.visu === costanti.VISUCAMPI.PER_EDITORE && tools.isCollaboratore())
); );
}); });
async function mounted() { async function mounted() {
console.log('mounted CProductTable'); //myorder = ProductStore.createMyOrder()
// ProductStore.initproduct(myorder);
internalProducts.value.forEach((p: IProduct) => {
p.myorder = ProductStore.createMyOrder();
});
// console.log('mounted CProductTable');
loading.value = true; loading.value = true;
if (props.table === shared_consts.TABLES_CATALOG) { if (props.table === shared_consts.TABLES_CATALOG) {
selectedColumns.value = selectedColumns_Catalogs.value; selectedColumns.value = selectedColumns_Catalogs.value;
} else { } else {
// "products" // "ProductStore"
selectedColumns.value = tools.isUtente() selectedColumns.value = tools.isUtente()
? selectedColumns_Utenti.value ? selectedColumns_Utenti.value
: selectedColumns_Editori.value; : selectedColumns_Editori.value;
@@ -455,10 +483,10 @@ export default defineComponent({
addstr.value = tools.addstrCookie(props.table); addstr.value = tools.addstrCookie(props.table);
if (props.table === 'products') { if (props.table === shared_consts.TABLES_PRODUCTS) {
allColumns.value = allColumns_Catalog.value; allColumns.value = allColumns_Catalog.value;
isVisibleEditBtn.value = true; isVisibleEditBtn.value = true;
} else if (props.table === 'catalogs') { } else if (props.table === shared_consts.TABLES_CATALOG) {
allColumns.value = allColumns_Raccolta.value; allColumns.value = allColumns_Raccolta.value;
isVisibleEditBtn.value = false; isVisibleEditBtn.value = false;
} }
@@ -522,6 +550,8 @@ export default defineComponent({
return tools.getstrDate(catalog.data_online); return tools.getstrDate(catalog.data_online);
case 'data_online_stampa': case 'data_online_stampa':
return tools.getstrDate(catalog.data_online_stampa); return tools.getstrDate(catalog.data_online_stampa);
case 'addtocart':
return true;
case 'image': case 'image':
return catalog.foto_collana?.imagefile return catalog.foto_collana?.imagefile
? tools.getFullFileNameByImageFile( ? tools.getFullFileNameByImageFile(
@@ -535,7 +565,10 @@ export default defineComponent({
switch (field.field) { switch (field.field) {
case 'image': case 'image':
return element.productInfo?.imagefile return element.productInfo?.imagefile
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile) ? tools.getFullFileNameByImageFile(
'productInfos',
element.productInfo?.imagefile
)
: element.productInfo?.image_link; : element.productInfo?.image_link;
case 'name': case 'name':
@@ -576,21 +609,25 @@ export default defineComponent({
return element.arrvariazioni?.[0]?.edizione; return element.arrvariazioni?.[0]?.edizione;
case 'casaeditrice': case 'casaeditrice':
return products.getCasaEditriceByIdPublisher(element.productInfo?.idPublisher); return ProductStore.getCasaEditriceByIdPublisher(
element.productInfo?.idPublisher
);
case 'idCollana': case 'idCollana':
return tools.formatCollane(element.productInfo?.idCollana); return tools.formatCollane(element.productInfo?.idCollana);
case 'stato': case 'stato':
return products.getDescrStatiProdottoByIdStatoProdotto( return ProductStore.getDescrStatiProdottoByIdStatoProdotto(
element.productInfo?.idStatoProdotto || '' element.productInfo?.idStatoProdotto || ''
); );
case 'tipologia': case 'tipologia':
return products.getDescrByIdTipologia(element.arrvariazioni?.[0]?.idTipologia || ''); return ProductStore.getDescrByIdTipologia(
element.arrvariazioni?.[0]?.idTipologia || ''
);
case 'tipoformato': case 'tipoformato':
return products.getDescrByIdTipoFormato( return ProductStore.getDescrByIdTipoFormato(
element.arrvariazioni?.[0]?.idTipoFormato || '' element.arrvariazioni?.[0]?.idTipoFormato || ''
); );
@@ -599,11 +636,11 @@ export default defineComponent({
case 'prezzo': case 'prezzo':
// return element.price ? '€ ' + element.price.toFixed(2) : ''; // return element.price ? '€ ' + element.price.toFixed(2) : '';
return '€ ' + element.arrvariazioni?.[0]?.price.toFixed(2); return '€ ' + element.arrvariazioni?.[0]?.price?.toFixed(2);
case 'prezzo_sconto': case 'prezzo_sconto':
// return element.sale_price ? '€ ' + element.sale_price.toFixed(2) : ''; // return element.sale_price ? '€ ' + element.sale_price.toFixed(2) : '';
return '€ ' + element.arrvariazioni?.[0]?.sale_price.toFixed(2); return '€ ' + element.arrvariazioni?.[0]?.sale_price?.toFixed(2);
case 'rank3M': case 'rank3M':
return element.productInfo?.rank3M; return element.productInfo?.rank3M;
@@ -637,7 +674,9 @@ export default defineComponent({
case 'quantity': case 'quantity':
if (tools.isUtente()) if (tools.isUtente())
return tools.getDescrQuantitàByQuantity(element.arrvariazioni?.[0]?.quantita); return tools.getDescrQuantitàByQuantity(
element.arrvariazioni?.[0]?.quantita
);
else return element.arrvariazioni?.[0]?.quantita; else return element.arrvariazioni?.[0]?.quantita;
default: default:
@@ -659,13 +698,13 @@ export default defineComponent({
: 'text-red'; : 'text-red';
case 'stato': case 'stato':
if (products.isProssimaUscita(element.productInfo)) { if (ProductStore.isProssimaUscita(element.productInfo)) {
return 'bg-purple-3'; return 'bg-purple-3';
} }
if (products.isPrevendita(element.productInfo)) { if (ProductStore.isPrevendita(element.productInfo)) {
return 'bg-blue-3'; return 'bg-blue-3';
} }
if (products.isNonVendibile(element.productInfo)) { if (ProductStore.isNonVendibile(element.productInfo)) {
return 'bg-grey'; return 'bg-grey';
} }
return ''; return '';
@@ -680,14 +719,14 @@ export default defineComponent({
} }
case 'quantity': case 'quantity':
if (products.isPubblicato(element.productInfo)) { if (ProductStore.isPubblicato(element.productInfo)) {
if (products.isQtaLimitata(element)) { if (ProductStore.isQtaLimitata(element)) {
return 'bg-yellow'; return 'bg-yellow';
} }
if (products.isInEsaurendo(element)) { if (ProductStore.isInEsaurendo(element)) {
return 'bg-orange'; return 'bg-orange';
} }
if (products.isEsaurito(element)) { if (ProductStore.isEsaurito(element)) {
return 'text-white bg-red-10'; return 'text-white bg-red-10';
} }
} }
@@ -846,14 +885,19 @@ export default defineComponent({
persistent: false, persistent: false,
}) })
.onOk(() => { .onOk(() => {
internalProducts.value = internalProducts.value.filter((p: any) => p._id !== product._id); internalProducts.value = internalProducts.value.filter(
(p: any) => p._id !== product._id
);
emit('update:lista_prodotti', internalProducts.value); // Notifica il parent del cambiamento emit('update:lista_prodotti', internalProducts.value); // Notifica il parent del cambiamento
}); });
}; };
// 8. Salvataggio delle colonne selezionate in un cookie // 8. Salvataggio delle colonne selezionate in un cookie
const saveSelectedColumns = () => { const saveSelectedColumns = () => {
tools.setCookie(addstr.value + 'selColCat_2', JSON.stringify(selectedColumns.value)); tools.setCookie(
addstr.value + 'selColCat_2',
JSON.stringify(selectedColumns.value)
);
}; };
// 9. Watcher per salvare automaticamente le preferenze quando cambiano // 9. Watcher per salvare automaticamente le preferenze quando cambiano
@@ -901,7 +945,7 @@ export default defineComponent({
let link_macro = element.productInfo?.link_macro; let link_macro = element.productInfo?.link_macro;
if (tools.isUtente() && link_macro) { if (tools.isUtente() && link_macro) {
tools.openUrl(link_macro + '?utm_source=catalog&id=' + props.idcatalog) tools.openUrl(link_macro + '?utm_source=catalog&id=' + props.idcatalog);
} else { } else {
selProd.value = element; selProd.value = element;
@@ -910,7 +954,7 @@ export default defineComponent({
} else if (isCatalog()) { } else if (isCatalog()) {
// Apri la pagina del catalogo // Apri la pagina del catalogo
if (element.idPageAssigned) { if (element.idPageAssigned) {
const mypagepath = productStore.getPathByPage(element.idPageAssigned); const mypagepath = ProductStore.getPathByPage(element.idPageAssigned);
// fai il route sulla pagina myfilename // fai il route sulla pagina myfilename
$router.push(`/${mypagepath}`); $router.push(`/${mypagepath}`);
@@ -953,9 +997,9 @@ export default defineComponent({
console.log('PRODUCT TABLE: updateproductmodif'); console.log('PRODUCT TABLE: updateproductmodif');
try { try {
if (element?._id) { if (element?._id) {
selProd.value = await products.getProductById(element?._id); selProd.value = await ProductStore.getProductById(element?._id);
} else { } else {
selProd.value = await products.getProductById(selProd.value?._id); selProd.value = await ProductStore.getProductById(selProd.value?._id);
} }
// update record inside internalProducts // update record inside internalProducts
@@ -1019,7 +1063,9 @@ export default defineComponent({
return sortDirection.value === 1 ? aVal - bVal : bVal - aVal; return sortDirection.value === 1 ? aVal - bVal : bVal - aVal;
} }
if (typeof aVal === 'string' && typeof bVal === 'string') { if (typeof aVal === 'string' && typeof bVal === 'string') {
return sortDirection.value === 1 ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal); return sortDirection.value === 1
? aVal.localeCompare(bVal)
: bVal.localeCompare(aVal);
} }
return sortDirection.value === 1 return sortDirection.value === 1
? String(aVal).localeCompare(String(bVal)) ? String(aVal).localeCompare(String(bVal))
@@ -1092,7 +1138,9 @@ export default defineComponent({
} }
function isSortable(field: string): boolean { function isSortable(field: string): boolean {
return allColumns && !allColumns.value.find((col) => col.name === field)?.notsortable; return (
allColumns && !allColumns.value.find((col) => col.name === field)?.notsortable
);
} }
function getImageByElement(element) { function getImageByElement(element) {
@@ -1107,10 +1155,48 @@ export default defineComponent({
} }
function isProduct() { function isProduct() {
return props.table === 'products'; return props.table === shared_consts.TABLES_PRODUCTS;
} }
function isCatalog() { function isCatalog() {
return props.table === 'catalogs'; return props.table === shared_consts.TABLES_CATALOG;
}
/*
async function addToCart(element: any) {
if (props.table === shared_consts.TABLES_PRODUCTS) {
await updateProduct(element);
if (!!element) {
arrordersCart.value = ProductStore.getOrdersCartInAttesaByIdProduct(
element._id
);
ProductStore.setMyOrder(myorder, element, null, {
setstore: false,
});
}
}
}*/
async function addtoCart(element: any, add: boolean) {
if (!userStore.isLogged) {
tools.showNeutralNotif($q, t('ecomm.area_personale'));
globalStore.rightDrawerOpen = true;
return false;
}
ProductStore.setMyOrder(element.myorder, element, null, {
setstore: false,
});
const ris = await ProductStore.addtoCartBase({
$q,
t,
id: element._id,
order: element.myorder,
addqty: add,
});
updateProduct(element);
} }
onMounted(mounted); onMounted(mounted);
@@ -1144,7 +1230,7 @@ export default defineComponent({
updateproductmodif, updateproductmodif,
optionscatalogo, optionscatalogo,
t, t,
products, ProductStore,
sortTable, sortTable,
sortAttribute, sortAttribute,
sortDirection, sortDirection,
@@ -1160,6 +1246,8 @@ export default defineComponent({
isProduct, isProduct,
isCatalog, isCatalog,
allColumnsComputed, allColumnsComputed,
addtoCart,
arrordersCart,
}; };
}, },
}); });

View File

@@ -54,9 +54,7 @@
<span>{{ col.label }}</span> <span>{{ col.label }}</span>
<span v-if="isSortable(col.name)"> <span v-if="isSortable(col.name)">
<q-icon <q-icon
v-if=" v-if="sortAttribute === col.name && optcatalogo.showListaArgomenti"
sortAttribute === col.name && optcatalogo.showListaArgomenti
"
:name="sortDirection === 1 ? 'expand_less' : 'expand_more'" :name="sortDirection === 1 ? 'expand_less' : 'expand_more'"
size="36px" size="36px"
class="q-ml-xs" class="q-ml-xs"
@@ -131,11 +129,40 @@
/> />
</span> </span>
</td> </td>
<td v-else-if="field.name === 'addtocart' && isColumnVisible('addtocart')">
<q-btn
icon-right="fas fa-cart-plus"
color="positive"
rounded
dense
size="sm"
:label="
t('products.addcart', {
qta: ProductStore.qtaNextAdd(element.myorder, element),
})
"
@click="addtoCart(element, true)"
>
</q-btn>
<q-btn
v-if="ProductStore.enableSubQty(element.myorder)"
icon-right="fas fa-cart-arrow-down"
color="negative"
rounded
dense
size="sm"
:label="
t('products.subcart', {
qta: ProductStore.qtaNextSub(element.myorder, element),
})
"
@click="addtoCart(element, false)"
>
</q-btn>
</td>
<!-- Immagine Piccola --> <!-- Immagine Piccola -->
<td <td v-else-if="field.name === 'image' && isColumnVisible('image')">
v-else-if="field.name === 'image' && isColumnVisible('image')"
>
<q-img <q-img
:src=" :src="
getImageByElement(element) getImageByElement(element)
@@ -162,9 +189,7 @@
</td> </td>
<!-- Azioni --> <!-- Azioni -->
<td <td
v-else-if=" v-else-if="field.name === 'actions' && isColumnVisible('actions', true)"
field.name === 'actions' && isColumnVisible('actions', true)
"
> >
<q-btn-dropdown <q-btn-dropdown
label="Azioni" label="Azioni"

View File

@@ -365,7 +365,7 @@ export default defineComponent({
mykey: 'idCatProds', mykey: 'idCatProds',
debounce: '1000', debounce: '1000',
type: costanti.FieldType.multiselect, type: costanti.FieldType.multiselect,
jointable: 'catprtotali', jointable: 'catprods',
dense: true, dense: true,
}, },
{ {

View File

@@ -72,7 +72,7 @@
v-model="causal" v-model="causal"
rounded rounded
filled filled
maxlength="80" maxlength="120"
counter counter
:label="$t('circuit.note_richiedente')" :label="$t('circuit.note_richiedente')"
class="q-ma-sm full-width q-px-xs" class="q-ma-sm full-width q-px-xs"

View File

@@ -17,7 +17,6 @@ export interface ICatalog {
collana_info?: ICollana collana_info?: ICollana
descr_introduttiva?: string descr_introduttiva?: string
idPageAssigned?: string idPageAssigned?: string
idPageAssigned_stampa?: string
referenti?: string[] referenti?: string[]
img_bordata?: IImg, img_bordata?: IImg,
img_intro?: IImg, img_intro?: IImg,
@@ -65,7 +64,6 @@ export interface IRaccoltaCatalogo {
foto_raccolta?: IImg, foto_raccolta?: IImg,
idPageAssigned?: string idPageAssigned?: string
idPageAssigned_stampa?: string
nomefile_da_generare?: string nomefile_da_generare?: string

View File

@@ -195,6 +195,7 @@ export interface IProductsState {
products: IProduct[] products: IProduct[]
authors: IAuthor[] authors: IAuthor[]
publishers: IPublisher[] publishers: IPublisher[]
publishers_sort_qty?: IPublisher[]
stati_prodotto?: T_Web_StatiProdotto[] stati_prodotto?: T_Web_StatiProdotto[]
tipologie?: T_Web_Tipologie[] tipologie?: T_Web_Tipologie[]
tipoformato?: T_WEB_TipiFormato[] tipoformato?: T_WEB_TipiFormato[]

View File

@@ -80,6 +80,7 @@ const msg_it = {
canBeShipped: 'Può essere spedito', canBeShipped: 'Può essere spedito',
canBeBuyOnline: 'Acquistabile On Line', canBeBuyOnline: 'Acquistabile On Line',
date: 'Data', date: 'Data',
date_pub: 'Data Pubbl.',
quantity: 'Quantità', quantity: 'Quantità',
quantityAvailable: 'Disponibili', quantityAvailable: 'Disponibili',
stockQty: 'In Magazzino', stockQty: 'In Magazzino',
@@ -2054,7 +2055,6 @@ const msg_it = {
isCatalogoGenerale: 'Fa parte del Catalogo Generale', isCatalogoGenerale: 'Fa parte del Catalogo Generale',
collane: 'Collane', collane: 'Collane',
idPageAssigned: 'Pagina Assegnata', idPageAssigned: 'Pagina Assegnata',
idPageAssigned_stampa: 'Pagina Assegnata (per STAMPA)',
descr_introduttiva: 'Descrizione Introduttiva (circa 1300 battute)', descr_introduttiva: 'Descrizione Introduttiva (circa 1300 battute)',
editore: 'Marchio Editoriale', editore: 'Marchio Editoriale',
editore_includi: 'Includi Editoriale', editore_includi: 'Includi Editoriale',

View File

@@ -63,7 +63,7 @@ export const useCatalogStore = defineStore('CatalogStore', {
ris = await Api.SendReq('/catalogs/id/' + id, 'GET', null) ris = await Api.SendReq('/catalogs/id/' + id, 'GET', null)
.then((res) => { .then((res) => {
console.log('catalogs', res.data.catalog); // console.log('catalogs', res.data.catalog);
if (res.data.catalog) { if (res.data.catalog) {
// console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories) // console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories)
return res.data.catalog; return res.data.catalog;

View File

@@ -140,12 +140,6 @@ export const colTableRaccoltaCataloghi = [
fieldtype: costanti.FieldType.select, fieldtype: costanti.FieldType.select,
jointable: 'mypages_id', jointable: 'mypages_id',
}), }),
AddCol({
name: 'idPageAssigned_stampa',
label_trans: 'cataloglist.idPageAssigned_stampa',
fieldtype: costanti.FieldType.select,
jointable: 'mypages_id',
}),
AddCol({ AddCol({
name: 'nomefile_da_generare', name: 'nomefile_da_generare',
@@ -224,14 +218,14 @@ export const colTableCatalogList = [
name: 'editore', name: 'editore',
label_trans: 'cataloglist.editore_includi', label_trans: 'cataloglist.editore_includi',
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'publishers_totali', jointable: 'publishers_totali_sort_qty',
isadvanced_field: true, isadvanced_field: true,
}), }),
AddCol({ AddCol({
name: 'editore_escludi', name: 'editore_escludi',
label_trans: 'cataloglist.editore_escludi', label_trans: 'cataloglist.editore_escludi',
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'publishers_totali', jointable: 'publishers_totali_sort_qty',
isadvanced_field: true, isadvanced_field: true,
}), }),
AddCol({ AddCol({
@@ -272,13 +266,6 @@ export const colTableCatalogList = [
label_trans: 'cataloglist.pdf_online', label_trans: 'cataloglist.pdf_online',
}), }),
AddCol({
name: 'idPageAssigned_stampa',
label_trans: 'cataloglist.idPageAssigned_stampa',
fieldtype: costanti.FieldType.select,
jointable: 'mypages_id',
}),
AddCol({ AddCol({
name: 'img_bordata_stampa', name: 'img_bordata_stampa',
label_trans: 'cataloglist.img_bordata_stampa', label_trans: 'cataloglist.img_bordata_stampa',
@@ -4607,6 +4594,13 @@ export const fieldsTable = {
colkey: '_id', colkey: '_id',
collabel: (row: any) => row.name + ' (' + row.quanti + ')', collabel: (row: any) => row.name + ' (' + row.quanti + ')',
}, },
{
value: 'publishers_totali_sort_qty',
label: 'Nome',
columns: colTablePublisher,
colkey: '_id',
collabel: (row: any) => row.name + ' (' + row.quanti + ')',
},
{ {
value: 'catais', value: 'catais',
label: 'Categorie AI', label: 'Categorie AI',

View File

@@ -101,6 +101,7 @@ export const tools = {
FILTER_MYFOLLOW: 2, FILTER_MYFOLLOW: 2,
COOK_TIPOCONTO: 'TC_', COOK_TIPOCONTO: 'TC_',
COOK_ARGOM: 'CK_ARG',
COOK_SEARCH: 'SEARCH_', COOK_SEARCH: 'SEARCH_',
COOK_SELCART: 'SELCART_', COOK_SELCART: 'SELCART_',
COOK_SELGAS: 'SELGAS', COOK_SELGAS: 'SELGAS',
@@ -4105,7 +4106,7 @@ export const tools = {
}, },
setLangAtt($q: any, $router: Router, mylang: string) { setLangAtt($q: any, $router: Router, mylang: string) {
console.log('setLangAtt =', mylang); // console.log('setLangAtt =', mylang);
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
if (!mylang || typeof mylang !== 'string') { if (!mylang || typeof mylang !== 'string') {

View File

@@ -36,7 +36,7 @@ import { defineStore } from 'pinia';
import { useUserStore } from '@store/UserStore'; import { useUserStore } from '@store/UserStore';
import { toolsext } from '@store/Modules/toolsext'; import { toolsext } from '@store/Modules/toolsext';
import { useGlobalStore } from './globalStore'; import { useGlobalStore } from './globalStore';
import { ref } from 'vue'; import { ref, reactive } from 'vue';
import objectId from '@src/js/objectId'; import objectId from '@src/js/objectId';
import { costanti } from '@costanti'; import { costanti } from '@costanti';
@@ -1109,7 +1109,7 @@ export const useProducts = defineStore('Products', {
ris = await Api.SendReq('/products/id/' + id, 'GET', null) ris = await Api.SendReq('/products/id/' + id, 'GET', null)
.then((res) => { .then((res) => {
console.log('product', res.data.product); // console.log('product', res.data.product);
if (res.data.product) { if (res.data.product) {
// console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories) // console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories)
this.updateDataProduct(res); this.updateDataProduct(res);
@@ -1242,8 +1242,8 @@ export const useProducts = defineStore('Products', {
if (res && res.msgerr) { if (res && res.msgerr) {
return res; return res;
} else if (res && res.risult) { } else if (res && res.risult) {
order.quantity = res.myord.quantity; order.quantity = res?.myord?.quantity;
order.quantitypreordered = res.myord.quantitypreordered; order.quantitypreordered = res?.myord?.quantitypreordered;
} }
return res; return res;
}); });
@@ -1672,7 +1672,7 @@ export const useProducts = defineStore('Products', {
}, },
qtaNextAdd(myorder: IOrder, myproduct: IProduct): number { qtaNextAdd(myorder: IOrder, myproduct: IProduct): number {
let step = myproduct.minStepQty; let step = myproduct.minStepQty || 1;
if (this.getQtyAvailable(myproduct) > 0) { if (this.getQtyAvailable(myproduct) > 0) {
if (myorder.quantity === 0) step = myproduct.minBuyQty; if (myorder.quantity === 0) step = myproduct.minBuyQty;
} else { } else {
@@ -2557,5 +2557,52 @@ export const useProducts = defineStore('Products', {
return ''; return '';
} }
}, },
createMyOrder() {
let myorder = reactive(<IOrder>{
idapp: tools.getEnv('VITE_APP_ID'),
quantity: 0,
quantitypreordered: 0,
idStorehouse: '',
idGasordine: '',
storehouse: {},
gasordine: { active: false },
});
return myorder;
},
initproduct(myorder: IOrder) {
myorder.quantity = 0;
myorder.quantitypreordered = 0;
myorder.idStorehouse = '';
myorder.idGasordine = '';
},
setMyOrder(myorder: IOrder, myproduct: IProduct, storeSelected: any = null, options: any = {setstore: false}) {
if (myproduct.storehouses && myproduct.storehouses.length === 1) {
// Se solo 1 presente, metto fisso l'unico negozio !
myorder.idStorehouse = myproduct.storehouses[0]._id;
} else if (myproduct.storehouse) {
myorder.idStorehouse = myproduct.storehouse._id;
}
if (myproduct.gasordine) {
myorder.idGasordine = myproduct.gasordine._id;
}
const ord = this.getOrderProductInCart(myproduct._id);
if (ord) {
myorder.quantity = ord.quantity;
myorder.quantitypreordered = ord.quantitypreordered;
// Seleziona il Negozio che avevo già scelto nell'ordine !
if (options.setstore && ord.idStorehouse) {
storeSelected = ord.idStorehouse;
}
}
}
}, },
}); });

View File

@@ -244,7 +244,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
sovrascriviPaginaDefaultFromTemplate: sovrascriviPaginaDefaultFromTemplate:
(state: IGlobalState) => (idTemplate: string, origDimensioni: IDimensioni) => { (state: IGlobalState) => (idTemplate: string, origDimensioni: IDimensioni) => {
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate); const myfindelem = state.myelems.find(
(myelem: IMyElem) => myelem._id === idTemplate
);
const precname = origDimensioni.name; const precname = origDimensioni.name;
@@ -255,7 +257,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
// myelemtocopy.scheda._id = origScheda.scheda?._id; // myelemtocopy.scheda._id = origScheda.scheda?._id;
myelemtocopy.catalogo.dimensioni_def.isTemplate = false; myelemtocopy.catalogo.dimensioni_def.isTemplate = false;
myelemtocopy.catalogo.dimensioni_def.name = precname; myelemtocopy.catalogo.dimensioni_def.name = precname;
myelemtocopy.catalogo.dimensioni_def.linkIdTemplate = origDimensioni.linkIdTemplate; myelemtocopy.catalogo.dimensioni_def.linkIdTemplate =
origDimensioni.linkIdTemplate;
return myelemtocopy.catalogo; return myelemtocopy.catalogo;
} }
@@ -266,13 +269,15 @@ export const useGlobalStore = defineStore('GlobalStore', {
sovrascriviAreadistampaFromTemplate: sovrascriviAreadistampaFromTemplate:
(state: IGlobalState) => (idTemplate: string, optCatalogo: IOptCatalogo) => { (state: IGlobalState) => (idTemplate: string, optCatalogo: IOptCatalogo) => {
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate); const myfindelem = state.myelems.find(
(myelem: IMyElem) => myelem._id === idTemplate
);
if (myfindelem) { if (myfindelem) {
const myelemtocopy = tools.jsonCopy(myfindelem); const myelemtocopy = tools.jsonCopy(myfindelem);
if (myelemtocopy) { if (myelemtocopy) {
const linkIdTemplate = myelemtocopy.catalogo.print_linkIdTemplate const linkIdTemplate = myelemtocopy.catalogo.print_linkIdTemplate;
myelemtocopy.catalogo.print_isTemplate = false; myelemtocopy.catalogo.print_isTemplate = false;
myelemtocopy.catalogo.print_linkIdTemplate = linkIdTemplate; myelemtocopy.catalogo.print_linkIdTemplate = linkIdTemplate;
@@ -304,24 +309,31 @@ export const useGlobalStore = defineStore('GlobalStore', {
}, },
getColByStatusSkills: (state: IGlobalState) => (id: number) => { getColByStatusSkills: (state: IGlobalState) => (id: number) => {
const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id); const ctrec = state.statusSkills.find(
(mystatus: IStatusSkill) => mystatus._id === id
);
return ctrec && ctrec.color ? ctrec.color : 'green'; return ctrec && ctrec.color ? ctrec.color : 'green';
}, },
getStatusSkillById: (state: IGlobalState) => (id: number) => { getStatusSkillById: (state: IGlobalState) => (id: number) => {
const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id); const ctrec = state.statusSkills.find(
(mystatus: IStatusSkill) => mystatus._id === id
);
return ctrec ? ctrec.descr : ''; return ctrec ? ctrec.descr : '';
}, },
getStatusSkillIconById: (state: IGlobalState) => (id: number) => { getStatusSkillIconById: (state: IGlobalState) => (id: number) => {
const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id); const ctrec = state.statusSkills.find(
(mystatus: IStatusSkill) => mystatus._id === id
);
return ctrec ? ctrec.icon : ''; return ctrec ? ctrec.icon : '';
}, },
isNewVersionAvailable: (state: IGlobalState) => { isNewVersionAvailable: (state: IGlobalState) => {
// console.log('cfgServer', cfgServer) // console.log('cfgServer', cfgServer)
const serversrec = state.cfgServer.find( const serversrec = state.cfgServer.find(
(x) => x.chiave === toolsext.SERVKEY_VERS && x.idapp === tools.getEnv('VITE_APP_ID') (x) =>
x.chiave === toolsext.SERVKEY_VERS && x.idapp === tools.getEnv('VITE_APP_ID')
); );
// console.log('Record ', serversrec) // console.log('Record ', serversrec)
if (serversrec) { if (serversrec) {
@@ -499,7 +511,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'mypages_id') ris = state.mypage; else if (table === 'mypages_id') ris = state.mypage;
else if (table === toolsext.TABMYELEMS) ris = state.myelems; else if (table === toolsext.TABMYELEMS) ris = state.myelems;
else if (table === toolsext.TABCATALOGS) ris = catalogStore.catalogs!; else if (table === toolsext.TABCATALOGS) ris = catalogStore.catalogs!;
else if (table === toolsext.TABRACCOLTA_CATALOGHI) ris = catalogStore.raccoltacataloghis!; else if (table === toolsext.TABRACCOLTA_CATALOGHI)
ris = catalogStore.raccoltacataloghis!;
else if (table === toolsext.TABCALZOOM) ris = state.calzoom; else if (table === toolsext.TABCALZOOM) ris = state.calzoom;
else if (table === 'producers') ris = state.producers; else if (table === 'producers') ris = state.producers;
else if (table === 'storehouses') ris = state.storehouses; else if (table === 'storehouses') ris = state.storehouses;
@@ -522,6 +535,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'authors') ris = Products.authors; else if (table === 'authors') ris = Products.authors;
else if (table === 'publishers') ris = Products.publishers; else if (table === 'publishers') ris = Products.publishers;
else if (table === 'publishers_totali') ris = Products.publishers; else if (table === 'publishers_totali') ris = Products.publishers;
else if (table === 'publishers_totali_sort_qty')
ris = Products.publishers_sort_qty;
else if (table === 't_web_statiprodottos') ris = Products.stati_prodotto; else if (table === 't_web_statiprodottos') ris = Products.stati_prodotto;
else if (table === 't_web_tipologies') ris = Products.tipologie; else if (table === 't_web_tipologies') ris = Products.tipologie;
else if (table === 't_web_tipiformatos') ris = Products.tipoformato; else if (table === 't_web_tipiformatos') ris = Products.tipoformato;
@@ -556,7 +571,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABSECTORS) return state.sectors; else if (table === toolsext.TABSECTORS) return state.sectors;
else if (table === 'sectorgoods') return state.sectorgoods; else if (table === 'sectorgoods') return state.sectorgoods;
else if (table === 'catgrps') return state.catgrps; else if (table === 'catgrps') return state.catgrps;
else if (table === 'schedeopt') return Products.getSchedeOptByArrSchede(state.myschedas); else if (table === 'schedeopt')
return Products.getSchedeOptByArrSchede(state.myschedas);
else if (table === 'provinces') else if (table === 'provinces')
return state.provinces.filter( return state.provinces.filter(
(rec: IProvince) => !rec.card && rec.prov !== 'ITA' && rec.prov !== 'EST' (rec: IProvince) => !rec.card && rec.prov !== 'ITA' && rec.prov !== 'EST'
@@ -567,10 +583,12 @@ export const useGlobalStore = defineStore('GlobalStore', {
); );
if (arrprov) { if (arrprov) {
// const idCardArray: { _id: number, card: string }[] = arrprov.map(({ _id, card }) => ({ _id, card })); // const idCardArray: { _id: number, card: string }[] = arrprov.map(({ _id, card }) => ({ _id, card }));
const idCardArray: { card: string; label: string }[] = arrprov.map(({ card }) => ({ const idCardArray: { card: string; label: string }[] = arrprov.map(
({ card }) => ({
card, card,
label: card, label: card,
})); })
);
return idCardArray; return idCardArray;
} }
return []; return [];
@@ -601,7 +619,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
getdestnewsletterbyId: getdestnewsletterbyId:
(mystate: IGlobalState) => (mystate: IGlobalState) =>
(id: string): string => { (id: string): string => {
const myrec = mystate.destnewsletter.find((rec: IDestNewsletter) => rec._id === id); const myrec = mystate.destnewsletter.find(
(rec: IDestNewsletter) => rec._id === id
);
return !!myrec ? myrec.descr! : ''; return !!myrec ? myrec.descr! : '';
}, },
}, },
@@ -624,7 +644,15 @@ export const useGlobalStore = defineStore('GlobalStore', {
return []; return [];
}, },
setValueSettingsByKey({ key, value, serv }: { key: string; value: any; serv: boolean }): any { setValueSettingsByKey({
key,
value,
serv,
}: {
key: string;
value: any;
serv: boolean;
}): any {
// Update the Server // Update the Server
// Update in Memory // Update in Memory
@@ -633,7 +661,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
else myrec = this.settings.find((rec: any) => rec.key === key); else myrec = this.settings.find((rec: any) => rec.key === key);
if (myrec) { if (myrec) {
if (myrec.type === costanti.FieldType.date || myrec.type === costanti.FieldType.onlydate) if (
myrec.type === costanti.FieldType.date ||
myrec.type === costanti.FieldType.onlydate
)
myrec.value_date = value; myrec.value_date = value;
else if ( else if (
myrec.type === costanti.FieldType.number || myrec.type === costanti.FieldType.number ||
@@ -651,9 +682,15 @@ export const useGlobalStore = defineStore('GlobalStore', {
const myrec = this.getrecSettingsByKey(key, serv); const myrec = this.getrecSettingsByKey(key, serv);
// console.log('getValueSettingsByKey', myrec, 'key=', key, 'srv=', serv) // console.log('getValueSettingsByKey', myrec, 'key=', key, 'srv=', serv)
if (myrec) { if (myrec) {
if (myrec.type === costanti.FieldType.date || myrec.type === costanti.FieldType.onlydate) if (
myrec.type === costanti.FieldType.date ||
myrec.type === costanti.FieldType.onlydate
)
return myrec.value_date; return myrec.value_date;
if (myrec.type === costanti.FieldType.number || myrec.type === costanti.FieldType.hours) if (
myrec.type === costanti.FieldType.number ||
myrec.type === costanti.FieldType.hours
)
return myrec.value_num; return myrec.value_num;
if (myrec.type === costanti.FieldType.boolean) return myrec.value_bool; if (myrec.type === costanti.FieldType.boolean) return myrec.value_bool;
else if (myrec.type === costanti.FieldType.crypted) return '***********'; else if (myrec.type === costanti.FieldType.crypted) return '***********';
@@ -1496,9 +1533,20 @@ export const useGlobalStore = defineStore('GlobalStore', {
const obj = { test: 'OK! Versione Client: ' + tools.getvers(), timeout }; const obj = { test: 'OK! Versione Client: ' + tools.getvers(), timeout };
return Api.SendReq('/api/test-lungo', 'POST', obj, false, false, 0, 5000, null, null, { return Api.SendReq(
'/api/test-lungo',
'POST',
obj,
false,
false,
0,
5000,
null,
null,
{
timeout, timeout,
}) }
)
.then((res) => { .then((res) => {
return res; return res;
}) })
@@ -1851,7 +1899,13 @@ export const useGlobalStore = defineStore('GlobalStore', {
}); });
}, },
async GetArrDoniNavi({ ricalcola, showall }: { ricalcola: boolean; showall: boolean }) { async GetArrDoniNavi({
ricalcola,
showall,
}: {
ricalcola: boolean;
showall: boolean;
}) {
console.log('GetArrDoniNavi'); console.log('GetArrDoniNavi');
const mydata = { const mydata = {
@@ -1933,7 +1987,11 @@ export const useGlobalStore = defineStore('GlobalStore', {
}, },
async loadTest(ind: number, numval: number) { async loadTest(ind: number, numval: number) {
const restest = await Api.SendReq(`/testpao/?numval=${numval}&ind=${ind}`, 'GET', null); const restest = await Api.SendReq(
`/testpao/?numval=${numval}&ind=${ind}`,
'GET',
null
);
return restest; return restest;
}, },
@@ -1968,12 +2026,18 @@ export const useGlobalStore = defineStore('GlobalStore', {
calendarStore.bookedevent = res.data.bookedevent ? res.data.bookedevent : []; calendarStore.bookedevent = res.data.bookedevent ? res.data.bookedevent : [];
calendarStore.eventlist = res.data.eventlist ? res.data.eventlist : []; calendarStore.eventlist = res.data.eventlist ? res.data.eventlist : [];
calendarStore.operators = res.data.operators ? res.data.operators : []; calendarStore.operators = res.data.operators ? res.data.operators : [];
calendarStore.internalpages = res.data.internalpages ? res.data.internalpages : []; calendarStore.internalpages = res.data.internalpages
? res.data.internalpages
: [];
calendarStore.wheres = res.data.wheres ? res.data.wheres : []; calendarStore.wheres = res.data.wheres ? res.data.wheres : [];
calendarStore.contribtype = res.data.contribtype ? res.data.contribtype : []; calendarStore.contribtype = res.data.contribtype ? res.data.contribtype : [];
circuitStore.listcircuits = res.data.listcircuits ? res.data.listcircuits : []; circuitStore.listcircuits = res.data.listcircuits
circuitStore.listaccounts = res.data.listaccounts ? res.data.listaccounts : []; ? res.data.listcircuits
: [];
circuitStore.listaccounts = res.data.listaccounts
? res.data.listaccounts
: [];
catalogStore.catalogs = res.data.catalogs; catalogStore.catalogs = res.data.catalogs;
catalogStore.raccoltacataloghis = res.data.raccoltacataloghis; catalogStore.raccoltacataloghis = res.data.raccoltacataloghis;
@@ -1984,7 +2048,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.gallery = res.data.gallery ? [...res.data.gallery] : []; this.gallery = res.data.gallery ? [...res.data.gallery] : [];
this.calzoom = res.data.calzoom ? [...res.data.calzoom] : []; this.calzoom = res.data.calzoom ? [...res.data.calzoom] : [];
Products.products = res.data.products ? [...res.data.products] : []; Products.products = res.data.products ? [...res.data.products] : [];
Products.productInfos = res.data.productInfos ? [...res.data.productInfos] : []; Products.productInfos = res.data.productInfos
? [...res.data.productInfos]
: [];
this.producers = res.data.producers ? [...res.data.producers] : []; this.producers = res.data.producers ? [...res.data.producers] : [];
this.storehouses = res.data.storehouses ? [...res.data.storehouses] : []; this.storehouses = res.data.storehouses ? [...res.data.storehouses] : [];
this.providers = res.data.providers ? [...res.data.providers] : []; this.providers = res.data.providers ? [...res.data.providers] : [];
@@ -1993,13 +2059,23 @@ export const useGlobalStore = defineStore('GlobalStore', {
Products.catprtotali = res.data.catprtotali ? [...res.data.catprtotali] : []; Products.catprtotali = res.data.catprtotali ? [...res.data.catprtotali] : [];
Products.collane = res.data.collane ? [...res.data.collane] : []; Products.collane = res.data.collane ? [...res.data.collane] : [];
Products.subcatprods = res.data.subcatprods ? [...res.data.subcatprods] : []; Products.subcatprods = res.data.subcatprods ? [...res.data.subcatprods] : [];
Products.stati_prodotto = res.data.stati_prodotto ? [...res.data.stati_prodotto] : []; Products.stati_prodotto = res.data.stati_prodotto
? [...res.data.stati_prodotto]
: [];
Products.tipologie = res.data.tipologie ? [...res.data.tipologie] : []; Products.tipologie = res.data.tipologie ? [...res.data.tipologie] : [];
Products.tipoformato = res.data.tipoformato ? [...res.data.tipoformato] : []; Products.tipoformato = res.data.tipoformato ? [...res.data.tipoformato] : [];
Products.catprods_gas = res.data.catprods_gas ? [...res.data.catprods_gas] : []; Products.catprods_gas = res.data.catprods_gas
? [...res.data.catprods_gas]
: [];
Products.authors = res.data.authors ? [...res.data.authors] : []; Products.authors = res.data.authors ? [...res.data.authors] : [];
Products.publishers = res.data.publishers ? [...res.data.publishers] : []; Products.publishers = res.data.publishers ? [...res.data.publishers] : [];
Products.publishers_sort_qty = [...res.data.publishers];
Products.publishers_sort_qty.sort((a, b) => b.quanti - a.quanti);
// console.table(Products.publishers)
// console.table(Products.publishers_sort_qty)
this.gasordines = res.data.gasordines ? [...res.data.gasordines] : []; this.gasordines = res.data.gasordines ? [...res.data.gasordines] : [];
this.scontisticas = res.data.scontisticas ? [...res.data.scontisticas] : []; this.scontisticas = res.data.scontisticas ? [...res.data.scontisticas] : [];
this.groups = res.data.groups ? [...res.data.groups] : []; this.groups = res.data.groups ? [...res.data.groups] : [];
@@ -2372,7 +2448,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'confpages_lang') myarr = costanti.ArrLang; else if (table === 'confpages_lang') myarr = costanti.ArrLang;
else if (table === 'bottype') myarr = shared_consts.BotType; else if (table === 'bottype') myarr = shared_consts.BotType;
else if (table === 'visibility') myarr = shared_consts.Visibility; else if (table === 'visibility') myarr = shared_consts.Visibility;
else if (table === 'cat_interesse_arcadei') myarr = shared_consts.Cat_Interesse_Arcadei; else if (table === 'cat_interesse_arcadei')
myarr = shared_consts.Cat_Interesse_Arcadei;
else if (table === 'pub_to_share') myarr = shared_consts.Pub_to_Share; else if (table === 'pub_to_share') myarr = shared_consts.Pub_to_Share;
else if (table === 'visibilGroup') myarr = shared_consts.VisibilGroup; else if (table === 'visibilGroup') myarr = shared_consts.VisibilGroup;
else if (table === 'statuscircuit') myarr = shared_consts.StatusCircuit; else if (table === 'statuscircuit') myarr = shared_consts.StatusCircuit;
@@ -2391,7 +2468,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom; else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom;
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom; else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom;
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences; else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences;
else if (table === toolsext.TABUNITS) myarr = shared_consts.Units_Of_Measure_ListBox; else if (table === toolsext.TABUNITS)
myarr = shared_consts.Units_Of_Measure_ListBox;
else if (table === toolsext.TABTYPECASH) myarr = shared_consts.TypeCashStr; else if (table === toolsext.TABTYPECASH) myarr = shared_consts.TypeCashStr;
else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List; else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List;
else if (table === 'typenotifs') myarr = shared_consts.TypeNotifs_Arr; else if (table === 'typenotifs') myarr = shared_consts.TypeNotifs_Arr;
@@ -2478,7 +2556,12 @@ export const useGlobalStore = defineStore('GlobalStore', {
getTableJoinLabelValueByName(col: IColGridTable) { getTableJoinLabelValueByName(col: IColGridTable) {
let myarrrec: any = []; let myarrrec: any = [];
if (col.jointable) { if (col.jointable) {
let myarrtab = this.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter); let myarrtab = this.getTableJoinByName(
col.jointable,
col.addall,
col.addnone,
col.filter
);
const key = fieldsTable.getKeyByTable(col.jointable); const key = fieldsTable.getKeyByTable(col.jointable);
const collab = fieldsTable.getLabelByTable(col.jointable); const collab = fieldsTable.getLabelByTable(col.jointable);
@@ -2523,7 +2606,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
async delMyElem($q: any, t: any, myelem: IMyElem) { async delMyElem($q: any, t: any, myelem: IMyElem) {
if (!myelem._id) return false; if (!myelem._id) return false;
return await this.DeleteRec({ table: 'myelems', id: myelem._id }).then(async (ris) => { return await this.DeleteRec({ table: 'myelems', id: myelem._id }).then(
async (ris) => {
if (ris) { if (ris) {
this.myelems = this.myelems.filter((rec) => rec._id !== myelem._id); this.myelems = this.myelems.filter((rec) => rec._id !== myelem._id);
@@ -2536,7 +2620,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
tools.showNegativeNotif($q, t('db.recdelfailed')); tools.showNegativeNotif($q, t('db.recdelfailed'));
return false; return false;
} }
}); }
);
}, },
async saveMyElem($q: any, t: any, myelem: IMyElem) { async saveMyElem($q: any, t: any, myelem: IMyElem) {
@@ -2748,7 +2833,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
dir_out: string = '', dir_out: string = '',
file_out: string = '', file_out: string = '',
print: boolean = false, print: boolean = false,
optcatalogo: IOptCatalogo | null = null, optcatalogo: IOptCatalogo | null = null
) { ) {
try { try {
if (!pdfFile) { if (!pdfFile) {
@@ -2756,7 +2841,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
return; return;
} }
const filenameToDownload = tools.removeFileExtension(pdfFile.name) + '-compresso.pdf'; const filenameToDownload =
tools.removeFileExtension(pdfFile.name) + '-compresso.pdf';
const formData = new FormData(); const formData = new FormData();
if (pdfFile instanceof File) { if (pdfFile instanceof File) {
@@ -2775,8 +2861,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
formData.append('print_right', optcatalogo.areadistampa.margini.right); formData.append('print_right', optcatalogo.areadistampa.margini.right);
formData.append('print_bottom', optcatalogo.areadistampa.margini.bottom); // 7 mm 0,275" formData.append('print_bottom', optcatalogo.areadistampa.margini.bottom); // 7 mm 0,275"
} }
formData.append('salvasufiledascaricare', salvasufiledascaricare ? 'true' : 'false'); formData.append(
'salvasufiledascaricare',
salvasufiledascaricare ? 'true' : 'false'
);
console.log('2) Invia le immagini al convertitore/compressione di PDF...'); console.log('2) Invia le immagini al convertitore/compressione di PDF...');
@@ -2877,7 +2965,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
numrec: 1, numrec: 1,
query: '', query: '',
where: where:
'T.IdArticolo =' + sku + ' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;', 'T.IdArticolo =' +
sku +
' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;',
fieldGM: field, fieldGM: field,
showQtaDisponibile: false, showQtaDisponibile: false,
outhtml: false, outhtml: false,
@@ -2913,7 +3003,11 @@ export const useGlobalStore = defineStore('GlobalStore', {
return valueris; return valueris;
}, },
async setGM_FieldOf_T_Web_Articoli(sku: string, data: Record<string, any>, cmd: number) { async setGM_FieldOf_T_Web_Articoli(
sku: string,
data: Record<string, any>,
cmd: number
) {
try { try {
// Verifica se i campi specificati sono validi // Verifica se i campi specificati sono validi
if (!data || Object.keys(data).length === 0) { if (!data || Object.keys(data).length === 0) {
@@ -3051,7 +3145,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (mytablerec && resdata && resdata.rec) { if (mytablerec && resdata && resdata.rec) {
// Trova l'indice del record da aggiornare // Trova l'indice del record da aggiornare
const index = mytablerec.findIndex((item: any) => item._id === resdata.rec._id); const index = mytablerec.findIndex(
(item: any) => item._id === resdata.rec._id
);
if (index !== -1 && index !== undefined) { if (index !== -1 && index !== undefined) {
// Aggiorna il record mantenendo reattività // Aggiorna il record mantenendo reattività
@@ -3075,8 +3171,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
} catch (e) {} } catch (e) {}
}, },
setshowHeader(value: boolean) { setshowHeader(value: boolean) {
this.showHeader = value this.showHeader = value;
} },
}, },
}); });

View File

@@ -47,6 +47,11 @@
color="accent" color="accent"
@click="EseguiFunz('updateAllBook', { usaDBGMLocale: false, caricatutti: true })" @click="EseguiFunz('updateAllBook', { usaDBGMLocale: false, caricatutti: true })"
></q-btn> ></q-btn>
<q-btn
label="Riaggiorna TUTTI gli ARTICOLI (Cron)"
color="accent"
@click="EseguiFunz('updateAllBooksAndRemoveCanc')"
></q-btn>
<q-btn <q-btn
label="Riaggiorna TUTTI gli ARTICOLI da GM SERVER e Rimuovi Cancellati !" label="Riaggiorna TUTTI gli ARTICOLI da GM SERVER e Rimuovi Cancellati !"
color="negative" color="negative"

View File

@@ -247,3 +247,8 @@ body {
color: #5c8ef4; color: #5c8ef4;
} }
} }
.clCondiz {
margin-bottom: 2px;
margin-left: 2px;
margin-right: 2px;
}

View File

@@ -317,10 +317,12 @@ export default defineComponent({
const tabvisu = ref('categorie'); const tabvisu = ref('categorie');
const tabcatalogo = ref('visu'); const tabcatalogo = ref('visu');
const tabgen = ref('condizioni');
const searchList = ref([] as ISearchList[]); const searchList = ref([] as ISearchList[]);
const arrProducts = ref<IProduct[]>([]); const arrProducts = ref<IProduct[]>([]);
const arrListaTemporanea = ref<IProduct[]>([]);
const arrProdToView = ref<IProdView[]>([]); const arrProdToView = ref<IProdView[]>([]);
const numRecLoaded = ref(0); const numRecLoaded = ref(0);
@@ -1000,7 +1002,7 @@ export default defineComponent({
return arrris; return arrris;
} }
async function calcArrProducts(generalista?: boolean) { async function calcArrProducts(generalista?: boolean, salva_listatemp: boolean) {
// console.log('calcArrProducts (generalista=' + generalista + ')'); // console.log('calcArrProducts (generalista=' + generalista + ')');
if (generalista) { if (generalista) {
@@ -1089,11 +1091,14 @@ export default defineComponent({
salva = true; salva = true;
} }
if (salva_listatemp) {
arrListaTemporanea.value = arrprod;
} else {
arrProducts.value = arrprod; arrProducts.value = arrprod;
// console.log('arrprod', arrprod) optcatalogo.value = productStore.populateDataWithlinkIdTemplate(
optcatalogo.value
optcatalogo.value = productStore.populateDataWithlinkIdTemplate(optcatalogo.value); );
// Ordina la lista // Ordina la lista
generatearrProdToViewSorted(!generalista, salva, !showListaFiltrata.value); generatearrProdToViewSorted(!generalista, salva, !showListaFiltrata.value);
@@ -1107,13 +1112,14 @@ export default defineComponent({
await saveCatalog(); await saveCatalog();
} }
} }
}
// console.log('***** FINE calcArrPROD');
// console.log('areadistampa FINITO...', optcatalogo.value.areadistampa)
generatinglist.value = false; generatinglist.value = false;
if (!salva_listatemp) {
rigeneraLibri.value = false; rigeneraLibri.value = false;
} else {
tabgen.value = 'generato'
}
} }
async function saveCatalog() { async function saveCatalog() {
@@ -1146,6 +1152,13 @@ export default defineComponent({
}); });
} }
function generaListaTempLibri() {
// chiedi prima "Sei sicuro di rigenerare il catalogo?"
let risposta_si = false;
calcArrProducts(true, true);
}
function reSortList() { function reSortList() {
let risposta_si = false; let risposta_si = false;
@@ -1344,12 +1357,12 @@ export default defineComponent({
salva?: boolean, salva?: boolean,
salvasudb?: boolean salvasudb?: boolean
) { ) {
console.log( /*console.log(
'generatearrProdToViewSorted... usaprodottiSalvati=', 'generatearrProdToViewSorted... usaprodottiSalvati=',
usaprodottiSalvati, usaprodottiSalvati,
' salva=', ' salva=',
salva salva
); );*/
try { try {
// Svuota // Svuota
@@ -2922,6 +2935,7 @@ export default defineComponent({
componentToFixRef, componentToFixRef,
isFixed, isFixed,
arrProducts, arrProducts,
arrListaTemporanea,
show_hide, show_hide,
onLoadScroll, onLoadScroll,
numRecLoaded, numRecLoaded,
@@ -2996,6 +3010,8 @@ export default defineComponent({
isStampa, isStampa,
onlyCatalogoPDF, onlyCatalogoPDF,
updatecatalogmodif, updatecatalogmodif,
tabgen,
generaListaTempLibri,
}; };
}, },
}); });

View File

@@ -188,7 +188,7 @@
icon="fas fa-redo" icon="fas fa-redo"
label="Rigenera Lista" label="Rigenera Lista"
color="primary" color="primary"
@click="rigeneraLibri = true" @click="rigeneraLibri = true; tabgen = 'condizioni'"
></q-btn> ></q-btn>
<!--<q-bcctn <!--<q-bcctn
@@ -619,7 +619,10 @@
</div> </div>
<div class="row"> <div class="row">
<div v-if="myCatalog.pdf_online" class="catalog-download-section"> <div
v-if="myCatalog.pdf_online"
class="catalog-download-section"
>
<q-card class="catalog-card shadow-8"> <q-card class="catalog-card shadow-8">
<q-card-section class="text-center"> <q-card-section class="text-center">
<q-img <q-img
@@ -1532,26 +1535,31 @@
title="Rigenera Lista" title="Rigenera Lista"
class="q-ma-sm" class="q-ma-sm"
> >
<q-card class="q-ma-sm"> <q-tabs
<q-card-section> dense
<div style="width: 800px; margin: 0 auto"> class="bg-green text-white"
<CMyValueDb v-model="tabgen"
v-if="myCatalog"
:editOn="true"
:title="t('cataloglist.idTipoFormato')"
table="catalogs"
:id="myCatalog._id"
:rec="myCatalog"
mykey="idTipoFormato"
debounce="1000"
:type="costanti.FieldType.multiselect"
jointable="t_web_tipiformatos"
class="q-mb-md"
@save="(v) => updatecatalogmodif('idTipoFormato', v)"
:dense="false"
> >
</CMyValueDb> <q-tab
name="condizioni"
icon="fas fa-list"
label="Rigenera"
/>
<q-tab
name="generato"
icon="fas fa-list"
label="Anteprima Lista"
/>
</q-tabs>
<q-tab-panels
v-model="tabgen"
animated
keep-alive
>
<q-tab-panel name="condizioni">
<q-card>
<q-card-section class="q-ma-sm">
<div style="min-width: 800px; width: 100%; margin: 0 auto">
<div class="row"> <div class="row">
<CMyValueDb <CMyValueDb
v-if="myCatalog" v-if="myCatalog"
@@ -1563,7 +1571,7 @@
mykey="condition_andor" mykey="condition_andor"
debounce="1000" debounce="1000"
:type="costanti.FieldType.op_andor" :type="costanti.FieldType.op_andor"
class="q-mb-md" class="clCondiz"
@save="(v) => updatecatalogmodif('condition_andor', v)" @save="(v) => updatecatalogmodif('condition_andor', v)"
:dense="false" :dense="false"
> >
@@ -1580,10 +1588,11 @@
:type="costanti.FieldType.multiselect" :type="costanti.FieldType.multiselect"
jointable="catprods" jointable="catprods"
@save="(v) => updatecatalogmodif('argomenti', v)" @save="(v) => updatecatalogmodif('argomenti', v)"
class="q-mb-md" class="clCondiz"
:dense="false" :dense="false"
> >
</CMyValueDb> </CMyValueDb>
<CMyValueDb <CMyValueDb
v-if="myCatalog" v-if="myCatalog"
:editOn="true" :editOn="true"
@@ -1596,7 +1605,7 @@
:type="costanti.FieldType.multiselect" :type="costanti.FieldType.multiselect"
jointable="collanastotali" jointable="collanastotali"
@save="(v) => updatecatalogmodif('idCollane', v)" @save="(v) => updatecatalogmodif('idCollane', v)"
class="q-mb-md" class="clCondiz"
:dense="false" :dense="false"
> >
</CMyValueDb> </CMyValueDb>
@@ -1610,9 +1619,9 @@
mykey="editore" mykey="editore"
debounce="1000" debounce="1000"
:type="costanti.FieldType.multiselect" :type="costanti.FieldType.multiselect"
jointable="publishers_totali" jointable="publishers_totali_sort_qty"
@save="(v) => updatecatalogmodif('editore', v)" @save="(v) => updatecatalogmodif('editore', v)"
class="q-mb-md" class="clCondiz"
:dense="false" :dense="false"
> >
</CMyValueDb> </CMyValueDb>
@@ -1626,14 +1635,32 @@
mykey="editore_escludi" mykey="editore_escludi"
debounce="1000" debounce="1000"
:type="costanti.FieldType.multiselect" :type="costanti.FieldType.multiselect"
jointable="publishers_totali" jointable="publishers_totali_sort_qty"
@save="(v) => updatecatalogmodif('editore_escludi', v)" @save="(v) => updatecatalogmodif('editore_escludi', v)"
class="q-mb-md" class="clCondiz"
:dense="false" :dense="false"
> >
</CMyValueDb> </CMyValueDb>
</div> </div>
<CMyValueDb
v-if="myCatalog"
:editOn="true"
:title="t('cataloglist.idTipoFormato')"
table="catalogs"
:id="myCatalog._id"
:rec="myCatalog"
mykey="idTipoFormato"
debounce="1000"
:type="costanti.FieldType.multiselect"
jointable="t_web_tipiformatos"
class="clCondiz"
@save="(v) => updatecatalogmodif('idTipoFormato', v)"
:dense="false"
>
</CMyValueDb>
<div>Filtra per Disponibilità Magazzino:</div> <div>Filtra per Disponibilità Magazzino:</div>
<q-btn-toggle <q-btn-toggle
v-model="optrigenera.visibilitaDisp" v-model="optrigenera.visibilitaDisp"
@@ -1652,7 +1679,21 @@
</q-btn-toggle> </q-btn-toggle>
</div> </div>
</q-card-section> </q-card-section>
<div class="row justify-center">
<q-spinner-hourglass
v-if="generatinglist"
size="4em"
/>
</div>
<q-card-actions align="center"> <q-card-actions align="center">
<q-btn
rounded
label="Anteprima"
color="positive"
icon="fas fa-eye"
@click="generaListaTempLibri()"
class="float-right"
></q-btn>
<q-btn <q-btn
rounded rounded
label="Rigenera" label="Rigenera"
@@ -1669,7 +1710,22 @@
@click="rigeneraLibri = false" @click="rigeneraLibri = false"
></q-btn> ></q-btn>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-tab-panel>
<q-tab-panel name="generato">
<CProductTable
v-if="arrListaTemporanea?.length > 0"
:lista_prodotti="arrListaTemporanea"
:optcatalogo="optcatalogo"
table="products"
@rigenera="generaListaLibri()"
/>
</q-tab-panel>
</q-tab-panels>
</CMyDialog> </CMyDialog>
<CMyDialog <CMyDialog

View File

@@ -1,45 +1,44 @@
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount } from 'vue' import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount } from 'vue';
import { tools } from '@tools' import { tools } from '@tools';
import { useUserStore } from '@store/UserStore' import { useUserStore } from '@store/UserStore';
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router';
import { useGlobalStore } from '@store/globalStore' import { useGlobalStore } from '@store/globalStore';
import { useProducts } from '@store/Products' import { useProducts } from '@store/Products';
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n';
import { toolsext } from '@store/Modules/toolsext' import { toolsext } from '@store/Modules/toolsext';
import { useQuasar } from 'quasar' import { useQuasar } from 'quasar';
import { costanti } from '@costanti' import { costanti } from '@costanti';
import { shared_consts } from '@src/common/shared_vuejs' import { shared_consts } from '@src/common/shared_vuejs';
import { CProductCard } from '@src/components/CProductCard' import { CProductCard } from '@src/components/CProductCard';
import { CSelectUserActive } from '@src/components/CSelectUserActive' import { CSelectUserActive } from '@src/components/CSelectUserActive';
import type { IProduct } from '@src/model' import type { IProduct } from '@src/model';
export default defineComponent({ export default defineComponent({
name: 'ProductsList', name: 'ProductsList',
components: { CProductCard, CSelectUserActive }, components: { CProductCard, CSelectUserActive },
props: {}, props: {},
setup() { setup() {
const userStore = useUserStore() const userStore = useUserStore();
const globalStore = useGlobalStore() const globalStore = useGlobalStore();
const productStore = useProducts() const productStore = useProducts();
const router = useRouter() const router = useRouter();
const $q = useQuasar() const $q = useQuasar();
const { t } = useI18n() const { t } = useI18n();
const search = ref('') const search = ref('');
const cosa = ref(0) const cosa = ref(0);
const cat = ref('') const cat = ref('');
const subcat = ref('') const subcat = ref('');
const idGasSel = ref('') const idGasSel = ref('');
const loadpage = ref(false) const loadpage = ref(false);
const refreshpage = ref(false) const refreshpage = ref(false);
const show_hide = ref(false) const show_hide = ref(false);
const arrProducts = ref<any>([]) const arrProducts = ref<any>([]);
const numRecLoaded = ref(0)
const numRecLoaded = ref(0);
// Create a ref for the component to fix // Create a ref for the component to fix
const componentToFixRef = ref(<any>null); const componentToFixRef = ref(<any>null);
@@ -48,11 +47,11 @@ export default defineComponent({
const arrLoaded = computed(() => { const arrLoaded = computed(() => {
if (arrProducts.value && numRecLoaded.value) if (arrProducts.value && numRecLoaded.value)
return arrProducts.value.slice(0, numRecLoaded.value) return arrProducts.value.slice(0, numRecLoaded.value);
else { else {
return [] return [];
} }
}) });
// Register the scroll event on component mount // Register the scroll event on component mount
const handleScroll = () => { const handleScroll = () => {
@@ -65,60 +64,93 @@ export default defineComponent({
isFixed.value = scrollTop > threshold; isFixed.value = scrollTop > threshold;
}; };
watch(() => cat.value, (newval, oldval) => { watch(
calcArrProducts() () => cat.value,
}) (newval, oldval) => {
if (loadpage.value) {
tools.setCookie(tools.COOK_ARGOM, cat.value.toString());
calcArrProducts();
}
}
);
watch(() => subcat.value, (newval, oldval) => { watch(
calcArrProducts() () => subcat.value,
}) (newval, oldval) => {
if (loadpage.value) {
calcArrProducts();
}
}
);
watch(() => idGasSel.value, (newval, oldval) => { watch(
calcArrProducts() () => idGasSel.value,
}) (newval, oldval) => {
if (loadpage.value) {
calcArrProducts();
}
}
);
watch(() => search.value, (newval, oldval) => { watch(
calcArrProducts() () => search.value,
(newval, oldval) => {
if (loadpage.value) {
calcArrProducts();
if (tools.scrollTop() > 300) { if (tools.scrollTop() > 300) {
tools.scrollToTopValue(300) tools.scrollToTopValue(300);
} }
}) }
}
);
watch(() => cosa.value, (newval, oldval) => { watch(
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString()) () => cosa.value,
(newval, oldval) => {
if (loadpage.value) {
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString());
if (cosa.value !== shared_consts.PROD.TUTTI) { if (cosa.value !== shared_consts.PROD.TUTTI) {
cat.value = '' cat.value = '';
subcat.value = '' subcat.value = '';
} }
calcArrProducts() calcArrProducts();
}) }
}
);
function calcArrProducts() { function calcArrProducts() {
// console.log('calcArrProducts') // console.log('calcArrProducts')
refreshpage.value = true refreshpage.value = true;
let arrprod = productStore.getProducts(cosa.value) let arrprod = productStore.getProducts(cosa.value);
const catstr = cat.value; const catstr = cat.value;
const subcatstr = subcat.value; const subcatstr = subcat.value;
let gasselstr = '' let gasselstr = '';
if (cosa.value === shared_consts.PROD.GAS) { if (cosa.value === shared_consts.PROD.GAS) {
gasselstr = idGasSel.value gasselstr = idGasSel.value;
} }
const lowerSearchText = search.value.toLowerCase().trim(); const lowerSearchText = search.value.toLowerCase().trim();
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && !subcatstr && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) { if (
(!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) &&
!catstr &&
!subcatstr &&
!gasselstr &&
cosa.value !== shared_consts.PROD.GAS
) {
} else { } else {
arrprod = arrprod.filter((product: IProduct) => { arrprod = arrprod.filter((product: IProduct) => {
if (product && product.productInfo && !!product.productInfo.name) { if (product && product.productInfo && !!product.productInfo.name) {
const lowerName = product.productInfo.name.toLowerCase(); const lowerName = product.productInfo.name.toLowerCase();
const hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr)); const hasCategoria =
const hasSubCategoria = !subcatstr || (subcatstr && product.productInfo.idSubCatProds?.includes(subcatstr)); !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
const hasSubCategoria =
!subcatstr ||
(subcatstr && product.productInfo.idSubCatProds?.includes(subcatstr));
let productgassel = true let productgassel = true;
if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) { if (gasselstr || cosa.value === shared_consts.PROD.GAS) {
productgassel = (product.idGasordine === gasselstr) productgassel = product.idGasordine === gasselstr;
} }
// Use a regular expression to match whole words // Use a regular expression to match whole words
@@ -126,16 +158,23 @@ export default defineComponent({
const nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i'); const nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i');
// Check if any word in lowerName starts with lowerSearchText // Check if any word in lowerName starts with lowerSearchText
const anyWordStartsWithSearch = lowerName.split(/\s+/).some(word => nameMatch.test(word)); const anyWordStartsWithSearch = lowerName
.split(/\s+/)
.some((word) => nameMatch.test(word));
return (codeMatch.test(product.productInfo.code) || anyWordStartsWithSearch) && hasCategoria && hasSubCategoria && productgassel; return (
(codeMatch.test(product.productInfo.code) || anyWordStartsWithSearch) &&
hasCategoria &&
hasSubCategoria &&
productgassel
);
} }
}); });
} }
arrProducts.value = arrprod arrProducts.value = arrprod;
loaddata() loaddata();
refreshpage.value = false refreshpage.value = false;
} }
/*function getProducts() { /*function getProducts() {
@@ -155,23 +194,30 @@ export default defineComponent({
}*/ }*/
async function mounted() { async function mounted() {
loadpage.value = false loadpage.value = false;
await productStore.loadProducts(true)
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.GAS, true) cosa.value = tools.getCookie(
if (cosa.value === shared_consts.PROD.TUTTI) tools.COOK_COSA_PRODOTTI,
cosa.value = shared_consts.PROD.GAS shared_consts.PROD.GAS,
true
);
if (cosa.value === shared_consts.PROD.TUTTI) cosa.value = shared_consts.PROD.GAS;
cat.value = tools.getCookie(tools.COOK_ARGOM, '');
await productStore.loadProducts(true);
// Inizializza // Inizializza
loadpage.value = true loadpage.value = true;
window.addEventListener('scroll', handleScroll); window.addEventListener('scroll', handleScroll);
calcArrProducts() calcArrProducts();
loaddata() loaddata();
} }
function loaddata() { function loaddata() {
numRecLoaded.value = 20 numRecLoaded.value = 20;
} }
// Remove the event listener on component destroy // Remove the event listener on component destroy
@@ -180,65 +226,76 @@ export default defineComponent({
}); });
function getCatProds() { function getCatProds() {
const arrcat = productStore.getCatProds(shared_consts.PROD.BOTTEGA) const arrcat = productStore.getCatProds(shared_consts.PROD.BOTTEGA);
// console.log('getCatProds', arrcat) // console.log('getCatProds', arrcat)
let riscat: any = [] let riscat: any = [];
if (arrcat && arrcat.length > 0) { if (arrcat && arrcat.length > 0) {
riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }] riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }];
for (const rec of arrcat) { for (const rec of arrcat) {
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color }) riscat.push({
label: rec.name,
value: rec._id,
icon: rec.icon,
color: rec.color,
});
} }
} }
return riscat return riscat;
} }
function getCatProdsByGas(idGasOrdine: string): any { function getCatProdsByGas(idGasOrdine: string): any {
const arrcat = productStore.getCatProdsByGas(idGasOrdine) const arrcat = productStore.getCatProdsByGas(idGasOrdine);
let riscat: any = [] let riscat: any = [];
if (arrcat && arrcat.length > 0) { if (arrcat && arrcat.length > 0) {
riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }] riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }];
for (const rec of arrcat) { for (const rec of arrcat) {
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color }) riscat.push({
label: rec.name,
value: rec._id,
icon: rec.icon,
color: rec.color,
});
} }
} }
return riscat return riscat;
} }
function getSubCatProdsByGas(idGasOrdine: string, idCatProd: string): any { function getSubCatProdsByGas(idGasOrdine: string, idCatProd: string): any {
const arrcat = productStore.getSubCatProdsByGas(idGasOrdine, idCatProd) const arrcat = productStore.getSubCatProdsByGas(idGasOrdine, idCatProd);
let riscat: any = [] let riscat: any = [];
if (arrcat && arrcat.length > 0) { if (arrcat && arrcat.length > 0) {
riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }] riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }];
for (const rec of arrcat) { for (const rec of arrcat) {
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color }) riscat.push({
label: rec.name,
value: rec._id,
icon: rec.icon,
color: rec.color,
});
} }
} }
return riscat return riscat;
} }
function onLoadScroll(index: number, done: any) { function onLoadScroll(index: number, done: any) {
if (index >= 1) { if (index >= 1) {
if (numRecLoaded.value < arrProducts.value.length) { if (numRecLoaded.value < arrProducts.value.length) {
const step = 10;
let mynrec = numRecLoaded.value + step;
const step = 10 if (mynrec > arrProducts.value.length) mynrec = arrProducts.value.length;
let mynrec = numRecLoaded.value + step
if (mynrec > arrProducts.value.length)
mynrec = arrProducts.value.length
numRecLoaded.value = mynrec
numRecLoaded.value = mynrec;
} }
done() done();
} else { } else {
done(true) done(true);
} }
} }
onMounted(mounted) onMounted(mounted);
return { return {
userStore, userStore,
@@ -265,7 +322,6 @@ export default defineComponent({
numRecLoaded, numRecLoaded,
arrLoaded, arrLoaded,
getSubCatProdsByGas, getSubCatProdsByGas,
} };
} },
}) });