PCB lista categorie
This commit is contained in:
@@ -208,7 +208,6 @@
|
|||||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||||
:disable="disable"
|
:disable="disable"
|
||||||
:readonly="disable"
|
:readonly="disable"
|
||||||
:hint="hint"
|
|
||||||
:type="
|
:type="
|
||||||
col.fieldtype === costanti.FieldType.crypted
|
col.fieldtype === costanti.FieldType.crypted
|
||||||
? `password`
|
? `password`
|
||||||
|
|||||||
@@ -5,14 +5,6 @@ const msg_website_it = {
|
|||||||
description: '',
|
description: '',
|
||||||
keywords: '',
|
keywords: '',
|
||||||
},
|
},
|
||||||
products: {
|
|
||||||
quantity: 'Quantità',
|
|
||||||
quantityAvailable: 'Disponibili',
|
|
||||||
weight: 'Peso',
|
|
||||||
stars: 'Voto',
|
|
||||||
color: 'Colore',
|
|
||||||
theme: 'Tema',
|
|
||||||
},
|
|
||||||
hours: {
|
hours: {
|
||||||
descr: 'Descrizione',
|
descr: 'Descrizione',
|
||||||
date: 'Data',
|
date: 'Data',
|
||||||
@@ -40,6 +32,7 @@ const msg_website_it = {
|
|||||||
products: 'Prodotti',
|
products: 'Prodotti',
|
||||||
productslist: 'Lista Prodotti',
|
productslist: 'Lista Prodotti',
|
||||||
collabora: 'Collabora',
|
collabora: 'Collabora',
|
||||||
|
categories: 'Categorie',
|
||||||
storehouses: 'Magazzino',
|
storehouses: 'Magazzino',
|
||||||
departments: 'Uffici',
|
departments: 'Uffici',
|
||||||
orders: 'Ordini Ricevuti',
|
orders: 'Ordini Ricevuti',
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
export interface ICategory {
|
|
||||||
id?: number,
|
|
||||||
descr_it?: string
|
|
||||||
descr_en?: string
|
|
||||||
descr_es?: string
|
|
||||||
campo2bool: boolean
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { IAction } from '@src/model/Projects'
|
import { IAction } from '@src/model/Projects'
|
||||||
import { IFriends, IGroupShort, IMyGroup, IPaymentType } from '@src/model/UserStore'
|
import { IFriends, IGroupShort, IMyGroup, IPaymentType } from '@src/model/UserStore'
|
||||||
import {
|
import {
|
||||||
IDepartment, IProducer, IShareWithUs, IStorehouse,
|
IDepartment, IProducer, IShareWithUs, IStorehouse, ICategory
|
||||||
} from '@src/model/Products'
|
} from '@src/model/Products'
|
||||||
|
|
||||||
import { IUserFields, IUserProfile } from '@src/model/UserStore'
|
import { IUserFields, IUserProfile } from '@src/model/UserStore'
|
||||||
@@ -434,6 +434,7 @@ export interface IGlobalState {
|
|||||||
producers: IProducer[],
|
producers: IProducer[],
|
||||||
storehouses: IStorehouse[],
|
storehouses: IStorehouse[],
|
||||||
departments: IDepartment[],
|
departments: IDepartment[],
|
||||||
|
categories: ICategory[],
|
||||||
sharewithus: IShareWithUs[],
|
sharewithus: IShareWithUs[],
|
||||||
groups: IGroup[],
|
groups: IGroup[],
|
||||||
resps: IResp[],
|
resps: IResp[],
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ export interface IDepartment {
|
|||||||
username?: string,
|
username?: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ICategory {
|
||||||
|
_id?: any
|
||||||
|
name: string,
|
||||||
|
img?: string,
|
||||||
|
}
|
||||||
|
|
||||||
export interface IStorehouse {
|
export interface IStorehouse {
|
||||||
_id?: any
|
_id?: any
|
||||||
idapp?: string
|
idapp?: string
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ export * from './signup-option'
|
|||||||
export * from './key-value'
|
export * from './key-value'
|
||||||
// export * from './payload'
|
// export * from './payload'
|
||||||
|
|
||||||
export * from './Categories'
|
|
||||||
export * from './Todos'
|
export * from './Todos'
|
||||||
export * from './Projects'
|
export * from './Projects'
|
||||||
|
|
||||||
|
|||||||
0
src/rootgen/admin/categories/categories.scss
Executable file
0
src/rootgen/admin/categories/categories.scss
Executable file
34
src/rootgen/admin/categories/categories.ts
Executable file
34
src/rootgen/admin/categories/categories.ts
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
import { colTablecategories } from '@src/store/Modules/fieldsTable'
|
||||||
|
|
||||||
|
import { CImgText } from '../../../components/CImgText/index'
|
||||||
|
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
import { CCard } from '@/components/CCard'
|
||||||
|
import { CMyPage } from '@/components/CMyPage'
|
||||||
|
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||||
|
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||||
|
|
||||||
|
import MixinMetaTags from '../../../mixins/mixin-metatags'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'CategoriesPage',
|
||||||
|
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
|
||||||
|
setup() {
|
||||||
|
const pagination = {
|
||||||
|
sortBy: 'name',
|
||||||
|
descending: false,
|
||||||
|
page: 2,
|
||||||
|
rowsPerPage: 5
|
||||||
|
// rowsNumber: xx if getting data from a server
|
||||||
|
}
|
||||||
|
|
||||||
|
const { setmeta } = MixinMetaTags()
|
||||||
|
|
||||||
|
return {
|
||||||
|
colTablecategories,
|
||||||
|
setmeta,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
31
src/rootgen/admin/categories/categories.vue
Executable file
31
src/rootgen/admin/categories/categories.vue
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<CMyPage title="Categorie" imgbackground="images/produttori.jpg" sizes="max-height: 120px">
|
||||||
|
<span>{{
|
||||||
|
setmeta({
|
||||||
|
title: 'Categorie',
|
||||||
|
description: '',
|
||||||
|
keywords: '',
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||||
|
<CTitleBanner title="Categorie"></CTitleBanner>
|
||||||
|
<CGridTableRec
|
||||||
|
prop_mytable="categorys"
|
||||||
|
prop_mytitle="Categorie"
|
||||||
|
:prop_mycolumns="colTablecategories"
|
||||||
|
prop_colkey="name"
|
||||||
|
nodataLabel="Nessuna Categoria"
|
||||||
|
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
|
||||||
|
|
||||||
|
</CGridTableRec>
|
||||||
|
</div>
|
||||||
|
</CMyPage>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" src="./categories.ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import 'categories.scss';
|
||||||
|
</style>
|
||||||
@@ -114,6 +114,34 @@ function getRoutesAd(site: ISites) {
|
|||||||
onlyManager: true,
|
onlyManager: true,
|
||||||
onlyEditor: true
|
onlyEditor: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 31,
|
||||||
|
path: '/admin/ecommerce/orders',
|
||||||
|
materialIcon: 'fas fa-file-alt',
|
||||||
|
name: 'pages.orders',
|
||||||
|
component: () => import('@/rootgen/admin/orders/orders.vue'),
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
level_parent: 0,
|
||||||
|
level_child: 0.5,
|
||||||
|
onlyManager: true,
|
||||||
|
onlyEditor: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 32,
|
||||||
|
path: '/admin/ecommerce/categories',
|
||||||
|
materialIcon: 'fas fa-file-alt',
|
||||||
|
name: 'pages.categories',
|
||||||
|
component: () => import('@/rootgen/admin/categories/categories.vue'),
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
level_parent: 0,
|
||||||
|
level_child: 0.5,
|
||||||
|
onlyManager: true,
|
||||||
|
onlyEditor: true
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -160,6 +188,14 @@ function getRoutesAd(site: ISites) {
|
|||||||
component: () => import('@/rootgen/admin/orders/orders.vue'),
|
component: () => import('@/rootgen/admin/orders/orders.vue'),
|
||||||
infooter: false,
|
infooter: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 36,
|
||||||
|
path: '/admin/ecommerce/categories',
|
||||||
|
name: 'pages.categories',
|
||||||
|
component: () => import('@/rootgen/admin/categories/categories.vue'),
|
||||||
|
infooter: false,
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,29 @@ const msg_it = {
|
|||||||
aportador_him: 'Invitato da',
|
aportador_him: 'Invitato da',
|
||||||
myactivities: 'Attività',
|
myactivities: 'Attività',
|
||||||
},
|
},
|
||||||
|
products: {
|
||||||
|
name: 'Nome',
|
||||||
|
active: 'Attivo',
|
||||||
|
code: 'Codice',
|
||||||
|
description: 'Descrizione',
|
||||||
|
icon: 'Icona',
|
||||||
|
img: 'Img',
|
||||||
|
department: 'Ufficio',
|
||||||
|
producer: 'Produttore',
|
||||||
|
category: 'Categorie',
|
||||||
|
price: 'Prezzo',
|
||||||
|
after_price: 'Dopo il Prezzo',
|
||||||
|
size: 'Dimensioni',
|
||||||
|
canBeShipped: 'Può essere spedito',
|
||||||
|
canBeBuyOnline: 'Acquistabile On Line',
|
||||||
|
date: 'Data',
|
||||||
|
quantity: 'Quantità',
|
||||||
|
quantityAvailable: 'Disponibili',
|
||||||
|
weight: 'Peso',
|
||||||
|
stars: 'Voto',
|
||||||
|
color: 'Colore',
|
||||||
|
theme: 'Tema',
|
||||||
|
},
|
||||||
otherpages: {
|
otherpages: {
|
||||||
myactivities: 'Attività',
|
myactivities: 'Attività',
|
||||||
myactivities2: 'Mie Attività',
|
myactivities2: 'Mie Attività',
|
||||||
|
|||||||
@@ -396,6 +396,13 @@ export const colTabledepartments = [
|
|||||||
AddCol(DuplicateRec),
|
AddCol(DuplicateRec),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const colTablecategories = [
|
||||||
|
AddCol({ name: 'name', label_trans: 'categories.name' }),
|
||||||
|
AddCol({ name: 'img', label_trans: 'categories.img' }),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec),
|
||||||
|
]
|
||||||
|
|
||||||
export const colTableStorehouse = [
|
export const colTableStorehouse = [
|
||||||
AddCol({ name: 'name', label_trans: 'store.name' }),
|
AddCol({ name: 'name', label_trans: 'store.name' }),
|
||||||
AddCol({ name: 'description', label_trans: 'store.description' }),
|
AddCol({ name: 'description', label_trans: 'store.description' }),
|
||||||
@@ -1924,7 +1931,12 @@ export const colTableProducts = [
|
|||||||
jointable: 'departments',
|
jointable: 'departments',
|
||||||
}),
|
}),
|
||||||
// AddCol({ name: 'department', label_trans: 'products.department' }),
|
// AddCol({ name: 'department', label_trans: 'products.department' }),
|
||||||
AddCol({ name: 'category', label_trans: 'products.category' }),
|
AddCol({
|
||||||
|
name: 'category',
|
||||||
|
label_trans: 'products.category',
|
||||||
|
fieldtype: costanti.FieldType.multiselect,
|
||||||
|
jointable: 'categorys',
|
||||||
|
}),
|
||||||
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number }),
|
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number }),
|
||||||
AddCol({ name: 'after_price', label_trans: 'products.after_price' }),
|
AddCol({ name: 'after_price', label_trans: 'products.after_price' }),
|
||||||
AddCol({ name: 'color', label_trans: 'products.color' }),
|
AddCol({ name: 'color', label_trans: 'products.color' }),
|
||||||
@@ -3466,6 +3478,13 @@ export const fieldsTable = {
|
|||||||
colkey: 'username',
|
colkey: 'username',
|
||||||
collabel: 'name',
|
collabel: 'name',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: 'categorys',
|
||||||
|
label: 'Categorie',
|
||||||
|
columns: colTablecategories,
|
||||||
|
colkey: '_id',
|
||||||
|
collabel: 'name',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: 'storehouses',
|
value: 'storehouses',
|
||||||
label: 'Magazzini',
|
label: 'Magazzini',
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
workers: [],
|
workers: [],
|
||||||
storehouses: [],
|
storehouses: [],
|
||||||
departments: [],
|
departments: [],
|
||||||
|
categories: [],
|
||||||
sharewithus: [],
|
sharewithus: [],
|
||||||
TIMER: null,
|
TIMER: null,
|
||||||
TIMEOUT: null,
|
TIMEOUT: null,
|
||||||
@@ -300,6 +301,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
else if (table === 'resps') ris = state.resps
|
else if (table === 'resps') ris = state.resps
|
||||||
else if (table === 'workers') ris = state.workers
|
else if (table === 'workers') ris = state.workers
|
||||||
else if (table === 'departments') ris = state.departments
|
else if (table === 'departments') ris = state.departments
|
||||||
|
else if (table === 'categorys') ris = state.categories
|
||||||
else if (table === 'sharewithus') ris = state.sharewithus
|
else if (table === 'sharewithus') ris = state.sharewithus
|
||||||
else if (table === 'paymenttypes') ris = state.paymenttypes
|
else if (table === 'paymenttypes') ris = state.paymenttypes
|
||||||
else if (table === 'circuits') ris = circuitStore.listcircuits
|
else if (table === 'circuits') ris = circuitStore.listcircuits
|
||||||
@@ -1512,6 +1514,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
this.resps = (res.data.resps) ? [...res.data.resps] : []
|
this.resps = (res.data.resps) ? [...res.data.resps] : []
|
||||||
this.workers = (res.data.workers) ? [...res.data.workers] : []
|
this.workers = (res.data.workers) ? [...res.data.workers] : []
|
||||||
this.departments = (res.data.departments) ? [...res.data.departments] : []
|
this.departments = (res.data.departments) ? [...res.data.departments] : []
|
||||||
|
this.categories = (res.data.categories) ? [...res.data.categories] : []
|
||||||
this.levels = (res.data.levels) ? [...res.data.levels] : []
|
this.levels = (res.data.levels) ? [...res.data.levels] : []
|
||||||
this.skills = (res.data.skills) ? [...res.data.skills] : []
|
this.skills = (res.data.skills) ? [...res.data.skills] : []
|
||||||
this.goods = (res.data.goods) ? [...res.data.goods] : []
|
this.goods = (res.data.goods) ? [...res.data.goods] : []
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default defineComponent({
|
|||||||
return cart.items || null
|
return cart.items || null
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNumItems() {
|
function getNumItems(): number {
|
||||||
const cart = productStore.getCart()
|
const cart = productStore.getCart()
|
||||||
if (!!cart.items)
|
if (!!cart.items)
|
||||||
return cart.items.length || 0
|
return cart.items.length || 0
|
||||||
@@ -51,7 +51,7 @@ export default defineComponent({
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCart() {
|
function getCart(): ICart {
|
||||||
return productStore.getCart()
|
return productStore.getCart()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,21 +70,21 @@ export default defineComponent({
|
|||||||
|
|
||||||
const aggiorna = fieldname !== 'status'
|
const aggiorna = fieldname !== 'status'
|
||||||
tools.saveFieldToServer($q, 'carts', mycart.value._id, mydata, aggiorna)
|
tools.saveFieldToServer($q, 'carts', mycart.value._id, mydata, aggiorna)
|
||||||
myrec.value = oldrec.value
|
oldrec.value[fieldname] = myrec.value[fieldname]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function myTotalPrice() {
|
function myTotalPrice(): string {
|
||||||
if (productStore.cart && productStore.cart.totalPrice) {
|
if (productStore.cart && productStore.cart.totalPrice) {
|
||||||
return productStore.cart.totalPrice.toFixed(2)
|
return productStore.cart.totalPrice.toFixed(2)
|
||||||
} else {
|
} else {
|
||||||
return 0
|
return '0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function myTotalQty() {
|
function myTotalQty(): number {
|
||||||
if (productStore.cart) {
|
if (productStore.cart) {
|
||||||
return productStore.cart.totalQty
|
return productStore.cart.totalQty!
|
||||||
} else {
|
} else {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,7 @@ export default defineComponent({
|
|||||||
async function load() {
|
async function load() {
|
||||||
mycart.value = getCart()
|
mycart.value = getCart()
|
||||||
myrec.value = Object.keys(mycart)
|
myrec.value = Object.keys(mycart)
|
||||||
|
oldrec.value = myrec.value
|
||||||
note.value = mycart.value.note!
|
note.value = mycart.value.note!
|
||||||
|
|
||||||
if (mycart.value)
|
if (mycart.value)
|
||||||
|
|||||||
Reference in New Issue
Block a user