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>{
idapp: process.env.APP_ID,
quantity: 0,
idStorehouse: ''
idStorehouse: '',
idProvider: ''
})
const myproduct = ref(<IProduct>{})
@@ -166,8 +167,8 @@ export default defineComponent({
}
function getQtyWarn() {
if (myorder.value.quantity > 0){
return t('ecomm.di_cui_x_in_carrello', {qty: myorder.value.quantity})
if (myorder.value.quantity > 0) {
return t('ecomm.di_cui_x_in_carrello', { qty: myorder.value.quantity })
}
return ''
}
@@ -196,12 +197,13 @@ export default defineComponent({
if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) {
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'
}
function getclimg() {
return (props.complete) ? 'myimgtitle centermydiv' : 'centermydiv'
function getclimgproduct() {
return 'myimgproduct centermydiv'
}
function enableSubQty() {
@@ -229,7 +231,7 @@ export default defineComponent({
addtoCart,
iconWhishlist,
getmycardcl,
getclimg,
getclimgproduct,
getnumstore,
getSingleStorehouse,
getStorehouses,

View File

@@ -1,7 +1,7 @@
<template>
<div class="q-pa-md row items-start q-gutter-md">
<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-item>

View File

@@ -1,7 +1,6 @@
<template>
<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 class="col-2 text-h6 ellipsis">
<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 {
width: 100%;
padding: 1rem 1rem;

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
import { IAction } from '@src/model/Projects'
import { IFriends, IGroupShort, IMyGroup, IPaymentType } from '@src/model/UserStore'
import {
IDepartment, IProducer, IShareWithUs, IStorehouse, ICategory
IDepartment, IProducer, IShareWithUs, IStorehouse, IProvider, ICategory
} from '@src/model/Products'
import { IUserFields, IUserProfile } from '@src/model/UserStore'
@@ -434,6 +434,7 @@ export interface IGlobalState {
mailinglist: IMailinglist[],
calzoom: ICalZoom[],
producers: IProducer[],
providers: IProvider[],
storehouses: IStorehouse[],
departments: IDepartment[],
categories: ICategory[],

View File

@@ -2,9 +2,11 @@ export interface IProduct {
_id?: any
active?: boolean
idProducer?: string,
idProvider?: string,
idStorehouses?: string[],
producer: IProducer,
storehouses: IStorehouse[],
provider: IProvider,
code?: string,
name?: string,
description?: string,
@@ -38,6 +40,7 @@ export interface IOrder {
status?: number
idProduct?: string
idProducer?: string
idProvider?: string
idStorehouse?: string
price?: number
after_price?: string
@@ -49,6 +52,7 @@ export interface IOrder {
product?: IProduct
producer?: IProducer
storehouse?: IStorehouse
provider?: IProvider
date_created?: Date
date_checkout?: Date
date_payment?: Date
@@ -101,6 +105,18 @@ export interface IStorehouse {
img?: 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 {
_id?: any

View File

@@ -377,15 +377,19 @@ export default defineComponent({
strris += ', '
}
strris += '{ '
strris += ' "code":"' + tools.removeescape(tools.addslashes(rec[0])) + '",'
strris += ' "name":"' + tools.removeescape(tools.addslashes(rec[1])) + '",'
strris += ' "price":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[2]))) + '",'
strris += ' "stockQty":"' + tools.removeescape(tools.addslashes(rec[3])) + '",'
strris += ' "link":"' + tools.removeescape(tools.addslashes(rec[4])) + '",'
strris += ' "perc_iva":"' + tools.removeescape(tools.addslashes(rec[5])) + '",'
strris += ' "price_acquistato":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[6]))) + '",'
strris += ' "producer_name":"' + tools.removeescape(tools.addslashes(rec[7])) + '"'
strris += ' "fornitore_name":"' + tools.removeescape(tools.addslashes(rec[8])) + '"'
strris += ' "idapp":"' + tools.appid() + '"'
strris += ', "code":"' + tools.removeescape(tools.addslashes(rec[0])) + '"'
strris += ', "name":"' + tools.removeescape(tools.addslashes(rec[1])) + '"'
strris += ', "price":"' + tools.removeescape(tools.addslashes(tools.convertPriceEurToValue(rec[2]))) + '"'
strris += ', "stockQty":"' + tools.removeescape(tools.addslashes(rec[3])) + '"'
strris += ', "quantityAvailable":"' + tools.removeescape(tools.addslashes(rec[3])) + '"'
strris += ', "link":"' + tools.removeescape(tools.addslashes(rec[4])) + '"'
strris += ', "perc_iva":"' + tools.removeescape(tools.addslashes(rec[5])) + '"'
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 += '} '
} 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'
export default defineComponent({
name: 'StorehousePage',
name: 'OrdersPage',
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
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 { CGridTableRec } from '@/components/CGridTableRec'
import { colTableStorehouse } from '@src/store/Modules/fieldsTable'
import MixinMetaTags from '@/mixins/mixin-metatags'
import { tools } from '@store/Modules/tools'
export default defineComponent({

View File

@@ -97,6 +97,20 @@ function getRoutesEcomm(site: ISites) {
onlyManager: 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,
order: 31,
@@ -169,6 +183,14 @@ function getRoutesEcomm(site: ISites) {
component: () => import('@/rootgen/admin/storehouses/storehouses.vue'),
infooter: false,
},
{
active: true,
order: 32,
path: '/admin/ecommerce/providers',
name: 'pages.providers',
component: () => import('@/rootgen/admin/providers/providers.vue'),
infooter: false,
},
{
active: true,
order: 32,

View File

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

View File

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

View File

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

View File

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

View File

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