- catalogo macro, importazione dati
This commit is contained in:
@@ -11,6 +11,8 @@ import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { CProvaPao } from '@/components/CProvaPao'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
import { Vue } from 'vue-class-component'
|
||||
|
||||
import 'animate.css';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -362,6 +362,7 @@ export const shared_consts = {
|
||||
PRODUCTS: 20,
|
||||
PRODUCTS_V2: 22,
|
||||
INVENTARIO: 30,
|
||||
MACRO_CATALOGO_JSON: 40,
|
||||
},
|
||||
|
||||
BotType: [
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<q-card-section horizontal class="image-section">
|
||||
<div class="image-container">
|
||||
<q-img
|
||||
:src="`` + myproduct.productInfo.img"
|
||||
:src="myproduct.productInfo.img ? `` + myproduct.productInfo.img : myproduct.productInfo.image_link"
|
||||
:alt="myproduct.productInfo.name"
|
||||
class="cursor-pointer img-pic"
|
||||
@click="
|
||||
@@ -995,7 +995,7 @@
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
<q-img
|
||||
:src="`` + myproduct.productInfo.img"
|
||||
:src="myproduct.productInfo.img ? `` + myproduct.productInfo.img : myproduct.productInfo.image_link"
|
||||
:alt="myproduct.productInfo.name"
|
||||
:fit="tools.isMobile() ? 'fill' : 'none'"
|
||||
@touchstart="onTouchStart"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const msg_website_it = {
|
||||
ws: {
|
||||
sitename: 'Riso',
|
||||
siteshortname: 'RISO',
|
||||
description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.',
|
||||
keywords: 'riso, piattaforma di scambio, rete italiana scambio orizzontale, riso app, riso piattaforma, scambio e baratto, momenta RIS',
|
||||
sitename: 'Gruppo Macro',
|
||||
siteshortname: 'Gruppo Macro',
|
||||
description: '',
|
||||
keywords: '',
|
||||
},
|
||||
hours: {
|
||||
descr: 'Descrizione',
|
||||
@@ -16,23 +16,35 @@ const msg_website_it = {
|
||||
pages: {
|
||||
home: 'Home',
|
||||
profile: 'Profilo',
|
||||
install_site: 'Installa Sito',
|
||||
profile2: 'ProfiloU',
|
||||
mypage2: 'mypage2',
|
||||
myservice2: 'myservice2',
|
||||
myhosps2: 'myhosps2',
|
||||
mygood2: 'mygood2',
|
||||
catalogo: 'Catalogo',
|
||||
fundraising: 'Sostieni il Progetto',
|
||||
notifs: 'Configura le Notifiche',
|
||||
unsubscribe: 'Disiscriviti',
|
||||
unsubscribe_user: 'Disiscriviti User',
|
||||
test: 'Test',
|
||||
projects: 'Progetti',
|
||||
report: 'Report Ore',
|
||||
producer: 'Produttore',
|
||||
orderinfo: 'Ordini Effettuati',
|
||||
products: 'Prodotti',
|
||||
cash: 'Cassa',
|
||||
productInfos: 'Info Prodotti',
|
||||
listinoprodotti: 'Listino Prodotti',
|
||||
productslist: 'Lista Prodotti',
|
||||
collabora: 'Collabora',
|
||||
categories: 'Categorie',
|
||||
storehouses: 'Magazzino',
|
||||
providers: 'Fornitori',
|
||||
catprods: 'Categorie',
|
||||
subcatprods: 'Sotto-Categorie',
|
||||
gasordine: 'Gas Ordine',
|
||||
scontisticas: 'Scontistica',
|
||||
departments: 'Uffici',
|
||||
orders: 'Ordini Ricevuti',
|
||||
orders2: 'Ordini Ricevuti',
|
||||
@@ -121,9 +133,11 @@ const msg_website_it = {
|
||||
only_residenti: 'Solo Residenti',
|
||||
only_consiglio: 'Solo Consiglieri',
|
||||
color: 'Colore',
|
||||
gasordini: 'Gas Ordini',
|
||||
gestoreordini: 'Gestore Ordini',
|
||||
},
|
||||
msg: {
|
||||
myAppName: 'Riso',
|
||||
myAppName: 'Più che Buono',
|
||||
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
|
||||
underconstruction: 'App in costruzione...',
|
||||
myDescriz: '',
|
||||
|
||||
@@ -67,28 +67,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 12,
|
||||
path: '/goods',
|
||||
materialIcon: 'fas fa-tshirt',
|
||||
name: 'mypages.goods',
|
||||
component: () => import('@/root/goods/goods.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
path: '/services',
|
||||
materialIcon: 'fas fa-house-user',
|
||||
name: 'mypages.services',
|
||||
component: () => import('@/root/services/services.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
@@ -100,17 +78,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
path: '/hosps',
|
||||
materialIcon: 'fas fa-bed',
|
||||
name: 'mypages.hosp',
|
||||
component: () => import('@/root/hosp/hosp.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: site.confpages && site.confpages.enableCircuits,
|
||||
order: 16,
|
||||
|
||||
@@ -4,6 +4,7 @@ import { IUserFields, IUserShort } from './UserStore'
|
||||
export interface IProductInfo {
|
||||
_id?: any
|
||||
code?: string,
|
||||
id_wp?: string,
|
||||
name?: string,
|
||||
description?: string,
|
||||
department?: string,
|
||||
@@ -22,9 +23,14 @@ export interface IProductInfo {
|
||||
date?: Date,
|
||||
icon?: string,
|
||||
img?: string
|
||||
image_link?: string
|
||||
ingredienti?: string,
|
||||
link_scheda?: string,
|
||||
valori_nutrizionali?: string,
|
||||
author?: string,
|
||||
collezione?: string,
|
||||
publisher?: string,
|
||||
numpages?: number,
|
||||
}
|
||||
|
||||
export interface IProduct {
|
||||
@@ -43,6 +49,7 @@ export interface IProduct {
|
||||
gasordine: IGasordine | null,
|
||||
provider?: IProvider,
|
||||
price: number,
|
||||
sale_price?: number,
|
||||
after_price?: string,
|
||||
quantityAvailable?: number,
|
||||
bookableAvailableQty?: number,
|
||||
@@ -51,6 +58,7 @@ export interface IProduct {
|
||||
note?: string
|
||||
|
||||
stockQty: number, // UPDATING
|
||||
status?: string,
|
||||
stockBloccatiQty: number, // UPDATING
|
||||
bookedQtyOrdered: number // UPDATING
|
||||
bookedQtyConfirmed: number // UPDATING
|
||||
|
||||
@@ -78,6 +78,10 @@ export default defineComponent({
|
||||
label: 'converti da TXT seperato senza spazi',
|
||||
value: shared_consts.Cmd.CAT_NO_SPAZI
|
||||
},
|
||||
{
|
||||
label: 'Importa da JSON (ImportaMacro)',
|
||||
value: shared_consts.Cmd.MACRO_CATALOGO_JSON
|
||||
},
|
||||
]
|
||||
)
|
||||
|
||||
@@ -144,6 +148,11 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function created() {
|
||||
|
||||
// se idapp = 18
|
||||
if (tools.getIdApp() === tools.IDAPP_MACRO) {
|
||||
cosafare.value = shared_consts.Cmd.MACRO_CATALOGO_JSON
|
||||
}
|
||||
inputfile.value = ''
|
||||
|
||||
if (caricaDatiToggle.value) {
|
||||
@@ -302,6 +311,10 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
function importMacroCatalogoJson(cmd: number, testo: string) {
|
||||
return testo
|
||||
}
|
||||
|
||||
function importNoSpazi(cmd: number, testo: string) {
|
||||
|
||||
const delim = '\n';
|
||||
@@ -343,6 +356,8 @@ export default defineComponent({
|
||||
return importCmdTxt(cmd, testo);
|
||||
} else if (cmd === shared_consts.Cmd.CAT_NO_SPAZI) {
|
||||
return importNoSpazi(cmd, testo);
|
||||
} else if (cmd === shared_consts.Cmd.MACRO_CATALOGO_JSON) {
|
||||
return importMacroCatalogoJson(cmd, testo);
|
||||
}
|
||||
|
||||
function addfield(col: number, field: string, rec: any, opt: any) {
|
||||
@@ -562,6 +577,13 @@ export default defineComponent({
|
||||
risultato.value = ''
|
||||
}
|
||||
|
||||
function eseguiCmdCatalogoJson() {
|
||||
let options = { aggiornaStockQty: checkAggiornaQta.value }
|
||||
|
||||
userStore.importToServerCmd($q, t, cosafare.value, { arrdata: risultato.value, options })
|
||||
risultato.value = ''
|
||||
}
|
||||
|
||||
function createProvLink() {
|
||||
let str = ''
|
||||
|
||||
@@ -607,6 +629,7 @@ export default defineComponent({
|
||||
eseguiCmdProduct,
|
||||
checkAggiornaQta,
|
||||
eseguiCmdInventario,
|
||||
eseguiCmdCatalogoJson,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<q-btn v-if="(cosafare !== shared_consts.Cmd.PRODUCTS && cosafare !== shared_consts.Cmd.PRODUCTS_V2)" label="Esegui" @click="eseguiCmd"></q-btn>
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.PRODUCTS" label="Importa Prodotti" @click="eseguiCmdProduct"></q-btn>
|
||||
<q-btn v-if="cosafare === shared_consts.Cmd.PRODUCTS" label="Importa Prodotti" @click="eseguiCmdProduct"></q-btn>
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.PRODUCTS_V2" label="Importa Prodotti Versione 2" @click="eseguiCmdProduct"></q-btn>
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.INVENTARIO" label="Importa Inventario" @click="eseguiCmdInventario"></q-btn>
|
||||
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.MACRO_CATALOGO_JSON" label="Importa Catalogo JSON" @click="eseguiCmdCatalogoJson"></q-btn>
|
||||
<q-btn v-else label="Esegui" @click="eseguiCmd"></q-btn>
|
||||
<br>
|
||||
<q-btn label="Genera HTML Province Territoriali" @click="createProvLink"></q-btn>
|
||||
|
||||
|
||||
@@ -2075,6 +2075,10 @@ export const colTableProductInfos = [
|
||||
AddCol({ name: 'link_scheda', label_trans: 'products.link_scheda' }),
|
||||
AddCol({ name: 'ingredienti', label_trans: 'products.ingredienti', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'valori_nutrizionali', label_trans: 'products.valori_nutrizionali', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'author', label_trans: 'products.author', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'collezione', label_trans: 'products.collezione', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'publisher', label_trans: 'products.publisher', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'numpages', label_trans: 'products.numpages', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'note', label_trans: 'products.note', fieldtype: costanti.FieldType.html }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
@@ -2129,6 +2133,7 @@ export const colTableProducts = [
|
||||
jointable: 'scontisticas',
|
||||
}),
|
||||
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number, required: true }),
|
||||
AddCol({ name: 'sale_price', label_trans: 'products.sale_price', fieldtype: costanti.FieldType.number, required: false }),
|
||||
AddCol({ name: 'price_acquistato', label_trans: 'products.price_acquistato', fieldtype: costanti.FieldType.number, required: true }),
|
||||
AddCol({ name: 'after_price', label_trans: 'products.after_price' }),
|
||||
AddCol({
|
||||
@@ -2195,6 +2200,7 @@ export const colTableProducts = [
|
||||
|
||||
AddCol({ name: 'canBeShipped', label_trans: 'products.canBeShipped', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'canBeBuyOnline', label_trans: 'products.canBeBuyOnline', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'status', label_trans: 'products.status', fieldtype: costanti.FieldType.string }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
]
|
||||
|
||||
@@ -98,6 +98,7 @@ export const tools = {
|
||||
IDAPP_CNM: '10',
|
||||
IDAPP_FREEPLANET: '1',
|
||||
IDAPP_RISO: '13',
|
||||
IDAPP_MACRO: '18',
|
||||
|
||||
TipoMsg: {
|
||||
SEND_LINK_CHAT_DONATORI: 1,
|
||||
@@ -3911,6 +3912,11 @@ export const tools = {
|
||||
// this.$q.lang.set(mylang)
|
||||
|
||||
},
|
||||
|
||||
getIdApp() {
|
||||
return process.env.APP_ID
|
||||
},
|
||||
|
||||
getappname(short: boolean) {
|
||||
|
||||
if (short) {
|
||||
|
||||
Reference in New Issue
Block a user