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

@@ -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] : []