PCB
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
const msg_website_enUs = {
|
const msg_website_enUs = {
|
||||||
ws: {
|
ws: {
|
||||||
sitename: 'Fiore Della Vita',
|
sitename: 'Più che Buono',
|
||||||
siteshortname: 'Fiore Della Vita',
|
siteshortname: 'Più che Buono',
|
||||||
description: '',
|
description: '',
|
||||||
keywords: '',
|
keywords: '',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const msg_website_it = {
|
const msg_website_it = {
|
||||||
ws: {
|
ws: {
|
||||||
sitename: 'Fiore Della Vita',
|
sitename: 'Più che Buono',
|
||||||
siteshortname: 'Fiore Della Vita',
|
siteshortname: 'Più che Buono',
|
||||||
description: '',
|
description: '',
|
||||||
keywords: '',
|
keywords: '',
|
||||||
},
|
},
|
||||||
@@ -131,7 +131,7 @@ const msg_website_it = {
|
|||||||
color: 'Colore',
|
color: 'Colore',
|
||||||
},
|
},
|
||||||
msg: {
|
msg: {
|
||||||
myAppName: 'Fiore della Vita',
|
myAppName: 'Più che Buono',
|
||||||
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
|
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
|
||||||
underconstruction: 'App in costruzione...',
|
underconstruction: 'App in costruzione...',
|
||||||
myDescriz: '',
|
myDescriz: '',
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default defineComponent({
|
|||||||
CPresentazione, CMyActivities,
|
CPresentazione, CMyActivities,
|
||||||
CMyProfileTutorial, CSendRISTo,
|
CMyProfileTutorial, CSendRISTo,
|
||||||
CTitleBanner, CShareSocial, CCheckAppRunning, CRegistration,
|
CTitleBanner, CShareSocial, CCheckAppRunning, CRegistration,
|
||||||
CVisuVideoPromoAndPDF,
|
CVisuVideoPromoAndPDF, CECommerce,
|
||||||
},
|
},
|
||||||
emits: ['selElemClick'],
|
emits: ['selElemClick'],
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
HOLA:
|
||||||
<q-card :class="getmycardcl()" v-if="!!myproduct">
|
<q-card :class="getmycardcl()" v-if="!!myproduct">
|
||||||
<q-img :src="`` + myproduct.img" :alt="myproduct.name" :class="getclimg()"></q-img>
|
<q-img :src="`` + myproduct.img" :alt="myproduct.name" :class="getclimg()"></q-img>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const msg_website_it = {
|
const msg_website_it = {
|
||||||
ws: {
|
ws: {
|
||||||
sitename: 'Fiore Della Vita',
|
sitename: 'Più che Buono',
|
||||||
siteshortname: 'Fiore Della Vita',
|
siteshortname: 'Più che Buono',
|
||||||
description: '',
|
description: '',
|
||||||
keywords: '',
|
keywords: '',
|
||||||
},
|
},
|
||||||
@@ -131,7 +131,7 @@ const msg_website_it = {
|
|||||||
color: 'Colore',
|
color: 'Colore',
|
||||||
},
|
},
|
||||||
msg: {
|
msg: {
|
||||||
myAppName: 'Fiore della Vita',
|
myAppName: 'Più che Buono',
|
||||||
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
|
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
|
||||||
underconstruction: 'App in costruzione...',
|
underconstruction: 'App in costruzione...',
|
||||||
myDescriz: '',
|
myDescriz: '',
|
||||||
|
|||||||
@@ -57,6 +57,112 @@ function getRoutesAd(site: ISites) {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const routes_admin_ecommerce: IListRoutes[] = [
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 30,
|
||||||
|
path: '/admin/ecommerce/products',
|
||||||
|
materialIcon: 'fas fa-file-alt',
|
||||||
|
name: 'pages.products',
|
||||||
|
component: () => import('@/rootgen/admin/products/products.vue'),
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
level_parent: 0,
|
||||||
|
level_child: 0.5,
|
||||||
|
onlyManager: true,
|
||||||
|
onlyEditor: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 30,
|
||||||
|
path: '/admin/ecommerce/producers',
|
||||||
|
materialIcon: 'fas fa-file-alt',
|
||||||
|
name: 'pages.producer',
|
||||||
|
component: () => import('@/rootgen/admin/producer/producer.vue'),
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
level_parent: 0,
|
||||||
|
level_child: 0.5,
|
||||||
|
onlyManager: true,
|
||||||
|
onlyEditor: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 30,
|
||||||
|
path: '/admin/ecommerce/storehouses',
|
||||||
|
materialIcon: 'fas fa-file-alt',
|
||||||
|
name: 'pages.storehouses',
|
||||||
|
component: () => import('@/rootgen/admin/storehouses/storehouses.vue'),
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
level_parent: 0,
|
||||||
|
level_child: 0.5,
|
||||||
|
onlyManager: true,
|
||||||
|
onlyEditor: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 31,
|
||||||
|
path: '/admin/ecommerce/departments',
|
||||||
|
materialIcon: 'fas fa-file-alt',
|
||||||
|
name: 'pages.departments',
|
||||||
|
component: () => import('@/rootgen/admin/departments/departments.vue'),
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
level_parent: 0,
|
||||||
|
level_child: 0.5,
|
||||||
|
onlyManager: true,
|
||||||
|
onlyEditor: true
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const routes_admin_ecommerce_menu: IListRoutes[] = [
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 30,
|
||||||
|
path: '/admin/ecommerce/products',
|
||||||
|
name: 'pages.products',
|
||||||
|
component: () => import('@/rootgen/admin/products/products.vue'),
|
||||||
|
inmenu: false,
|
||||||
|
infooter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 31,
|
||||||
|
path: '/admin/ecommerce/producers',
|
||||||
|
name: 'pages.producer',
|
||||||
|
component: () => import('@/rootgen/admin/producer/producer.vue'),
|
||||||
|
inmenu: false,
|
||||||
|
infooter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 32,
|
||||||
|
path: '/admin/ecommerce/storehouses',
|
||||||
|
name: 'pages.storehouses',
|
||||||
|
component: () => import('@/rootgen/admin/storehouses/storehouses.vue'),
|
||||||
|
infooter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 32,
|
||||||
|
path: '/admin/ecommerce/departments',
|
||||||
|
name: 'pages.departments',
|
||||||
|
component: () => import('@/rootgen/admin/departments/departments.vue'),
|
||||||
|
infooter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 35,
|
||||||
|
path: '/admin/ecommerce/orders',
|
||||||
|
name: 'pages.orders2',
|
||||||
|
component: () => import('@/rootgen/admin/orders/orders.vue'),
|
||||||
|
infooter: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
const routes_newsletter: IListRoutes[] = [
|
const routes_newsletter: IListRoutes[] = [
|
||||||
{
|
{
|
||||||
@@ -339,9 +445,8 @@ function getRoutesAd(site: ISites) {
|
|||||||
onlyAdmin: true,
|
onlyAdmin: true,
|
||||||
onlyManager: true
|
onlyManager: true
|
||||||
},
|
},
|
||||||
/*
|
{
|
||||||
{
|
active: site.confpages && site.confpages.enableEcommerce,
|
||||||
active: functionality.ENABLE_ECOMMERCE,
|
|
||||||
path: '/admin/ecommerce',
|
path: '/admin/ecommerce',
|
||||||
order: 31,
|
order: 31,
|
||||||
faIcon: 'fa fa-list-alt',
|
faIcon: 'fa fa-list-alt',
|
||||||
@@ -357,8 +462,6 @@ function getRoutesAd(site: ISites) {
|
|||||||
onlyManager: true,
|
onlyManager: true,
|
||||||
onlyDepartment: true
|
onlyDepartment: true
|
||||||
},
|
},
|
||||||
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
active: true,
|
active: true,
|
||||||
order: 35,
|
order: 35,
|
||||||
|
|||||||
@@ -1,149 +1,126 @@
|
|||||||
import Vue from 'vue'
|
import { defineComponent, onMounted, ref } from 'vue'
|
||||||
import { Component, Watch } from 'vue-property-decorator'
|
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 { SingleProject } from '../../../components/projects/SingleProject/index'
|
|
||||||
import { CTodo } from '../../../components/todos/CTodo'
|
|
||||||
|
|
||||||
import { CProgress } from '../../../components/CProgress'
|
|
||||||
import { CDate } from '../../../components/CDate'
|
|
||||||
import { Action } from 'vuex'
|
|
||||||
import Products from '@src/store/Modules/Products'
|
|
||||||
import { CSingleCart } from '../../../components/CSingleCart'
|
import { CSingleCart } from '../../../components/CSingleCart'
|
||||||
import { CTitleBanner } from '@components'
|
import { CTitleBanner } from '@components'
|
||||||
import { tools } from '@src/store/Modules/tools'
|
|
||||||
import { ICart, IOrderCart } from '@src/model'
|
import { ICart, IOrderCart } from '@src/model'
|
||||||
import MixinBase from '@src/mixins/mixin-base'
|
|
||||||
import { shared_consts } from '@src/common/shared_vuejs'
|
|
||||||
|
|
||||||
const namespace: string = 'Products'
|
export default defineComponent({
|
||||||
|
name: 'OrderInfo',
|
||||||
|
components: { CSingleCart, CTitleBanner },
|
||||||
|
props: {},
|
||||||
|
setup() {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
|
const productStore = useProducts()
|
||||||
|
const $router = useRouter()
|
||||||
|
const $q = useQuasar()
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
@Component({
|
const myorderscart = ref(<IOrderCart[] | undefined>[])
|
||||||
name: 'checkOut',
|
const myarrrec = ref(<any>{})
|
||||||
components: { SingleProject, CProgress, CTodo, CDate, CSingleCart, CTitleBanner },
|
const myoldrec = ref(<any>{})
|
||||||
filters: {
|
|
||||||
capitalize(value) {
|
const conferma_carrello = ref(false)
|
||||||
if (!value) {
|
const conferma_ordine = ref(false)
|
||||||
return ''
|
|
||||||
|
const taborders = ref('incorso')
|
||||||
|
const statusnow = ref(0)
|
||||||
|
const arrnumstatus = ref(<any[]>[])
|
||||||
|
const columns = ref(<any>[
|
||||||
|
{
|
||||||
|
name: 'numorder',
|
||||||
|
required: true,
|
||||||
|
align: 'left',
|
||||||
|
label: 'Numero Ordine',
|
||||||
|
field: 'numorder',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'nameSurname',
|
||||||
|
required: true,
|
||||||
|
align: 'left',
|
||||||
|
label: 'Nome',
|
||||||
|
field: 'nameSurname',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'created_at',
|
||||||
|
required: true,
|
||||||
|
align: 'center',
|
||||||
|
label: 'Effettuato il',
|
||||||
|
field: 'created_at',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'items',
|
||||||
|
required: true,
|
||||||
|
label: 'Articoli',
|
||||||
|
field: 'items',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'totalPrice',
|
||||||
|
required: true,
|
||||||
|
label: 'Totale',
|
||||||
|
field: 'totalPrice',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'status',
|
||||||
|
align: 'center',
|
||||||
|
required: true,
|
||||||
|
label: 'Stato',
|
||||||
|
field: 'status',
|
||||||
|
sortable: true
|
||||||
}
|
}
|
||||||
value = value.toString()
|
])
|
||||||
return value.charAt(0).toUpperCase() + value.slice(1)
|
|
||||||
|
// const { setValDb, getValDb } = MixinBase()
|
||||||
|
|
||||||
|
function getCols(props: any) {
|
||||||
|
return props.cols.filter((col: any) => col.name !== 'desc')
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default class OrderInfo extends MixinBase {
|
function getOrdersCart(): IOrderCart[] | undefined {
|
||||||
public $q: any
|
return productStore.getOrdersCart(taborders.value)
|
||||||
public myorderscart: IOrderCart[] = []
|
|
||||||
public myarrrec: any = {}
|
|
||||||
|
|
||||||
public conferma_carrello: boolean = false
|
|
||||||
public conferma_ordine: boolean = false
|
|
||||||
|
|
||||||
public taborders: string = 'incorso'
|
|
||||||
public filter: string = ''
|
|
||||||
public statusnow: number = 0
|
|
||||||
public arrnumstatus: any = []
|
|
||||||
public columns = [
|
|
||||||
{
|
|
||||||
name: 'numorder',
|
|
||||||
required: true,
|
|
||||||
align: 'left',
|
|
||||||
label: 'Numero Ordine',
|
|
||||||
field: 'numorder',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'nameSurname',
|
|
||||||
required: true,
|
|
||||||
align: 'left',
|
|
||||||
label: 'Nome',
|
|
||||||
field: 'nameSurname',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'created_at',
|
|
||||||
required: true,
|
|
||||||
align: 'center',
|
|
||||||
label: 'Effettuato il',
|
|
||||||
field: 'created_at',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'items',
|
|
||||||
required: true,
|
|
||||||
label: 'Articoli',
|
|
||||||
field: 'items',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'totalPrice',
|
|
||||||
required: true,
|
|
||||||
label: 'Totale',
|
|
||||||
field: 'totalPrice',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'status',
|
|
||||||
align: 'center',
|
|
||||||
required: true,
|
|
||||||
label: 'Stato',
|
|
||||||
field: 'status',
|
|
||||||
sortable: true
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
|
|
||||||
/*public $refs: {
|
function getAllOrdersCart() {
|
||||||
singleproject: SingleProject[],
|
return productStore.getOrdersAllCart()
|
||||||
ctodo: CTodo
|
}
|
||||||
}*/
|
|
||||||
|
|
||||||
get getOrdersCart() {
|
function updateorders() {
|
||||||
return Products.getters.getOrdersCart(this.taborders)
|
myorderscart.value = getOrdersCart()
|
||||||
}
|
for (const ordercart of myorderscart.value!) {
|
||||||
|
myarrrec.value[ordercart._id] = Object.keys(ordercart)
|
||||||
get getAllOrdersCart() {
|
}
|
||||||
return Products.getters.getOrdersAllCart()
|
|
||||||
}
|
const allorders = getAllOrdersCart()
|
||||||
|
for (const status of [2, 3, 4, 6, 10]) {
|
||||||
public change_field(myorderid, fieldname) {
|
arrnumstatus.value[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0)
|
||||||
if (this.myarrrec[myorderid][fieldname] !== this[fieldname]) {
|
|
||||||
this.myarrrec[myorderid][fieldname] = this[fieldname]
|
|
||||||
|
|
||||||
const mydata = {
|
|
||||||
[fieldname]: this.myarrrec[myorderid][fieldname]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const aggiorna = fieldname !== 'status'
|
|
||||||
tools.saveFieldToServer(this, 'orderscart', myorderid, mydata, aggiorna)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public updateorders() {
|
|
||||||
this.myorderscart = this.getOrdersCart
|
|
||||||
for (const ordercart of this.myorderscart) {
|
|
||||||
this.myarrrec[ordercart._id] = Object.keys(ordercart)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const allorders = this.getAllOrdersCart
|
function mounted() {
|
||||||
for (const status of [
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
6,
|
|
||||||
10
|
|
||||||
]) {
|
|
||||||
this.arrnumstatus[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
updateorders()
|
||||||
|
|
||||||
public mounted() {
|
console.log('arrnumstatus;')
|
||||||
|
console.log(arrnumstatus.value)
|
||||||
|
|
||||||
this.updateorders()
|
columns.value = [...columns.value,
|
||||||
|
|
||||||
console.log('arrnumstatus;')
|
|
||||||
console.log(this.arrnumstatus)
|
|
||||||
|
|
||||||
this.columns = [...this.columns,
|
|
||||||
{
|
{
|
||||||
name: 'comandi',
|
name: 'comandi',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -153,75 +130,93 @@ export default class OrderInfo extends MixinBase {
|
|||||||
sortable: false
|
sortable: false
|
||||||
}]
|
}]
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public CanBeShipped() {
|
|
||||||
return Products.state.cart.items.filter((rec) => rec.order.product.canBeShipped).length
|
|
||||||
}
|
|
||||||
|
|
||||||
public CanBeBuyOnline() {
|
|
||||||
return Products.state.cart.items.filter((rec) => rec.order.product.canBeBuyOnline).length
|
|
||||||
}
|
|
||||||
|
|
||||||
get getnumsteps() {
|
|
||||||
let numsteps = 1
|
|
||||||
|
|
||||||
if (this.CanBeShipped())
|
|
||||||
numsteps++
|
|
||||||
if (this.CanBeBuyOnline())
|
|
||||||
numsteps++
|
|
||||||
|
|
||||||
return numsteps
|
|
||||||
}
|
|
||||||
|
|
||||||
public docheckout() {
|
|
||||||
|
|
||||||
// Può essere spedito?
|
|
||||||
|
|
||||||
if (this.CanBeShipped()) {
|
|
||||||
// mostra form di spedizione
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.CanBeBuyOnline()) {
|
function CanBeShipped() {
|
||||||
// mostra form di acquisto Online
|
return productStore.cart.items!.filter((rec) => rec.order.product!.canBeShipped).length
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get nextstep() {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
public clickFunz(order, status) {
|
|
||||||
|
|
||||||
if (status === shared_consts.OrderStatus.ORDER_CONFIRMED) {
|
|
||||||
// Conferma Ordine
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusStr = shared_consts.getStatusStr(status)
|
function CanBeBuyOnline() {
|
||||||
|
return productStore.cart.items!.filter((rec) => rec.order.product!.canBeBuyOnline).length
|
||||||
|
}
|
||||||
|
|
||||||
this.$q.dialog({
|
function getnumsteps() {
|
||||||
message: 'Impostare l\'ordine n. ' + order.numorder + ' ' + statusStr + ' ?',
|
let numsteps = 1
|
||||||
ok: {
|
|
||||||
label: this.$t('dialog.yes'),
|
|
||||||
push: true
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
label: this.$t('dialog.cancel')
|
|
||||||
},
|
|
||||||
title: 'Ordine'
|
|
||||||
}).onOk(async () => {
|
|
||||||
|
|
||||||
this.statusnow = await Products.actions.UpdateOrderStatus({ order_id: order._id, status })
|
if (CanBeShipped())
|
||||||
|
numsteps++
|
||||||
|
if (CanBeBuyOnline())
|
||||||
|
numsteps++
|
||||||
|
|
||||||
if (this.statusnow === status) {
|
return numsteps
|
||||||
order.status = this.statusnow
|
}
|
||||||
this.updateorders()
|
|
||||||
tools.showPositiveNotif(this.$q, 'Ordine ' + statusStr)
|
function docheckout() {
|
||||||
|
|
||||||
|
// Può essere spedito?
|
||||||
|
|
||||||
|
if (CanBeShipped()) {
|
||||||
|
// mostra form di spedizione
|
||||||
}
|
}
|
||||||
// this.change_field('status')
|
|
||||||
// this.change_field('status')
|
if (CanBeBuyOnline()) {
|
||||||
})
|
// mostra form di acquisto Online
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextstep() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function clickFunz(order: IOrderCart, status: number) {
|
||||||
|
|
||||||
|
if (status === shared_consts.OrderStatus.ORDER_CONFIRMED) {
|
||||||
|
// Conferma Ordine
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusStr = shared_consts.getStatusStr(status)
|
||||||
|
|
||||||
|
$q.dialog({
|
||||||
|
message: 'Impostare l\'ordine n. ' + order.numorder + ' ' + statusStr + ' ?',
|
||||||
|
ok: {
|
||||||
|
label: t('dialog.yes'),
|
||||||
|
push: true
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
label: t('dialog.cancel')
|
||||||
|
},
|
||||||
|
title: 'Ordine'
|
||||||
|
}).onOk(async () => {
|
||||||
|
|
||||||
|
statusnow.value = await productStore.UpdateOrderStatus({ order_id: order._id, status })
|
||||||
|
|
||||||
|
if (statusnow.value === status) {
|
||||||
|
order.status = statusnow.value
|
||||||
|
updateorders()
|
||||||
|
tools.showPositiveNotif($q, 'Ordine ' + statusStr)
|
||||||
|
}
|
||||||
|
// change_field('status')
|
||||||
|
// change_field('status')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(mounted)
|
||||||
|
|
||||||
|
return {
|
||||||
|
userStore,
|
||||||
|
costanti,
|
||||||
|
tools,
|
||||||
|
toolsext,
|
||||||
|
shared_consts,
|
||||||
|
columns,
|
||||||
|
taborders,
|
||||||
|
arrnumstatus,
|
||||||
|
clickFunz,
|
||||||
|
getOrdersCart,
|
||||||
|
getAllOrdersCart,
|
||||||
|
updateorders,
|
||||||
|
getCols,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,16 +2,42 @@
|
|||||||
<q-page>
|
<q-page>
|
||||||
<CTitleBanner title="Ordini"></CTitleBanner>
|
<CTitleBanner title="Ordini"></CTitleBanner>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<q-tabs
|
<q-tabs v-model="taborders" inline-label class="text-blue">
|
||||||
v-model="taborders"
|
<q-tab
|
||||||
inline-label
|
class="text-black"
|
||||||
class="text-blue"
|
v-if="arrnumstatus[2] > 0"
|
||||||
>
|
name="incorso"
|
||||||
<q-tab class="text-black" v-if="this.arrnumstatus[2] > 0" name="incorso" icon="fas fa-tasks" :label="`(` + this.arrnumstatus[2] +`) in Corso`"/>
|
icon="fas fa-tasks"
|
||||||
<q-tab class="text-blue" v-if="this.arrnumstatus[3] > 0" name="confermati" icon="fas fa-calendar" :label="`(` + this.arrnumstatus[3] +`) Confermati`"/>
|
:label="`(` + arrnumstatus[2] + `) in Corso`"
|
||||||
<q-tab class="text-green" v-if="this.arrnumstatus[4] > 0" name="pagati" icon="fas fa-calendar" :label="`(` + this.arrnumstatus[4] +`) Pagati`"/>
|
/>
|
||||||
<q-tab class="text-blue-grey-8" v-if="this.arrnumstatus[6] > 0" name="completati" icon="fas fa-check" :label="`(` + this.arrnumstatus[6] +`) Completati`"/>
|
<q-tab
|
||||||
<q-tab class="text-red" v-if="this.arrnumstatus[10] > 0" name="cancellati" icon="delete" :label="`(` + this.arrnumstatus[10] +`) Cancellati`"/>
|
class="text-blue"
|
||||||
|
v-if="arrnumstatus[3] > 0"
|
||||||
|
name="confermati"
|
||||||
|
icon="fas fa-calendar"
|
||||||
|
:label="`(` + arrnumstatus[3] + `) Confermati`"
|
||||||
|
/>
|
||||||
|
<q-tab
|
||||||
|
class="text-green"
|
||||||
|
v-if="arrnumstatus[4] > 0"
|
||||||
|
name="pagati"
|
||||||
|
icon="fas fa-calendar"
|
||||||
|
:label="`(` + arrnumstatus[4] + `) Pagati`"
|
||||||
|
/>
|
||||||
|
<q-tab
|
||||||
|
class="text-blue-grey-8"
|
||||||
|
v-if="arrnumstatus[6] > 0"
|
||||||
|
name="completati"
|
||||||
|
icon="fas fa-check"
|
||||||
|
:label="`(` + arrnumstatus[6] + `) Completati`"
|
||||||
|
/>
|
||||||
|
<q-tab
|
||||||
|
class="text-red"
|
||||||
|
v-if="arrnumstatus[10] > 0"
|
||||||
|
name="cancellati"
|
||||||
|
icon="delete"
|
||||||
|
:label="`(` + arrnumstatus[10] + `) Cancellati`"
|
||||||
|
/>
|
||||||
</q-tabs>
|
</q-tabs>
|
||||||
|
|
||||||
<div class="q-pa-sm">
|
<div class="q-pa-sm">
|
||||||
@@ -20,38 +46,48 @@
|
|||||||
:hide-header="$q.screen.lt.sm"
|
:hide-header="$q.screen.lt.sm"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="numorder"
|
row-key="numorder"
|
||||||
:data="getOrdersCart">
|
:data="getOrdersCart()"
|
||||||
|
>
|
||||||
<template v-if="$q.screen.lt.sm" v-slot:item="props">
|
<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">
|
<div class="q-pa-xs col-xs-12 col-sm-6 col-md-4">
|
||||||
<q-card class="my-card-shadow yes_shadow">
|
<q-card class="my-card-shadow yes_shadow">
|
||||||
<q-list dense>
|
<q-list dense>
|
||||||
<q-item v-for="col in props.cols.filter(col => col.name !== 'desc')" :key="col.name">
|
<q-item v-for="col in getCols(props)" :key="col.name">
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>{{ col.label }}</q-item-label>
|
<q-item-label>{{ col.label }}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-item-label v-if="col.name === 'created_at'" caption>{{
|
<q-item-label v-if="col.name === 'created_at'" caption
|
||||||
tools.getstrDateTime(col.value)
|
>{{ tools.getstrDateTime(col.value) }}
|
||||||
}}
|
|
||||||
<span v-if="taborders === 'completati'">
|
<span v-if="taborders === 'completati'">
|
||||||
<br>Completato il: {{ tools.getstrDateTime(props.row.completed_at) }}
|
<br />Completato il:
|
||||||
|
{{ tools.getstrDateTime(props.row.completed_at) }}
|
||||||
</span>
|
</span>
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
<q-item-label v-else-if="col.name === 'items'" caption>
|
<q-item-label v-else-if="col.name === 'items'" caption>
|
||||||
<div v-for="item of props.row.items">
|
<div
|
||||||
|
v-for="(item, index) of props.row.items"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<div v-if="!!item.order.product">
|
<div v-if="!!item.order.product">
|
||||||
{{ item.order.product.name }} ({{ item.order.quantity }})<br>
|
{{ item.order.product.name }} ({{
|
||||||
|
item.order.quantity
|
||||||
|
}})<br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-item-label>
|
</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 }} €
|
{{ props.row.totalPrice }} €
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
<q-item-label v-else-if="col.name === 'status'" caption>
|
<q-item-label v-else-if="col.name === 'status'" caption>
|
||||||
{{ shared_consts.getStatusStr(props.row.status) }}
|
{{ shared_consts.getStatusStr(props.row.status) }}
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
<q-item-label v-else caption>{{ col.value }}</q-item-label>
|
<q-item-label v-else caption>{{
|
||||||
|
col.value
|
||||||
|
}}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
@@ -69,75 +105,138 @@
|
|||||||
<q-td key="created_at" :props="props">
|
<q-td key="created_at" :props="props">
|
||||||
{{ tools.getstrDateTime(props.row.created_at) }}
|
{{ tools.getstrDateTime(props.row.created_at) }}
|
||||||
<span v-if="taborders === 'completati'">
|
<span v-if="taborders === 'completati'">
|
||||||
<br>Completato il:<br>{{ tools.getstrDateTime(props.row.completed_at) }}
|
<br />Completato il:<br />{{
|
||||||
|
tools.getstrDateTime(props.row.completed_at)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="items" :props="props">
|
<q-td key="items" :props="props">
|
||||||
<div v-for="item of props.row.items">
|
<div v-for="(item, index) of props.row.items" :key="index">
|
||||||
<div v-if="!!item.order.product">
|
<div v-if="!!item.order.product">
|
||||||
{{ item.order.product.name }} ({{ item.order.quantity }})<br>
|
{{ item.order.product.name }} ({{
|
||||||
|
item.order.quantity
|
||||||
|
}})<br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="totalPrice" :props="props">
|
<q-td key="totalPrice" :props="props">
|
||||||
{{ props.row.totalPrice }} €
|
{{ props.row.totalPrice }} €
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="status" :props="props">
|
<q-td key="status" :props="props">
|
||||||
<span :class="props.row.status">{{ shared_consts.getStatusStr(props.row.status) }}</span>
|
<span :class="props.row.status">{{
|
||||||
|
shared_consts.getStatusStr(props.row.status)
|
||||||
|
}}</span>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="comandi" :props="props">
|
<q-td key="comandi" :props="props">
|
||||||
Bottone:
|
Bottone:
|
||||||
<div v-if="tools.isManager()" class="q-pa-sm">
|
<div v-if="tools.isManager()" class="q-pa-sm">
|
||||||
|
|
||||||
<q-btn-dropdown rounded dense label="Azioni">
|
<q-btn-dropdown rounded dense label="Azioni">
|
||||||
<q-list class="text-primary">
|
<q-list class="text-primary">
|
||||||
<q-item clickable v-close-popup
|
<q-item
|
||||||
@click="clickFunz(props.row, shared_consts.OrderStatus.ORDER_CONFIRMED)">
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
clickFunz(
|
||||||
|
props.row,
|
||||||
|
shared_consts.OrderStatus.ORDER_CONFIRMED
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-avatar icon="fas fa-list-ol" color="grey" text-color="white"/>
|
<q-avatar
|
||||||
|
icon="fas fa-list-ol"
|
||||||
|
color="grey"
|
||||||
|
text-color="white"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>Inviato</q-item-label>
|
<q-item-label>Inviato</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup
|
<q-item
|
||||||
@click="clickFunz(props.row, shared_consts.OrderStatus.ORDER_CONFIRMED)">
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
clickFunz(
|
||||||
|
props.row,
|
||||||
|
shared_consts.OrderStatus.ORDER_CONFIRMED
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-avatar icon="fas fa-calendar-check" color="secondary" text-color="white"/>
|
<q-avatar
|
||||||
|
icon="fas fa-calendar-check"
|
||||||
|
color="secondary"
|
||||||
|
text-color="white"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>Confermato</q-item-label>
|
<q-item-label>Confermato</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click="clickFunz(props.row, shared_consts.OrderStatus.PAYED)"
|
<q-item
|
||||||
color="blue">
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
clickFunz(props.row, shared_consts.OrderStatus.PAYED)
|
||||||
|
"
|
||||||
|
color="blue"
|
||||||
|
>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-avatar icon="money" color="positive" text-color="white"/>
|
<q-avatar
|
||||||
|
icon="money"
|
||||||
|
color="positive"
|
||||||
|
text-color="white"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>Pagato</q-item-label>
|
<q-item-label>Pagato</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click="clickFunz(props.row, shared_consts.OrderStatus.RECEIVED)"
|
<q-item
|
||||||
color="blue">
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
clickFunz(
|
||||||
|
props.row,
|
||||||
|
shared_consts.OrderStatus.RECEIVED
|
||||||
|
)
|
||||||
|
"
|
||||||
|
color="blue"
|
||||||
|
>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-avatar icon="fas fa-check" color="primary" text-color="white"/>
|
<q-avatar
|
||||||
|
icon="fas fa-check"
|
||||||
|
color="primary"
|
||||||
|
text-color="white"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>Completato</q-item-label>
|
<q-item-label>Completato</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click="clickFunz(props.row, shared_consts.OrderStatus.CANCELED)"
|
<q-item
|
||||||
color="blue">
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
clickFunz(
|
||||||
|
props.row,
|
||||||
|
shared_consts.OrderStatus.CANCELED
|
||||||
|
)
|
||||||
|
"
|
||||||
|
color="blue"
|
||||||
|
>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-avatar icon="delete" color="negative" text-color="white"/>
|
<q-avatar
|
||||||
|
icon="delete"
|
||||||
|
color="negative"
|
||||||
|
text-color="white"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>Cancellato</q-item-label>
|
<q-item-label>Cancellato</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-btn-dropdown>
|
</q-btn-dropdown>
|
||||||
</div>
|
</div>
|
||||||
@@ -176,14 +275,11 @@
|
|||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</q-page>
|
</q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" src="./orderInfo.ts">
|
<script lang="ts" src="./orderInfo.ts">
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export {default as ProductInfo} from './ProductInfo.vue'
|
export {default as ProductInfo} from './productInfo.vue'
|
||||||
|
|||||||
@@ -1,51 +1,55 @@
|
|||||||
import Vue from 'vue'
|
import { defineComponent, onMounted, ref } from 'vue'
|
||||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
import { tools } from '@store/Modules/tools'
|
||||||
|
import { useUserStore } from '@store/UserStore'
|
||||||
import {
|
import { useRouter } from 'vue-router'
|
||||||
IAction,
|
import { useRoute } from 'vue-router'
|
||||||
IDrag, IProduct,
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
IProductsState, ITodo, ITodosState,
|
import { useProducts } from '@store/Products'
|
||||||
TypeProj
|
import { useI18n } from '@/boot/i18n'
|
||||||
} from '../../../model/index'
|
import { toolsext } from '@store/Modules/toolsext'
|
||||||
import { SingleProject } from '../../../components/projects/SingleProject/index'
|
import { useQuasar } from 'quasar'
|
||||||
import { CTodo } from '../../../components/todos/CTodo'
|
import { costanti } from '@costanti'
|
||||||
|
import { shared_consts } from '@src/common/shared_vuejs'
|
||||||
import { tools } from '../../../store/Modules/tools'
|
// import MixinBase from '@src/mixins/mixin-base'
|
||||||
import { toolsext } from '@src/store/Modules/toolsext'
|
|
||||||
import { lists } from '../../../store/Modules/lists'
|
|
||||||
import * as ApiTables from '../../../store/Modules/ApiTables'
|
|
||||||
|
|
||||||
import { GlobalStore, Projects, Todos } from '@store'
|
|
||||||
import { UserStore } from '@store'
|
|
||||||
|
|
||||||
import { Getter } from 'vuex-class'
|
|
||||||
|
|
||||||
import { date, Screen } from 'quasar'
|
|
||||||
import { CProgress } from '../../../components/CProgress'
|
|
||||||
import { CDate } from '../../../components/CDate'
|
|
||||||
import { RouteNames } from '@src/router/route-names'
|
|
||||||
import { CProductCard } from '@src/components/CProductCard'
|
import { CProductCard } from '@src/components/CProductCard'
|
||||||
import { Action } from 'vuex'
|
|
||||||
import Products from '@src/store/Modules/Products'
|
|
||||||
|
|
||||||
const namespace: string = 'Products'
|
|
||||||
|
|
||||||
@Component({
|
export default defineComponent({
|
||||||
name: 'ProductInfo',
|
name: 'ProductInfo',
|
||||||
components: { SingleProject, CProgress, CTodo, CDate, CProductCard }
|
components: { CProductCard },
|
||||||
})
|
props: {},
|
||||||
|
setup() {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
|
const productStore = useProducts()
|
||||||
|
const $router = useRouter()
|
||||||
|
const $route = useRoute()
|
||||||
|
const $q = useQuasar()
|
||||||
|
const { t } = useI18n();
|
||||||
|
const code = ref('')
|
||||||
|
|
||||||
export default class ProductInfo extends Vue {
|
// const { setValDb, getValDb } = MixinBase()
|
||||||
public $q: any
|
|
||||||
public code: string = ''
|
|
||||||
|
|
||||||
public created() {
|
function mounted() {
|
||||||
console.log('created productInfo')
|
// Inizializza
|
||||||
console.log(this.$route)
|
console.log('created productInfo')
|
||||||
if (!!this.$route.params.codprod) {
|
console.log($route)
|
||||||
this.code = this.$route.params.codprod.toString()
|
if (!!$route.params.codprod) {
|
||||||
|
code.value = $route.params.codprod.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('code', code)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('this.code', this.code)
|
onMounted(mounted)
|
||||||
|
|
||||||
|
return {
|
||||||
|
userStore,
|
||||||
|
costanti,
|
||||||
|
tools,
|
||||||
|
toolsext,
|
||||||
|
shared_consts,
|
||||||
|
code,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
|||||||
@@ -15,15 +15,6 @@ import { CProductCard } from '@src/components/CProductCard'
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ProductsList',
|
name: 'ProductsList',
|
||||||
components: { CProductCard },
|
components: { CProductCard },
|
||||||
filters: {
|
|
||||||
capitalize(value: any) {
|
|
||||||
if (!value) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
value = value.toString()
|
|
||||||
return value.charAt(0).toUpperCase() + value.slice(1)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {},
|
props: {},
|
||||||
setup() {
|
setup() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -31,7 +22,7 @@ export default defineComponent({
|
|||||||
const productStore = useProducts()
|
const productStore = useProducts()
|
||||||
const $router = useRouter()
|
const $router = useRouter()
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
const { t } = useI18n();
|
const { t } = useI18n()
|
||||||
|
|
||||||
function mounted() {
|
function mounted() {
|
||||||
// Inizializza
|
// Inizializza
|
||||||
|
|||||||
Reference in New Issue
Block a user