import dati prodotti + fornitore + produttore

This commit is contained in:
Surya Paolo
2023-12-15 00:57:24 +01:00
parent b4af36d01c
commit 6a1a1fb249
50 changed files with 177 additions and 26 deletions

View File

@@ -43,7 +43,8 @@ export default defineComponent({
const myorder = ref(<IOrder>{ const myorder = ref(<IOrder>{
idapp: process.env.APP_ID, idapp: process.env.APP_ID,
quantity: 0, quantity: 0,
idStorehouse: '' idStorehouse: '',
idProvider: ''
}) })
const myproduct = ref(<IProduct>{}) const myproduct = ref(<IProduct>{})
@@ -166,8 +167,8 @@ export default defineComponent({
} }
function getQtyWarn() { function getQtyWarn() {
if (myorder.value.quantity > 0){ if (myorder.value.quantity > 0) {
return t('ecomm.di_cui_x_in_carrello', {qty: myorder.value.quantity}) return t('ecomm.di_cui_x_in_carrello', { qty: myorder.value.quantity })
} }
return '' return ''
} }
@@ -196,12 +197,13 @@ export default defineComponent({
if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) { if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) {
myorder.value.idStorehouse = myproduct.value.storehouses[0]._id myorder.value.idStorehouse = myproduct.value.storehouses[0]._id
} }
const ord = products.getOrderProductInCart(myproduct.value._id)
if (ord) {
myorder.value.quantity = ord.quantity
}
} }
const ord = products.getOrderProductInCart(myproduct.value._id)
if (ord) {
myorder.value.quantity = ord.quantity
}
} }
@@ -209,8 +211,8 @@ export default defineComponent({
return (props.complete) ? 'my-card-big' : 'my-card-prod' return (props.complete) ? 'my-card-big' : 'my-card-prod'
} }
function getclimg() { function getclimgproduct() {
return (props.complete) ? 'myimgtitle centermydiv' : 'centermydiv' return 'myimgproduct centermydiv'
} }
function enableSubQty() { function enableSubQty() {
@@ -229,7 +231,7 @@ export default defineComponent({
addtoCart, addtoCart,
iconWhishlist, iconWhishlist,
getmycardcl, getmycardcl,
getclimg, getclimgproduct,
getnumstore, getnumstore,
getSingleStorehouse, getSingleStorehouse,
getStorehouses, getStorehouses,

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="q-pa-md row items-start q-gutter-md"> <div class="q-pa-md row items-start q-gutter-md">
<q-card :class="getmycardcl()" v-if="!!myproduct" bordered> <q-card :class="getmycardcl()" v-if="!!myproduct" bordered>
<q-img :src="`` + myproduct.img" :alt="myproduct.name" :class="getclimg()"></q-img> <q-img :src="`` + myproduct.img" :alt="myproduct.name" :class="getclimgproduct()"></q-img>
<q-list> <q-list>
<q-item> <q-item>

View File

@@ -1,7 +1,6 @@
<template> <template>
<div class="q-pa-xs q-gutter-xs"> <div class="q-pa-xs q-gutter-xs">
order.product.img: {{ order.product.img }}
<div v-if="order.product" class="row items-center justify-evenly no-wrap"> <div v-if="order.product" class="row items-center justify-evenly no-wrap">
<div class="col-2 text-h6 ellipsis"> <div class="col-2 text-h6 ellipsis">
<q-img v-if="order.product && order.product.img" :src="`` + order.product.img" :alt="order.product.name" <q-img v-if="order.product && order.product.img" :src="`` + order.product.img" :alt="order.product.name"

View File

@@ -346,6 +346,13 @@ h3 {
} }
} }
.myimgproduct{
max-width: 100%;
height: 300px;
@media (max-width: 718px) {
}
}
.my-card-big { .my-card-big {
width: 100%; width: 100%;
padding: 1rem 1rem; padding: 1rem 1rem;

View File

@@ -37,6 +37,7 @@ const msg_website_enUs = {
productslist: 'Lista Prodotti', productslist: 'Lista Prodotti',
collabora: 'Collabora', collabora: 'Collabora',
storehouses: 'Magazzino', storehouses: 'Magazzino',
providers: 'Fornitori',
departments: 'Uffici', departments: 'Uffici',
orders: 'Ordini Ricevuti', orders: 'Ordini Ricevuti',
orders2: 'Ordini Ricevuti', orders2: 'Ordini Ricevuti',

View File

@@ -35,6 +35,7 @@ const msg_website_it = {
collabora: 'Collabora', collabora: 'Collabora',
categories: 'Categorie', categories: 'Categorie',
storehouses: 'Magazzino', storehouses: 'Magazzino',
providers: 'Fornitori',
departments: 'Uffici', departments: 'Uffici',
orders: 'Ordini Ricevuti', orders: 'Ordini Ricevuti',
orders2: 'Ordini Ricevuti', orders2: 'Ordini Ricevuti',

View File

@@ -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, ICategory IDepartment, IProducer, IShareWithUs, IStorehouse, IProvider, 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 {
mailinglist: IMailinglist[], mailinglist: IMailinglist[],
calzoom: ICalZoom[], calzoom: ICalZoom[],
producers: IProducer[], producers: IProducer[],
providers: IProvider[],
storehouses: IStorehouse[], storehouses: IStorehouse[],
departments: IDepartment[], departments: IDepartment[],
categories: ICategory[], categories: ICategory[],

View File

@@ -2,9 +2,11 @@ export interface IProduct {
_id?: any _id?: any
active?: boolean active?: boolean
idProducer?: string, idProducer?: string,
idProvider?: string,
idStorehouses?: string[], idStorehouses?: string[],
producer: IProducer, producer: IProducer,
storehouses: IStorehouse[], storehouses: IStorehouse[],
provider: IProvider,
code?: string, code?: string,
name?: string, name?: string,
description?: string, description?: string,
@@ -38,6 +40,7 @@ export interface IOrder {
status?: number status?: number
idProduct?: string idProduct?: string
idProducer?: string idProducer?: string
idProvider?: string
idStorehouse?: string idStorehouse?: string
price?: number price?: number
after_price?: string after_price?: string
@@ -49,6 +52,7 @@ export interface IOrder {
product?: IProduct product?: IProduct
producer?: IProducer producer?: IProducer
storehouse?: IStorehouse storehouse?: IStorehouse
provider?: IProvider
date_created?: Date date_created?: Date
date_checkout?: Date date_checkout?: Date
date_payment?: Date date_payment?: Date
@@ -101,6 +105,18 @@ export interface IStorehouse {
img?: string, img?: string,
website?: string, website?: string,
} }
export interface IProvider {
_id?: any
idapp?: string
name?: string,
description?: string,
referent?: string,
address?: string,
city?: string,
region?: string,
img?: string,
website?: string,
}
export interface ICart { export interface ICart {
_id?: any _id?: any

View File

@@ -377,15 +377,19 @@ export default defineComponent({
strris += ', ' strris += ', '
} }
strris += '{ ' strris += '{ '
strris += ' "code":"' + tools.removeescape(tools.addslashes(rec[0])) + '",' strris += ' "idapp":"' + tools.appid() + '"'
strris += ' "name":"' + tools.removeescape(tools.addslashes(rec[1])) + '",' strris += ', "code":"' + tools.removeescape(tools.addslashes(rec[0])) + '"'
strris += ' "price":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[2]))) + '",' strris += ', "name":"' + tools.removeescape(tools.addslashes(rec[1])) + '"'
strris += ' "stockQty":"' + tools.removeescape(tools.addslashes(rec[3])) + '",' strris += ', "price":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[2]))) + '"'
strris += ' "link":"' + tools.removeescape(tools.addslashes(rec[4])) + '",' strris += ', "stockQty":"' + tools.removeescape(tools.addslashes(rec[3])) + '"'
strris += ' "perc_iva":"' + tools.removeescape(tools.addslashes(rec[5])) + '",' strris += ', "quantityAvailable":"' + tools.removeescape(tools.addslashes(rec[3])) + '"'
strris += ' "price_acquistato":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[6]))) + '",' strris += ', "link":"' + tools.removeescape(tools.addslashes(rec[4])) + '"'
strris += ' "producer_name":"' + tools.removeescape(tools.addslashes(rec[7])) + '"' strris += ', "perc_iva":"' + tools.removeescape(tools.addslashes(rec[5])) + '"'
strris += ' "fornitore_name":"' + tools.removeescape(tools.addslashes(rec[8])) + '"' strris += ', "price_acquistato":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[6]))) + '"'
strris += ', "cat_name":"' + tools.removeescape(tools.addslashes(rec[7])) + '"'
strris += ', "producer_name":"' + tools.removeescape(tools.addslashes(rec[8])) + '"'
strris += ', "provider_name":"' + tools.removeescape(tools.addslashes(rec[9])) + '"'
strris += ', "magazzino_name":"' + tools.removeescape(tools.addslashes(rec[10])) + '"'
strris += '} ' strris += '} '
} else if (cmd === shared_consts.Cmd.CITIES_SERVER) { } else if (cmd === shared_consts.Cmd.CITIES_SERVER) {

View File

@@ -10,7 +10,7 @@ import { getcolorderscart } from '@src/store/Modules/fieldsTable'
import MixinMetaTags from '@/mixins/mixin-metatags' import MixinMetaTags from '@/mixins/mixin-metatags'
export default defineComponent({ export default defineComponent({
name: 'StorehousePage', name: 'OrdersPage',
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec }, components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
setup() { setup() {

View File

View File

@@ -0,0 +1,34 @@
import { colTableProviders } 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: 'FornitoriPage',
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 {
colTableProviders,
setmeta,
}
}
})

View File

@@ -0,0 +1,31 @@
<template>
<CMyPage title="Fornitori" imgbackground="images/fornitori.jpg" sizes="max-height: 120px">
<span>{{
setmeta({
title: 'Fornitori',
description: '',
keywords: '',
})
}}
</span>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CTitleBanner title="Fornitori"></CTitleBanner>
<CGridTableRec
prop_mytable="providers"
prop_mytitle="Lista Fornitori"
:prop_mycolumns="colTableProviders"
prop_colkey="name"
nodataLabel="Nessun Fornitore"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
</CGridTableRec>
</div>
</CMyPage>
</template>
<script lang="ts" src="./providers.ts">
</script>
<style lang="scss" scoped>
@import 'providers.scss';
</style>

View File

@@ -6,8 +6,6 @@ import { CMyPage } from '@/components/CMyPage'
import { CTitleBanner } from '@/components/CTitleBanner' import { CTitleBanner } from '@/components/CTitleBanner'
import { CGridTableRec } from '@/components/CGridTableRec' import { CGridTableRec } from '@/components/CGridTableRec'
import { colTableStorehouse } from '@src/store/Modules/fieldsTable'
import MixinMetaTags from '@/mixins/mixin-metatags'
import { tools } from '@store/Modules/tools' import { tools } from '@store/Modules/tools'
export default defineComponent({ export default defineComponent({

View File

@@ -97,6 +97,20 @@ function getRoutesEcomm(site: ISites) {
onlyManager: true, onlyManager: true,
onlyEditor: true onlyEditor: true
}, },
{
active: true,
order: 30,
path: '/admin/ecommerce/providers',
materialIcon: 'fas fa-file-alt',
name: 'pages.providers',
component: () => import('@/rootgen/admin/providers/providers.vue'),
inmenu: true,
submenu: true,
level_parent: 0,
level_child: 0.5,
onlyManager: true,
onlyEditor: true
},
{ {
active: true, active: true,
order: 31, order: 31,
@@ -169,6 +183,14 @@ function getRoutesEcomm(site: ISites) {
component: () => import('@/rootgen/admin/storehouses/storehouses.vue'), component: () => import('@/rootgen/admin/storehouses/storehouses.vue'),
infooter: false, infooter: false,
}, },
{
active: true,
order: 32,
path: '/admin/ecommerce/providers',
name: 'pages.providers',
component: () => import('@/rootgen/admin/providers/providers.vue'),
infooter: false,
},
{ {
active: true, active: true,
order: 32, order: 32,

View File

@@ -81,6 +81,9 @@ const msg_it = {
storehouses: { storehouses: {
name: 'Magazzino', name: 'Magazzino',
}, },
providers: {
name: 'Fornitori',
},
otherpages: { otherpages: {
myactivities: 'Attività', myactivities: 'Attività',
myactivities2: 'Mie Attività', myactivities2: 'Mie Attività',

View File

@@ -429,6 +429,19 @@ export const colTableStorehouse = [
AddCol(DuplicateRec), AddCol(DuplicateRec),
] ]
export const colTableProviders = [
AddCol({ name: 'name', label_trans: 'store.name' }),
AddCol({ name: 'description', label_trans: 'store.description' }),
AddCol({ name: 'referent', label_trans: 'store.referent' }),
AddCol({ name: 'address', label_trans: 'store.address' }),
AddCol({ name: 'city', label_trans: 'store.city' }),
AddCol({ name: 'region', label_trans: 'store.region' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'website', label_trans: 'reg.website' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colAdType = [ export const colAdType = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }), AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }), AddCol({ name: 'descr', label_trans: 'store.description' }),
@@ -1939,6 +1952,12 @@ export const colTableProducts = [
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'storehouses', jointable: 'storehouses',
}), }),
AddCol({
name: 'idProvider',
label_trans: 'provider.name',
fieldtype: costanti.FieldType.select,
jointable: 'providers',
}),
AddCol({ AddCol({
name: 'department', name: 'department',
label_trans: 'products.department', label_trans: 'products.department',
@@ -3518,6 +3537,13 @@ export const fieldsTable = {
colkey: '_id', colkey: '_id',
collabel: (rec: any) => `${rec.name} (${rec.city})`, collabel: (rec: any) => `${rec.name} (${rec.city})`,
}, },
{
value: 'providers',
label: 'Fornitori',
columns: colTableProviders,
colkey: '_id',
collabel: 'name',
},
{ {
value: 'sharewithus', value: 'sharewithus',
label: 'Condividi con Noi', label: 'Condividi con Noi',

View File

@@ -79,8 +79,10 @@ export const useProducts = defineStore('Products', {
active: false, active: false,
idProducer: '', idProducer: '',
idStorehouses: [], idStorehouses: [],
idProvider: '',
producer: {}, producer: {},
storehouses: [], storehouses: [],
provider: {},
code: '', code: '',
name: '', name: '',
description: '', description: '',
@@ -117,6 +119,7 @@ export const useProducts = defineStore('Products', {
idapp: process.env.APP_ID, idapp: process.env.APP_ID,
idProduct: product._id, idProduct: product._id,
idProducer: product.idProducer, idProducer: product.idProducer,
idProvider: product.idProvider,
status: shared_consts.OrderStatus.IN_CART, status: shared_consts.OrderStatus.IN_CART,
price: product.price, price: product.price,
after_price: product.after_price, after_price: product.after_price,
@@ -126,6 +129,7 @@ export const useProducts = defineStore('Products', {
quantity: order.quantity, quantity: order.quantity,
idStorehouse: order.idStorehouse, idStorehouse: order.idStorehouse,
} }
if (product.storehouses.length === 1) { if (product.storehouses.length === 1) {

View File

@@ -120,6 +120,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
resps: [], resps: [],
workers: [], workers: [],
storehouses: [], storehouses: [],
providers: [],
departments: [], departments: [],
categories: [], categories: [],
sharewithus: [], sharewithus: [],
@@ -306,6 +307,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABCALZOOM) ris = state.calzoom else if (table === toolsext.TABCALZOOM) ris = state.calzoom
else if (table === 'producers') ris = state.producers else if (table === 'producers') ris = state.producers
else if (table === 'storehouses') ris = state.storehouses else if (table === 'storehouses') ris = state.storehouses
else if (table === 'providers') ris = state.providers
else if (table === 'groups') ris = state.groups else if (table === 'groups') ris = state.groups
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
@@ -1532,6 +1534,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.calzoom = (res.data.calzoom) ? [...res.data.calzoom] : [] this.calzoom = (res.data.calzoom) ? [...res.data.calzoom] : []
this.producers = (res.data.producers) ? [...res.data.producers] : [] this.producers = (res.data.producers) ? [...res.data.producers] : []
this.storehouses = (res.data.storehouses) ? [...res.data.storehouses] : [] this.storehouses = (res.data.storehouses) ? [...res.data.storehouses] : []
this.providers = (res.data.providers) ? [...res.data.providers] : []
this.groups = (res.data.groups) ? [...res.data.groups] : [] this.groups = (res.data.groups) ? [...res.data.groups] : []
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] : []

View File

@@ -1,6 +1,5 @@
<template> <template>
<q-page v-if="recOrderCart"> <q-page v-if="recOrderCart">
recOrderCart: {{ recOrderCart }}
<CTitleBanner title="Carrello"></CTitleBanner> <CTitleBanner title="Carrello"></CTitleBanner>
<div class="panel"> <div class="panel">
<div> <div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB