diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.vue b/src/components/CMyPopupEdit/CMyPopupEdit.vue index b92f3272..a626f30c 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.vue +++ b/src/components/CMyPopupEdit/CMyPopupEdit.vue @@ -208,7 +208,6 @@ :maxlength="col.maxlength ? col.maxlength : undefined" :disable="disable" :readonly="disable" - :hint="hint" :type=" col.fieldtype === costanti.FieldType.crypted ? `password` diff --git a/src/db/lang/ws_it.js b/src/db/lang/ws_it.js index 752ef0e1..65ee5f22 100755 --- a/src/db/lang/ws_it.js +++ b/src/db/lang/ws_it.js @@ -5,14 +5,6 @@ const msg_website_it = { description: '', keywords: '', }, - products: { - quantity: 'Quantità', - quantityAvailable: 'Disponibili', - weight: 'Peso', - stars: 'Voto', - color: 'Colore', - theme: 'Tema', - }, hours: { descr: 'Descrizione', date: 'Data', @@ -40,6 +32,7 @@ const msg_website_it = { products: 'Prodotti', productslist: 'Lista Prodotti', collabora: 'Collabora', + categories: 'Categorie', storehouses: 'Magazzino', departments: 'Uffici', orders: 'Ordini Ricevuti', diff --git a/src/model/Categories.ts b/src/model/Categories.ts deleted file mode 100755 index f3f4b2fb..00000000 --- a/src/model/Categories.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface ICategory { - id?: number, - descr_it?: string - descr_en?: string - descr_es?: string - campo2bool: boolean -} diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index b6422737..850ee0d1 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -1,7 +1,7 @@ import { IAction } from '@src/model/Projects' import { IFriends, IGroupShort, IMyGroup, IPaymentType } from '@src/model/UserStore' import { - IDepartment, IProducer, IShareWithUs, IStorehouse, + IDepartment, IProducer, IShareWithUs, IStorehouse, ICategory } from '@src/model/Products' import { IUserFields, IUserProfile } from '@src/model/UserStore' @@ -434,6 +434,7 @@ export interface IGlobalState { producers: IProducer[], storehouses: IStorehouse[], departments: IDepartment[], + categories: ICategory[], sharewithus: IShareWithUs[], groups: IGroup[], resps: IResp[], diff --git a/src/model/Products.ts b/src/model/Products.ts index f01e4d2e..aae98e7b 100755 --- a/src/model/Products.ts +++ b/src/model/Products.ts @@ -80,6 +80,12 @@ export interface IDepartment { username?: string, } +export interface ICategory { + _id?: any + name: string, + img?: string, +} + export interface IStorehouse { _id?: any idapp?: string diff --git a/src/model/index.ts b/src/model/index.ts index bb784093..687eeff3 100755 --- a/src/model/index.ts +++ b/src/model/index.ts @@ -6,7 +6,6 @@ export * from './signup-option' export * from './key-value' // export * from './payload' -export * from './Categories' export * from './Todos' export * from './Projects' diff --git a/src/rootgen/admin/categories/categories.scss b/src/rootgen/admin/categories/categories.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/rootgen/admin/categories/categories.ts b/src/rootgen/admin/categories/categories.ts new file mode 100755 index 00000000..000419c8 --- /dev/null +++ b/src/rootgen/admin/categories/categories.ts @@ -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, + } + } + +}) diff --git a/src/rootgen/admin/categories/categories.vue b/src/rootgen/admin/categories/categories.vue new file mode 100755 index 00000000..b7468de8 --- /dev/null +++ b/src/rootgen/admin/categories/categories.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/router/routesAdmin.ts b/src/router/routesAdmin.ts index 11fc6f00..d3f6f5d2 100644 --- a/src/router/routesAdmin.ts +++ b/src/router/routesAdmin.ts @@ -114,6 +114,34 @@ function getRoutesAd(site: ISites) { onlyManager: 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'), infooter: false, }, + { + active: true, + order: 36, + path: '/admin/ecommerce/categories', + name: 'pages.categories', + component: () => import('@/rootgen/admin/categories/categories.vue'), + infooter: false, + }, ] diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index af5b1eaf..a039d3c2 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -43,6 +43,29 @@ const msg_it = { aportador_him: 'Invitato da', 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: { myactivities: 'Attività', myactivities2: 'Mie Attività', @@ -365,7 +388,7 @@ const msg_it = { sonomediatore: 'Quando sei MEDIATORE verrai contattato dai FACILITATORE AYNI tramite un messaggio sulla Chat AYNI BOT !', superchat: 'Nota Bene: Non inviarci la ricevuta, non ci occorre. Attendi il messaggio di conferma da parte del Sognatore (sulla Chat AYNI BOT).
SOLO se hai problemi di PAGAMENTO, o ti manca la conferma del SOGNATORE (dopo aver atteso almeno 12 ore) o se vuoi essere SOSTITUITO, due Facilitatore ti aspettano per aiutarti sulla Chat:
Entra nella Gift Chat', sonodonatore: '
  1. Quando sei in questa posizione, verrai invitato (tramite un messaggio su AYNI BOT) ad effettuare il Dono. Non sarà più necessario entrare in una Chat.
  2. ' - + '
  3. Avrai tempo 3 giorni per fare il Regalo (poi verrai sostituito), nella modalità di pagamento che troverai scritto sul messaggio in AYNI BOT .
', + + '
  • Avrai tempo 3 giorni per fare il Regalo (poi verrai sostituito), nella modalità di pagamento che troverai scritto sul messaggio in AYNI BOT .
    ', sonodonatore_seconda_tessitura: '
    1. Qui tu sei Mediatore e anche Donatore, ma essendo la seconda Tessitura (il Ritorno), non avrai bisogno di effettuare nuovamente il dono
    ', controlla_donatori: 'Controlla Lista Donatori', link_chat: 'Link della Gift Chat Telegram', @@ -393,15 +416,15 @@ const msg_it = { metodi_disponibili: 'Metodi Disponibili', importo: 'Importo', effettua_il_dono: 'E\' arrivato il momento di Effettuare il proprio Dono al Sognatore
    👉 {sognatore} 👈 !

    ' - + 'Inviare tramite PayPal a: {email}
    ' - + 'Aggiungere come messaggio la dicitura: Regalo
    ' - + 'ATTENZIONE IMPORTANTE: Scegliere l\'opzione
    "INVIO DI DENARO A UN AMICO"
    Cosi non pagherai delle commissioni extra!', + + 'Inviare tramite PayPal a: {email}
    ' + + 'Aggiungere come messaggio la dicitura: Regalo
    ' + + 'ATTENZIONE IMPORTANTE: Scegliere l\'opzione
    "INVIO DI DENARO A UN AMICO"
    Cosi non pagherai delle commissioni extra!', paypal_me: '
    2) Metodo Semplificato
    Cliccare direttamente qui
    ' - + 'si aprirà PayPal con l\'importo e il destinatario gia impostato.
    ' - + 'Aggiungere come messaggio la dicitura: Regalo
    ' - + 'ATTENZIONE IMPORTANTE: TOGLIERE LA SPUNTA SU: Devi pagare beni o servizi? ... (Protezione acquisti Paypal)
    Altrimenti pagherai inutilmente delle commissioni extra.
    ' - + 'Se hai dubbi, guarda il video qui sotto per vedere come fare:
    ' - + 'infine Clicca su “Invia Denaro ora”.', + + 'si aprirà PayPal con l\'importo e il destinatario gia impostato.
    ' + + 'Aggiungere come messaggio la dicitura: Regalo
    ' + + 'ATTENZIONE IMPORTANTE: TOGLIERE LA SPUNTA SU: Devi pagare beni o servizi? ... (Protezione acquisti Paypal)
    Altrimenti pagherai inutilmente delle commissioni extra.
    ' + + 'Se hai dubbi, guarda il video qui sotto per vedere come fare:
    ' + + 'infine Clicca su “Invia Denaro ora”.', commento_al_sognatore: 'Scrivi qui un commento per il Sognatore:', qui_compariranno_le_info: 'Nel giorno della partenza della Nave, compariranno le informazioni del Sognatore', posizione: 'Posizione', @@ -960,7 +983,7 @@ const msg_it = { contribstr: 'Contributo (esempio: 5€ + 5 RIS)', contact_phone: 'Telefono per info', contact_telegram: 'Username Telegram', - }, + }, disc: { typol_code: 'Codice Tipologia', order: 'Ordinamento', @@ -1225,7 +1248,7 @@ const msg_it = { invia_msg_dest: 'Invia la richiesta a {name}', non_hai_circuito_nazionale: 'Per poter inviare dei RIS ad una persona di un altro territorio, è necessario entrare sul "Circuito RIS Italia"', destin_non_ha_circuito_naz: 'Il tuo Destinatario non è ancora dentro al Circuito RIS Italia', - + beforeentertolocalcircuit: 'Prima di entrare nel Circuito Nazionale occorre accedere in quello della tua Provincia', non_entrato: 'Per far parte di questo Circuito devi chiedere di Entrare!', link_chat: 'Chat {name}', diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index b8ac006d..ba381348 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -396,6 +396,13 @@ export const colTabledepartments = [ 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 = [ AddCol({ name: 'name', label_trans: 'store.name' }), AddCol({ name: 'description', label_trans: 'store.description' }), @@ -1458,47 +1465,47 @@ export const colmyBachecas = [ icon: 'fas fa-calendar-day', sortable: false, }), - AddCol({ - name: 'idCity', - label_trans: 'skill.city', - fieldtype: costanti.FieldType.multiselect_by_server, - jointable: 'cities', - tablesel: 'cities', - noshowlabel: true, - icon: 'fas fa-map-marker-alt', - showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, - remote_table: 'mycities', - remote_key: '_id', - remote_field: 'comune', - sortable: false, - required: true, - }), - AddCol({ - name: 'idSector', - label_trans: 'sectors.name', - fieldtype: costanti.FieldType.select, - required: true, - jointable: toolsext.TABSECTORS, - showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, - visible: true, - icon: 'category', - sortable: false, - }), - AddCol({ - name: 'idSkill', - label_trans: 'skill.name', - fieldtype: costanti.FieldType.select, - jointable: 'skills', - addnone: true, - filter_table: toolsext.TABSECTORS, - filter_field: 'idSector', - noshowlabel: true, - icon: 'engineering', - showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView, - allowNewValue: false, - required: false, - sortable: false, - }), + AddCol({ + name: 'idCity', + label_trans: 'skill.city', + fieldtype: costanti.FieldType.multiselect_by_server, + jointable: 'cities', + tablesel: 'cities', + noshowlabel: true, + icon: 'fas fa-map-marker-alt', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + remote_table: 'mycities', + remote_key: '_id', + remote_field: 'comune', + sortable: false, + required: true, + }), + AddCol({ + name: 'idSector', + label_trans: 'sectors.name', + fieldtype: costanti.FieldType.select, + required: true, + jointable: toolsext.TABSECTORS, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + visible: true, + icon: 'category', + sortable: false, + }), + AddCol({ + name: 'idSkill', + label_trans: 'skill.name', + fieldtype: costanti.FieldType.select, + jointable: 'skills', + addnone: true, + filter_table: toolsext.TABSECTORS, + filter_field: 'idSector', + noshowlabel: true, + icon: 'engineering', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView, + allowNewValue: false, + required: false, + sortable: false, + }), AddCol({ name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, @@ -1924,7 +1931,12 @@ export const colTableProducts = [ jointable: 'departments', }), // 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: 'after_price', label_trans: 'products.after_price' }), AddCol({ name: 'color', label_trans: 'products.color' }), @@ -3466,6 +3478,13 @@ export const fieldsTable = { colkey: 'username', collabel: 'name', }, + { + value: 'categorys', + label: 'Categorie', + columns: colTablecategories, + colkey: '_id', + collabel: 'name', + }, { value: 'storehouses', label: 'Magazzini', diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index e2238fd0..666218a5 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -120,6 +120,7 @@ export const useGlobalStore = defineStore('GlobalStore', { workers: [], storehouses: [], departments: [], + categories: [], sharewithus: [], TIMER: null, TIMEOUT: null, @@ -300,6 +301,7 @@ export const useGlobalStore = defineStore('GlobalStore', { else if (table === 'resps') ris = state.resps else if (table === 'workers') ris = state.workers else if (table === 'departments') ris = state.departments + else if (table === 'categorys') ris = state.categories else if (table === 'sharewithus') ris = state.sharewithus else if (table === 'paymenttypes') ris = state.paymenttypes 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.workers = (res.data.workers) ? [...res.data.workers] : [] 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.skills = (res.data.skills) ? [...res.data.skills] : [] this.goods = (res.data.goods) ? [...res.data.goods] : [] diff --git a/src/views/ecommerce/checkOut/checkOut.ts b/src/views/ecommerce/checkOut/checkOut.ts index 276b039c..8dcded59 100755 --- a/src/views/ecommerce/checkOut/checkOut.ts +++ b/src/views/ecommerce/checkOut/checkOut.ts @@ -43,7 +43,7 @@ export default defineComponent({ return cart.items || null } - function getNumItems() { + function getNumItems(): number { const cart = productStore.getCart() if (!!cart.items) return cart.items.length || 0 @@ -51,7 +51,7 @@ export default defineComponent({ return 0 } - function getCart() { + function getCart(): ICart { return productStore.getCart() } @@ -70,21 +70,21 @@ export default defineComponent({ const aggiorna = fieldname !== 'status' 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) { return productStore.cart.totalPrice.toFixed(2) } else { - return 0 + return '0' } } - function myTotalQty() { + function myTotalQty(): number { if (productStore.cart) { - return productStore.cart.totalQty + return productStore.cart.totalQty! } else { return 0 } @@ -93,6 +93,7 @@ export default defineComponent({ async function load() { mycart.value = getCart() myrec.value = Object.keys(mycart) + oldrec.value = myrec.value note.value = mycart.value.note! if (mycart.value)