aggiornamento Ordini GAS filtri
@@ -1,6 +1,6 @@
|
||||
APP_VERSION="1.0.25"
|
||||
APP_VERSION="1.0.21"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
APP_ID="17"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
DIRECTORY_SERVER="freeplanet_serverside"
|
||||
SERVERDIR_WEBSITE=""
|
||||
@@ -12,7 +12,7 @@ LANG_DEFAULT="it"
|
||||
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
|
||||
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
|
||||
MONGODB_HOST="https://localhost:3000"
|
||||
LOGO_REG='riso-logo-full.png'
|
||||
LOGO_REG='piuchebuono-logo-full.png'
|
||||
TEST_NAME="Paolo"
|
||||
TEST_SURNAME="Arena"
|
||||
TEST_EMAIL=""
|
||||
|
||||
2
now.txt
@@ -1 +1 @@
|
||||
TERMINA DI LAVORARE SU piuchebuono.app: (Sovrascrivo !)
|
||||
TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !)
|
||||
|
||||
119
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "0.6.1",
|
||||
"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",
|
||||
"name": "piuchebuono",
|
||||
"version": "2.0.1",
|
||||
"description": "PiuCheBuono",
|
||||
"productName": "PiuCheBuono",
|
||||
"author": "Paolo Arena",
|
||||
"private": true,
|
||||
"keywords": [],
|
||||
@@ -17,109 +17,108 @@
|
||||
"lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt",
|
||||
"fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt",
|
||||
"pwa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa",
|
||||
"spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev --mode debug",
|
||||
"spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev --debug",
|
||||
"test": "echo \"No test specified\" && exit 0",
|
||||
"generate-sw": "workbox generateSW workbox-config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cubejs-client/core": "^0.31.0",
|
||||
"@quasar/extras": "^1.16.9",
|
||||
"@quasar/extras": "^1.16.7",
|
||||
"@quasar/quasar-ui-qcalendar": "^4.0.0-beta.16",
|
||||
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
||||
"@vue/compat": "^3.3.9",
|
||||
"@vue/compiler-sfc": "^3.3.9",
|
||||
"@vue-leaflet/vue-leaflet": "^0.9.0",
|
||||
"@vue/compat": "^3.2.47",
|
||||
"@vue/compiler-sfc": "^3.2.47",
|
||||
"@vue/eslint-config-standard": "7.0.0",
|
||||
"@vuelidate/core": "^2.0.3",
|
||||
"@vuelidate/validators": "^2.0.4",
|
||||
"acorn": "^8.11.2",
|
||||
"@vuelidate/core": "^2.0.2",
|
||||
"@vuelidate/validators": "^2.0.2",
|
||||
"acorn": "^8.8.2",
|
||||
"animate.css": "^4.1.1",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"axios": "^1.6.2",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"axios": "^1.3.5",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"chart.js": "^4.0.0",
|
||||
"core-js": "^3.33.3",
|
||||
"chart.js": "3.9.1",
|
||||
"core-js": "^3.30.0",
|
||||
"crypto": "^1.0.1",
|
||||
"date-fns": "^2.30.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"date-fns": "^2.29.3",
|
||||
"dotenv": "^16.0.3",
|
||||
"echarts": "5.4.2",
|
||||
"eslint-plugin-quasar": "^1.1.0",
|
||||
"graphql": "^16.8.1",
|
||||
"graphql": "^16.6.0",
|
||||
"graphql-tag": "^2.12.6",
|
||||
"gsap": "^3.12.3",
|
||||
"jquery": "^3.7.1",
|
||||
"js-cookie": "^3.0.5",
|
||||
"leaflet": "^1.9.4",
|
||||
"gsap": "^3.11.5",
|
||||
"jquery": "^3.6.4",
|
||||
"js-cookie": "^3.0.1",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"normalize.css": "^8.0.1",
|
||||
"npm": "^10.2.4",
|
||||
"npm": "^9.6.4",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.1.7",
|
||||
"pinia": "^2.0.33",
|
||||
"prerender-spa-plugin": "^3.4.0",
|
||||
"quasar": "^2.12.07",
|
||||
"quasar-extras": "^2.0.9",
|
||||
"register-service-worker": "^1.7.2",
|
||||
"typescript-eslint": "^0.0.1-alpha.0",
|
||||
"vee-validate": "^4.12.2",
|
||||
"vue": "^3.3.9",
|
||||
"vee-validate": "^4.8.4",
|
||||
"vue": "^3.2.47",
|
||||
"vue-chart-3": "^3.1.8",
|
||||
"vue-class-component": "^8.0.0-rc.1",
|
||||
"vue-country-code": "^1.1.3",
|
||||
"vue-echarts": "^6.6.1",
|
||||
"vue-i18n": "^9.8.0",
|
||||
"vue-echarts": "^6.5.4",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-idb": "^0.2.0",
|
||||
"vue-loader": "^17.3.1",
|
||||
"vue-loader": "^17.0.1",
|
||||
"vue-property-decorator": "^10.0.0-rc.3",
|
||||
"vue-router": "^4.2.5",
|
||||
"vue-scroll-reveal": "^2.1.0",
|
||||
"vue-router": "^4.1.6",
|
||||
"vue-scroll-reveal": "^1.0.11",
|
||||
"vue-social-sharing": "^4.0.0-alpha4",
|
||||
"vue-svgicon": "^4.0.0-alpha.3",
|
||||
"vue-timeago3": "^2.3.2",
|
||||
"vue-timeago3": "^2.3.0",
|
||||
"vue2-dragula": "^2.5.5",
|
||||
"vue3-pdf-app": "^1.0.3",
|
||||
"vuex": "^4.1.0",
|
||||
"vuex-router-sync": "^6.0.0-rc.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@quasar/app": "^3.3.3",
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/dotenv": "^8.2.0",
|
||||
"@types/googlemaps": "^3.43.3",
|
||||
"@types/jest": "^29.5.10",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/node": "18.17.0",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/vue-tel-input": "^2.1.6",
|
||||
"@types/vuelidate": "^0.7.21",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||
"@typescript-eslint/parser": "^6.13.1",
|
||||
"eslint": "^8.54.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"@types/jest": "^29.5.0",
|
||||
"@types/js-cookie": "^3.0.3",
|
||||
"@types/node": "18.15.11",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@types/vue-tel-input": "^2.1.2",
|
||||
"@types/vuelidate": "^0.7.16",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
||||
"@typescript-eslint/parser": "^6.7.2",
|
||||
"eslint": "^8.37.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-vue": "^9.19.2",
|
||||
"eslint-plugin-vue": "^9.10.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-webpack-plugin": "^5.5.3",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"jest": "^29.7.0",
|
||||
"jest": "^29.5.0",
|
||||
"json-loader": "^0.5.7",
|
||||
"node-sass": "^9.0.0",
|
||||
"npm-check-updates": "^16.14.11",
|
||||
"npm-check-updates": "^16.10.7",
|
||||
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
||||
"parcel": "^2.6.2",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-loader": "^7.3.3",
|
||||
"sass-loader": "^13.3.2",
|
||||
"strip-ansi": "=7.1.0",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-loader": "^9.5.1",
|
||||
"postcss": "^8.4.21",
|
||||
"postcss-loader": "^7.2.4",
|
||||
"sass-loader": "^13.2.2",
|
||||
"strip-ansi": "=7.0.1",
|
||||
"ts-jest": "^29.1.0",
|
||||
"ts-loader": "^9.4.2",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-standard": "^9.0.0",
|
||||
"tslint-loader": "^3.5.4",
|
||||
"typescript": "^5.3.2",
|
||||
"typescript": "^5.2.2",
|
||||
"vue-cli-plugin-element-ui": "^1.1.4",
|
||||
"vueify": "^9.4.1",
|
||||
"webpack": "^5.89.0",
|
||||
"workbox-webpack-plugin": "^7.0.0"
|
||||
"webpack": "^5.78.0",
|
||||
"workbox-webpack-plugin": "^6.5.4"
|
||||
},
|
||||
"browser": {
|
||||
"crypto": false
|
||||
|
||||
|
Before Width: | Height: | Size: 42 KiB |
BIN
public/images/foto1.jpg
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
public/images/foto2.jpg
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
public/images/foto3.jpg
Normal file
|
After Width: | Height: | Size: 165 KiB |
BIN
public/images/kolibrilab-logo-full.png
Executable file
|
After Width: | Height: | Size: 92 KiB |
BIN
public/images/marocco_foto1.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
public/images/nuda_e_cruda.jpeg
Normal file
|
After Width: | Height: | Size: 311 KiB |
BIN
public/images/pcb-android-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
public/images/pcb-android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
public/images/pcb-android-icon-36x36.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/pcb-android-icon-48x48.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
public/images/pcb-android-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/pcb-android-icon-96x96.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
public/images/pcb-apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
public/images/pcb-apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
public/images/pcb-apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
public/images/pcb-apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
public/images/pcb-apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
public/images/pcb-apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
public/images/pcb-apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
public/images/pcb-apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/pcb-apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/images/pcb-apple-icon.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
public/images/piuchebuono-logo-full.png
Normal file
|
After Width: | Height: | Size: 163 KiB |
BIN
public/images/piuchebuono.jpg
Normal file
|
After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 634 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 124 KiB |
@@ -94,6 +94,7 @@ module.exports = configure((ctx) => ({
|
||||
transpileDependencies: [
|
||||
/quasar-ui-qcalendar[\\/]src/
|
||||
],
|
||||
devtool: 'source-map',
|
||||
|
||||
chainWebpack(chain, { isServer, isClient }) {
|
||||
chain.resolve.alias
|
||||
@@ -147,9 +148,8 @@ module.exports = configure((ctx) => ({
|
||||
},
|
||||
devServer: {
|
||||
https: false,
|
||||
port: 8084,
|
||||
port: 8088,
|
||||
open: false, // opens browser window automatically
|
||||
hot: false, // Disable hot module replacement
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Headers': '*',
|
||||
@@ -306,9 +306,9 @@ module.exports = configure((ctx) => ({
|
||||
},
|
||||
|
||||
manifest: {
|
||||
name: 'Riso',
|
||||
short_name: 'Riso',
|
||||
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.',
|
||||
name: 'Più che Buono',
|
||||
short_name: 'PiuCheBuono',
|
||||
description: 'PiuCheBuono è un GAS e Bottega',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#fff',
|
||||
@@ -318,54 +318,54 @@ module.exports = configure((ctx) => ({
|
||||
start_url: "/?homescreen=1",
|
||||
icons: [
|
||||
{
|
||||
src: 'images/riso-android-icon-512x512.png',
|
||||
src: 'images/pcb-android-icon-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-android-icon-384x384.png',
|
||||
src: 'images/pcb-android-icon-384x384.png',
|
||||
sizes: '384x384',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-android-icon-192x192.png',
|
||||
src: 'images/pcb-android-icon-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-android-icon-144x144.png',
|
||||
src: 'images/pcb-android-icon-144x144.png',
|
||||
sizes: '144x144',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-android-icon-96x96.png',
|
||||
src: 'images/pcb-android-icon-96x96.png',
|
||||
sizes: '96x96',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-apple-icon-120x120.png',
|
||||
src: 'images/pcb-apple-icon-120x120.png',
|
||||
sizes: '120x120',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-apple-icon-144x144.png',
|
||||
src: 'images/pcb-apple-icon-144x144.png',
|
||||
sizes: '144x144',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-apple-icon-152x152.png',
|
||||
src: 'images/pcb-apple-icon-152x152.png',
|
||||
sizes: '152x152',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'images/riso-apple-icon-180x180.png',
|
||||
src: 'images/pcb-apple-icon-180x180.png',
|
||||
sizes: '180x180',
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
related_applications: [{
|
||||
"platform": "webapp",
|
||||
"url": "https://www.riso.app/manifest.json"
|
||||
"url": "https://www.piuchebuono.app/manifest.json"
|
||||
}]
|
||||
},
|
||||
},
|
||||
@@ -400,7 +400,7 @@ module.exports = configure((ctx) => ({
|
||||
builder: {
|
||||
// https://www.electron.build/configuration/configuration
|
||||
|
||||
appId: 'Riso',
|
||||
appId: 'PiuCheBuono',
|
||||
},
|
||||
|
||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||
|
||||
@@ -47,6 +47,8 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
|
||||
const orderQuantity = ref(<number | undefined>undefined);
|
||||
const weight = ref(<number | undefined>undefined);
|
||||
const price = ref(<number | undefined>undefined);
|
||||
const orderQuantityPreordered = ref(<number | undefined>undefined);
|
||||
const orderTotalPriceProduct = ref(<number | undefined>undefined);
|
||||
|
||||
@@ -64,6 +66,26 @@ export default defineComponent({
|
||||
enableChangeTotalPrice.value = false
|
||||
});
|
||||
|
||||
watch(weight, (newValue: any) => {
|
||||
if (order.value.product) {
|
||||
if (!newValue)
|
||||
order.value.product.productInfo.weight = 0
|
||||
else
|
||||
order.value.product.productInfo.weight = parseFloat(newValue);
|
||||
}
|
||||
enableChangeTotalPrice.value = false
|
||||
});
|
||||
|
||||
watch(price, (newValue: any) => {
|
||||
if (order.value) {
|
||||
if (!newValue)
|
||||
order.value.price = 0
|
||||
else
|
||||
order.value.price = parseFloat(newValue);
|
||||
}
|
||||
enableChangeTotalPrice.value = false
|
||||
});
|
||||
|
||||
watch(orderQuantityPreordered, (newValue: any) => {
|
||||
if (!newValue)
|
||||
order.value.quantitypreordered = 0
|
||||
@@ -137,7 +159,7 @@ export default defineComponent({
|
||||
|
||||
function isApplicatoSconto() {
|
||||
const totalipotetico = order.value.product!.price * (order.value.quantity + order.value.quantitypreordered)
|
||||
if (totalipotetico > order.value.TotalPriceProduct) {
|
||||
if (totalipotetico.toFixed(2) > order.value.TotalPriceProduct.toFixed(2)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -164,6 +186,8 @@ export default defineComponent({
|
||||
|
||||
function mounted() {
|
||||
endload.value = false
|
||||
weight.value = props.order.product?.productInfo.weight
|
||||
price.value = props.order.price
|
||||
if (props.order.quantity !== 0) {
|
||||
orderQuantity.value = props.order.quantity
|
||||
enableQty.value = true
|
||||
@@ -195,6 +219,8 @@ export default defineComponent({
|
||||
t,
|
||||
updateOrder,
|
||||
orderQuantity,
|
||||
weight,
|
||||
price,
|
||||
orderQuantityPreordered,
|
||||
enableQty,
|
||||
enableQtyPreordered,
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
<template>
|
||||
<div v-if="order && order.product && order.product.productInfo" class="q-pa-xs q-gutter-xs">
|
||||
<div
|
||||
v-if="order && order.product && order.product.productInfo"
|
||||
class="q-pa-xs q-gutter-xs"
|
||||
>
|
||||
order: {{order}}
|
||||
<div v-if="order.product">
|
||||
<q-item>
|
||||
<q-item-section top thumbnail class="q-ml-none">
|
||||
<img
|
||||
v-if="order.product && order.product.productInfo && order.product.productInfo.img"
|
||||
v-if="
|
||||
order.product &&
|
||||
order.product.productInfo &&
|
||||
order.product.productInfo.img
|
||||
"
|
||||
:src="`` + order.product.productInfo.img"
|
||||
:alt="order.product.productInfo.name"
|
||||
:class="myimgclass()"
|
||||
@@ -18,6 +26,7 @@
|
||||
</div>
|
||||
{{ order.product.productInfo.name }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
<div
|
||||
class="text-black text-h8"
|
||||
@@ -32,6 +41,28 @@
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
<div class="row q-mb-xs no-wrap items-center centeritems">
|
||||
<q-input
|
||||
v-if="editmode"
|
||||
v-model="weight"
|
||||
autofocus
|
||||
debounce="500"
|
||||
borderless
|
||||
rounded
|
||||
dense
|
||||
:label="t('products.weight')"
|
||||
></q-input>
|
||||
<q-input
|
||||
v-if="editmode"
|
||||
v-model="price"
|
||||
autofocus
|
||||
debounce="500"
|
||||
borderless
|
||||
rounded
|
||||
dense
|
||||
:label="t('products.price')"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="row q-mb-xs no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
v-if="showall && !nomodif"
|
||||
@@ -92,6 +123,7 @@
|
||||
updateOrder({
|
||||
quantitypreordered: order.quantitypreordered,
|
||||
quantity: order.quantity,
|
||||
price: order.price,
|
||||
})
|
||||
"
|
||||
>
|
||||
@@ -132,8 +164,13 @@
|
||||
: 0
|
||||
}}
|
||||
</span>
|
||||
<span v-if="tools.isManager() && order.TotalPriceProduct !== order.TotalPriceProductCalc"
|
||||
:class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''">
|
||||
<span
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
order.TotalPriceProduct.toFixed(2) !== order.TotalPriceProductCalc.toFixed(2)
|
||||
"
|
||||
:class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''"
|
||||
>
|
||||
(Calc: €
|
||||
{{
|
||||
order.TotalPriceProductCalc
|
||||
@@ -148,16 +185,20 @@
|
||||
>€
|
||||
{{
|
||||
(
|
||||
(order.price * order.quantity) +
|
||||
(order.price * order.quantitypreordered)
|
||||
order.price * order.quantity +
|
||||
order.price * order.quantitypreordered
|
||||
).toFixed(2)
|
||||
}}</span
|
||||
>)</span
|
||||
>
|
||||
</span>
|
||||
<span v-if="isApplicatoSconto() && !editmode" class="ordine_scritta_sconto">{{
|
||||
<span
|
||||
v-if="isApplicatoSconto() && !editmode"
|
||||
class="ordine_scritta_sconto"
|
||||
>{{
|
||||
$t('ecomm.sconto_applicato', { risparmio: getRisparmio() })
|
||||
}}</span>
|
||||
}}</span
|
||||
>
|
||||
</div>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
@@ -8,6 +8,8 @@ const msg_website_enUs = {
|
||||
products: {
|
||||
quantity: 'Quantità',
|
||||
quantityAvailable: 'Disponibili',
|
||||
stockQty: 'In Magazzino',
|
||||
stockBloccatiQty: 'Bloccati In Magazzino',
|
||||
weight: 'Peso',
|
||||
stars: 'Voto',
|
||||
color: 'Colore',
|
||||
@@ -36,6 +38,7 @@ const msg_website_enUs = {
|
||||
productslist: 'Lista Prodotti',
|
||||
collabora: 'Collabora',
|
||||
storehouses: 'Magazzino',
|
||||
providers: 'Fornitori',
|
||||
departments: 'Uffici',
|
||||
orders: 'Ordini Ricevuti',
|
||||
orders2: 'Ordini Ricevuti',
|
||||
|
||||
@@ -8,6 +8,7 @@ const msg_website_es = {
|
||||
products: {
|
||||
quantity: 'Quantità',
|
||||
quantityAvailable: 'Disponibili',
|
||||
stockQty: 'In Magazzino',
|
||||
weight: 'Peso',
|
||||
stars: 'Voto',
|
||||
color: 'Colore',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const msg_website_it = {
|
||||
ws: {
|
||||
sitename: 'Riso',
|
||||
siteshortname: 'RISO',
|
||||
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.',
|
||||
keywords: 'riso, piattaforma di scambio, rete italiana scambio orizzontale, riso app, riso piattaforma, scambio e baratto, momenta RIS',
|
||||
sitename: 'Più che Buono',
|
||||
siteshortname: 'Più che Buono',
|
||||
description: '',
|
||||
keywords: '',
|
||||
},
|
||||
hours: {
|
||||
descr: 'Descrizione',
|
||||
@@ -16,23 +16,35 @@ const msg_website_it = {
|
||||
pages: {
|
||||
home: 'Home',
|
||||
profile: 'Profilo',
|
||||
install_site: 'Installa Sito',
|
||||
profile2: 'ProfiloU',
|
||||
mypage2: 'mypage2',
|
||||
myservice2: 'myservice2',
|
||||
myhosps2: 'myhosps2',
|
||||
mygood2: 'mygood2',
|
||||
catalogo: 'Catalogo',
|
||||
fundraising: 'Sostieni il Progetto',
|
||||
notifs: 'Configura le Notifiche',
|
||||
unsubscribe: 'Disiscriviti',
|
||||
unsubscribe_user: 'Disiscriviti User',
|
||||
test: 'Test',
|
||||
projects: 'Progetti',
|
||||
report: 'Report Ore',
|
||||
producer: 'Produttore',
|
||||
orderinfo: 'Ordini Effettuati',
|
||||
products: 'Prodotti',
|
||||
cash: 'Cassa',
|
||||
productInfos: 'Info Prodotti',
|
||||
listinoprodotti: 'Listino Prodotti',
|
||||
productslist: 'Lista Prodotti',
|
||||
collabora: 'Collabora',
|
||||
categories: 'Categorie',
|
||||
storehouses: 'Magazzino',
|
||||
providers: 'Fornitori',
|
||||
catprods: 'Categorie',
|
||||
subcatprods: 'Sotto-Categorie',
|
||||
gasordine: 'Gas Ordine',
|
||||
scontisticas: 'Scontistica',
|
||||
departments: 'Uffici',
|
||||
orders: 'Ordini Ricevuti',
|
||||
orders2: 'Ordini Ricevuti',
|
||||
@@ -121,9 +133,11 @@ const msg_website_it = {
|
||||
only_residenti: 'Solo Residenti',
|
||||
only_consiglio: 'Solo Consiglieri',
|
||||
color: 'Colore',
|
||||
gasordini: 'Gas Ordini',
|
||||
gestoreordini: 'Gestore Ordini',
|
||||
},
|
||||
msg: {
|
||||
myAppName: 'Riso',
|
||||
myAppName: 'Più che Buono',
|
||||
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
|
||||
underconstruction: 'App in costruzione...',
|
||||
myDescriz: '',
|
||||
|
||||
@@ -7,30 +7,6 @@ import {
|
||||
import { func } from '@store/Modules/fieldsTable'
|
||||
|
||||
|
||||
// const SHOW_PROJINTHEMENU = false
|
||||
//
|
||||
// let arrlistafavourite = []
|
||||
// let arrlistaprojtutti = []
|
||||
// let arrlistaprojmiei = []
|
||||
// if (SHOW_PROJINTHEMENU) {
|
||||
// arrlistaprojtutti = Projects.getters.listaprojects(RouteNames.projectsall)
|
||||
// arrlistaprojmiei = Projects.getters.listaprojects(RouteNames.myprojects)
|
||||
// arrlistafavourite = Projects.getters.listaprojects(RouteNames.favouriteprojects)
|
||||
// }
|
||||
// PROGETTI -> FAVORITI :
|
||||
|
||||
// if (arrlistafavourite.length > 0) {
|
||||
// arrMenu.push({
|
||||
// icon: 'favorite_border',
|
||||
// nametranslate: 'pages.' + RouteNames.favouriteprojects,
|
||||
// urlroute: RouteNames.favouriteprojects,
|
||||
// level_parent: 0.0,
|
||||
// level_child: 0.5,
|
||||
// routes2: arrlistafavourite,
|
||||
// idelem: ''
|
||||
// })
|
||||
// }
|
||||
|
||||
const firstPage = {
|
||||
active: true,
|
||||
order: 5,
|
||||
@@ -57,56 +33,57 @@ function getDynamicPages(site: ISites): IListRoutes[] {
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
/*{
|
||||
active: true,
|
||||
order: 400,
|
||||
path: '/test',
|
||||
materialIcon: 'fas fa-test',
|
||||
name: 'mypages.test',
|
||||
component: () => import('@/views/testServer/testServer.vue'),
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
order: 20,
|
||||
path: '/events',
|
||||
materialIcon: 'fas fa-bullhorn',
|
||||
name: 'mypages.events',
|
||||
component: () => import('@/root/eventi/eventi.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},*/
|
||||
{
|
||||
active: true,
|
||||
order: 12,
|
||||
path: '/goods',
|
||||
materialIcon: 'fas fa-tshirt',
|
||||
name: 'mypages.goods',
|
||||
component: () => import('@/root/goods/goods.vue'),
|
||||
active: site.confpages && site.confpages.showProfile,
|
||||
order: 120,
|
||||
path: '/myprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile',
|
||||
component: () => import('@/views/user/myprofile/myprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
path: '/services',
|
||||
materialIcon: 'fas fa-house-user',
|
||||
name: 'mypages.services',
|
||||
component: () => import('@/root/services/services.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
path: '/provapao',
|
||||
materialIcon: 'fas fa-house-user',
|
||||
name: 'mypages.provapao',
|
||||
component: () => import('@/root/provapao/provapao.vue'),
|
||||
order: 120,
|
||||
path: '/install_site',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.install_site',
|
||||
component: () => import('@/views/admin/install_site/install_site.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
path: '/hosps',
|
||||
materialIcon: 'fas fa-bed',
|
||||
name: 'mypages.hosp',
|
||||
component: () => import('@/root/hosp/hosp.vue'),
|
||||
active: site.confpages && site.confpages.showProfile,
|
||||
order: 120,
|
||||
path: '/editprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile3',
|
||||
component: () => import('@/views/user/editprofile/editprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: site.confpages && site.confpages.showiscrittiMenu,
|
||||
order: 130,
|
||||
path: '/friends',
|
||||
materialIcon: 'fas fa-user-friends',
|
||||
name: 'mypages.iscritti',
|
||||
component: () => import('@/views/user/myfriends/myfriends.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
@@ -121,50 +98,8 @@ function getDynamicPages(site: ISites): IListRoutes[] {
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 20,
|
||||
path: '/events',
|
||||
materialIcon: 'fas fa-bullhorn',
|
||||
name: 'mypages.events',
|
||||
component: () => import('@/root/eventi/eventi.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 120,
|
||||
path: '/myprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile',
|
||||
component: () => import('@/views/user/myprofile/myprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 120,
|
||||
path: '/editprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile3',
|
||||
component: () => import('@/views/user/editprofile/editprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 130,
|
||||
path: '/friends',
|
||||
materialIcon: 'fas fa-user-friends',
|
||||
name: 'mypages.iscritti',
|
||||
component: () => import('@/views/user/myfriends/myfriends.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
onlyAdmin: true,
|
||||
onlyManager: true,
|
||||
},
|
||||
{
|
||||
active: site.confpages && site.confpages.enableGroups,
|
||||
@@ -176,6 +111,8 @@ function getDynamicPages(site: ISites): IListRoutes[] {
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: false,
|
||||
onlyAdmin: true,
|
||||
onlyManager: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
|
||||
0
src/rootgen/admin/gestoreordini_old/gestoreordini.scss
Executable file
167
src/rootgen/admin/gestoreordini_old/gestoreordini.ts
Executable file
@@ -0,0 +1,167 @@
|
||||
import { defineComponent, onMounted, ref } from 'vue'
|
||||
|
||||
import { CImgText } from '../../../components/CImgText/index'
|
||||
import { CCard } from '@/components/CCard'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||
|
||||
import { colTableGestoreOrdini } from '@src/store/Modules/fieldsTable'
|
||||
import MixinMetaTags from '@/mixins/mixin-metatags'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Gestoreordini',
|
||||
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
|
||||
setup() {
|
||||
|
||||
const { setmeta } = MixinMetaTags()
|
||||
const filtroOrdini = ref(<any[]>[])
|
||||
const idGasordine = ref('')
|
||||
|
||||
function mounted() {
|
||||
let queryord = []
|
||||
|
||||
filtroOrdini.value = []
|
||||
|
||||
if (idGasordine.value) {
|
||||
const gasordine = {
|
||||
$match: {
|
||||
idGasordine: idGasordine.value
|
||||
},
|
||||
}
|
||||
queryord.push(gasordine)
|
||||
}
|
||||
|
||||
|
||||
const query = [
|
||||
{
|
||||
$lookup: {
|
||||
from: 'products',
|
||||
localField: 'idProduct',
|
||||
foreignField: '_id',
|
||||
as: 'product',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$product',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'productinfos',
|
||||
localField: 'product.idProductInfo',
|
||||
foreignField: '_id',
|
||||
as: 'productInfo',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$productInfo',
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'gasordines',
|
||||
localField: 'idGasordine',
|
||||
foreignField: '_id',
|
||||
as: 'gasordine',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$gasordine',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$or: [
|
||||
{
|
||||
'gasordine.active': true,
|
||||
},
|
||||
{
|
||||
gasordine: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$or: [
|
||||
{
|
||||
quantity: {
|
||||
$gt: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
quantitypreordered: {
|
||||
$gt: 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: '$product._id',
|
||||
name: {
|
||||
$first: '$productInfo.name',
|
||||
},
|
||||
weight: {
|
||||
$first: '$productInfo.weight',
|
||||
},
|
||||
price_acquistato: {
|
||||
$first: '$product.price_acquistato',
|
||||
},
|
||||
totalQuantity: {
|
||||
$sum: {
|
||||
$add: [
|
||||
'$quantity',
|
||||
'$quantitypreordered',
|
||||
],
|
||||
},
|
||||
},
|
||||
totalPrice_acquistato: {
|
||||
$sum: {
|
||||
$multiply: [
|
||||
'$product.price_acquistato',
|
||||
{
|
||||
$add: [
|
||||
'$quantity',
|
||||
'$quantitypreordered',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
count: {
|
||||
$sum: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
name: 1,
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
queryord.push(query)
|
||||
|
||||
filtroOrdini.value = queryord
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
colTableGestoreOrdini,
|
||||
setmeta,
|
||||
filtroOrdini,
|
||||
}
|
||||
}
|
||||
})
|
||||
33
src/rootgen/admin/gestoreordini_old/gestoreordini.vue
Executable file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<CMyPage title="Info Prodotti" imgbackground="images/prodotti.jpg" sizes="max-height: 120px">
|
||||
<span>{{
|
||||
setmeta({
|
||||
title: 'Info Prodotti',
|
||||
description: '',
|
||||
keywords: '',
|
||||
})
|
||||
}}
|
||||
</span>
|
||||
|
||||
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<CTitleBanner title="Info Prodotti"></CTitleBanner>
|
||||
<CGridTableRec
|
||||
prop_mytable="orders"
|
||||
prop_mytitle="Gestore Ordini"
|
||||
:prop_mycolumns="colTableGestoreOrdini"
|
||||
:filtercustom="filtroOrdini"
|
||||
prop_colkey="name"
|
||||
nodataLabel="Nessun Ordine"
|
||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
|
||||
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
</CMyPage>
|
||||
</template>
|
||||
<script lang="ts" src="./gestoreordini.ts">
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import 'gestoreordini.scss';
|
||||
</style>
|
||||
@@ -98,6 +98,20 @@ function getRoutesEcomm(site: ISites) {
|
||||
onlyManager: true,
|
||||
onlyEditor: true
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 30,
|
||||
path: '/admin/ecommerce/gestoreordini',
|
||||
materialIcon: 'fas fa-lemon',
|
||||
name: 'pages.gestoreordini',
|
||||
component: () => import('@/views/admin/gestoreordini/gestoreordini.vue'),
|
||||
inmenu: true,
|
||||
submenu: true,
|
||||
level_parent: 0,
|
||||
level_child: 0.5,
|
||||
onlyManager: true,
|
||||
onlyEditor: true
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 30,
|
||||
|
||||
@@ -2018,6 +2018,19 @@ export const colTableIscrittiArcadei = [
|
||||
AddCol(DuplicateRec),
|
||||
]
|
||||
|
||||
export const colTableGestoreOrdini = [
|
||||
AddCol({ name: 'name', label_trans: 'products.name' }),
|
||||
AddCol({ name: 'totalQty', label_trans: 'orderscart.totalQty', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'totalQtyPreordered', label_trans: 'orderscart.totalQtyPreordered', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'price', label_trans: 'order.price', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'quantity', label_trans: 'order.quantity', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'quantitypreordered', label_trans: 'order.quantitypreordered', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'TotalPriceProduct', label_trans: 'orderscart.TotalPriceProduct', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'TotalPriceProduct_Sell', label_trans: 'orderscart.TotalPriceProduct_Sell', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'TotalPriceProductCalc', label_trans: 'orderscart.TotalPriceProductCalc', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'status', label_trans: 'orderscart.status', fieldtype: costanti.FieldType.number }),
|
||||
]
|
||||
|
||||
export const colTableProductInfos = [
|
||||
AddCol({ name: 'code', label_trans: 'products.code', required: true }),
|
||||
AddCol({ name: 'codice_EAN', label_trans: 'products.codice_EAN' }),
|
||||
|
||||
@@ -67,6 +67,7 @@ export const tools = {
|
||||
|
||||
COOK_SEARCH: 'SEARCH_',
|
||||
COOK_SELCART: 'SELCART_',
|
||||
COOK_SELGAS: 'SELGAS',
|
||||
COOK_TAB_CIRCUIT: 'TAB_CIRC',
|
||||
COOK_COSA_PRODOTTI: 'PROD_N',
|
||||
|
||||
@@ -8298,6 +8299,7 @@ export const tools = {
|
||||
return mystr
|
||||
},
|
||||
|
||||
|
||||
getWeightByUnit(unit: number, short: boolean, weight: number | undefined) {
|
||||
let unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.CHILI && weight && weight < 1) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort } from 'model'
|
||||
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine } from 'model'
|
||||
|
||||
import { Api } from '@api'
|
||||
import { serv_constants } from '@src/store/Modules/serv_constants'
|
||||
@@ -195,42 +195,52 @@ export const useProducts = defineStore('Products', {
|
||||
return state.cart
|
||||
},
|
||||
|
||||
getOrdersAllCart: (state: IProductsState) => (): IOrderCart[] => {
|
||||
return state.orders
|
||||
getOrdersAllCart: (state: IProductsState) => (idGasordine: string): IOrderCart[] => {
|
||||
return state.orders.filter((rec: IOrderCart) => {
|
||||
if ((idGasordine && !rec.items?.some(item => item.order.idGasordine === idGasordine))) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
return true
|
||||
})
|
||||
},
|
||||
|
||||
getNumOrders: (state: IProductsState) => (): number => {
|
||||
return state.orders.length
|
||||
},
|
||||
|
||||
getOrdersCart: (state: IProductsState) => (tipoord: number, hasGasordine: any): IOrderCart[] | undefined => {
|
||||
if (tipoord === shared_consts.OrderStat.IN_CORSO.value)
|
||||
return state.orders.filter((rec: IOrderCart) => ((rec.status ? rec.status : 0) <= shared_consts.OrderStatus.CHECKOUT_SENT)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.PREPARED.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.PREPARED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.CONFERMATI.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.ORDER_CONFIRMED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.PAGATI.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.PAYED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.DELIVERED.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.DELIVERED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.SHIPPED.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.SHIPPED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.RECEIVED.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.RECEIVED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.COMPLETATI.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.COMPLETED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
else if (tipoord === shared_consts.OrderStat.CANCELLATI.value)
|
||||
return state.orders.filter((rec: IOrderCart) => (rec.status === shared_consts.OrderStatus.CANCELED)
|
||||
&& (hasGasordine ? rec.items?.some(item => item.order.idGasordine) : true))
|
||||
getOrdersCart: (state: IProductsState) => (tipoord: number, hasGasordine: any, idGasordine: string): IOrderCart[] | undefined => {
|
||||
return state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order.idGasordine === idGasordine)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
|
||||
if (hasGasordine && !rec.items?.some(item => item.order.idGasordine)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
|
||||
switch (tipoord) {
|
||||
case shared_consts.OrderStat.IN_CORSO.value:
|
||||
return !rec.status || rec.status <= shared_consts.OrderStatus.CHECKOUT_SENT;
|
||||
case shared_consts.OrderStat.PREPARED.value:
|
||||
return rec.status === shared_consts.OrderStatus.PREPARED;
|
||||
case shared_consts.OrderStat.CONFERMATI.value:
|
||||
return rec.status === shared_consts.OrderStatus.ORDER_CONFIRMED;
|
||||
case shared_consts.OrderStat.PAGATI.value:
|
||||
return rec.status === shared_consts.OrderStatus.PAYED;
|
||||
case shared_consts.OrderStat.DELIVERED.value:
|
||||
return rec.status === shared_consts.OrderStatus.DELIVERED;
|
||||
case shared_consts.OrderStat.SHIPPED.value:
|
||||
return rec.status === shared_consts.OrderStatus.SHIPPED;
|
||||
case shared_consts.OrderStat.RECEIVED.value:
|
||||
return rec.status === shared_consts.OrderStatus.RECEIVED;
|
||||
case shared_consts.OrderStat.COMPLETATI.value:
|
||||
return rec.status === shared_consts.OrderStatus.COMPLETED;
|
||||
case shared_consts.OrderStat.CANCELLATI.value:
|
||||
return rec.status === shared_consts.OrderStatus.CANCELED;
|
||||
default:
|
||||
return false; // Invalid tipoord
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
existProductInCart: (state: IProductsState) => (idproduct: string): boolean => {
|
||||
@@ -627,6 +637,23 @@ export const useProducts = defineStore('Products', {
|
||||
})
|
||||
},
|
||||
|
||||
async getGestoreOrdini({ idGasordine }: { idGasordine: string }) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let useractive = this.userActive._id
|
||||
if (!useractive)
|
||||
useractive = userStore.my._id;
|
||||
|
||||
return Api.SendReq('/cart/' + useractive + '/gestord', 'POST', { idGasordine })
|
||||
.then((res) => {
|
||||
if (res)
|
||||
return res.data.arrout
|
||||
else
|
||||
return []
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
async addToCart({ product, order, addqty }: { product: IProduct, order: IOrder, addqty: boolean }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -882,7 +909,7 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
|
||||
if (qta >= 0) {
|
||||
let totalPrice = this.cart.totalPrice ? this.cart.totalPrice.toFixed(2): 0
|
||||
let totalPrice = this.cart.totalPrice ? this.cart.totalPrice.toFixed(2) : 0
|
||||
let tot = totalPrice + ' €'
|
||||
msg = t('ecomm.prod_sul_carrello', { strprod, qty: qta, tot })
|
||||
}
|
||||
@@ -1075,9 +1102,60 @@ export const useProducts = defineStore('Products', {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
getStrInfoOrder(t: any, order: IOrder) {
|
||||
let mystr = ''
|
||||
let qtyrisult: any
|
||||
|
||||
if (order.product) {
|
||||
let qtystr = ''
|
||||
let qtynum = 0
|
||||
if (order.quantity > 0)
|
||||
qtynum += order.quantity;
|
||||
if (order.quantitypreordered > 0)
|
||||
qtynum += order.quantitypreordered;
|
||||
|
||||
if (order.product.productInfo.sfuso && order.product.productInfo.weight)
|
||||
qtyrisult = qtynum * order.product.productInfo.weight;
|
||||
else
|
||||
qtyrisult = qtynum + ' x ' + order.product.productInfo.weight;
|
||||
|
||||
qtystr += qtyrisult + ' ' + tools.getUnitsMeasure(order.product.productInfo.unit, true, order.product.productInfo.weight);
|
||||
|
||||
if (order.quantitypreordered > 0)
|
||||
qtystr += ' Pre-Ordinati';
|
||||
|
||||
mystr += '✅ [' + qtystr + '] ' + order.product.productInfo.name + ' a ' + order.price + '€ ' + (order.after_price ? order.after_price : '') + '<br>Totale = ' + order.TotalPriceProduct + '€';
|
||||
|
||||
}
|
||||
return mystr
|
||||
},
|
||||
|
||||
getGasordines() {
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const myarr: any = [{
|
||||
id: 0,
|
||||
label: 'Tutti',
|
||||
value: ''
|
||||
}]
|
||||
let ind = 1
|
||||
globalStore.gasordines.forEach((gasordine: IGasordine) => {
|
||||
myarr.push(
|
||||
{
|
||||
id: ind,
|
||||
label: gasordine.name,
|
||||
value: gasordine._id
|
||||
})
|
||||
|
||||
ind++
|
||||
})
|
||||
|
||||
return myarr
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -642,6 +642,14 @@
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Genera CSV Ordine Prodotti"
|
||||
color="primary"
|
||||
@click="EseguiFunz('GeneraCSVOrdineProdotti')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./dbop.ts">
|
||||
</script>
|
||||
|
||||
41
src/views/admin/gestoreordini/gestoreordini.scss
Executable file
@@ -0,0 +1,41 @@
|
||||
$heightBtn: 100%;
|
||||
|
||||
.card .product-image {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.mycol{
|
||||
color:gray;
|
||||
}
|
||||
|
||||
|
||||
.q-item__label--caption{
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.ordstat{
|
||||
text-align: center;
|
||||
border: 1px solid #8778cb;
|
||||
border-radius: 10px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.confermato {
|
||||
font-weight: bold;
|
||||
color: green;
|
||||
}
|
||||
|
||||
.note {
|
||||
font-style: italic;
|
||||
color:blue;
|
||||
}
|
||||
.totali {
|
||||
font-weight: bold;
|
||||
color: blue;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.totaliacq {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
font-size: 1rem;
|
||||
}
|
||||
236
src/views/admin/gestoreordini/gestoreordini.ts
Executable file
@@ -0,0 +1,236 @@
|
||||
import { defineComponent, onMounted, ref, watch } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
// import MixinBase from '@src/mixins/mixin-base'
|
||||
import { serv_constants } from '@store/Modules/serv_constants'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
|
||||
import { CSingleCart } from '../../../components/CSingleCart'
|
||||
import { CTitleBanner, CMyFieldDb } from '@components'
|
||||
import { ICart, IOrder, IOrderCart } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'gestoreordini',
|
||||
components: { CSingleCart, CTitleBanner, CMyFieldDb },
|
||||
props: {},
|
||||
setup() {
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const productStore = useProducts()
|
||||
const $router = useRouter()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
const mygestord = ref(<any[] | undefined>[])
|
||||
const myarrrec = ref(<any>{})
|
||||
const myoldrec = ref(<any>{})
|
||||
const templemail = ref('')
|
||||
|
||||
const storeGasordine = ref(<any>'')
|
||||
|
||||
const cosa = ref(0)
|
||||
const arrout = ref(<any[]>[])
|
||||
|
||||
const initialPagination = ref({
|
||||
sortBy: 'desc',
|
||||
descending: false,
|
||||
rowsPerPage: 10,
|
||||
// rowsNumber: xx if getting data from a server
|
||||
})
|
||||
|
||||
const conferma_carrello = ref(false)
|
||||
const conferma_ordine = ref(false)
|
||||
const endload = ref(false)
|
||||
|
||||
const taborders = ref(shared_consts.OrderStat.IN_CORSO.value)
|
||||
const columns = ref(<any>[
|
||||
{
|
||||
name: 'name',
|
||||
required: true,
|
||||
align: 'left',
|
||||
label: 'Nome Prodotto',
|
||||
field: 'nameSurname',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
name: 'weight',
|
||||
required: true,
|
||||
label: 'Peso',
|
||||
field: 'weight',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
name: 'price_acquistato',
|
||||
required: true,
|
||||
label: 'Prezzo (P)',
|
||||
field: 'price_acquistato',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
name: 'totalQuantity',
|
||||
required: true,
|
||||
label: 'Qty',
|
||||
field: 'totalQuantity',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
name: 'totalPrice_acquistato',
|
||||
required: true,
|
||||
label: 'Totale (P)',
|
||||
field: 'totalPrice_acquistato',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
name: 'totalPrice',
|
||||
required: true,
|
||||
label: 'Totale (C)',
|
||||
field: 'totalPrice',
|
||||
sortable: true
|
||||
},
|
||||
])
|
||||
|
||||
watch(() => cosa.value, (newval, oldval) => {
|
||||
|
||||
})
|
||||
watch(() => storeGasordine.value, (newval, oldval) => {
|
||||
tools.setCookie(tools.COOK_SELGAS, storeGasordine.value)
|
||||
updateorders()
|
||||
})
|
||||
|
||||
function getCols(props: any) {
|
||||
return props.cols.filter((col: any) => col.name !== 'desc')
|
||||
}
|
||||
|
||||
async function getGestoreOrd() {
|
||||
const hasGasordine: any = (cosa.value === shared_consts.PROD.TUTTI) ? undefined : (cosa.value === shared_consts.PROD.GAS)
|
||||
const ris = await productStore.getGestoreOrdini({ idGasordine: storeGasordine.value })
|
||||
|
||||
return ris
|
||||
}
|
||||
|
||||
async function getGestoreOrdWithTotals() {
|
||||
const orderscart = await getGestoreOrd();
|
||||
|
||||
if (orderscart) {
|
||||
// Calculate totals
|
||||
const totals = {
|
||||
name: 'TOTALI',
|
||||
weight: '',
|
||||
totalQuantity: orderscart.reduce((total: number, rec: any) => total + rec.totalQuantity, 0),
|
||||
totalPrice_acquistato: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice_acquistato, 0),
|
||||
totalPrice: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice, 0),
|
||||
};
|
||||
|
||||
let rowsWithTotals: any = [...orderscart];
|
||||
|
||||
if (tools.isManager()) {
|
||||
// Combine orders and totals
|
||||
rowsWithTotals.push(totals);
|
||||
}
|
||||
|
||||
return rowsWithTotals;
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function updateorders() {
|
||||
mygestord.value = await getGestoreOrd()
|
||||
if (mygestord.value) {
|
||||
for (const gestord of mygestord.value) {
|
||||
myarrrec.value[gestord._id] = Object.keys(gestord)
|
||||
}
|
||||
}
|
||||
|
||||
arrout.value = await getGestoreOrdWithTotals()
|
||||
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
|
||||
storeGasordine.value = tools.getCookie(tools.COOK_SELGAS, '')
|
||||
|
||||
await userStore.newsletterload(false)
|
||||
await productStore.loadProducts()
|
||||
|
||||
taborders.value = -1
|
||||
|
||||
await updateorders()
|
||||
|
||||
if (taborders.value === -1)
|
||||
taborders.value = shared_consts.OrderStat.IN_CORSO.value
|
||||
|
||||
endload.value = true
|
||||
}
|
||||
|
||||
function CanBeShipped() {
|
||||
return productStore.cart.items!.filter((rec) => rec.order.product!.canBeShipped).length
|
||||
}
|
||||
|
||||
function CanBeBuyOnline() {
|
||||
return productStore.cart.items!.filter((rec) => rec.order.product!.canBeBuyOnline).length
|
||||
}
|
||||
|
||||
function getnumsteps() {
|
||||
let numsteps = 1
|
||||
|
||||
if (CanBeShipped())
|
||||
numsteps++
|
||||
if (CanBeBuyOnline())
|
||||
numsteps++
|
||||
|
||||
return numsteps
|
||||
}
|
||||
|
||||
function docheckout() {
|
||||
|
||||
// Può essere spedito?
|
||||
|
||||
if (CanBeShipped()) {
|
||||
// mostra form di spedizione
|
||||
}
|
||||
|
||||
if (CanBeBuyOnline()) {
|
||||
// mostra form di acquisto Online
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
userStore,
|
||||
costanti,
|
||||
tools,
|
||||
toolsext,
|
||||
shared_consts,
|
||||
globalStore,
|
||||
columns,
|
||||
taborders,
|
||||
getGestoreOrd,
|
||||
updateorders,
|
||||
getCols,
|
||||
endload,
|
||||
getGestoreOrdWithTotals,
|
||||
productStore,
|
||||
t,
|
||||
initialPagination,
|
||||
cosa,
|
||||
templemail,
|
||||
fieldsTable,
|
||||
arrout,
|
||||
storeGasordine,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
117
src/views/admin/gestoreordini/gestoreordini.vue
Executable file
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<q-page>
|
||||
<CTitleBanner title="Ordini"></CTitleBanner>
|
||||
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
|
||||
|
||||
<div class="q-gutter-md text-center">
|
||||
<q-btn-toggle
|
||||
v-model="cosa"
|
||||
push
|
||||
rounded
|
||||
glossy
|
||||
toggle-color="purple"
|
||||
:options="[
|
||||
{ value: shared_consts.PROD.TUTTI, slot: 'tutti' },
|
||||
{ value: shared_consts.PROD.BOTTEGA, slot: 'bottega' },
|
||||
{ value: shared_consts.PROD.GAS, slot: 'gas' },
|
||||
]"
|
||||
>
|
||||
<template v-slot:tutti>
|
||||
<div class="row items-center no-wrap">
|
||||
<div class="text-center">
|
||||
{{ t('gas.tutti') }}
|
||||
</div>
|
||||
<q-icon right name="fas fa-user-friends" />
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:gas>
|
||||
<div class="row items-center no-wrap">
|
||||
<div class="text-center">
|
||||
{{ t('gas.ordina_sul_gas') }}
|
||||
</div>
|
||||
<q-icon right name="fas fa-user-friends" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:bottega>
|
||||
<div class="row items-center no-wrap">
|
||||
<div class="text-center">
|
||||
{{ t('gas.bottega') }}
|
||||
</div>
|
||||
<q-icon right name="fas fa-store" />
|
||||
</div>
|
||||
</template>
|
||||
</q-btn-toggle>
|
||||
</div>
|
||||
|
||||
<div v-if="endload" class="panel">
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
outlined
|
||||
v-model="storeGasordine"
|
||||
:options="productStore.getGasordines()"
|
||||
:label="t('products.gasordine') + `:`"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<div class="q-pa-sm" v-if="arrout">
|
||||
<q-table
|
||||
:columns="columns"
|
||||
row-key="numorder"
|
||||
:pagination="initialPagination"
|
||||
:rows="arrout"
|
||||
>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td key="name" :props="props">
|
||||
<span v-if="props.row.name"> {{ props.row.name }}</span>
|
||||
</q-td>
|
||||
<q-td key="weight" :props="props">
|
||||
<span v-if="props.row.weight">
|
||||
{{ props.row.weight }}
|
||||
{{ tools.getUnitsMeasure(props.row.unit, true) }}</span
|
||||
>
|
||||
</q-td>
|
||||
<q-td key="price_acquistato" :props="props">
|
||||
<span v-if="props.row.price_acquistato">
|
||||
{{ props.row.price_acquistato.toFixed(2) }} €
|
||||
</span>
|
||||
</q-td>
|
||||
<q-td key="totalQuantity" :props="props">
|
||||
<span v-if="props.row.totalQuantity">
|
||||
|
||||
{{ props.row.totalQuantity }}</span
|
||||
>
|
||||
</q-td>
|
||||
<q-td key="totalPrice_acquistato" :props="props">
|
||||
<span v-if="props.row.totalPrice_acquistato">
|
||||
<span :class="props.row.name !== 'TOTALI' ? '' : 'totaliacq'">
|
||||
{{ props.row.totalPrice_acquistato.toFixed(2) }} €
|
||||
</span
|
||||
>
|
||||
</span>
|
||||
</q-td>
|
||||
<q-td key="totalPrice" :props="props">
|
||||
<span v-if="props.row.totalPrice">
|
||||
<span :class="props.row.name !== 'TOTALI' ? '' : 'totali'">
|
||||
{{ props.row.totalPrice.toFixed(2) }} €
|
||||
</span
|
||||
>
|
||||
</span>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./gestoreordini.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './gestoreordini';
|
||||
</style>
|
||||
1
src/views/admin/gestoreordini/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as gestoreordini} from './orderInfo.vue'
|
||||
@@ -36,6 +36,8 @@ export default defineComponent({
|
||||
|
||||
const cosa = ref(0)
|
||||
|
||||
const arrout = ref(<any[]>[])
|
||||
|
||||
const initialPagination = ref({
|
||||
sortBy: 'desc',
|
||||
descending: false,
|
||||
@@ -47,6 +49,8 @@ export default defineComponent({
|
||||
const conferma_ordine = ref(false)
|
||||
const endload = ref(false)
|
||||
|
||||
const storeGasordine = ref(<any>'')
|
||||
|
||||
const taborders = ref(shared_consts.OrderStat.IN_CORSO.value)
|
||||
const statusnow = ref(0)
|
||||
const arrnumstatus = ref(<any[]>[])
|
||||
@@ -165,7 +169,16 @@ export default defineComponent({
|
||||
])
|
||||
|
||||
watch(() => cosa.value, (newval, oldval) => {
|
||||
updateorders(true)
|
||||
})
|
||||
|
||||
watch(() => taborders.value, (newval, oldval) => {
|
||||
updateorders(false)
|
||||
})
|
||||
|
||||
watch(() => storeGasordine.value, (newval, oldval) => {
|
||||
tools.setCookie(tools.COOK_SELGAS, storeGasordine.value)
|
||||
updateorders(true)
|
||||
})
|
||||
|
||||
// const { setValDb, getValDb } = MixinBase()
|
||||
@@ -176,7 +189,7 @@ export default defineComponent({
|
||||
|
||||
function getOrdersCart(): IOrderCart[] | undefined {
|
||||
const hasGasordine: any = (cosa.value === shared_consts.PROD.TUTTI) ? undefined : (cosa.value === shared_consts.PROD.GAS)
|
||||
const ris = productStore.getOrdersCart(taborders.value, hasGasordine)
|
||||
const ris = productStore.getOrdersCart(taborders.value, hasGasordine, storeGasordine.value)
|
||||
|
||||
return ris
|
||||
}
|
||||
@@ -184,7 +197,7 @@ export default defineComponent({
|
||||
function getOrdersCartWithTotals(): any[] {
|
||||
const orderscart = getOrdersCart();
|
||||
|
||||
if (orderscart) {
|
||||
if (orderscart && taborders.value > 0) {
|
||||
// Calculate totals
|
||||
const totals = {
|
||||
created_at: new Date(),
|
||||
@@ -216,10 +229,12 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getAllOrdersCart() {
|
||||
return productStore.getOrdersAllCart()
|
||||
return productStore.getOrdersAllCart(storeGasordine.value)
|
||||
}
|
||||
|
||||
function updateorders() {
|
||||
function updateorders(updatetab: boolean) {
|
||||
arrout.value = []
|
||||
|
||||
myorderscart.value = getOrdersCart()
|
||||
if (myorderscart.value) {
|
||||
for (const orderscart of myorderscart.value) {
|
||||
@@ -227,19 +242,22 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
if (updatetab) {
|
||||
const allorders = getAllOrdersCart()
|
||||
for (const status of [15, 2, 3, 4, 5, 6, 7, 8, 10]) {
|
||||
arrnumstatus.value[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0)
|
||||
}
|
||||
|
||||
selectfirstavailable()
|
||||
}
|
||||
|
||||
|
||||
arrout.value = getOrdersCartWithTotals()
|
||||
|
||||
}
|
||||
|
||||
function selectfirstavailable() {
|
||||
|
||||
taborders.value = -1
|
||||
Object.keys(arrnumstatus.value).forEach((stat: any) => {
|
||||
if (arrnumstatus.value[stat] > 0) {
|
||||
if (taborders.value === -1)
|
||||
@@ -250,12 +268,14 @@ export default defineComponent({
|
||||
|
||||
async function mounted() {
|
||||
|
||||
taborders.value = -1
|
||||
storeGasordine.value = tools.getCookie(tools.COOK_SELGAS, '')
|
||||
|
||||
await userStore.newsletterload(false)
|
||||
await productStore.loadProducts()
|
||||
|
||||
taborders.value = -1
|
||||
|
||||
updateorders()
|
||||
updateorders(true)
|
||||
|
||||
if (taborders.value === -1)
|
||||
taborders.value = shared_consts.OrderStat.IN_CORSO.value
|
||||
@@ -328,7 +348,7 @@ export default defineComponent({
|
||||
|
||||
if (statusnow.value === status) {
|
||||
order.status = statusnow.value
|
||||
updateorders()
|
||||
updateorders(true)
|
||||
tools.showPositiveNotif($q, 'Ordine ' + statusStr)
|
||||
}
|
||||
// change_field('status')
|
||||
@@ -398,6 +418,8 @@ export default defineComponent({
|
||||
sendMailTest,
|
||||
templemail,
|
||||
fieldsTable,
|
||||
storeGasordine,
|
||||
arrout,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -47,14 +47,37 @@
|
||||
<div v-if="endload" class="panel">
|
||||
<q-tabs v-model="taborders" inline-label class="text-blue">
|
||||
<span v-for="(stat, index) of shared_consts.OrderStat" :key="index">
|
||||
<q-tab v-if="arrnumstatus[stat.value] > 0" :class="stat.color" :name="stat.value" :icon="stat.icon"
|
||||
:label="`(` + arrnumstatus[stat.value] + `) ` + stat.label" />
|
||||
<q-tab
|
||||
v-if="arrnumstatus[stat.value] > 0"
|
||||
:class="stat.color"
|
||||
:name="stat.value"
|
||||
:icon="stat.icon"
|
||||
:label="`(` + arrnumstatus[stat.value] + `) ` + stat.label"
|
||||
/>
|
||||
</span>
|
||||
</q-tabs>
|
||||
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
outlined
|
||||
v-model="storeGasordine"
|
||||
:options="productStore.getGasordines()"
|
||||
:label="t('products.gasordine') + `:`"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<div class="q-pa-sm">
|
||||
<q-table :grid="$q.screen.lt.sm" :hide-header="$q.screen.lt.sm" :columns="columns" row-key="numorder"
|
||||
:pagination="initialPagination" :rows="getOrdersCartWithTotals()">
|
||||
<q-table
|
||||
v-if="taborders > 0"
|
||||
:grid="$q.screen.lt.sm"
|
||||
:hide-header="$q.screen.lt.sm"
|
||||
:columns="columns"
|
||||
row-key="numorder"
|
||||
:pagination="initialPagination"
|
||||
:rows="arrout"
|
||||
>
|
||||
<template v-if="$q.screen.lt.sm" v-slot:item="props">
|
||||
<div class="q-pa-xs col-xs-12 col-sm-6 col-md-4">
|
||||
<q-card class="my-card-shadow yes_shadow">
|
||||
@@ -64,13 +87,21 @@
|
||||
<q-item-label>{{ col.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label v-if="col.name === 'created_at'" caption>{{ tools.getstrDateTime(col.value) }}
|
||||
<q-item-label v-if="col.name === 'created_at'" caption
|
||||
>{{ tools.getstrDateTime(col.value) }}
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'nameSurname'" caption>
|
||||
<q-item-label
|
||||
v-else-if="col.name === 'nameSurname'"
|
||||
caption
|
||||
>
|
||||
<span v-if="props.row.user">
|
||||
<span :class="props.row.user.name !== 'TOTALI' ? '' : 'totali'
|
||||
">{{ tools.getNomeUtenteByRecUser(props.row.user) }}
|
||||
</span></span>
|
||||
<span
|
||||
:class="
|
||||
props.row.user.name !== 'TOTALI' ? '' : 'totali'
|
||||
"
|
||||
>{{ tools.getNomeUtenteByRecUser(props.row.user) }}
|
||||
</span></span
|
||||
>
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'items'" caption>
|
||||
<div
|
||||
@@ -85,33 +116,53 @@
|
||||
item.order.product.productInfo
|
||||
"
|
||||
>
|
||||
{{ productStore.getStrInfoOrder(t, item.order) }}
|
||||
{{ item.order.product.productInfo.name }} ({{
|
||||
productStore.getQuantityByOrder(t, item.order)
|
||||
}})<br />
|
||||
</div>
|
||||
</div>
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'totalPrice'" caption>
|
||||
<q-item-label
|
||||
v-else-if="col.name === 'totalPrice'"
|
||||
caption
|
||||
>
|
||||
{{ props.row.totalPrice }} €
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'totalPriceCalc'" caption>
|
||||
<q-item-label
|
||||
v-else-if="col.name === 'totalPriceCalc'"
|
||||
caption
|
||||
>
|
||||
{{ props.row.totalPriceCalc }} €
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'status'" caption>
|
||||
{{ shared_consts.getStatusStr(props.row.status) }}
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="col.name === 'comandi'" caption>
|
||||
<div v-if="tools.isManager() &&
|
||||
<div
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
props.row.user.name !== 'TOTALI'
|
||||
" class="q-pa-sm">
|
||||
"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-btn-dropdown rounded dense label="Azioni">
|
||||
<q-list class="text-primary">
|
||||
<q-item v-for="(
|
||||
<q-item
|
||||
v-for="(
|
||||
cmd, index
|
||||
) of shared_consts.OrderCmdStr" :key="index" clickable v-close-popup
|
||||
@click="clickFunz(props.row, cmd.value)">
|
||||
) of shared_consts.OrderCmdStr"
|
||||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickFunz(props.row, cmd.value)"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-avatar :icon="cmd.icon" :color="cmd.color" text-color="white" />
|
||||
<q-avatar
|
||||
:icon="cmd.icon"
|
||||
:color="cmd.color"
|
||||
text-color="white"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ cmd.label }}</q-item-label>
|
||||
@@ -122,7 +173,10 @@
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label v-else-if="col.name === 'apri' && props.row._id" caption>
|
||||
<q-item-label
|
||||
v-else-if="col.name === 'apri' && props.row._id"
|
||||
caption
|
||||
>
|
||||
<div class="q-pa-sm">
|
||||
<q-btn
|
||||
size="sm"
|
||||
@@ -158,13 +212,25 @@
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="comandi" :props="props">
|
||||
<div v-if="tools.isManager() && props.row.user.name !== 'TOTALI'" class="q-pa-sm">
|
||||
<div
|
||||
v-if="tools.isManager() && props.row.user.name !== 'TOTALI'"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-btn-dropdown rounded dense label="Azioni">
|
||||
<q-list class="text-primary">
|
||||
<q-item v-for="(cmd, index) of shared_consts.OrderCmdStr" :key="index" clickable v-close-popup
|
||||
@click="clickFunz(props.row, cmd.value)">
|
||||
<q-item
|
||||
v-for="(cmd, index) of shared_consts.OrderCmdStr"
|
||||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickFunz(props.row, cmd.value)"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-avatar :icon="cmd.icon" :color="cmd.color" text-color="white" />
|
||||
<q-avatar
|
||||
:icon="cmd.icon"
|
||||
:color="cmd.color"
|
||||
text-color="white"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ cmd.label }}</q-item-label>
|
||||
@@ -176,13 +242,16 @@
|
||||
</q-td>
|
||||
<q-td key="numorder" :props="props">
|
||||
<span v-if="props.row.numorder">
|
||||
n. {{ props.row.numorder }}</span>
|
||||
n. {{ props.row.numorder }}</span
|
||||
>
|
||||
</q-td>
|
||||
<q-td key="nameSurname" :props="props">
|
||||
<span v-if="props.row.user">
|
||||
<span :class="props.row.user.name !== 'TOTALI' ? '' : 'totali'">{{
|
||||
tools.getNomeUtenteByRecUser(props.row.user) }}
|
||||
</span></span>
|
||||
<span
|
||||
:class="props.row.user.name !== 'TOTALI' ? '' : 'totali'"
|
||||
>{{ tools.getNomeUtenteByRecUser(props.row.user) }}
|
||||
</span></span
|
||||
>
|
||||
</q-td>
|
||||
<q-td key="created_at" :props="props">
|
||||
{{ tools.getstrDateTime(props.row.created_at) }}
|
||||
@@ -217,7 +286,9 @@
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="totalPrice" :props="props">
|
||||
<span :class="props.row.user.name !== 'TOTALI' ? '' : 'totali'">{{ props.row.totalPrice }} €</span>
|
||||
<span :class="props.row.user.name !== 'TOTALI' ? '' : 'totali'"
|
||||
>{{ props.row.totalPrice }} €</span
|
||||
>
|
||||
</q-td>
|
||||
<q-td key="status" :props="props">
|
||||
<span :class="props.row.status">{{
|
||||
|
||||