PCB
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const msg_website_enUs = {
|
||||
ws: {
|
||||
sitename: 'Fiore Della Vita',
|
||||
siteshortname: 'Fiore Della Vita',
|
||||
sitename: 'Più che Buono',
|
||||
siteshortname: 'Più che Buono',
|
||||
description: '',
|
||||
keywords: '',
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const msg_website_it = {
|
||||
ws: {
|
||||
sitename: 'Fiore Della Vita',
|
||||
siteshortname: 'Fiore Della Vita',
|
||||
sitename: 'Più che Buono',
|
||||
siteshortname: 'Più che Buono',
|
||||
description: '',
|
||||
keywords: '',
|
||||
},
|
||||
@@ -131,7 +131,7 @@ const msg_website_it = {
|
||||
color: 'Colore',
|
||||
},
|
||||
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',
|
||||
underconstruction: 'App in costruzione...',
|
||||
myDescriz: '',
|
||||
|
||||
@@ -54,7 +54,7 @@ export default defineComponent({
|
||||
CPresentazione, CMyActivities,
|
||||
CMyProfileTutorial, CSendRISTo,
|
||||
CTitleBanner, CShareSocial, CCheckAppRunning, CRegistration,
|
||||
CVisuVideoPromoAndPDF,
|
||||
CVisuVideoPromoAndPDF, CECommerce,
|
||||
},
|
||||
emits: ['selElemClick'],
|
||||
props: {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
HOLA:
|
||||
<q-card :class="getmycardcl()" v-if="!!myproduct">
|
||||
<q-img :src="`` + myproduct.img" :alt="myproduct.name" :class="getclimg()"></q-img>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const msg_website_it = {
|
||||
ws: {
|
||||
sitename: 'Fiore Della Vita',
|
||||
siteshortname: 'Fiore Della Vita',
|
||||
sitename: 'Più che Buono',
|
||||
siteshortname: 'Più che Buono',
|
||||
description: '',
|
||||
keywords: '',
|
||||
},
|
||||
@@ -131,7 +131,7 @@ const msg_website_it = {
|
||||
color: 'Colore',
|
||||
},
|
||||
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',
|
||||
underconstruction: 'App in costruzione...',
|
||||
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[] = [
|
||||
{
|
||||
@@ -339,9 +445,8 @@ function getRoutesAd(site: ISites) {
|
||||
onlyAdmin: true,
|
||||
onlyManager: true
|
||||
},
|
||||
/*
|
||||
{
|
||||
active: functionality.ENABLE_ECOMMERCE,
|
||||
active: site.confpages && site.confpages.enableEcommerce,
|
||||
path: '/admin/ecommerce',
|
||||
order: 31,
|
||||
faIcon: 'fa fa-list-alt',
|
||||
@@ -357,8 +462,6 @@ function getRoutesAd(site: ISites) {
|
||||
onlyManager: true,
|
||||
onlyDepartment: true
|
||||
},
|
||||
|
||||
*/
|
||||
{
|
||||
active: true,
|
||||
order: 35,
|
||||
|
||||
@@ -1,49 +1,43 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Watch } from 'vue-property-decorator'
|
||||
import { defineComponent, onMounted, ref } 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 { 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 { CTitleBanner } from '@components'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
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({
|
||||
name: 'checkOut',
|
||||
components: { SingleProject, CProgress, CTodo, CDate, CSingleCart, CTitleBanner },
|
||||
filters: {
|
||||
capitalize(value) {
|
||||
if (!value) {
|
||||
return ''
|
||||
}
|
||||
value = value.toString()
|
||||
return value.charAt(0).toUpperCase() + value.slice(1)
|
||||
}
|
||||
}
|
||||
})
|
||||
const myorderscart = ref(<IOrderCart[] | undefined>[])
|
||||
const myarrrec = ref(<any>{})
|
||||
const myoldrec = ref(<any>{})
|
||||
|
||||
export default class OrderInfo extends MixinBase {
|
||||
public $q: any
|
||||
public myorderscart: IOrderCart[] = []
|
||||
public myarrrec: any = {}
|
||||
const conferma_carrello = ref(false)
|
||||
const conferma_ordine = ref(false)
|
||||
|
||||
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 = [
|
||||
const taborders = ref('incorso')
|
||||
const statusnow = ref(0)
|
||||
const arrnumstatus = ref(<any[]>[])
|
||||
const columns = ref(<any>[
|
||||
{
|
||||
name: 'numorder',
|
||||
required: true,
|
||||
@@ -90,60 +84,43 @@ export default class OrderInfo extends MixinBase {
|
||||
field: 'status',
|
||||
sortable: true
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
/*public $refs: {
|
||||
singleproject: SingleProject[],
|
||||
ctodo: CTodo
|
||||
}*/
|
||||
// const { setValDb, getValDb } = MixinBase()
|
||||
|
||||
get getOrdersCart() {
|
||||
return Products.getters.getOrdersCart(this.taborders)
|
||||
function getCols(props: any) {
|
||||
return props.cols.filter((col: any) => col.name !== 'desc')
|
||||
}
|
||||
|
||||
get getAllOrdersCart() {
|
||||
return Products.getters.getOrdersAllCart()
|
||||
function getOrdersCart(): IOrderCart[] | undefined {
|
||||
return productStore.getOrdersCart(taborders.value)
|
||||
}
|
||||
|
||||
public change_field(myorderid, fieldname) {
|
||||
if (this.myarrrec[myorderid][fieldname] !== this[fieldname]) {
|
||||
this.myarrrec[myorderid][fieldname] = this[fieldname]
|
||||
|
||||
const mydata = {
|
||||
[fieldname]: this.myarrrec[myorderid][fieldname]
|
||||
function getAllOrdersCart() {
|
||||
return productStore.getOrdersAllCart()
|
||||
}
|
||||
|
||||
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)
|
||||
function updateorders() {
|
||||
myorderscart.value = getOrdersCart()
|
||||
for (const ordercart of myorderscart.value!) {
|
||||
myarrrec.value[ordercart._id] = Object.keys(ordercart)
|
||||
}
|
||||
|
||||
const allorders = this.getAllOrdersCart
|
||||
for (const status of [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
6,
|
||||
10
|
||||
]) {
|
||||
this.arrnumstatus[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0)
|
||||
const allorders = getAllOrdersCart()
|
||||
for (const status of [2, 3, 4, 6, 10]) {
|
||||
arrnumstatus.value[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public mounted() {
|
||||
function mounted() {
|
||||
|
||||
this.updateorders()
|
||||
updateorders()
|
||||
|
||||
console.log('arrnumstatus;')
|
||||
console.log(this.arrnumstatus)
|
||||
console.log(arrnumstatus.value)
|
||||
|
||||
this.columns = [...this.columns,
|
||||
columns.value = [...columns.value,
|
||||
{
|
||||
name: 'comandi',
|
||||
align: 'center',
|
||||
@@ -155,43 +132,43 @@ export default class OrderInfo extends MixinBase {
|
||||
|
||||
}
|
||||
|
||||
public CanBeShipped() {
|
||||
return Products.state.cart.items.filter((rec) => rec.order.product.canBeShipped).length
|
||||
function CanBeShipped() {
|
||||
return productStore.cart.items!.filter((rec) => rec.order.product!.canBeShipped).length
|
||||
}
|
||||
|
||||
public CanBeBuyOnline() {
|
||||
return Products.state.cart.items.filter((rec) => rec.order.product.canBeBuyOnline).length
|
||||
function CanBeBuyOnline() {
|
||||
return productStore.cart.items!.filter((rec) => rec.order.product!.canBeBuyOnline).length
|
||||
}
|
||||
|
||||
get getnumsteps() {
|
||||
function getnumsteps() {
|
||||
let numsteps = 1
|
||||
|
||||
if (this.CanBeShipped())
|
||||
if (CanBeShipped())
|
||||
numsteps++
|
||||
if (this.CanBeBuyOnline())
|
||||
if (CanBeBuyOnline())
|
||||
numsteps++
|
||||
|
||||
return numsteps
|
||||
}
|
||||
|
||||
public docheckout() {
|
||||
function docheckout() {
|
||||
|
||||
// Può essere spedito?
|
||||
|
||||
if (this.CanBeShipped()) {
|
||||
if (CanBeShipped()) {
|
||||
// mostra form di spedizione
|
||||
}
|
||||
|
||||
if (this.CanBeBuyOnline()) {
|
||||
if (CanBeBuyOnline()) {
|
||||
// mostra form di acquisto Online
|
||||
}
|
||||
}
|
||||
|
||||
get nextstep() {
|
||||
function nextstep() {
|
||||
return 0
|
||||
}
|
||||
|
||||
public clickFunz(order, status) {
|
||||
function clickFunz(order: IOrderCart, status: number) {
|
||||
|
||||
if (status === shared_consts.OrderStatus.ORDER_CONFIRMED) {
|
||||
// Conferma Ordine
|
||||
@@ -199,29 +176,47 @@ export default class OrderInfo extends MixinBase {
|
||||
|
||||
const statusStr = shared_consts.getStatusStr(status)
|
||||
|
||||
this.$q.dialog({
|
||||
$q.dialog({
|
||||
message: 'Impostare l\'ordine n. ' + order.numorder + ' ' + statusStr + ' ?',
|
||||
ok: {
|
||||
label: this.$t('dialog.yes'),
|
||||
label: t('dialog.yes'),
|
||||
push: true
|
||||
},
|
||||
cancel: {
|
||||
label: this.$t('dialog.cancel')
|
||||
label: t('dialog.cancel')
|
||||
},
|
||||
title: 'Ordine'
|
||||
}).onOk(async () => {
|
||||
|
||||
this.statusnow = await Products.actions.UpdateOrderStatus({ order_id: order._id, status })
|
||||
statusnow.value = await productStore.UpdateOrderStatus({ order_id: order._id, status })
|
||||
|
||||
if (this.statusnow === status) {
|
||||
order.status = this.statusnow
|
||||
this.updateorders()
|
||||
tools.showPositiveNotif(this.$q, 'Ordine ' + statusStr)
|
||||
if (statusnow.value === status) {
|
||||
order.status = statusnow.value
|
||||
updateorders()
|
||||
tools.showPositiveNotif($q, 'Ordine ' + statusStr)
|
||||
}
|
||||
// this.change_field('status')
|
||||
// this.change_field('status')
|
||||
// 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>
|
||||
<CTitleBanner title="Ordini"></CTitleBanner>
|
||||
<div class="panel">
|
||||
<q-tabs
|
||||
v-model="taborders"
|
||||
inline-label
|
||||
<q-tabs v-model="taborders" inline-label class="text-blue">
|
||||
<q-tab
|
||||
class="text-black"
|
||||
v-if="arrnumstatus[2] > 0"
|
||||
name="incorso"
|
||||
icon="fas fa-tasks"
|
||||
:label="`(` + arrnumstatus[2] + `) in Corso`"
|
||||
/>
|
||||
<q-tab
|
||||
class="text-blue"
|
||||
>
|
||||
<q-tab class="text-black" v-if="this.arrnumstatus[2] > 0" name="incorso" icon="fas fa-tasks" :label="`(` + this.arrnumstatus[2] +`) in Corso`"/>
|
||||
<q-tab class="text-blue" v-if="this.arrnumstatus[3] > 0" name="confermati" icon="fas fa-calendar" :label="`(` + this.arrnumstatus[3] +`) Confermati`"/>
|
||||
<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 class="text-red" v-if="this.arrnumstatus[10] > 0" name="cancellati" icon="delete" :label="`(` + this.arrnumstatus[10] +`) Cancellati`"/>
|
||||
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>
|
||||
|
||||
<div class="q-pa-sm">
|
||||
@@ -20,38 +46,48 @@
|
||||
:hide-header="$q.screen.lt.sm"
|
||||
:columns="columns"
|
||||
row-key="numorder"
|
||||
:data="getOrdersCart">
|
||||
|
||||
:data="getOrdersCart()"
|
||||
>
|
||||
<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">
|
||||
<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-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) }}
|
||||
<span v-if="taborders === 'completati'">
|
||||
<br>Completato il: {{ tools.getstrDateTime(props.row.completed_at) }}
|
||||
<br />Completato il:
|
||||
{{ tools.getstrDateTime(props.row.completed_at) }}
|
||||
</span>
|
||||
</q-item-label>
|
||||
<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">
|
||||
{{ item.order.product.name }} ({{ item.order.quantity }})<br>
|
||||
{{ item.order.product.name }} ({{
|
||||
item.order.quantity
|
||||
}})<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 === 'status'" caption>
|
||||
{{ shared_consts.getStatusStr(props.row.status) }}
|
||||
</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>
|
||||
</q-list>
|
||||
@@ -69,75 +105,138 @@
|
||||
<q-td key="created_at" :props="props">
|
||||
{{ tools.getstrDateTime(props.row.created_at) }}
|
||||
<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>
|
||||
</q-td>
|
||||
<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">
|
||||
{{ item.order.product.name }} ({{ item.order.quantity }})<br>
|
||||
{{ item.order.product.name }} ({{
|
||||
item.order.quantity
|
||||
}})<br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</q-td>
|
||||
<q-td key="totalPrice" :props="props">
|
||||
{{ props.row.totalPrice }} €
|
||||
</q-td>
|
||||
<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 key="comandi" :props="props">
|
||||
Bottone:
|
||||
<div v-if="tools.isManager()" class="q-pa-sm">
|
||||
|
||||
<q-btn-dropdown rounded dense label="Azioni">
|
||||
<q-list class="text-primary">
|
||||
<q-item clickable v-close-popup
|
||||
@click="clickFunz(props.row, shared_consts.OrderStatus.ORDER_CONFIRMED)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
clickFunz(
|
||||
props.row,
|
||||
shared_consts.OrderStatus.ORDER_CONFIRMED
|
||||
)
|
||||
"
|
||||
>
|
||||
<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-label>Inviato</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="clickFunz(props.row, shared_consts.OrderStatus.ORDER_CONFIRMED)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
clickFunz(
|
||||
props.row,
|
||||
shared_consts.OrderStatus.ORDER_CONFIRMED
|
||||
)
|
||||
"
|
||||
>
|
||||
<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-label>Confermato</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="clickFunz(props.row, shared_consts.OrderStatus.PAYED)"
|
||||
color="blue">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
clickFunz(props.row, shared_consts.OrderStatus.PAYED)
|
||||
"
|
||||
color="blue"
|
||||
>
|
||||
<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-label>Pagato</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="clickFunz(props.row, shared_consts.OrderStatus.RECEIVED)"
|
||||
color="blue">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
clickFunz(
|
||||
props.row,
|
||||
shared_consts.OrderStatus.RECEIVED
|
||||
)
|
||||
"
|
||||
color="blue"
|
||||
>
|
||||
<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-label>Completato</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="clickFunz(props.row, shared_consts.OrderStatus.CANCELED)"
|
||||
color="blue">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
clickFunz(
|
||||
props.row,
|
||||
shared_consts.OrderStatus.CANCELED
|
||||
)
|
||||
"
|
||||
color="blue"
|
||||
>
|
||||
<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-label>Cancellato</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</div>
|
||||
@@ -176,14 +275,11 @@
|
||||
<br>
|
||||
</div>
|
||||
-->
|
||||
|
||||
|
||||
</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./orderInfo.ts">
|
||||
|
||||
</script>
|
||||
|
||||
<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 { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
|
||||
import {
|
||||
IAction,
|
||||
IDrag, IProduct,
|
||||
IProductsState, ITodo, ITodosState,
|
||||
TypeProj
|
||||
} from '../../../model/index'
|
||||
import { SingleProject } from '../../../components/projects/SingleProject/index'
|
||||
import { CTodo } from '../../../components/todos/CTodo'
|
||||
|
||||
import { tools } from '../../../store/Modules/tools'
|
||||
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 { defineComponent, onMounted, ref } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRoute } 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 { 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',
|
||||
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 {
|
||||
public $q: any
|
||||
public code: string = ''
|
||||
// const { setValDb, getValDb } = MixinBase()
|
||||
|
||||
public created() {
|
||||
function mounted() {
|
||||
// Inizializza
|
||||
console.log('created productInfo')
|
||||
console.log(this.$route)
|
||||
if (!!this.$route.params.codprod) {
|
||||
this.code = this.$route.params.codprod.toString()
|
||||
console.log($route)
|
||||
if (!!$route.params.codprod) {
|
||||
code.value = $route.params.codprod.toString()
|
||||
}
|
||||
|
||||
console.log('this.code', this.code)
|
||||
console.log('code', code)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
userStore,
|
||||
costanti,
|
||||
tools,
|
||||
toolsext,
|
||||
shared_consts,
|
||||
code,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -15,15 +15,6 @@ import { CProductCard } from '@src/components/CProductCard'
|
||||
export default defineComponent({
|
||||
name: 'ProductsList',
|
||||
components: { CProductCard },
|
||||
filters: {
|
||||
capitalize(value: any) {
|
||||
if (!value) {
|
||||
return ''
|
||||
}
|
||||
value = value.toString()
|
||||
return value.charAt(0).toUpperCase() + value.slice(1)
|
||||
}
|
||||
},
|
||||
props: {},
|
||||
setup() {
|
||||
const userStore = useUserStore()
|
||||
@@ -31,7 +22,7 @@ export default defineComponent({
|
||||
const productStore = useProducts()
|
||||
const $router = useRouter()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n();
|
||||
const { t } = useI18n()
|
||||
|
||||
function mounted() {
|
||||
// Inizializza
|
||||
|
||||
Reference in New Issue
Block a user