- aggiornamento catalogo: lista titoli del catalogo
- scheda prodotto libro - migliorata tabella prodotto
This commit is contained in:
@@ -2475,4 +2475,14 @@ export const shared_consts = {
|
||||
SET: 1,
|
||||
},
|
||||
|
||||
SCHEDA_PRODOTTO: {
|
||||
CMD_NONE: 0,
|
||||
CMD_MODIFICA: 1,
|
||||
},
|
||||
|
||||
VISU_SEARCHPROD_MODE: {
|
||||
VISU: 0,
|
||||
INSERT: 1,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -122,6 +122,10 @@
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.book-big {
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
|
||||
.book-details {
|
||||
margin: 20px;
|
||||
|
||||
|
||||
@@ -13,14 +13,17 @@ import { CMyValueDb } from '../CMyValueDb'
|
||||
import { CPrice } from '../CPrice'
|
||||
import { CText } from '../CText'
|
||||
import { CLabel } from '@src/components/CLabel'
|
||||
import { CSchedaProdotto } from '@src/components/CSchedaProdotto'
|
||||
|
||||
import { CBarCode } from '../CBarCode'
|
||||
import { CTableCupleLabelValue } from '../CTableCupleLabelValue'
|
||||
|
||||
import { func_tools, toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
import type {
|
||||
IOptCatalogo, IGasordine, IMyScheda, IOrder, IOrderCart,
|
||||
IProduct, IVariazione
|
||||
IProduct, IVariazione,
|
||||
IRecFields
|
||||
} from '@src/model';
|
||||
import {
|
||||
IBaseOrder
|
||||
@@ -86,7 +89,7 @@ export default defineComponent({
|
||||
},
|
||||
components: {
|
||||
CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice, CBarCode, CLabel,
|
||||
CText, CViewTable
|
||||
CText, CViewTable, CTableCupleLabelValue, CSchedaProdotto
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
@@ -103,6 +106,9 @@ export default defineComponent({
|
||||
|
||||
const site = ref(globalStore.site)
|
||||
|
||||
const arrlistScheda = ref([])
|
||||
|
||||
|
||||
const $router = useRouter()
|
||||
|
||||
const fullscreenImage = ref(<any>null)
|
||||
@@ -132,6 +138,7 @@ export default defineComponent({
|
||||
// updateCatalogoPadre()
|
||||
}, { deep: false });
|
||||
|
||||
|
||||
function updateCatalogoPadre() {
|
||||
emit('update:modelValue', optcatalogo.value);
|
||||
}
|
||||
@@ -323,10 +330,14 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
async function updateproductmodif() {
|
||||
// console.log('updateproductmodif')
|
||||
async function updateproductmodif(element: any) {
|
||||
console.log('CCATALOGOCARD: updateproductmodif')
|
||||
try {
|
||||
if (element?._id) {
|
||||
myproduct.value = await products.getProductById(element?._id)
|
||||
} else {
|
||||
myproduct.value = await products.getProductById(props.id)
|
||||
}
|
||||
|
||||
updateLabel()
|
||||
} catch (e) {
|
||||
|
||||
@@ -18,12 +18,6 @@
|
||||
size="3em"
|
||||
:thickness="2"
|
||||
/>
|
||||
<q-spinner
|
||||
v-if="!endload"
|
||||
color="primary"
|
||||
size="3em"
|
||||
:thickness="2"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="!!myproduct && !!myproduct.productInfo"
|
||||
@@ -104,7 +98,10 @@
|
||||
/>
|
||||
</a>
|
||||
<div class="q-ma-sm">
|
||||
<div class="row absolute-top-left semi-transparent" style="z-index: 10;">
|
||||
<div
|
||||
class="row absolute-top-left semi-transparent"
|
||||
style="z-index: 10"
|
||||
>
|
||||
<q-btn-dropdown
|
||||
push
|
||||
glossy
|
||||
@@ -225,7 +222,6 @@
|
||||
<q-item-label>Visualizza su GM (Tutti i campi)</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</div>
|
||||
@@ -243,7 +239,8 @@
|
||||
<div
|
||||
v-if="scheda.testo_right_attaccato.font?.posiz_text !== costanti.POSIZ_TESTO.IN_BASSO"
|
||||
:style="{
|
||||
alignSelf: scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO ? '' : 'center',
|
||||
alignSelf:
|
||||
scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO ? '' : 'center',
|
||||
marginTop:
|
||||
scheda.testo_right_attaccato.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO ? 'auto' : '0',
|
||||
}"
|
||||
@@ -571,320 +568,13 @@
|
||||
<q-dialog
|
||||
v-if="myproduct && modifOn"
|
||||
v-model="modifOn"
|
||||
maximized
|
||||
>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Modifica a {{ myproduct.productInfo.name }}</q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<div class="column">
|
||||
<div class="etichetta">Titolo:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="name"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
<CSchedaProdotto
|
||||
v-model="myproduct"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">SottoTitolo:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="sottotitolo"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">Descrizione Estesa:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.descrizione_estesa')"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="descrizione_completa_macro"
|
||||
:maxlength="scheda.testo_bottom.maxlength ? scheda.testo_bottom.maxlength : 10000"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="row q-ma-xm q-pa-xs">
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Pagine:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.pagine')"
|
||||
table="arrvariazioni"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct"
|
||||
mykey="pagine"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Misure:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.misure')"
|
||||
table="arrvariazioni"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct"
|
||||
mykey="misure"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Pubblicazione:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.date_pub')"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="date_pub"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.date"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Formato:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.formato')"
|
||||
table="arrvariazioni"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct"
|
||||
mykey="formato"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Quantità:</div>
|
||||
<CMyValueDb
|
||||
:editOn="false"
|
||||
table="arrvariazioni"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct"
|
||||
mykey="quantita"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Argomenti:</div>
|
||||
{{ products.getCatProdsStrByCatProds(myproduct.productInfo.idCatProds) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Prezzo:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.prezzo')"
|
||||
table="arrvariazioni"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct"
|
||||
mykey="price"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Prezzo Scontato:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.prezzo_scontato')"
|
||||
table="arrvariazioni"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct"
|
||||
mykey="sale_price"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Descrizione breve macro:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.descrizione_breve_macro')"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="descrizione_breve_macro"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Link a gruppomacro.com:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
:title="t('catalogo.link_macro')"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="link_macro"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-blue-4">
|
||||
<div class="etichetta">Fatturati:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="totFat"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">Fatturati Ultimi 3 Mese:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="fatLast3M"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">Venduti:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="totVen"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">Venduti Ultimi 3 Mesi:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="vLast3M"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">Venduti Ultimi 6 Mesi:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="vLast6M"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">Venduti Ultimo Anno:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="vLastY"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<CLabel
|
||||
:value="myproduct.indiceRanking"
|
||||
label="N° in Classifica:"
|
||||
/>
|
||||
|
||||
<div class="etichetta">3 Mesi:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="rank3M"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">6 Mesi:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="rank6M"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<div class="etichetta">1 Anno:</div>
|
||||
<CMyValueDb
|
||||
:editOn="modifOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="rank1Y"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</CSchedaProdotto>
|
||||
</q-dialog>
|
||||
<q-dialog
|
||||
v-if="visufromgm && myproduct"
|
||||
|
||||
@@ -21,7 +21,7 @@ import type { IOptCatalogo, IMyScheda, IProduct } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CContainerCatalogoCard',
|
||||
emits: ['selauthor', 'update:modelValue'],
|
||||
emits: ['selauthor', 'update:modelValue', 'updateproductmodif'],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
@@ -105,6 +105,10 @@ export default defineComponent({
|
||||
//
|
||||
}
|
||||
|
||||
function updateproductmodif(element: IProduct) {
|
||||
emit('updateproductmodif', element)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -120,6 +124,7 @@ export default defineComponent({
|
||||
opendetailbool,
|
||||
optcatalogo,
|
||||
updateCatalogo,
|
||||
updateproductmodif,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
v-model="optcatalogo"
|
||||
:idPage="idPage"
|
||||
@selauthor="selauthor"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
:scheda="scheda"
|
||||
>
|
||||
</CCatalogoCard>
|
||||
|
||||
@@ -49,11 +49,6 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
minuteinterval: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '5',
|
||||
},
|
||||
view: {
|
||||
type: String,
|
||||
required: false,
|
||||
@@ -169,7 +164,7 @@ export default defineComponent({
|
||||
return ''
|
||||
}
|
||||
|
||||
function getstrDate(mydate: Date) {
|
||||
function getstrDate(mydate: Date | string) {
|
||||
if (props.view === 'date-time') {
|
||||
return tools.getstrDateTime(mydate)
|
||||
} else {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<q-field
|
||||
:label="label"
|
||||
stack-label
|
||||
:stack-label="!!label"
|
||||
:value="myvalue"
|
||||
standout
|
||||
:dense="dense"
|
||||
|
||||
0
src/components/CInput/CInput.scss
Executable file
0
src/components/CInput/CInput.scss
Executable file
94
src/components/CInput/CInput.ts
Executable file
94
src/components/CInput/CInput.ts
Executable file
@@ -0,0 +1,94 @@
|
||||
import { defineComponent, ref, toRef, watch } from 'vue'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CInput',
|
||||
emits: ['update:modelValue', 'savedb'],
|
||||
props: {
|
||||
modelValue: {
|
||||
type: [Number, String, null],
|
||||
required: true
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '',
|
||||
},
|
||||
copy: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n();
|
||||
|
||||
const draftValue = ref(props.modelValue)
|
||||
const editing = ref(false)
|
||||
|
||||
function copytoclip() {
|
||||
tools.copyStringToClipboard($q, draftValue.value.toString(), true)
|
||||
}
|
||||
|
||||
// Abilita la modalità modifica al focus o all'input
|
||||
const onFocus = () => {
|
||||
// editing.value = true;
|
||||
}
|
||||
|
||||
const onInputChange = () => {
|
||||
if (draftValue.value !== props.modelValue) {
|
||||
editing.value = true
|
||||
}
|
||||
}
|
||||
|
||||
// Disabilita le frecce (ArrowUp e ArrowDown)
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (event.key === 'Enter') {
|
||||
confirmUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
// Conferma la modifica: emette l'evento per aggiornare il valore e chiama savedb
|
||||
const confirmUpdate = () => {
|
||||
if (draftValue.value !== props.modelValue) {
|
||||
emit('update:modelValue', draftValue.value);
|
||||
emit('savedb', draftValue.value);
|
||||
}
|
||||
editing.value = false
|
||||
}
|
||||
|
||||
// Annulla la modifica: ripristina il valore originale e nasconde i bottoni
|
||||
const cancelUpdate = () => {
|
||||
draftValue.value = props.modelValue;
|
||||
editing.value = false;
|
||||
}
|
||||
|
||||
return {
|
||||
tools,
|
||||
toolsext,
|
||||
copytoclip,
|
||||
draftValue,
|
||||
editing,
|
||||
onFocus,
|
||||
onInputChange,
|
||||
onKeyDown,
|
||||
confirmUpdate,
|
||||
cancelUpdate,
|
||||
t,
|
||||
}
|
||||
},
|
||||
})
|
||||
39
src/components/CInput/CInput.vue
Executable file
39
src/components/CInput/CInput.vue
Executable file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-input
|
||||
v-bind="$attrs"
|
||||
v-model="draftValue"
|
||||
filled
|
||||
:label="label || undefined"
|
||||
type="number"
|
||||
:dense="dense"
|
||||
@focus="onFocus"
|
||||
@update:model-value="onInputChange"
|
||||
@keydown="onKeyDown"
|
||||
@wheel.prevent
|
||||
/>
|
||||
|
||||
<!-- Mostra i bottoni solo se l'utente ha modificato il valore -->
|
||||
<div
|
||||
v-if="editing"
|
||||
class="button-group"
|
||||
>
|
||||
<q-btn
|
||||
:label="$t('dialog.save')"
|
||||
color="positive"
|
||||
@click="confirmUpdate"
|
||||
/>
|
||||
<q-btn
|
||||
:label="$t('dialog.cancel')"
|
||||
color="negative"
|
||||
@click="cancelUpdate"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CInput.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CInput.scss';
|
||||
</style>
|
||||
1
src/components/CInput/index.ts
Executable file
1
src/components/CInput/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CInput} from './CInput.vue'
|
||||
@@ -24,7 +24,7 @@ export default defineComponent({
|
||||
default: '',
|
||||
},
|
||||
class_text: {
|
||||
type: String,
|
||||
type: [String, Object],
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
@@ -32,7 +32,12 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
setup(props, { emit }) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<div class="q-gutter-y-xs column" style="min-width: 100px">
|
||||
<q-field
|
||||
:label="label"
|
||||
stack-label
|
||||
:label="label ? label : undefined"
|
||||
:stack-label="!!label"
|
||||
outlined
|
||||
:dense="dense"
|
||||
color="blue-6"
|
||||
>
|
||||
|
||||
@@ -12,7 +13,7 @@
|
||||
</template>
|
||||
<template v-slot:control>
|
||||
<div class="self-center full-width no-outline" tabindex="0">
|
||||
<span :class="class_text" :style="`color: ` + color ">{{ value }}</span>
|
||||
<span :class="class_text" :style="`color: ` + color " v-html="value"></span>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -23,6 +23,16 @@
|
||||
<q-card-section class="inset-shadow">
|
||||
<slot></slot>
|
||||
</q-card-section>
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
label="CHIUDI"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</div>
|
||||
|
||||
@@ -1688,7 +1688,7 @@
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.Argomenti"
|
||||
v-model="myel.catalogo.argomenti"
|
||||
:options="Products.catprods"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
|
||||
@@ -13,6 +13,7 @@ import { CMyToggleList } from '../CMyToggleList'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
import { CCurrencyValue } from '../CCurrencyValue'
|
||||
import { CMapEditAddressByCoord } from '../CMapEditAddressByCoord'
|
||||
import { CInput } from '../CInput'
|
||||
import { CMyEditor } from '../CMyEditor'
|
||||
import { CGallery } from '../CGallery'
|
||||
import { CSelectImage } from '../CSelectImage'
|
||||
@@ -140,11 +141,6 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: 'row',
|
||||
},
|
||||
minuteinterval: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '5',
|
||||
},
|
||||
disable: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -223,7 +219,7 @@ export default defineComponent({
|
||||
},
|
||||
components: {
|
||||
CMyChipList, CDateTime, CDate, CMyToggleList, CMySelect, CMyEditor, CGallery,
|
||||
CCurrencyValue, CLabel, CAccomodation, CSelectImage, CMapEditAddressByCoord,
|
||||
CCurrencyValue, CLabel, CAccomodation, CSelectImage, CMapEditAddressByCoord, CInput,
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
@@ -481,6 +477,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
// console.log('mounted CMyPopupEdit')
|
||||
|
||||
|
||||
myrow.value = props.rec && props.isrec ? { ...props.rec } : { ...props.row }
|
||||
@@ -522,6 +519,7 @@ export default defineComponent({
|
||||
// console.log('myvalue.value', myvalue.value)
|
||||
myvalueprec.value = myvalue.value
|
||||
|
||||
|
||||
crea()
|
||||
|
||||
if (!loaded.value) {
|
||||
@@ -647,6 +645,8 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
console.log('SaveValueInt', newVal, valinitial)
|
||||
|
||||
emit('save', newVal, valinitial)
|
||||
}
|
||||
|
||||
@@ -910,6 +910,7 @@ export default defineComponent({
|
||||
|
||||
onBeforeMount(mounted)
|
||||
|
||||
|
||||
return {
|
||||
myvalue,
|
||||
countryname,
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
v-if="
|
||||
tools.checkIfShowField(
|
||||
col,
|
||||
insertMode
|
||||
? tools.TIPOVIS_NEW_RECORD
|
||||
: isInModif
|
||||
? tools.TIPOVIS_EDIT_RECORD
|
||||
: tools.TIPOVIS_SHOW_RECORD,
|
||||
insertMode ? tools.TIPOVIS_NEW_RECORD : isInModif ? tools.TIPOVIS_EDIT_RECORD : tools.TIPOVIS_SHOW_RECORD,
|
||||
visulabel,
|
||||
myvalue
|
||||
)
|
||||
"
|
||||
style="flex-grow: 1"
|
||||
style=""
|
||||
>
|
||||
<div :class="{ flex: !isInModif, 'justify-center': justifycenter }">
|
||||
<div>
|
||||
@@ -36,8 +32,7 @@
|
||||
v-model="myvalue"
|
||||
:label="col.title"
|
||||
:disable="
|
||||
(disable && col.name !== 'profile.saw_zoom_presentation') ||
|
||||
(!isInModif && !canModify && !canEdit)
|
||||
(disable && col.name !== 'profile.saw_zoom_presentation') || (!isInModif && !canModify && !canEdit)
|
||||
"
|
||||
@update:model-value="Savedb"
|
||||
></q-toggle>
|
||||
@@ -84,8 +79,7 @@
|
||||
<span
|
||||
v-if="
|
||||
col.extrafield &&
|
||||
(col.tipovisu !== costanti.TipoVisu.LINK ||
|
||||
(col.tipovisu === costanti.TipoVisu.LINK && myvalue))
|
||||
(col.tipovisu !== costanti.TipoVisu.LINK || (col.tipovisu === costanti.TipoVisu.LINK && myvalue))
|
||||
"
|
||||
>
|
||||
<span class="extrafield">{{ $t(col.extrafield) }}</span>
|
||||
@@ -93,16 +87,12 @@
|
||||
</div>
|
||||
<div v-if="canModify">
|
||||
<q-input
|
||||
:type="
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
? 'password'
|
||||
: 'text'
|
||||
"
|
||||
:type="col.fieldtype === costanti.FieldType.crypted ? 'password' : 'text'"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="myvalue"
|
||||
@update:model-value="changevalRec"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : ''"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : undefined"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
@@ -113,32 +103,26 @@
|
||||
v-else-if="
|
||||
!col.extrafield ||
|
||||
(col.extrafield &&
|
||||
(col.tipovisu !== costanti.TipoVisu.LINK ||
|
||||
(col.tipovisu === costanti.TipoVisu.LINK && myvalue)))
|
||||
(col.tipovisu !== costanti.TipoVisu.LINK || (col.tipovisu === costanti.TipoVisu.LINK && myvalue)))
|
||||
"
|
||||
class="q-ma-xs chip_shadow"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
(col.tipovisu === costanti.TipoVisu.LINK ||
|
||||
col.tipovisu === costanti.TipoVisu.NONE) &&
|
||||
myvalue
|
||||
"
|
||||
v-if="(col.tipovisu === costanti.TipoVisu.LINK || col.tipovisu === costanti.TipoVisu.NONE) && myvalue"
|
||||
class="full-width"
|
||||
>
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
@click="
|
||||
gotoPage(
|
||||
col.link
|
||||
? col.link.replace(col.name, myvalue)
|
||||
: `/my/username`.replace(col.name, myvalue)
|
||||
)
|
||||
gotoPage(col.link ? col.link.replace(col.name, myvalue) : `/my/username`.replace(col.name, myvalue))
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-avatar round size="48px">
|
||||
<q-avatar
|
||||
round
|
||||
size="48px"
|
||||
>
|
||||
<img :src="userStore.getImgByProfile(row, false, col)" />
|
||||
<q-badge
|
||||
v-if="tools.isUserOnline(row, col)"
|
||||
@@ -158,13 +142,12 @@
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
<q-item-section class="">
|
||||
<q-item-label>{{
|
||||
tools.getNameToShow(row, col)
|
||||
}}</q-item-label>
|
||||
<q-item-label caption>{{
|
||||
tools.getUserNameOnlyIfToShow(row, col)
|
||||
}}</q-item-label>
|
||||
<q-item-label v-if="row.profile && row.profile.resid_province" style="text-align:right;">
|
||||
<q-item-label>{{ tools.getNameToShow(row, col) }}</q-item-label>
|
||||
<q-item-label caption>{{ tools.getUserNameOnlyIfToShow(row, col) }}</q-item-label>
|
||||
<q-item-label
|
||||
v-if="row.profile && row.profile.resid_province"
|
||||
style="text-align: right"
|
||||
>
|
||||
({{ row.profile.resid_province }})
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
@@ -172,9 +155,7 @@
|
||||
</q-item>
|
||||
</div>
|
||||
<q-avatar
|
||||
v-else-if="
|
||||
col.tipovisu === costanti.TipoVisu.LINKIMG && myvalue
|
||||
"
|
||||
v-else-if="col.tipovisu === costanti.TipoVisu.LINKIMG && myvalue"
|
||||
size="60px"
|
||||
>
|
||||
<q-img
|
||||
@@ -202,12 +183,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.string ||
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted">
|
||||
<div
|
||||
v-if="isInModif"
|
||||
:class="{ flex: !isInModif, 'q-mb-sm': true }"
|
||||
@@ -215,22 +191,20 @@
|
||||
<q-input
|
||||
v-bind="$attrs"
|
||||
v-model="myvalue"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
:style="$q.screen.lt.sm ? 'min-width: 300px' : ''"
|
||||
:style="$q.screen.lt.sm ? 'min-width: 300px' : 'min-width: 300px'"
|
||||
counter
|
||||
filled
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:disable="disable"
|
||||
:readonly="disable"
|
||||
:type="
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
? `password`
|
||||
: `text`
|
||||
"
|
||||
:type="col.fieldtype === costanti.FieldType.crypted ? `password` : `text`"
|
||||
@keydown="nameKeydown($event, col)"
|
||||
@keyup.enter.stop
|
||||
@update:model-value="changevalRec"
|
||||
autofocus
|
||||
:rules="[val => (!!val || !col.required) || 'Campo richiesto']"
|
||||
:rules="[(val) => !!val || !col.required || 'Campo richiesto']"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : col.label"
|
||||
>
|
||||
</q-input>
|
||||
@@ -258,18 +232,12 @@
|
||||
color="white"
|
||||
text-color="blue"
|
||||
:icon="`img:` + userStore.getImgUserByUsername(myvalue)"
|
||||
:to="
|
||||
col.link
|
||||
? col.link.replace(col.name, myvalue)
|
||||
: `/my/username`.replace(col.name, myvalue)
|
||||
"
|
||||
:to="col.link ? col.link.replace(col.name, myvalue) : `/my/username`.replace(col.name, myvalue)"
|
||||
:label="myvalue"
|
||||
>
|
||||
</q-btn>
|
||||
<q-avatar
|
||||
v-else-if="
|
||||
col.tipovisu === costanti.TipoVisu.LINKIMG && myvalue
|
||||
"
|
||||
v-else-if="col.tipovisu === costanti.TipoVisu.LINKIMG && myvalue"
|
||||
size="60px"
|
||||
>
|
||||
<q-img
|
||||
@@ -290,11 +258,24 @@
|
||||
>
|
||||
</q-btn>
|
||||
<span v-else>
|
||||
<span v-if="notAllowAtChar" class="text-h7">@</span>
|
||||
<span
|
||||
v-if="notAllowAtChar"
|
||||
class="text-h7"
|
||||
>@</span
|
||||
>
|
||||
<CLabel
|
||||
:dense="dense"
|
||||
:class_text="{ 'cursor-pointer': canEdit }"
|
||||
:class="{ disabled: disable }"
|
||||
:value="visuValByType(myvalue, col, row)"
|
||||
label=""
|
||||
/>
|
||||
|
||||
<!--<span
|
||||
:class="{ disabled: disable }"
|
||||
v-html="visuValByType(myvalue, col, row)"
|
||||
></span>
|
||||
-->
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -306,30 +287,17 @@
|
||||
@update:model-value="changeValRecCoordAddr"
|
||||
></CMapEditAddressByCoord>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.number ||
|
||||
col.fieldtype === costanti.FieldType.currency
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.number || col.fieldtype === costanti.FieldType.currency">
|
||||
<div v-if="canEdit || isInModif">
|
||||
<q-input
|
||||
v-bind="$attrs"
|
||||
debounce="1000"
|
||||
<div>
|
||||
|
||||
<CInput
|
||||
v-model="myvalue"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
@update:model-value="Savedb"
|
||||
:label="
|
||||
col.visulabel
|
||||
? $t(col.label_trans)
|
||||
: (visulabel
|
||||
? addstrrequired + $t(col.label_trans)
|
||||
: '')
|
||||
"
|
||||
type="number"
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
:label="col.visulabel ? $t(col.label_trans) : visulabel ? addstrrequired + $t(col.label_trans) : undefined"
|
||||
:dense="dense"
|
||||
@savedb="Savedb"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.currency">
|
||||
<CCurrencyValue
|
||||
@@ -362,14 +330,14 @@
|
||||
</CMySelect>
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-input
|
||||
<CInput
|
||||
v-model="myvalue"
|
||||
type="number"
|
||||
:label="col.visulabel ? $t(col.label_trans) : visulabel ? addstrrequired + $t(col.label_trans) : undefined"
|
||||
:dense="dense"
|
||||
@savedb="changevalRec"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
@update:value="changevalRec"
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -389,9 +357,7 @@
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile ? myvalue.imagefile : myvalue
|
||||
"
|
||||
:imgGall="myvalue && myvalue.imagefile ? myvalue.imagefile : myvalue"
|
||||
:isInModif="isInModif"
|
||||
:edit="isviewfield() && isInModif"
|
||||
:canModify="canModify && isInModif"
|
||||
@@ -421,18 +387,10 @@
|
||||
{{ $t(col.label_trans ? col.label_trans : '') }}
|
||||
</span>
|
||||
<CGallery
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
: ''
|
||||
"
|
||||
:imagebak="col.showpicprofile_ifnotset ? userStore.getImgByProfile(row['profile'], true) : ''"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:imgGall="myvalue && myvalue.imagefile ? [myvalue] : [{ imagefile: myvalue, vers_img: 1 }]"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -443,7 +401,10 @@
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="myvalue" class="text-center">
|
||||
<div
|
||||
v-if="myvalue"
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="myvalue"
|
||||
class="text-center"
|
||||
@@ -452,7 +413,10 @@
|
||||
>
|
||||
</q-img>
|
||||
</div>
|
||||
<div v-else class="text-center">
|
||||
<div
|
||||
v-else
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="
|
||||
col.showpicprofile_ifnotset
|
||||
@@ -475,9 +439,7 @@
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.fieldtype === costanti.FieldType.image_and_filename"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.image_and_filename">
|
||||
<div v-if="canEdit">
|
||||
{{ $t('reg.photo') }}
|
||||
<q-input
|
||||
@@ -489,18 +451,10 @@
|
||||
>
|
||||
</q-input>
|
||||
<CGallery
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
: ''
|
||||
"
|
||||
:imagebak="col.showpicprofile_ifnotset ? userStore.getImgByProfile(row['profile'], true) : ''"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:imgGall="myvalue && myvalue.imagefile ? [myvalue] : [{ imagefile: myvalue, vers_img: 1 }]"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -511,7 +465,10 @@
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="myvalue" class="text-center">
|
||||
<div
|
||||
v-if="myvalue"
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="myvalue"
|
||||
class="text-center"
|
||||
@@ -520,7 +477,10 @@
|
||||
>
|
||||
</q-img>
|
||||
</div>
|
||||
<div v-else class="text-center">
|
||||
<div
|
||||
v-else
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="
|
||||
col.showpicprofile_ifnotset
|
||||
@@ -548,16 +508,10 @@
|
||||
{{ $t('reg.photo') }}
|
||||
<CSelectImage
|
||||
v-bind="$attrs"
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
: ''
|
||||
"
|
||||
:imagebak="col.showpicprofile_ifnotset ? userStore.getImgByProfile(row['profile'], true) : ''"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile ? [myvalue.imagefile] : [myvalue]
|
||||
"
|
||||
:imgGall="myvalue && myvalue.imagefile ? [myvalue.imagefile] : [myvalue]"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -567,7 +521,10 @@
|
||||
</CSelectImage>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="myvalue" class="text-center">
|
||||
<div
|
||||
v-if="myvalue"
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="myvalue"
|
||||
class="text-center"
|
||||
@@ -576,7 +533,10 @@
|
||||
>
|
||||
</q-img>
|
||||
</div>
|
||||
<div v-else class="text-center">
|
||||
<div
|
||||
v-else
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="
|
||||
col.showpicprofile_ifnotset
|
||||
@@ -615,14 +575,7 @@
|
||||
:pickup="pickup"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false"
|
||||
:addstrrequired="addstrrequired"
|
||||
>
|
||||
@@ -648,14 +601,7 @@
|
||||
:pickup="pickup"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false"
|
||||
:addstrrequired="addstrrequired"
|
||||
>
|
||||
@@ -669,16 +615,11 @@
|
||||
<div v-if="myvalue">
|
||||
<CDateTime
|
||||
:label="
|
||||
col.label
|
||||
? addstrrequired + col.label
|
||||
: col.label_trans
|
||||
? (addstrrequired + $t(col.label_trans))
|
||||
: ''
|
||||
col.label ? addstrrequired + col.label : col.label_trans ? addstrrequired + $t(col.label_trans) : undefined
|
||||
"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="dense"
|
||||
:canEdit="canEdit"
|
||||
@savetoclose="SaveValueInt"
|
||||
@@ -696,13 +637,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
|
||||
<div v-if="myvalue">
|
||||
<CDateTime
|
||||
:label="col.label ? (addstrrequired + col.label) : (addstrrequired + $t(col.label_trans))"
|
||||
:label="
|
||||
col.label ? addstrrequired + col.label : col.label_trans ? addstrrequired + $t(col.label_trans) : undefined
|
||||
"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="dense"
|
||||
:canEdit="canEdit"
|
||||
@savetoclose="SaveValueInt"
|
||||
@@ -711,21 +653,13 @@
|
||||
>
|
||||
</CDateTime>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.binary">
|
||||
<div v-if="isInModif">
|
||||
<span v-if="insertMode">
|
||||
{{ col.label ? col.label : $t(col.label_trans) }}:
|
||||
</span>
|
||||
<span v-if="insertMode"> {{ col.label ? col.label : $t(col.label_trans) }}: </span>
|
||||
<CMyToggleList
|
||||
:label="col.titlepopupedit ? col.titlepopupedit : ''"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:label="col.titlepopupedit ? col.titlepopupedit : undefined"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
v-model:value="myvalue"
|
||||
@update:value="changevalRec"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
@@ -739,14 +673,7 @@
|
||||
:type="costanti.FieldType.binary"
|
||||
:value="myvalue"
|
||||
@update:value="changevalRec"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
||||
@@ -775,14 +702,7 @@
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:sola_lettura="!isInModif"
|
||||
:useinput="col.allowNewValue"
|
||||
:newvaluefunc="addNewValue"
|
||||
@@ -828,14 +748,7 @@
|
||||
:type_out="col.field_outtype"
|
||||
@update:value="changevalRec"
|
||||
:value="myvalue"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
||||
@@ -843,7 +756,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.color">
|
||||
<div v-if="myvalue" :style="`color: text-${myvalue};`">
|
||||
<div
|
||||
v-if="myvalue"
|
||||
:style="`color: text-${myvalue};`"
|
||||
>
|
||||
{{ myvalue }}
|
||||
</div>
|
||||
<div v-else>(Scegli)</div>
|
||||
@@ -863,20 +779,12 @@
|
||||
v-model="myvalue"
|
||||
type="toggle"
|
||||
@update:model-value="changevalRec"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
></q-option-group>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.select ||
|
||||
col.fieldtype === costanti.FieldType.select_by_server
|
||||
col.fieldtype === costanti.FieldType.select || col.fieldtype === costanti.FieldType.select_by_server
|
||||
"
|
||||
>
|
||||
<div v-if="isInModif">
|
||||
@@ -887,11 +795,7 @@
|
||||
:label="col.label ? col.label : $t(col.label_trans)"
|
||||
v-model:value="myvalue"
|
||||
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
|
||||
:tablesel="
|
||||
col.fieldtype === costanti.FieldType.select_by_server
|
||||
? tablesel
|
||||
: ''
|
||||
"
|
||||
:tablesel="col.fieldtype === costanti.FieldType.select_by_server ? tablesel : ''"
|
||||
@update:value="changevalRec"
|
||||
@update:model-value="Savedb"
|
||||
:newvaluefunc="addNewValue"
|
||||
@@ -901,14 +805,7 @@
|
||||
:value_extra="value_extra"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="col.allowNewValue"
|
||||
:addstrrequired="addstrrequired"
|
||||
:dense="dense"
|
||||
@@ -934,25 +831,14 @@
|
||||
:labelifblank="canEdit ? 'Selezionare' : ''"
|
||||
:filter_table="col.filter_table"
|
||||
:filter_field="col.filter_field"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
||||
></CMyChipList>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.multiselect_by_server
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
|
||||
<CMySelect
|
||||
:type_out="col.field_outtype"
|
||||
:col="col"
|
||||
@@ -973,14 +859,7 @@
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:sola_lettura="!isInModif"
|
||||
:useinput="isInModif"
|
||||
:addstrrequired="addstrrequired"
|
||||
@@ -988,12 +867,7 @@
|
||||
>
|
||||
</CMySelect>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.star5 ||
|
||||
col.fieldtype === costanti.FieldType.star3
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.star5 || col.fieldtype === costanti.FieldType.star3">
|
||||
<div v-if="isInModif">
|
||||
<CMySelect
|
||||
:type_out="col.field_outtype"
|
||||
@@ -1007,14 +881,7 @@
|
||||
:value_extra="value_extra"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false"
|
||||
:addstrrequired="addstrrequired"
|
||||
:dense="dense"
|
||||
@@ -1048,7 +915,7 @@
|
||||
<div v-if="!isFieldDb()">
|
||||
<CMyEditor
|
||||
v-model:value="myvalue"
|
||||
:title="!isInModif ? getTitleEditor(col, row) : ''"
|
||||
:title="!isInModif ? getTitleEditor(col, row) : undefined"
|
||||
@keyup.enter.stop
|
||||
:showButtons="false"
|
||||
:canModify="canModify"
|
||||
@@ -1089,9 +956,16 @@
|
||||
></div>
|
||||
|
||||
<div v-if="!isFieldDb()">
|
||||
<q-dialog v-model="visuhtml" full-height full-width>
|
||||
<q-dialog
|
||||
v-model="visuhtml"
|
||||
full-height
|
||||
full-width
|
||||
>
|
||||
<q-card>
|
||||
<q-bar :dense="dense" class="bg-primary text-white">
|
||||
<q-bar
|
||||
:dense="dense"
|
||||
class="bg-primary text-white"
|
||||
>
|
||||
<span> {{ getTitleEditor(col, row) }} </span>
|
||||
<q-space />
|
||||
<q-btn
|
||||
@@ -1104,7 +978,10 @@
|
||||
</q-bar>
|
||||
<q-card-section class="inset-shadow">
|
||||
<q-card class="dialog_card">
|
||||
<div v-html="myvalue" class="wrap_anywhere"></div>
|
||||
<div
|
||||
v-html="myvalue"
|
||||
class="wrap_anywhere"
|
||||
></div>
|
||||
</q-card>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
@@ -1159,11 +1036,7 @@
|
||||
<q-popup-edit
|
||||
v-if="!isInModif && canEdit && noPopupeditByCol(col)"
|
||||
v-model="myvalue"
|
||||
:disable="
|
||||
col.disable ||
|
||||
disable ||
|
||||
col.fieldtype === costanti.FieldType.image_and_filename
|
||||
"
|
||||
:disable="col.disable || disable || col.fieldtype === costanti.FieldType.image_and_filename"
|
||||
:readonly="col.disable || disable"
|
||||
:title="col.title ? col.title : col.titlepopupedit"
|
||||
buttons
|
||||
@@ -1183,29 +1056,25 @@
|
||||
<span v-html="visuValByType(myvalue, col, row)"></span>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.string ||
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
"
|
||||
v-else-if="col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted"
|
||||
>
|
||||
<q-input
|
||||
v-bind="$attrs"
|
||||
counter
|
||||
:type="
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
? 'password'
|
||||
: 'text'
|
||||
"
|
||||
:type="col.fieldtype === costanti.FieldType.crypted ? 'password' : 'text'"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="scope.value"
|
||||
:label="col.visulabel ? (addstrrequired + $t(col.label_trans)) : ''"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : undefined"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
:rules="[val => (!!val || !col.required) || 'Campo richiesto']"
|
||||
:rules="[(val) => !!val || !col.required || 'Campo richiesto']"
|
||||
>
|
||||
<template
|
||||
v-if="notAllowAtChar"
|
||||
v-slot:prepend
|
||||
>
|
||||
<template v-if="notAllowAtChar" v-slot:prepend>
|
||||
<span class="text-h7 text-blue">@</span>
|
||||
</template>
|
||||
</q-input>
|
||||
@@ -1218,13 +1087,7 @@
|
||||
debounce="1000"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
autofocus
|
||||
:label="
|
||||
col.visulabel
|
||||
? $t(col.label_trans)
|
||||
: visulabel
|
||||
? (addstrrequired + col.label)
|
||||
: ''
|
||||
"
|
||||
:label="col.visulabel ? $t(col.label_trans) : visulabel ? addstrrequired + col.label : undefined"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
@@ -1292,8 +1155,7 @@
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.select ||
|
||||
col.fieldtype === costanti.FieldType.select_by_server
|
||||
col.fieldtype === costanti.FieldType.select || col.fieldtype === costanti.FieldType.select_by_server
|
||||
"
|
||||
>
|
||||
<CMySelect
|
||||
@@ -1304,36 +1166,21 @@
|
||||
v-model:value="scope.value"
|
||||
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
|
||||
:addnone="col.addnone"
|
||||
:tablesel="
|
||||
col.fieldtype === costanti.FieldType.select_by_server
|
||||
? tablesel
|
||||
: ''
|
||||
"
|
||||
:tablesel="col.fieldtype === costanti.FieldType.select_by_server ? tablesel : undefined"
|
||||
:filter_table="col.filter_table"
|
||||
:filter_field="col.filter_field"
|
||||
:value_extra="value_extra"
|
||||
:newvaluefunc="addNewValue"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="col.allowNewValue"
|
||||
:addstrrequired="addstrrequired"
|
||||
:dense="dense"
|
||||
>
|
||||
</CMySelect>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.multiselect_by_server
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
|
||||
<CMySelect
|
||||
:type_out="col.field_outtype"
|
||||
:col="col"
|
||||
@@ -1354,14 +1201,7 @@
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="true"
|
||||
:addstrrequired="addstrrequired"
|
||||
:dense="dense"
|
||||
@@ -1388,14 +1228,7 @@
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:sola_lettura="!isInModif"
|
||||
:useinput="col.allowNewValue"
|
||||
:newvaluefunc="addNewValue"
|
||||
@@ -1496,16 +1329,11 @@
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.date">
|
||||
<CDateTime
|
||||
:label="
|
||||
col.label
|
||||
? (addstrrequired + col.label)
|
||||
: (col.label_trans
|
||||
? (addstrrequired + $t(col.label_trans))
|
||||
: '')
|
||||
col.label ? addstrrequired + col.label : col.label_trans ? addstrrequired + $t(col.label_trans) : undefined
|
||||
"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="dense"
|
||||
:canEdit="canEdit"
|
||||
@savetoclose="SaveValueInt"
|
||||
@@ -1515,12 +1343,11 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
|
||||
<CDateTime
|
||||
:label="col.label ? addstrrequired + col.label : (addstrrequired + $t(col.label_trans))"
|
||||
:label="col.label ? addstrrequired + col.label : addstrrequired + $t(col.label_trans)"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="dense"
|
||||
:canEdit="canEdit"
|
||||
@savetoclose="SaveValueInt"
|
||||
@@ -1531,15 +1358,8 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.binary">
|
||||
<CMyToggleList
|
||||
:label="col.titlepopupedit ? col.titlepopupedit : ''"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:label="col.titlepopupedit ? col.titlepopupedit : undefined"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
v-model:value="scope.value"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
@@ -1548,27 +1368,18 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.username_chip">
|
||||
<q-input
|
||||
:type="
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
? 'password'
|
||||
: 'text'
|
||||
"
|
||||
:type="col.fieldtype === costanti.FieldType.crypted ? 'password' : 'text'"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="scope.value"
|
||||
:label="col.visulabel ? (addstrrequired + $t(col.label_trans)) : ''"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : undefined"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.star5 ||
|
||||
col.fieldtype === costanti.FieldType.star3
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.star5 || col.fieldtype === costanti.FieldType.star3">
|
||||
<CMySelect
|
||||
:type_out="col.field_outtype"
|
||||
:col="col"
|
||||
@@ -1577,14 +1388,7 @@
|
||||
v-model:value="scope.value"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
)
|
||||
"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false"
|
||||
:addstrrequired="addstrrequired"
|
||||
>
|
||||
@@ -1605,7 +1409,7 @@
|
||||
<div v-if="!isFieldDb()">
|
||||
<CMyEditor
|
||||
v-model:value="myvalue"
|
||||
:title="!isInModif ? getTitleEditor(col, row) : ''"
|
||||
:title="!isInModif ? getTitleEditor(col, row) : undefined"
|
||||
@keyup.enter.stop
|
||||
:showButtons="false"
|
||||
:canModify="canModify"
|
||||
@@ -1616,11 +1420,7 @@
|
||||
</CMyEditor>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.image_and_filename
|
||||
"
|
||||
>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.image_and_filename">
|
||||
<div v-if="canEdit">
|
||||
{{ $t('reg.photo') }}
|
||||
<q-input
|
||||
@@ -1631,18 +1431,10 @@
|
||||
>
|
||||
</q-input>
|
||||
<CGallery
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
: ''
|
||||
"
|
||||
:imagebak="col.showpicprofile_ifnotset ? userStore.getImgByProfile(row['profile'], true) : ''"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:imgGall="myvalue && myvalue.imagefile ? [myvalue] : [{ imagefile: myvalue, vers_img: 1 }]"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -1676,8 +1468,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyPopupEdit.ts">
|
||||
</script>
|
||||
<script lang="ts" src="./CMyPopupEdit.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyPopupEdit.scss';
|
||||
|
||||
@@ -79,6 +79,9 @@ export default defineComponent({
|
||||
const esiste_descrintro = computed(() => {
|
||||
return myrec.value.descr_introduttiva && myrec.value.descr_introduttiva.length > 100
|
||||
})
|
||||
const numprodottistr = computed(() => {
|
||||
return myrec.value.lista_prodotti?.length || 0
|
||||
})
|
||||
const pagina_collegata = computed(() => {
|
||||
|
||||
let linkpage = ''
|
||||
@@ -124,6 +127,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
|
||||
|
||||
editorestr.value = ''
|
||||
if (myrec.value.editore) {
|
||||
for (const receditore of myrec.value.editore) {
|
||||
@@ -218,6 +222,7 @@ export default defineComponent({
|
||||
esiste_descrintro,
|
||||
argomentistr,
|
||||
numprodtot,
|
||||
numprodottistr,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -17,19 +17,10 @@
|
||||
:height="opt.heightimg"
|
||||
class="clickable-image"
|
||||
fit="cover"
|
||||
:src="
|
||||
tools.getFullFileName(
|
||||
[myrec.foto_collana],
|
||||
table,
|
||||
myrec.username,
|
||||
myrec._id
|
||||
)
|
||||
"
|
||||
:src="tools.getFullFileName([myrec.foto_collana], table, myrec.username, myrec._id)"
|
||||
>
|
||||
<template v-slot:error>
|
||||
<div class="absolute-full flex flex-center text-white">
|
||||
immagine non impostata
|
||||
</div>
|
||||
<div class="absolute-full flex flex-center text-white">immagine non impostata</div>
|
||||
</template>
|
||||
<!--<div class="text-h6 absolute-bottom text-left">
|
||||
{{ myrec.title }}
|
||||
@@ -38,20 +29,24 @@
|
||||
|
||||
<q-card-section>
|
||||
<div
|
||||
class="q-mt-sm q-mb-xs"
|
||||
class="q-mb-sm text-center text-bold"
|
||||
style="font-size: 1.15rem"
|
||||
>
|
||||
{{ myrec.title }}
|
||||
</div>
|
||||
<div class="text-caption text-h7 text-grey">
|
||||
<div class="">
|
||||
<div
|
||||
v-if="numprodottistr"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-list-ol" /> {{ $t('cataloglist.numprodotti') }}:
|
||||
<span class="text-blue">{{ numprodottistr }}</span>
|
||||
</div>
|
||||
<div class="text-caption text-h7 text-grey q-pb-xs">
|
||||
<q-icon name="fas fa-user" /> {{ $t('cataloglist.referenti') }}:
|
||||
<span
|
||||
v-if="myrec.referenti && myrec.referenti.length > 0"
|
||||
:class="
|
||||
`text-bold ` + myrec.referenti && myrec.referenti.length > 0
|
||||
? 'text-blue'
|
||||
: 'text-red'
|
||||
"
|
||||
:class="`text-bold ` + myrec.referenti && myrec.referenti.length > 0 ? 'text-blue' : 'text-red'"
|
||||
>
|
||||
{{ myrec.referenti ? myrec.referenti.join(', ') : '' }}
|
||||
</span>
|
||||
@@ -59,19 +54,31 @@
|
||||
<span class="text-red">[Nessuno]</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="collanestr" class="text-caption text-h7 text-grey">
|
||||
<div
|
||||
v-if="collanestr"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-book" /> {{ t('cataloglist.collane') }}:
|
||||
<span class="text-blue">{{ collanestr }}</span>
|
||||
</div>
|
||||
<div v-if="argomentistr" class="text-caption text-h7 text-grey">
|
||||
<div
|
||||
v-if="argomentistr"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-book" /> {{ $t('cataloglist.argomenti') }}:
|
||||
<span class="text-blue">{{ argomentistr + ` (${numprodtot})` }}</span>
|
||||
</div>
|
||||
<div v-if="editorestr" class="text-caption text-h7 text-grey">
|
||||
<div
|
||||
v-if="editorestr"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-book-open" /> {{ $t('cataloglist.referenti') }}:
|
||||
<span class="text-blue">{{ editorestr }}</span>
|
||||
</div>
|
||||
<div v-if="!esiste_descrintro" class="text-caption text-h7 text-grey">
|
||||
<div
|
||||
v-if="!esiste_descrintro"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-pencil-alt" /> Testo descrittivo:
|
||||
<span :style="`color: ` + (esiste_descrintro ? 'green' : 'red')">{{
|
||||
esiste_descrintro ? 'Presente' : 'Mancante'
|
||||
@@ -79,40 +86,55 @@
|
||||
</div>
|
||||
<div
|
||||
v-if="!myrec.img_bordata?.imagefile"
|
||||
class="text-caption text-h7 text-grey"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-image" /> Sfondo:
|
||||
<span
|
||||
:style="
|
||||
`color: ` + (myrec.img_bordata?.imagefile ? 'green' : 'red')
|
||||
"
|
||||
>{{ myrec.img_bordata?.imagefile ? 'Presente' : 'Mancante' }}</span
|
||||
>
|
||||
<span :style="`color: ` + (myrec.img_bordata?.imagefile ? 'green' : 'red')">{{
|
||||
myrec.img_bordata?.imagefile ? 'Presente' : 'Mancante'
|
||||
}}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="!myrec.img_intro?.imagefile"
|
||||
class="text-caption text-h7 text-grey"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-image" /> Copertina:
|
||||
<span
|
||||
:style="`color: ` + (myrec.img_intro?.imagefile ? 'green' : 'red')"
|
||||
>{{ myrec.img_intro?.imagefile ? 'Presente' : 'Mancante' }}</span
|
||||
>
|
||||
<span :style="`color: ` + (myrec.img_intro?.imagefile ? 'green' : 'red')">{{
|
||||
myrec.img_intro?.imagefile ? 'Presente' : 'Mancante'
|
||||
}}</span>
|
||||
</div>
|
||||
<div v-if="myrec.pdf_generato" class="text-caption text-h7 text-blue">
|
||||
<div
|
||||
v-if="myrec.pdf_generato"
|
||||
class="text-caption text-h7 text-blue q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-book" /> -
|
||||
<a :href="myrec.pdf_generato" target="_blank">PDF Generato</a>
|
||||
<a
|
||||
:href="myrec.pdf_generato"
|
||||
target="_blank"
|
||||
>PDF Generato</a
|
||||
>
|
||||
(Data: {{ tools.getstrDate(myrec.data_generato) }})
|
||||
</div>
|
||||
<div v-if="myrec.pdf_online" class="text-caption text-h7 text-blue">
|
||||
<div
|
||||
v-if="myrec.pdf_online"
|
||||
class="text-caption text-h7 text-blue q-pb-xs"
|
||||
>
|
||||
<q-icon name="fas fa-book" /> -
|
||||
<a :href="myrec.pdf_online" target="_blank">PDF ONLINE</a>
|
||||
<a
|
||||
:href="myrec.pdf_online"
|
||||
target="_blank"
|
||||
>PDF ONLINE</a
|
||||
>
|
||||
(Data: {{ tools.getstrDate(myrec.data_online) }})
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="text-overline text-orange-9">{{collanestr}}</div>-->
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="center" class="q-pa-none" style="position: absolute; bottom: 0; width: 100%;">
|
||||
<q-card-actions
|
||||
align="center"
|
||||
class="q-pa-none"
|
||||
style="position: absolute; bottom: 0; width: 100%"
|
||||
>
|
||||
<div class="row justify-center">
|
||||
<q-fab
|
||||
color="primary"
|
||||
@@ -180,37 +202,52 @@
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section>
|
||||
<div class="row justify-center q-ma-sm q-pa-sm">
|
||||
<div style="width: 300px" class="q-ma-sm">
|
||||
<div class="row justify-center q-ma-sm q-pb-xs">
|
||||
<div
|
||||
style="width: 300px"
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:value="
|
||||
myrec.referenti && myrec.referenti.length > 0
|
||||
? myrec.referenti.join(', ')
|
||||
: '[Non Assegnato]'
|
||||
"
|
||||
:value="myrec.referenti && myrec.referenti.length > 0 ? myrec.referenti.join(', ') : '[Non Assegnato]'"
|
||||
:label="$t('cataloglist.referenti') + `:`"
|
||||
:color="
|
||||
myrec.referenti && myrec.referenti.length > 0
|
||||
? 'text-blue'
|
||||
: 'text-red'
|
||||
"
|
||||
:color="myrec.referenti && myrec.referenti.length > 0 ? 'text-blue' : 'text-red'"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="collanestr" style="width: 300px" class="q-ma-sm">
|
||||
<CLabel :value="collanestr" :label="$t('cataloglist.collane') + `:`" />
|
||||
</div>
|
||||
<div v-if="argomentistr" style="width: 300px" class="q-ma-sm">
|
||||
<CLabel :value="argomentistr + ` (${numprodtot})`" :label="$t('cataloglist.argomenti') + `:`" />
|
||||
</div>
|
||||
<div style="width: 300px" class="q-ma-sm">
|
||||
<div
|
||||
v-if="collanestr"
|
||||
style="width: 300px"
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
class_text="text-bold"
|
||||
:value="collanestr"
|
||||
:label="$t('cataloglist.collane') + `:`"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="argomentistr"
|
||||
style="width: 300px"
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:value="argomentistr + ` (${numprodtot})`"
|
||||
:label="$t('cataloglist.argomenti') + `:`"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
style="width: 300px"
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:class_text="{ 'text-bold': true }"
|
||||
:value="esiste_descrintro ? 'PRESENTE ' : 'MANCANTE !'"
|
||||
label="Testo descrittivo"
|
||||
:color="esiste_descrintro ? 'green' : 'red'"
|
||||
/>
|
||||
</div>
|
||||
<div style="width: 300px" class="q-ma-sm">
|
||||
<div
|
||||
style="width: 300px"
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:value="myrec.pdf_generato || 'ancora non è stato generato'"
|
||||
label="PDF generato"
|
||||
@@ -228,12 +265,15 @@
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
<q-card-actions align="center">
|
||||
<q-btn color="primary" label="Chiudi" @click="apriInfo = false" />
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="Chiudi"
|
||||
@click="apriInfo = false"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script lang="ts" src="./CMyRecCatalog.ts">
|
||||
</script>
|
||||
<script lang="ts" src="./CMyRecCatalog.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyRecCatalog.scss';
|
||||
|
||||
@@ -13,7 +13,7 @@ import { tools } from '@tools'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMySelect',
|
||||
emits: ['update:value', 'update:arrvalue', 'changeval'],
|
||||
emits: ['update:value', 'update:arrvalue', 'changeval', 'clear'],
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
@@ -141,6 +141,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
focus: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
withToggle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -171,6 +175,11 @@ export default defineComponent({
|
||||
|
||||
const optionsreal: any = []
|
||||
|
||||
const selectMultiServer = ref(null)
|
||||
const selectPickup = ref(null)
|
||||
const selectMultiple = ref(null)
|
||||
const selectGeneric = ref(null)
|
||||
|
||||
const valoriload = computed(() => {
|
||||
return updateArrOptions()
|
||||
})
|
||||
@@ -317,7 +326,29 @@ export default defineComponent({
|
||||
|
||||
function mounted() {
|
||||
optionsreal.value = props.options
|
||||
if (props.focus) {
|
||||
focusVisibleSelect()
|
||||
}
|
||||
|
||||
update()
|
||||
|
||||
}
|
||||
|
||||
function focusVisibleSelect() {
|
||||
|
||||
try {
|
||||
if (selectMultiServer.value && props.multiselect_by_server) {
|
||||
selectMultiServer.value.focus()
|
||||
} else if (selectPickup.value && props.pickup) {
|
||||
selectPickup.value.focus()
|
||||
} else if (selectMultiple.value && props.multiple) {
|
||||
selectMultiple.value.focus()
|
||||
} else {
|
||||
selectGeneric.value.focus()
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Err', e)
|
||||
}
|
||||
}
|
||||
|
||||
function update() {
|
||||
@@ -778,7 +809,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getOptionLabel(option: any): string {
|
||||
console.log('getOptionLabel', option)
|
||||
// console.log('getOptionLabel', option)
|
||||
if (typeof props.optlab === 'function') {
|
||||
return props.optlab(option); // Se optlab è una funzione, chiamala
|
||||
} else {
|
||||
@@ -786,6 +817,11 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
emit('clear')
|
||||
myvalue.value = ''
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
|
||||
@@ -804,6 +840,7 @@ export default defineComponent({
|
||||
selectText,
|
||||
getLabelValue,
|
||||
getOptionLabel,
|
||||
clear,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div class="text-center">
|
||||
<div v-if="multiselect_by_server">
|
||||
<q-select
|
||||
ref="selectMultiServer"
|
||||
:model-value="myarrvalue"
|
||||
@update:model-value="changeval"
|
||||
v-bind="$attrs"
|
||||
@@ -27,15 +28,16 @@
|
||||
:class="myclass ? myclass : 'combowidth'"
|
||||
style="min-width: 250px !important"
|
||||
>
|
||||
<template v-if="getIcon() && !sola_lettura" v-slot:prepend>
|
||||
<template
|
||||
v-if="getIcon() && !sola_lettura"
|
||||
v-slot:prepend
|
||||
>
|
||||
<q-icon :name="getIcon()" />
|
||||
</template>
|
||||
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
Digita il testo da cercare
|
||||
</q-item-section>
|
||||
<q-item-section class="text-grey"> Digita il testo da cercare </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
@@ -64,9 +66,7 @@
|
||||
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
|
||||
<q-item v-bind="itemProps">
|
||||
<q-item-section>
|
||||
<q-item-label>{{
|
||||
opt[fieldsTable.getLabelByTable(tablesel)]
|
||||
}}</q-item-label>
|
||||
<q-item-label>{{ opt[fieldsTable.getLabelByTable(tablesel)] }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-toggle
|
||||
@@ -80,6 +80,7 @@
|
||||
</div>
|
||||
<div v-else-if="pickup">
|
||||
<q-select
|
||||
ref="selectPickup"
|
||||
v-if="pickup"
|
||||
:model-value="myvalue"
|
||||
@update:model-value="changeval"
|
||||
@@ -94,30 +95,26 @@
|
||||
:options="valori"
|
||||
:option-value="optval"
|
||||
:option-label="getOptionLabel"
|
||||
:use-chips="myvalue && myvalue !== '' ? true : false"
|
||||
:use-chips="tools.isValueNotEmpty(myvalue)"
|
||||
stack-label
|
||||
clearable
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
@filter="filterFn"
|
||||
@clear="myvalue = ''"
|
||||
@clear="clear"
|
||||
v-bind="$attrs"
|
||||
|
||||
>
|
||||
<template v-slot:append>
|
||||
<template
|
||||
v-if="getIcon()"
|
||||
v-slot:prepend
|
||||
>
|
||||
<q-icon
|
||||
v-if="myvalue !== ''"
|
||||
class="cursor-pointer"
|
||||
name="clear"
|
||||
@click.stop.prevent="myvalue = ''"
|
||||
size="xs"
|
||||
:name="getIcon()"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="getIcon()" v-slot:prepend>
|
||||
<q-icon size="xs" :name="getIcon()" />
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
Digita il testo da cercare
|
||||
</q-item-section>
|
||||
<q-item-section class="text-grey"> Digita il testo da cercare </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-slot:option="scope">
|
||||
@@ -125,16 +122,15 @@
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
|
||||
</q-item-label
|
||||
>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
</q-select>
|
||||
</div>
|
||||
<div v-else-if="multiple">
|
||||
<q-select
|
||||
ref="selectMultiple"
|
||||
:multiple="true"
|
||||
:model-value="myarrvalue"
|
||||
label-color="primary"
|
||||
@@ -159,7 +155,10 @@
|
||||
>
|
||||
<!--options-selected-class="text-deep-blue"-->
|
||||
|
||||
<template v-if="getIcon()" v-slot:prepend>
|
||||
<template
|
||||
v-if="getIcon()"
|
||||
v-slot:prepend
|
||||
>
|
||||
<q-icon :name="getIcon()" />
|
||||
</template>
|
||||
<template v-slot:selected-item="scope">
|
||||
@@ -188,12 +187,12 @@
|
||||
>
|
||||
<q-item v-bind="itemProps">
|
||||
<q-item-section>
|
||||
<q-item-label>{{
|
||||
tools.getValueByFunzOrVal(opt, optlab)
|
||||
}}</q-item-label>
|
||||
<q-item-label v-if="'hint' in opt" class="hint">{{
|
||||
opt['hint']
|
||||
}}</q-item-label>
|
||||
<q-item-label>{{ tools.getValueByFunzOrVal(opt, optlab) }}</q-item-label>
|
||||
<q-item-label
|
||||
v-if="'hint' in opt"
|
||||
class="hint"
|
||||
>{{ opt['hint'] }}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-toggle
|
||||
@@ -207,6 +206,7 @@
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-select
|
||||
ref="selectGeneric"
|
||||
:multiple="false"
|
||||
rounded
|
||||
outlined
|
||||
@@ -228,7 +228,10 @@
|
||||
v-bind="$attrs"
|
||||
:class="myclass ? myclass : 'combowidth'"
|
||||
>
|
||||
<template v-if="getIcon()" v-slot:prepend>
|
||||
<template
|
||||
v-if="getIcon()"
|
||||
v-slot:prepend
|
||||
>
|
||||
<q-icon :name="getIcon()" />
|
||||
</template>
|
||||
<template v-slot:option="scope">
|
||||
@@ -237,12 +240,12 @@
|
||||
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{
|
||||
tools.getValueByFunzOrVal(scope.opt, optlab)
|
||||
}}</q-item-label>
|
||||
<q-item-label v-if="'hint' in scope.opt" class="hint">{{
|
||||
scope.opt['hint']
|
||||
}}</q-item-label>
|
||||
<q-item-label>{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}</q-item-label>
|
||||
<q-item-label
|
||||
v-if="'hint' in scope.opt"
|
||||
class="hint"
|
||||
>{{ scope.opt['hint'] }}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
@@ -251,8 +254,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMySelect.ts">
|
||||
</script>
|
||||
<script lang="ts" src="./CMySelect.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMySelect.scss';
|
||||
|
||||
@@ -18,7 +18,8 @@ export default defineComponent({
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
required: true,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
hint: {
|
||||
type: String,
|
||||
@@ -78,6 +79,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
canModify: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
<CMyPopupEdit
|
||||
:dense="false"
|
||||
:dense="dense"
|
||||
debounce="1000"
|
||||
:fielddb="true"
|
||||
v-bind="$attrs"
|
||||
@@ -68,7 +68,6 @@
|
||||
:tablesel="tablesel"
|
||||
:pickup="pickup"
|
||||
v-model:row="row"
|
||||
minuteinterval="1"
|
||||
@showandsave="showandsave"
|
||||
@save="save"
|
||||
:path="path"
|
||||
|
||||
@@ -206,10 +206,14 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
async function updateproductmodif() {
|
||||
|
||||
async function updateproductmodif(element: any) {
|
||||
// console.log('updateproductmodif')
|
||||
try {
|
||||
if (element?._id) {
|
||||
myproduct.value = await products.getProductById(element?._id)
|
||||
} else {
|
||||
myproduct.value = await products.getProductById(props.id)
|
||||
}
|
||||
|
||||
updateLabel()
|
||||
} catch (e) {
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="stockQty"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -212,7 +212,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="stockBloccatiQty"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -370,7 +370,7 @@
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="note"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -401,7 +401,7 @@
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="imagefile"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.image"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -462,7 +462,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="bookableAvailableQty"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -475,7 +475,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="maxbookableGASQty"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -523,7 +523,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="bookableGASBloccatiQty"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -535,7 +535,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="bookedGASQtyConfirmed"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -610,7 +610,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="bookedGASQtyOrdered"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -623,7 +623,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="qtyToReachForGas"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -709,7 +709,7 @@
|
||||
:rec="myproduct.gasordine"
|
||||
mykey="dataora_chiusura_ordini"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.date"
|
||||
:justifycenter="false"
|
||||
>
|
||||
@@ -739,7 +739,7 @@
|
||||
:rec="myproduct.gasordine"
|
||||
mykey="data_arrivo_merce"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.date"
|
||||
:justifycenter="false"
|
||||
>
|
||||
@@ -769,7 +769,7 @@
|
||||
mykey="dataora_ritiro"
|
||||
:justifycenter="false"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.onlydate"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -869,7 +869,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="bookedQtyOrdered"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -881,7 +881,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="bookedQtyConfirmed"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
@@ -907,7 +907,7 @@
|
||||
:rec="myproduct"
|
||||
mykey="active"
|
||||
debounce="1000"
|
||||
:save="updateproductmodif()"
|
||||
@save="updateproductmodif"
|
||||
:type="costanti.FieldType.boolean"
|
||||
>
|
||||
</CMyValueDb>
|
||||
|
||||
@@ -5,3 +5,19 @@
|
||||
.drag-handle:active {
|
||||
cursor: grabbing; /* Cambia la manina quando l'utente sta trascinando */
|
||||
}
|
||||
|
||||
.etichetta{
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
font-weight: bold;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.boxtitleval{
|
||||
padding: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { defineComponent, onMounted, ref, watch } from "vue";
|
||||
import { PropType, computed, defineComponent, onMounted, ref, watch } from "vue";
|
||||
import draggable from 'vuedraggable'
|
||||
|
||||
import { tools } from '@tools'
|
||||
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
|
||||
import { CMyValueDb } from '@src/components/CMyValueDb'
|
||||
import { CSearchProduct } from '@src/components/CSearchProduct'
|
||||
import { CMyDialog } from '@src/components/CMyDialog'
|
||||
|
||||
@@ -12,33 +13,82 @@ import { costanti } from '@costanti'
|
||||
import { IAuthor, ICatProd } from "app/src/model";
|
||||
|
||||
import type {
|
||||
IMyScheda,
|
||||
IOptCatalogo,
|
||||
IProduct
|
||||
} from '@src/model';
|
||||
import { shared_consts } from "app/src/common/shared_vuejs";
|
||||
import { useProducts } from "app/src/store/Products";
|
||||
import { CViewTable } from "../CViewTable";
|
||||
import { CLabel } from "../CLabel";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: "CProductTable",
|
||||
emits: ["update:lista_prodotti", "update:optcatalogo"],
|
||||
components: {
|
||||
draggable, CSearchProduct, CMyDialog,
|
||||
draggable, CSearchProduct, CMyDialog, CMyValueDb, CViewTable, CLabel,
|
||||
},
|
||||
props: {
|
||||
lista_prodotti: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
optcatalogo: {
|
||||
type: Object as PropType<IOptCatalogo>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
scheda: {
|
||||
type: Object as PropType<IMyScheda>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
|
||||
}),
|
||||
},
|
||||
},
|
||||
emits: ["update:lista_prodotti"],
|
||||
setup(props, { emit }) {
|
||||
// Copia locale della lista_prodotti per manipolazione interna
|
||||
const internalProducts = ref([...props.lista_prodotti]);
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
const products = useProducts()
|
||||
|
||||
const showProd = ref(false)
|
||||
const selProd = ref(<IProduct>{})
|
||||
const selProd = ref(<IProduct | null>null)
|
||||
|
||||
const cmd = ref(shared_consts.SCHEDA_PRODOTTO.CMD_NONE)
|
||||
|
||||
const showQtaDisponibile = ref(false)
|
||||
const loading = ref(false)
|
||||
const visufromgm = ref(false)
|
||||
const updatefromgm = ref(false)
|
||||
const field_updated_fromGM = ref('')
|
||||
|
||||
const modifOn = ref(false)
|
||||
const endload = ref(false)
|
||||
|
||||
const optionscatalogo = ref(<any>{maxlength: 0})
|
||||
|
||||
const editOn = computed({
|
||||
get(): boolean {
|
||||
return globalStore.editOn ? globalStore.editOn : false
|
||||
},
|
||||
|
||||
set(value: boolean) {
|
||||
return tools.updateEditOn(value)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
async function mounted() {
|
||||
|
||||
optionscatalogo.value = {
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
}
|
||||
}
|
||||
|
||||
// Aggiorna la copia locale quando il prop cambia
|
||||
@@ -51,17 +101,27 @@ export default defineComponent({
|
||||
|
||||
// Colonne della tabella
|
||||
const allColumns = [
|
||||
{ name: "drag", label: "Ordinamento", field: "", align: "left", style: "width: 50px" },
|
||||
{ name: "image", label: "Copertina", field: "image", align: "center" },
|
||||
{ name: "name", label: "Titolo", field: "name", align: "left" },
|
||||
{ name: "drag", label: "Ordinam.", field: "", align: "left", style: "width: 50px" },
|
||||
{ name: "image", label: "Foto", field: "image", align: "center" },
|
||||
{ name: "name", label: "Titolo del Libro", field: "name", align: "left" },
|
||||
{ name: "authors", label: "Autore", field: "authors", align: "left" },
|
||||
{ name: "trafiletto", label: "Trafiletto", field: "trafiletto", align: "left" },
|
||||
{ name: "catprods", label: "Argomento", field: "catprods", align: "left" },
|
||||
{ name: "quantity", label: "Disponibilità", field: "quantity", align: "left" },
|
||||
{ name: "date_pub", label: "Pubblicato", field: "date_pub", align: "left" },
|
||||
{ name: "ranking", label: "Class.", field: "ranking", align: "right" },
|
||||
{ name: "rank3M", label: "Class. 3M", field: "rank3M", align: "right" },
|
||||
{ name: "rank6M", label: "Class. 6M", field: "rank6M", align: "right" },
|
||||
{ name: "rank1Y", label: "Class. 1Y", field: "rank1Y", align: "right" },
|
||||
{ name: "pagine", label: "Pag.", field: "pagine", align: "right" },
|
||||
{ name: "totVen", label: "Venduti", field: "totVen", align: "right" },
|
||||
{ name: "totFat", label: "Fattur.", field: "totFat", align: "right" },
|
||||
{ name: "ult_ord", label: "Ult. Ordine", field: "ult_ord", align: "left" },
|
||||
{ name: "quantity", label: "Magazz.", field: "quantity", align: "right" },
|
||||
{ name: "isbn", label: "ISBN", field: "isbn", align: "left" },
|
||||
{ name: "actions", label: "Azioni", field: "", align: "center" },
|
||||
];
|
||||
|
||||
let cookieValue: string | null = null;
|
||||
let cookieValue: [] | null = null;
|
||||
try {
|
||||
cookieValue = tools.getCookie("selColCat");
|
||||
// Se il cookie esiste e contiene una stringa JSON valida
|
||||
@@ -139,6 +199,70 @@ export default defineComponent({
|
||||
showProd.value = true
|
||||
}
|
||||
|
||||
function modifyProduct(element: any) {
|
||||
if (element) {
|
||||
selProd.value = element
|
||||
|
||||
cmd.value = shared_consts.SCHEDA_PRODOTTO.CMD_MODIFICA
|
||||
modifOn.value = true
|
||||
}
|
||||
}
|
||||
|
||||
function updateProduct(element: any) {
|
||||
selProd.value = element
|
||||
|
||||
// Aggiorna l'elemento nella lista interna
|
||||
internalProducts.value = internalProducts.value.map((prod: any) => {
|
||||
if (prod._id === selProd.value._id) {
|
||||
return selProd.value;
|
||||
}
|
||||
return prod;
|
||||
});
|
||||
|
||||
emit("update:lista_prodotti", internalProducts.value); // Notifica il parent del cambiamento
|
||||
|
||||
}
|
||||
|
||||
async function updateproductmodif(element: any) {
|
||||
console.log('PRODUCT TABLE: updateproductmodif')
|
||||
try {
|
||||
if (element?._id) {
|
||||
selProd.value = await products.getProductById(element?._id)
|
||||
} else {
|
||||
selProd.value = await products.getProductById(selProd.value?._id)
|
||||
}
|
||||
|
||||
// update record inside internalProducts
|
||||
internalProducts.value = internalProducts.value.map((prod: any) => {
|
||||
if (prod._id === selProd.value._id) {
|
||||
return selProd.value;
|
||||
}
|
||||
return prod;
|
||||
});
|
||||
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error('err', e)
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDataFromGM() {
|
||||
|
||||
}
|
||||
async function refreshFieldFromGM(field: string) {
|
||||
if (selProd.value) {
|
||||
loading.value = true
|
||||
updatefromgm.value = true
|
||||
field_updated_fromGM.value = ''
|
||||
field_updated_fromGM.value = await globalStore.getGM_FieldOf_T_Web_Articoli(selProd.value.productInfo.sku!, field, shared_consts.CmdQueryMs.GET)
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
allColumns,
|
||||
selectedColumns,
|
||||
@@ -147,6 +271,7 @@ export default defineComponent({
|
||||
formatAuthors,
|
||||
formatCatProds,
|
||||
removeProduct,
|
||||
modifyProduct,
|
||||
tools,
|
||||
globalStore,
|
||||
costanti,
|
||||
@@ -154,6 +279,22 @@ export default defineComponent({
|
||||
showProduct,
|
||||
showProd,
|
||||
selProd,
|
||||
cmd,
|
||||
shared_consts,
|
||||
updateProduct,
|
||||
field_updated_fromGM,
|
||||
refreshFieldFromGM,
|
||||
refreshDataFromGM,
|
||||
updatefromgm,
|
||||
visufromgm,
|
||||
loading,
|
||||
showQtaDisponibile,
|
||||
modifOn,
|
||||
endload,
|
||||
updateproductmodif,
|
||||
optionscatalogo,
|
||||
t,
|
||||
products,
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -73,11 +73,67 @@
|
||||
<!-- Autore -->
|
||||
<td v-if="isColumnVisible('authors')">{{ formatAuthors(element.productInfo?.authors) }}</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('trafiletto')"
|
||||
style="text-align: center"
|
||||
:class="element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'text-green' : 'text-red'"
|
||||
>
|
||||
{{ element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'SI' : 'NO' }}
|
||||
</td>
|
||||
|
||||
<!-- Argomento -->
|
||||
<td v-if="isColumnVisible('catprods')">{{ formatCatProds(element.productInfo?.catprods) }}</td>
|
||||
|
||||
<td v-if="isColumnVisible('date_pub')">{{ tools.getstrDate(element.productInfo?.date_pub) }}</td>
|
||||
|
||||
<td v-if="isColumnVisible('ranking')">{{ element.indiceRanking }}</td>
|
||||
<td
|
||||
v-if="isColumnVisible('rank3M')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.rank3M }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('rank6M')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.rank6M }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('rank1Y')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.rank1Y }}
|
||||
</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('pagine')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.arrvariazioni[0].pagine }}
|
||||
</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('totVen')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.totVen }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('totFat')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.totFat }}
|
||||
</td>
|
||||
<td v-if="isColumnVisible('ult_ord')">{{ tools.getstrDate(element.productInfo?.dataUltimoOrdine) }}</td>
|
||||
|
||||
<!-- Quantità -->
|
||||
<td v-if="isColumnVisible('quantity')">{{ element.arrvariazioni[0].quantita }}</td>
|
||||
<td
|
||||
v-if="isColumnVisible('quantity')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.arrvariazioni[0].quantita }}
|
||||
</td>
|
||||
|
||||
<!-- ISBN -->
|
||||
<td v-if="isColumnVisible('isbn')">{{ element.isbn }}</td>
|
||||
@@ -90,6 +146,15 @@
|
||||
flat
|
||||
>
|
||||
<q-list>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="modifyProduct(element)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Modifica</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@@ -112,8 +177,100 @@
|
||||
title="Prodotto"
|
||||
class="q-ma-md"
|
||||
>
|
||||
<CSearchProduct v-if="selProd" :idprodtoshow="selProd._id" nameLinkTemplate="SEARCH_Prima"> </CSearchProduct>
|
||||
<CSearchProduct
|
||||
:idprodtoshow="selProd?._id"
|
||||
nameLinkTemplate="SEARCH_Prima"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
>
|
||||
</CSearchProduct>
|
||||
</CMyDialog>
|
||||
<q-dialog
|
||||
v-model="modifOn"
|
||||
maximized
|
||||
>
|
||||
<q-spinner
|
||||
v-if="!endload"
|
||||
color="primary"
|
||||
size="3em"
|
||||
:thickness="2"
|
||||
/>
|
||||
|
||||
<div v-if="!!selProd && !!selProd.productInfo">
|
||||
</div>
|
||||
</q-dialog>
|
||||
<q-dialog
|
||||
v-if="visufromgm"
|
||||
v-model="visufromgm"
|
||||
@hide="visufromgm = false"
|
||||
>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Visu </q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<q-spinner
|
||||
v-if="!endload"
|
||||
color="primary"
|
||||
size="3em"
|
||||
:thickness="2"
|
||||
/>
|
||||
|
||||
<div v-if="visufromgm && selProd">
|
||||
<CViewTable
|
||||
:options="{
|
||||
nameTable: 'T_Web_Articoli',
|
||||
campispeciali: true,
|
||||
numrec: 100,
|
||||
where: 'T.IdArticolo =' + selProd.productInfo.sku,
|
||||
showQtaDisponibile,
|
||||
outhtml: true,
|
||||
}"
|
||||
>
|
||||
</CViewTable>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog
|
||||
v-if="updatefromgm && selProd"
|
||||
v-model="updatefromgm"
|
||||
@hide="updatefromgm = false"
|
||||
>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Aggiorna da GM: </q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<q-inner-loading
|
||||
id="spinner"
|
||||
:showing="loading"
|
||||
>
|
||||
<q-spinner-tail
|
||||
color="primary"
|
||||
size="4em"
|
||||
>
|
||||
</q-spinner-tail>
|
||||
</q-inner-loading>
|
||||
<br />
|
||||
Valore: {{ field_updated_fromGM }}
|
||||
<br />
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CProductTable.ts"></script>
|
||||
|
||||
23
src/components/CSchedaProdotto/CSchedaProdotto.scss
Executable file
23
src/components/CSchedaProdotto/CSchedaProdotto.scss
Executable file
@@ -0,0 +1,23 @@
|
||||
.drag-handle {
|
||||
cursor: grab; /* Mostra la manina */
|
||||
}
|
||||
|
||||
.drag-handle:active {
|
||||
cursor: grabbing; /* Cambia la manina quando l'utente sta trascinando */
|
||||
}
|
||||
|
||||
.etichetta{
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
font-weight: bold;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.boxtitleval{
|
||||
padding: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
353
src/components/CSchedaProdotto/CSchedaProdotto.ts
Executable file
353
src/components/CSchedaProdotto/CSchedaProdotto.ts
Executable file
@@ -0,0 +1,353 @@
|
||||
import { PropType, computed, defineComponent, onMounted, ref, watch } from "vue";
|
||||
import draggable from 'vuedraggable'
|
||||
|
||||
import { tools } from '@tools'
|
||||
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
|
||||
import { CTableCupleLabelValue } from '@src/components/CTableCupleLabelValue'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
import type {
|
||||
IMyScheda,
|
||||
IProduct,
|
||||
IRecFields
|
||||
} from '@src/model';
|
||||
import { shared_consts } from "app/src/common/shared_vuejs";
|
||||
import { useProducts } from "app/src/store/Products";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: "CSchedaProdotto",
|
||||
emits: [],
|
||||
components: {
|
||||
CTableCupleLabelValue
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Object as PropType<IProduct>,
|
||||
required: true,
|
||||
},
|
||||
scheda: {
|
||||
type: Object as PropType<IMyScheda>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
|
||||
}),
|
||||
},
|
||||
updateproductmodif: {
|
||||
type: Function as PropType<(element: any) => void>,
|
||||
required: false,
|
||||
default: () => () => { },
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
// Copia locale della lista_prodotti per manipolazione interna
|
||||
const { t } = useI18n()
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
const products = useProducts()
|
||||
|
||||
const mytab = ref('scheda')
|
||||
|
||||
const myproduct = ref<IProduct>({ ...props.modelValue })
|
||||
|
||||
watch(() => props.modelValue, (newVal) => {
|
||||
myproduct.value = { ...newVal };
|
||||
}, { deep: false });
|
||||
|
||||
|
||||
async function mounted() {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// Aggiorna la copia locale quando il prop cambia
|
||||
watch(
|
||||
() => props.lista_prodotti,
|
||||
(newVal) => {
|
||||
internalProducts.value = [...newVal];
|
||||
}
|
||||
);
|
||||
*/
|
||||
|
||||
function getArrListStat(): IRecFields[] {
|
||||
const arrlist: IRecFields[] = [
|
||||
{
|
||||
editOn: false,
|
||||
label: "Fatturati",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "totFat",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Fatturati ultimi 3 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "fatLast3M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Venduti",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "totVen",
|
||||
debounce: "1000", type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Venduti Ultimi 3 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "vLast3M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Venduti Ultimi 6 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "vLast6M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Venduti Ultimo Anno",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "vLastY",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
|
||||
// SEZIONE RANKING (FATTURATI)
|
||||
{
|
||||
editOn: false,
|
||||
label: "Ranking 3 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "rank3M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Ranking 6 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "rank6M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Ranking 1 Anno",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "rank1Y",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
];
|
||||
return arrlist
|
||||
}
|
||||
|
||||
function getArrListDescrizioni(): IRecFields[] {
|
||||
const arrlist: IRecFields[] = [
|
||||
{
|
||||
editOn: true,
|
||||
label: "Descrizione breve macro",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "descrizione_breve_macro",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Descrizione Trafiletto per Catalogo",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "descr_trafiletto_catalogo",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Descrizione Estesa",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "descrizione_completa_macro",
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength ? props.scheda?.testo_bottom?.maxlength : 10000,
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Link a gruppomacro.com",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "link_macro",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
]
|
||||
|
||||
return arrlist
|
||||
|
||||
}
|
||||
|
||||
function getArrListScheda(): IRecFields[] {
|
||||
const arrlist: IRecFields[] = [
|
||||
{
|
||||
editOn: true,
|
||||
label: "Titolo",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: "name",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "SottoTitolo",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "sottotitolo",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Pubblicazione",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "date_pub",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.onlydate,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Pagine",
|
||||
table: "arrvariazioni",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "pagine",
|
||||
debounce: "0",
|
||||
|
||||
type: costanti.FieldType.number,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Misure",
|
||||
table: "arrvariazioni",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "misure",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Formato",
|
||||
table: "arrvariazioni",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "formato",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.string,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Prezzo",
|
||||
table: "arrvariazioni",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "price",
|
||||
debounce: "0",
|
||||
|
||||
type: costanti.FieldType.number,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Prezzo Scontato",
|
||||
table: "arrvariazioni",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "sale_price",
|
||||
debounce: "0",
|
||||
|
||||
type: costanti.FieldType.number,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Magazzino",
|
||||
table: "arrvariazioni",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "quantita",
|
||||
debounce: "0",
|
||||
|
||||
type: costanti.FieldType.number,
|
||||
dense: true,
|
||||
},
|
||||
]
|
||||
|
||||
return arrlist
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
globalStore,
|
||||
costanti,
|
||||
shared_consts,
|
||||
t,
|
||||
products,
|
||||
getArrListScheda,
|
||||
getArrListDescrizioni,
|
||||
getArrListStat,
|
||||
mytab,
|
||||
myproduct,
|
||||
}
|
||||
}
|
||||
})
|
||||
68
src/components/CSchedaProdotto/CSchedaProdotto.vue
Executable file
68
src/components/CSchedaProdotto/CSchedaProdotto.vue
Executable file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Modifica a {{ myproduct.productInfo.name }}</q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<q-tabs
|
||||
v-model="mytab"
|
||||
inline-label
|
||||
class="text-blue shadow-2"
|
||||
>
|
||||
<q-tab
|
||||
label="Scheda"
|
||||
name="scheda"
|
||||
icon="fas fa-file-alt"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
label="Descrizioni"
|
||||
name="descr"
|
||||
icon="fas fa-align-left"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
label="Statistiche"
|
||||
name="stat"
|
||||
icon="fas fa-stats"
|
||||
></q-tab>
|
||||
</q-tabs>
|
||||
<q-tab-panels
|
||||
v-model="mytab"
|
||||
animated
|
||||
>
|
||||
<q-tab-panel name="scheda">
|
||||
<CTableCupleLabelValue
|
||||
:list="getArrListScheda()"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
>
|
||||
</CTableCupleLabelValue>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="descr">
|
||||
<CTableCupleLabelValue
|
||||
:list="getArrListDescrizioni()"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
>
|
||||
</CTableCupleLabelValue>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="stat">
|
||||
<CTableCupleLabelValue
|
||||
:list="getArrListStat()"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
>
|
||||
</CTableCupleLabelValue>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CSchedaProdotto.ts"></script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CSchedaProdotto.scss';
|
||||
</style>
|
||||
1
src/components/CSchedaProdotto/index.ts
Executable file
1
src/components/CSchedaProdotto/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CSchedaProdotto } from './CSchedaProdotto.vue'
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount, nextTick } from 'vue'
|
||||
import { defineComponent, onMounted, ref, watch, computed} from 'vue'
|
||||
import { tools } from '@tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -17,18 +17,17 @@ import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import type {
|
||||
IOptCatalogo, IDimensioni, IFilterCatalogo,
|
||||
IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog, IImg
|
||||
IOptCatalogo,
|
||||
IProduct, ISearchList
|
||||
} from 'model';
|
||||
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { useCatalogStore } from '@src/store/CatalogStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSearchProduct',
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
|
||||
emits: [],
|
||||
emits: ['insert', 'close', 'updateproductmodif'],
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Object as PropType<IOptCatalogo>,
|
||||
@@ -40,11 +39,21 @@ export default defineComponent({
|
||||
required: false,
|
||||
default : '',
|
||||
},
|
||||
empty: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
nameLinkTemplate: {
|
||||
type: String,
|
||||
required: false,
|
||||
default : '',
|
||||
},
|
||||
visu: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: shared_consts.VISU_SEARCHPROD_MODE.VISU,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const userStore = useUserStore()
|
||||
@@ -55,6 +64,7 @@ export default defineComponent({
|
||||
const { t } = useI18n()
|
||||
|
||||
const search = ref('')
|
||||
const focus = ref(false)
|
||||
|
||||
const loadpage = ref(false)
|
||||
const refreshpage = ref(false)
|
||||
@@ -99,6 +109,12 @@ export default defineComponent({
|
||||
console.log('searchText=', searchText.value)
|
||||
const id = getSearchId()
|
||||
loadProduct(id)
|
||||
|
||||
})
|
||||
watch(() => myproduct.value, (newval, oldval) => {
|
||||
console.log('myproduct', myproduct.value)
|
||||
// loadProduct(myproduct.value._id)
|
||||
updateproductmodif(myproduct.value)
|
||||
})
|
||||
|
||||
async function loadProduct(id: string) {
|
||||
@@ -110,9 +126,14 @@ export default defineComponent({
|
||||
myproduct.value = null
|
||||
}
|
||||
|
||||
saveSearch()
|
||||
|
||||
console.log('myproduct.value', myproduct.value)
|
||||
|
||||
if (!props.idprodtoshow) {
|
||||
}
|
||||
|
||||
function saveSearch() {
|
||||
if (!props.idprodtoshow && !props.empty) {
|
||||
if (myproduct.value) {
|
||||
tools.setCookie(tools.COOK_LAST_PROD_SEARCH, myproduct.value._id.toString())
|
||||
} else {
|
||||
@@ -120,6 +141,9 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
if (!myproduct.value) {
|
||||
tools.setCookie(tools.COOK_LAST_PROD_SEARCH, '')
|
||||
}
|
||||
}
|
||||
|
||||
function resetSearch() {
|
||||
@@ -137,7 +161,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function populateDataWithlinkIdTemplate() {
|
||||
console.log('populateDataWithlinkIdTemplate')
|
||||
// console.log('populateDataWithlinkIdTemplate')
|
||||
|
||||
if (optcatalogo.value) {
|
||||
|
||||
@@ -174,12 +198,16 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
const id = props.idprodtoshow || tools.getCookie(tools.COOK_LAST_PROD_SEARCH, '')
|
||||
const id = props.idprodtoshow || (!props.empty ? tools.getCookie(tools.COOK_LAST_PROD_SEARCH, '') : '')
|
||||
|
||||
if (props.nameLinkTemplate) {
|
||||
populateDataWithlinkIdTemplate()
|
||||
}
|
||||
|
||||
if (props.visu === shared_consts.VISU_SEARCHPROD_MODE.INSERT) {
|
||||
focus.value = true
|
||||
}
|
||||
|
||||
loadpage.value = false
|
||||
|
||||
if (id) {
|
||||
@@ -216,15 +244,30 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function collabel (rec: any) {
|
||||
console.log('Record:', rec)
|
||||
// console.log('Record:', rec)
|
||||
let label = ''
|
||||
if (rec && rec.productInfo) {
|
||||
label = `${rec.productInfo.name} - ${rec.productInfo.authors.map((a: any) => a.name + ' ' + a.surname).join(', ')}`
|
||||
console.log('Computed label:', label)
|
||||
// console.log('Computed label:', label)
|
||||
}
|
||||
return label
|
||||
}
|
||||
|
||||
function insertProd() {
|
||||
// console.log('insertProd')
|
||||
emit('insert', myproduct.value)
|
||||
}
|
||||
|
||||
function clickClose() {
|
||||
searchList.value[0].value = ''
|
||||
myproduct.value = null
|
||||
emit('close')
|
||||
}
|
||||
|
||||
function updateproductmodif(element: IProduct) {
|
||||
emit('updateproductmodif', element)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -250,6 +293,11 @@ export default defineComponent({
|
||||
valoriopt,
|
||||
labelcombo,
|
||||
searchText,
|
||||
insertProd,
|
||||
focus,
|
||||
clickClose,
|
||||
saveSearch,
|
||||
updateproductmodif,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
v-model:value="item.value"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:focus="focus"
|
||||
:addlast="true"
|
||||
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
@@ -37,7 +38,7 @@
|
||||
:filter="item.filter"
|
||||
:filter_extra="item.filter_extra"
|
||||
:useinput="item.useinput && item.type !== costanti.FieldType.select_by_server"
|
||||
@clear="item.value = ''"
|
||||
@clear="item.value = ''; myproduct = null; saveSearch()"
|
||||
>
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -45,7 +46,7 @@
|
||||
<div
|
||||
v-if="myproduct?._id"
|
||||
class="row justify-center"
|
||||
style="text-align: center;"
|
||||
style="text-align: center"
|
||||
>
|
||||
<CContainerCatalogoCard
|
||||
:id="myproduct._id"
|
||||
@@ -59,9 +60,33 @@
|
||||
}"
|
||||
@selauthor="selauthor"
|
||||
:scheda="optcatalogo.arrSchede[0].scheda"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column text-center">
|
||||
<div class="row justify-center q-ma-md">
|
||||
<div v-if="visu === shared_consts.VISU_SEARCHPROD_MODE.INSERT">
|
||||
<q-btn
|
||||
rounded
|
||||
class="q-ma-sm"
|
||||
color="secondary"
|
||||
icon="fas fa-plus"
|
||||
label="Inserisci"
|
||||
@click="insertProd"
|
||||
></q-btn>
|
||||
<!-- Button Close window -->
|
||||
<q-btn
|
||||
rounded
|
||||
class="q-ma-sm"
|
||||
color="primary"
|
||||
icon="fas fa-times-circle"
|
||||
label="Chiudi"
|
||||
@click="clickClose"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
51
src/components/CTableCupleLabelValue/CTableCupleLabelValue.scss
Executable file
51
src/components/CTableCupleLabelValue/CTableCupleLabelValue.scss
Executable file
@@ -0,0 +1,51 @@
|
||||
/* Stile generale del contenitore */
|
||||
.table-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
max-width: 800px; /* Limita la larghezza per schermi grandi */
|
||||
margin: 0 auto; /* Centra il contenuto */
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Stile delle righe della tabella */
|
||||
.table-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
/* Ultima riga senza bordo inferiore */
|
||||
.table-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* Stile delle celle */
|
||||
.table-cell {
|
||||
flex: 1;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* Stile specifico per la colonna delle etichette */
|
||||
.label-cell {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: left;
|
||||
min-width: 150px; /* Larghezza fissa per le etichette */
|
||||
}
|
||||
|
||||
/* Stile specifico per la colonna dei valori */
|
||||
.value-cell {
|
||||
flex: 2;
|
||||
text-align: left;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/* Hover su una riga */
|
||||
.table-row:hover {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
52
src/components/CTableCupleLabelValue/CTableCupleLabelValue.ts
Executable file
52
src/components/CTableCupleLabelValue/CTableCupleLabelValue.ts
Executable file
@@ -0,0 +1,52 @@
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, onMounted, ref, watch } from 'vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { tools } from '@tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { CMyValueDb } from '@src/components/CMyValueDb'
|
||||
import { IProduct, IRecFields } from 'app/src/model';
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CTableCupleLabelValue',
|
||||
emits: ['updateproductmodif'],
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
list: {
|
||||
type: Array as PropType<IRecFields[]>,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
components: { CMyValueDb },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
function mounted() {
|
||||
|
||||
}
|
||||
|
||||
function updateproductmodif(element: any) {
|
||||
emit('updateproductmodif', element)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
fieldsTable,
|
||||
globalStore,
|
||||
updateproductmodif,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
36
src/components/CTableCupleLabelValue/CTableCupleLabelValue.vue
Executable file
36
src/components/CTableCupleLabelValue/CTableCupleLabelValue.vue
Executable file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="table-container">
|
||||
<div
|
||||
v-for="(myrec, index) in list"
|
||||
:key="index"
|
||||
class="table-row"
|
||||
>
|
||||
<!-- Colonna Sinistra: Etichetta -->
|
||||
<div class="table-cell label-cell">
|
||||
{{ myrec.label }}
|
||||
</div>
|
||||
|
||||
<!-- Colonna Destra: Valore (CMyValueDb) -->
|
||||
<div class="table-cell value-cell">
|
||||
<CMyValueDb
|
||||
:editOn="myrec.editOn"
|
||||
:table="myrec.table"
|
||||
:id="myrec.id"
|
||||
:rec="myrec.rec"
|
||||
:mykey="myrec.mykey"
|
||||
:debounce="myrec.debounce"
|
||||
:maxlength="myrec.maxlength"
|
||||
:type="myrec.type"
|
||||
:dense="myrec.dense ? myrec.dense : true"
|
||||
@save="updateproductmodif"
|
||||
></CMyValueDb>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CTableCupleLabelValue.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CTableCupleLabelValue.scss';
|
||||
</style>
|
||||
1
src/components/CTableCupleLabelValue/index.ts
Executable file
1
src/components/CTableCupleLabelValue/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CTableCupleLabelValue} from './CTableCupleLabelValue.vue'
|
||||
@@ -818,6 +818,19 @@ export interface IMyScheda {
|
||||
|
||||
}
|
||||
|
||||
export interface IRecFields {
|
||||
editOn?: boolean
|
||||
label?: string
|
||||
table?: string
|
||||
id?: string
|
||||
rec?: any
|
||||
mykey?: string
|
||||
debounce?: string
|
||||
type?: number
|
||||
dense?: boolean
|
||||
maxlength?: number
|
||||
}
|
||||
|
||||
export interface ISchedaSingola {
|
||||
_id?: string
|
||||
scheda?: IMyScheda,
|
||||
|
||||
@@ -64,6 +64,7 @@ export interface IProductInfo {
|
||||
|
||||
descrizione_breve_macro?: string,
|
||||
descrizione_completa_macro?: string,
|
||||
descr_trafiletto_catalogo?: string,
|
||||
sottotitolo?: string,
|
||||
link_macro?: string,
|
||||
}
|
||||
|
||||
@@ -2010,6 +2010,7 @@ const msg_it = {
|
||||
prezzo_scontato: '{prezzo_scontato}',
|
||||
descrizione_completa_macro: '{descrizione_completa_macro}',
|
||||
descrizione_breve_macro: '{descrizione_breve_macro}',
|
||||
descr_trafiletto_catalogo: '{descr_trafiletto_catalogo}',
|
||||
link_macro: '{link_macro}',
|
||||
totVen: 'Totale Venduti',
|
||||
totFat: 'Totale Fatturati',
|
||||
@@ -2022,6 +2023,7 @@ const msg_it = {
|
||||
},
|
||||
|
||||
cataloglist: {
|
||||
numprodotti: 'Libri presenti',
|
||||
foto_collana: 'Foto Catalogo',
|
||||
referenti: 'Editori',
|
||||
img_bordata: 'Immagine di sfondo',
|
||||
|
||||
@@ -2244,11 +2244,15 @@ export const tools = {
|
||||
},
|
||||
|
||||
strToObj(mystr: string): any {
|
||||
try {
|
||||
if (mystr) {
|
||||
mystr = decodeURIComponent(mystr)
|
||||
return JSON.parse(mystr)
|
||||
} else
|
||||
return null
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
||||
objToStr(myobj: any): string {
|
||||
@@ -9839,7 +9843,20 @@ export const tools = {
|
||||
const url = import.meta.env.VITE_APP_URL
|
||||
const protocol = url.startsWith('http://') ? 'http://' : url.startsWith('https://') ? 'https://' : ''
|
||||
return protocol
|
||||
}
|
||||
},
|
||||
|
||||
isRisoApp() {
|
||||
return this.appid() === tools.IDAPP_RISO
|
||||
},
|
||||
|
||||
isValueNotEmpty(value: any) {
|
||||
// Verifica se `value` è un oggetto non vuoto o un valore valido
|
||||
return (
|
||||
value !== null &&
|
||||
typeof value === "object" &&
|
||||
Object.keys(value).length > 0
|
||||
);
|
||||
},
|
||||
|
||||
// FINE !
|
||||
|
||||
|
||||
@@ -549,12 +549,19 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
async getProductById(id: string): Promise<IProduct> {
|
||||
let prod = null
|
||||
try {
|
||||
if (!id) {
|
||||
return null
|
||||
}
|
||||
if (!this.products) {
|
||||
// Se non lo carico all'avvio, allora fai la chiamata al server
|
||||
prod = await this.loadProductById(id)
|
||||
} else {
|
||||
prod = this.products.find((prod: IProduct) => prod._id === id)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Err', e)
|
||||
}
|
||||
|
||||
return prod ? prod : getRecordProductEmpty()
|
||||
},
|
||||
@@ -1419,6 +1426,7 @@ export const useProducts = defineStore('Products', {
|
||||
descrizione_completa_macro += addstrcontinua
|
||||
}
|
||||
|
||||
const descr_trafiletto_catalogo = myproduct.productInfo.descr_trafiletto_catalogo || '';
|
||||
const short_descr = myproduct.productInfo.descrizione_breve_macro || '';
|
||||
const descrizione_breve_macro = short_descr.length > maxDescriptionLength
|
||||
? short_descr.substring(0, short_descr.lastIndexOf(' ', maxDescriptionLength)) + '...'
|
||||
@@ -1468,6 +1476,7 @@ export const useProducts = defineStore('Products', {
|
||||
'{prezzo_scontato}': prezzo_scontato || '',
|
||||
'{descrizione_completa_macro}': descrizione_completa_macro || '',
|
||||
'{descrizione_breve_macro}': descrizione_breve_macro || '',
|
||||
'{descr_trafiletto_catalogo}': descr_trafiletto_catalogo || '',
|
||||
'{link_macro}': link_macro || '',
|
||||
'{qta}': qta || '',
|
||||
'{image_link}': image_link || '',
|
||||
|
||||
@@ -94,8 +94,11 @@ body {
|
||||
.book-details {
|
||||
font-family: 'DINPro-Condensed-Regular', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(16 * var(--scalecatalog) * 1px);
|
||||
text-align: left !important;
|
||||
&.big {
|
||||
font-size: calc(22 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,10 @@ import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { CProductCard } from '@src/components/CProductCard'
|
||||
|
||||
import { CMyDialog } from '@src/components/CMyDialog'
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CProductTable } from '@src/components/CProductTable'
|
||||
import { CSearchProduct } from '@src/components/CSearchProduct'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import type {
|
||||
@@ -34,7 +36,10 @@ import { Catalogo } from '.';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Catalogo',
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect, CProductTable },
|
||||
components: {
|
||||
CContainerCatalogoCard, CProductCard,
|
||||
CSelectUserActive, CMySelect, CProductTable, CSearchProduct, CMyDialog,
|
||||
},
|
||||
emits: ['update:modelValue', 'updateCatalogo'],
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -59,6 +64,7 @@ export default defineComponent({
|
||||
const optauthors = ref(<any>[])
|
||||
|
||||
const pdfContent = ref(null);
|
||||
const addnewProd = ref(false)
|
||||
|
||||
const optcatalogo = ref(<IOptCatalogo>{ ...props.modelValue });
|
||||
|
||||
@@ -601,8 +607,8 @@ export default defineComponent({
|
||||
let risposta_si = false
|
||||
|
||||
$q.dialog({
|
||||
title: 'Genera catalogo',
|
||||
message: 'Sei sicuro di rigenerare il catalogo?',
|
||||
title: 'Rigenera lista',
|
||||
message: 'Sicuri di rigenerare questa lista di libri, perdendo l\'ordinamento attuale ?',
|
||||
cancel: true,
|
||||
persistent: true
|
||||
}).onOk(() => {
|
||||
@@ -1225,6 +1231,29 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function addProductToList(element: IProduct) {
|
||||
// console.log('addProductToList', element)
|
||||
|
||||
if (element) {
|
||||
// add this record to lista_prodotti
|
||||
if (getCatalogoByMyPage.value && !getCatalogoByMyPage.value.lista_prodotti.some((p) => p._id === element._id)) {
|
||||
// inserire il record in cima
|
||||
const arr = getCatalogoByMyPage.value.lista_prodotti
|
||||
arr.unshift(element)
|
||||
|
||||
updateProducts(arr)
|
||||
|
||||
addnewProd.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function clickaddNewBook() {
|
||||
addnewProd.value = true
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -1284,6 +1313,9 @@ export default defineComponent({
|
||||
generaListaLibri,
|
||||
lista_prodotti,
|
||||
updateProducts,
|
||||
clickaddNewBook,
|
||||
addProductToList,
|
||||
addnewProd,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -64,14 +64,23 @@
|
||||
>
|
||||
<q-btn
|
||||
rounded
|
||||
label="Rigenera Lista Libri"
|
||||
label="Rigenera Ordinamento Libri"
|
||||
color="primary"
|
||||
@click="generaListaLibri()"
|
||||
></q-btn>
|
||||
|
||||
<q-btn
|
||||
rounded
|
||||
label="Aggiungi"
|
||||
icon="fas fa-plus"
|
||||
color="primary"
|
||||
@click="clickaddNewBook()"
|
||||
></q-btn>
|
||||
|
||||
<CProductTable
|
||||
:lista_prodotti="lista_prodotti"
|
||||
@update:lista_prodotti="updateProducts"
|
||||
:optcatalogo="optcatalogo"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
@@ -638,6 +647,21 @@
|
||||
|
||||
<!--<div ref="pdfContent" class="pdf-content">-->
|
||||
</q-page>
|
||||
|
||||
<CMyDialog
|
||||
v-model="addnewProd"
|
||||
title="Aggiungi"
|
||||
class="q-ma-md"
|
||||
>
|
||||
<CSearchProduct
|
||||
:visu="shared_consts.VISU_SEARCHPROD_MODE.INSERT"
|
||||
@insert="addProductToList"
|
||||
@close="addnewProd = false"
|
||||
nameLinkTemplate="SEARCH_Prima"
|
||||
:empty="true"
|
||||
>
|
||||
</CSearchProduct>
|
||||
</CMyDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./catalogo.ts"></script>
|
||||
|
||||
@@ -89,7 +89,7 @@ export default defineComponent({
|
||||
const listgroupsfiltered = ref(<IMyGroup[]>[])
|
||||
const listcircuitsfiltered = ref(<IMyCircuit[]>[])
|
||||
|
||||
const tab = ref('attivita')
|
||||
const tab = ref('')
|
||||
|
||||
function profile() {
|
||||
return userStore.my.profile
|
||||
@@ -150,6 +150,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
tab.value = tools.isRisoApp() ? 'attivita' : 'info'
|
||||
loadProfile()
|
||||
}
|
||||
|
||||
|
||||
@@ -666,6 +666,7 @@
|
||||
>
|
||||
<q-tab
|
||||
name="attivita"
|
||||
v-if="tools.isRisoApp()"
|
||||
:label="t('profile.annunci')"
|
||||
icon="fas fa-pencil-alt"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user