- aggiornato scheda e rigenera lista
- corretto filtro sulla Collana
This commit is contained in:
@@ -20,6 +20,11 @@ export default defineComponent({
|
|||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
|
dense: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
optlab: {
|
optlab: {
|
||||||
type: [String, Function],
|
type: [String, Function],
|
||||||
required: true,
|
required: true,
|
||||||
@@ -53,6 +58,11 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {},
|
components: {},
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="row clchip">
|
<div class="row clchip">
|
||||||
<div v-for="(rec, index) in myarrvalues" :key="index">
|
<div v-for="(rec, index) in myarrvalues" :key="index" class="row items-center no-wrap">
|
||||||
|
<div class="text-caption text-weight-bold q-mr-sm">{{ label }}</div>
|
||||||
<q-chip
|
<q-chip
|
||||||
v-if="rec.icon"
|
:dense="dense"
|
||||||
dense
|
class="clchip shadow-2"
|
||||||
:color="rec.color"
|
:color="rec.color"
|
||||||
text-color="white"
|
text-color="white"
|
||||||
:icon="rec.icon">
|
:icon="rec.icon"
|
||||||
{{ rec.label }}
|
:style="`border-radius: 10px;`"
|
||||||
</q-chip>
|
>
|
||||||
<q-chip
|
|
||||||
dense
|
|
||||||
:color="rec.color"
|
|
||||||
text-color="white">
|
|
||||||
{{ rec.label }}
|
{{ rec.label }}
|
||||||
</q-chip>
|
</q-chip>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,16 @@
|
|||||||
(!myel.active ? ` clEditNotActive` : ``)
|
(!myel.active ? ` clEditNotActive` : ``)
|
||||||
">
|
">
|
||||||
<div v-if="myel.type">
|
<div v-if="myel.type">
|
||||||
<q-btn v-if="editOn" rounded dense icon="fas fa-pencil-alt" @click="clickOnElem">
|
<q-btn
|
||||||
|
v-if="editOn"
|
||||||
|
class="btn-edit-floating"
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
size="sm"
|
||||||
|
color="primary"
|
||||||
|
icon="fas fa-pencil-alt"
|
||||||
|
@click="clickOnElem"
|
||||||
|
>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<div v-if="myel.type === shared_consts.ELEMTYPE.TEXT">
|
<div v-if="myel.type === shared_consts.ELEMTYPE.TEXT">
|
||||||
<transition appear enter-active-class="animated fadeIn" leave-active-class="animated fadeOut">
|
<transition appear enter-active-class="animated fadeIn" leave-active-class="animated fadeOut">
|
||||||
@@ -333,7 +342,6 @@
|
|||||||
:prop_modif="myel.parambool4"></CGridOriz>
|
:prop_modif="myel.parambool4"></CGridOriz>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.SEARCHPRODUCT">
|
<div v-else-if="myel.type === shared_consts.ELEMTYPE.SEARCHPRODUCT">
|
||||||
<div v-if="editOn" class="elemEdit">Cerca Prodotto</div>
|
|
||||||
<CSearchProduct v-model="myel.catalogo">
|
<CSearchProduct v-model="myel.catalogo">
|
||||||
</CSearchProduct>
|
</CSearchProduct>
|
||||||
</div>
|
</div>
|
||||||
@@ -430,7 +438,6 @@
|
|||||||
<CECommerce></CECommerce>
|
<CECommerce></CECommerce>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CATALOGO">
|
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CATALOGO">
|
||||||
<div v-if="editOn" class="elemEdit">PRODOTTI CATALOGO:</div>
|
|
||||||
<CCatalogo v-model="myel.catalogo" :idPage="idPage" @updateCatalogo="updateCatalogoEmit(myel.catalogo)" />
|
<CCatalogo v-model="myel.catalogo" :idPage="idPage" @updateCatalogo="updateCatalogoEmit(myel.catalogo)" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.MAPPA">
|
<div v-else-if="myel.type === shared_consts.ELEMTYPE.MAPPA">
|
||||||
|
|||||||
@@ -73,8 +73,9 @@ export default defineComponent({
|
|||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
mycol: {
|
mycol: {
|
||||||
type: Object as PropType<IColGridTable | undefined>,
|
type: Object as PropType<IColGridTable | undefined | null>,
|
||||||
required: true,
|
required: false,
|
||||||
|
default: undefined,
|
||||||
},
|
},
|
||||||
canEdit: {
|
canEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -485,7 +486,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
myrow.value = props.rec && props.isrec ? { ...props.rec } : { ...props.row }
|
myrow.value = props.rec && props.isrec ? { ...props.rec } : { ...props.row }
|
||||||
|
|
||||||
console.log('myrow', myrow.value?.arrvariazioni?.[0])
|
// console.log('myrow', myrow.value?.arrvariazioni?.[0])
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
dark
|
dark
|
||||||
color="green"
|
color="green"
|
||||||
v-model="myvalue"
|
v-model="myvalue"
|
||||||
:label="col.title ? col.title : col.label"
|
:label="title ? title : col.label"
|
||||||
@update:model-value="changevalRec"
|
@update:model-value="changevalRec"
|
||||||
></q-toggle>
|
></q-toggle>
|
||||||
</div>
|
</div>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
dark
|
dark
|
||||||
color="green"
|
color="green"
|
||||||
v-model="myvalue"
|
v-model="myvalue"
|
||||||
:label="col.title"
|
:label="title"
|
||||||
:disable="
|
:disable="
|
||||||
(disable && col.name !== 'profile.saw_zoom_presentation') || (!isInModif && !canModify && !canEdit)
|
(disable && col.name !== 'profile.saw_zoom_presentation') || (!isInModif && !canModify && !canEdit)
|
||||||
"
|
"
|
||||||
@@ -688,6 +688,7 @@
|
|||||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||||
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
||||||
|
:dense="dense"
|
||||||
></CMyChipList>
|
></CMyChipList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -700,7 +701,7 @@
|
|||||||
:row="row"
|
:row="row"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
:withToggle="true"
|
:withToggle="true"
|
||||||
:label="col.label ? col.label : t(col.label_trans)"
|
:label="col.label ? col.label : col?.label_trans ? t(col?.label_trans) : ''"
|
||||||
:filter_table="col.filter_table"
|
:filter_table="col.filter_table"
|
||||||
:filter_field="col.filter_field"
|
:filter_field="col.filter_field"
|
||||||
:value_extra="value_extra"
|
:value_extra="value_extra"
|
||||||
@@ -757,12 +758,14 @@
|
|||||||
:rec="row"
|
:rec="row"
|
||||||
:type="col.fieldtype"
|
:type="col.fieldtype"
|
||||||
:type_out="col.field_outtype"
|
:type_out="col.field_outtype"
|
||||||
|
:label="title"
|
||||||
@update:value="changevalRec"
|
@update:value="changevalRec"
|
||||||
:value="myvalue"
|
: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)"
|
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||||
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
||||||
|
:dense="dense"
|
||||||
></CMyChipList>
|
></CMyChipList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -846,6 +849,7 @@
|
|||||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||||
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
:opticon="fieldsTable.getIconByTable(col.jointable)"
|
||||||
|
:dense="dense"
|
||||||
></CMyChipList>
|
></CMyChipList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1009,7 +1013,7 @@
|
|||||||
<CMyEditor
|
<CMyEditor
|
||||||
v-if="visueditor"
|
v-if="visueditor"
|
||||||
v-model:value="myvalue"
|
v-model:value="myvalue"
|
||||||
:title="col.title"
|
:title="title"
|
||||||
@keyup.enter.stop
|
@keyup.enter.stop
|
||||||
:canModify="canModify"
|
:canModify="canModify"
|
||||||
@showandsave="Savedb"
|
@showandsave="Savedb"
|
||||||
@@ -1050,7 +1054,7 @@
|
|||||||
v-model="myvalue"
|
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"
|
:readonly="col.disable || disable"
|
||||||
:title="col.title ? col.title : col.titlepopupedit"
|
:title="title ? title : col.titlepopupedit"
|
||||||
buttons
|
buttons
|
||||||
:label-set="t('dialog.save')"
|
:label-set="t('dialog.save')"
|
||||||
:label-cancel="t('dialog.cancel')"
|
:label-cancel="t('dialog.cancel')"
|
||||||
@@ -1063,7 +1067,7 @@
|
|||||||
<div v-if="col.fieldtype === costanti.FieldType.boolean">
|
<div v-if="col.fieldtype === costanti.FieldType.boolean">
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
v-model="scope.value"
|
v-model="scope.value"
|
||||||
:label="col.title ? col.title : col.titlepopupedit"
|
:label="title ? title : col.titlepopupedit"
|
||||||
>
|
>
|
||||||
</q-checkbox>
|
</q-checkbox>
|
||||||
<span v-html="visuValByType(myvalue, col, row)"></span>
|
<span v-html="visuValByType(myvalue, col, row)"></span>
|
||||||
|
|||||||
@@ -345,9 +345,10 @@ export default defineComponent({
|
|||||||
} else if (selectPickup.value && props.pickup) {
|
} else if (selectPickup.value && props.pickup) {
|
||||||
selectPickup.value.focus()
|
selectPickup.value.focus()
|
||||||
} else if (selectMultiple.value && props.multiple) {
|
} else if (selectMultiple.value && props.multiple) {
|
||||||
selectMultiple.value.focus()
|
selectMultiple.value?.focus()
|
||||||
} else {
|
} else {
|
||||||
selectGeneric.value.focus()
|
if (selectGeneric.value)
|
||||||
|
selectGeneric.value?.focus()
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Err', e)
|
console.error('Err', e)
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
visulabel: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
hint: {
|
hint: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -118,7 +123,7 @@ export default defineComponent({
|
|||||||
type: Object as PropType<IColGridTable> | undefined,
|
type: Object as PropType<IColGridTable> | undefined,
|
||||||
required: false,
|
required: false,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {}
|
return null
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
:table="table"
|
:table="table"
|
||||||
:hint="title"
|
:hint="title"
|
||||||
:title="title"
|
:title="title"
|
||||||
|
:visulabel="visulabel"
|
||||||
:field="mykey"
|
:field="mykey"
|
||||||
:showall="showall"
|
:showall="showall"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
:canEdit="editOn"
|
:canEdit="editOn"
|
||||||
:id="id"
|
:id="id"
|
||||||
:idmain="idmain"
|
:idmain="idmain"
|
||||||
:mycol="col ? col : {}"
|
:mycol="col ? col : null"
|
||||||
:tablesel="tablesel"
|
:tablesel="tablesel"
|
||||||
:pickup="pickup"
|
:pickup="pickup"
|
||||||
v-model:row="row"
|
v-model:row="row"
|
||||||
|
|||||||
@@ -107,31 +107,193 @@ export default defineComponent({
|
|||||||
// Colonne della tabella
|
// Colonne della tabella
|
||||||
const allColumns = [
|
const allColumns = [
|
||||||
{ name: "pos", label: "Pos", field: "pos", align: "left", style: "width: 50px" },
|
{ name: "pos", label: "Pos", field: "pos", align: "left", style: "width: 50px" },
|
||||||
{ name: "drag", label: "Ordinam.", field: "", align: "left", style: "width: 50px" },
|
{ name: "drag", label: "Ordinam.", field: "", align: "left", style: "width: 50px", edit: true },
|
||||||
{ name: "image", label: "Foto", field: "image", align: "center" },
|
{ name: "image", label: "Foto", field: "image", align: "center" },
|
||||||
{ name: "name", label: "Titolo del Libro", field: "name", align: "left" },
|
{ name: "name", label: "Titolo del Libro", field: "name", align: "left" },
|
||||||
{ name: "authors", label: "Autore", field: "authors", align: "left" },
|
{ name: "authors", label: "Autore", field: "authors", align: "left" },
|
||||||
{ name: "isbn", label: "ISBN", field: "isbn", align: "left" },
|
{ name: "isbn", label: "ISBN", field: "isbn", align: "left" },
|
||||||
{ name: "trafiletto", label: "Trafiletto", field: "trafiletto", align: "left" },
|
{ name: "trafiletto", label: "Trafiletto", field: "trafiletto", align: "left" },
|
||||||
{ name: "catprods", label: "Argomento", field: "catprods", align: "left" },
|
{ name: "catprods", label: "Argomento", field: "catprods", align: "left" },
|
||||||
|
{ name: "edizione", label: "Edizione", field: "edizione", align: "left" },
|
||||||
|
{ name: "casaeditrice", label: "Casa Editrice", field: "casaeditrice", align: "left" },
|
||||||
{ name: "idCollana", label: "Collana", field: "idCollana", align: "left" },
|
{ name: "idCollana", label: "Collana", field: "idCollana", align: "left" },
|
||||||
{ name: "stato", label: "Stato", field: "stato", align: "left" },
|
{ name: "stato", label: "Stato", field: "stato", align: "left" },
|
||||||
{ name: "tipologia", label: "Tipologia", field: "tipologia", align: "left" },
|
{ name: "tipologia", label: "Tipologia", field: "tipologia", align: "left" },
|
||||||
{ name: "date_pub", label: "Pubblicato", field: "date_pub", align: "left" },
|
{ name: "date_pub", label: "Pubblicato", field: "date_pub", align: "left" },
|
||||||
{ name: "ranking", label: "Class.", field: "ranking", align: "right" },
|
//{ name: "ranking", label: "Class.", field: "ranking", align: "right" },
|
||||||
{ name: "rank3M", label: "Class. 3M", field: "rank3M", align: "right" },
|
//{ name: "rank3M", label: "Class. 3M", field: "rank3M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "rank6M", label: "Class. 6M", field: "rank6M", align: "right" },
|
//{ name: "rank6M", label: "Class. 6M", field: "rank6M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "rank1Y", label: "Class. 1Y", field: "rank1Y", align: "right" },
|
//{ name: "rank1Y", label: "Class. 1Y", field: "rank1Y", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "pagine", label: "Pag.", field: "pagine", align: "right" },
|
{ name: "pagine", label: "Pag.", field: "pagine", align: "right" },
|
||||||
{ name: "totVen", label: "Venduti", field: "totVen", align: "right" },
|
{ name: "totVen", label: "Venduti", field: "totVen", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "totFat", label: "Fattur.", field: "totFat", align: "right" },
|
{ name: "totFat", label: "Fattur.", field: "totFat", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "fatLast6M", label: "Fat 6M", field: "fatLast6M", align: "right" },
|
{ name: "fatLast6M", label: "Fat 6M", field: "fatLast6M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "fatLast1Y", label: "Fat Anno", field: "fatLast1Y", align: "right" },
|
{ name: "fatLast1Y", label: "Fat Anno", field: "fatLast1Y", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "ult_ord", label: "Ult. Ordine", field: "ult_ord", align: "left" },
|
{ name: "fatLast2Y", label: "Fat 2A", field: "fatLast2Y", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "quantity", label: "Magazz.", field: "quantity", align: "right" },
|
{ name: "ult_ord", label: "Ult. Ordine", field: "ult_ord", align: "left", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
{ name: "actions", label: "Azioni", field: "", align: "center" },
|
{ name: "quantity", label: "Magazz.", field: "quantity", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
|
{ name: "actions", label: "Azioni", field: "", align: "center", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function getFieldValue(element: any, field: any): any {
|
||||||
|
switch (field.field) {
|
||||||
|
case 'image':
|
||||||
|
return element.productInfo?.imagefile
|
||||||
|
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile)
|
||||||
|
: element.productInfo?.image_link;
|
||||||
|
|
||||||
|
case 'name':
|
||||||
|
return element.productInfo?.name;
|
||||||
|
|
||||||
|
case 'authors':
|
||||||
|
return formatAuthors(element.productInfo?.authors);
|
||||||
|
|
||||||
|
case 'isbn':
|
||||||
|
return element.isbn;
|
||||||
|
|
||||||
|
case 'trafiletto':
|
||||||
|
return element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'SI' : 'NO';
|
||||||
|
|
||||||
|
case 'catprods':
|
||||||
|
return tools.formatCatProds(element.productInfo?.catprods);
|
||||||
|
|
||||||
|
case 'edizione':
|
||||||
|
return element.arrvariazioni?.[0]?.edizione;
|
||||||
|
|
||||||
|
case 'casaeditrice':
|
||||||
|
return products.getCasaEditriceByIdPublisher(element.productInfo?.idPublisher);
|
||||||
|
|
||||||
|
case 'idCollana':
|
||||||
|
return tools.formatCollane(element.productInfo?.idCollana);
|
||||||
|
|
||||||
|
case 'stato':
|
||||||
|
return products.getDescrStatiProdottoByIdStatoProdotto(element.productInfo?.idStatoProdotto || '');
|
||||||
|
|
||||||
|
case 'tipologia':
|
||||||
|
return products.getDescrByIdTipologia(element.arrvariazioni?.[0]?.idTipologia || '');
|
||||||
|
|
||||||
|
case 'tipoformato':
|
||||||
|
return products.getDescrByIdTipoFormato(element.arrvariazioni?.[0]?.idTipoFormato || '');
|
||||||
|
|
||||||
|
case 'date_pub':
|
||||||
|
return tools.getstrDate(element.productInfo?.date_pub);
|
||||||
|
|
||||||
|
case 'rank3M':
|
||||||
|
return element.productInfo?.rank3M;
|
||||||
|
|
||||||
|
case 'rank6M':
|
||||||
|
return element.productInfo?.rank6M;
|
||||||
|
|
||||||
|
case 'rank1Y':
|
||||||
|
return element.productInfo?.rank1Y;
|
||||||
|
|
||||||
|
case 'pagine':
|
||||||
|
return element.arrvariazioni?.[0]?.pagine;
|
||||||
|
|
||||||
|
case 'totVen':
|
||||||
|
return element.productInfo?.totVen;
|
||||||
|
|
||||||
|
case 'totFat':
|
||||||
|
return element.productInfo?.totFat;
|
||||||
|
|
||||||
|
case 'fatLast6M':
|
||||||
|
return element.productInfo?.fatLast6M;
|
||||||
|
|
||||||
|
case 'fatLast1Y':
|
||||||
|
return element.productInfo?.fatLast1Y;
|
||||||
|
|
||||||
|
case 'ult_ord':
|
||||||
|
return tools.getstrDate(element.productInfo?.dataUltimoOrdine);
|
||||||
|
|
||||||
|
case 'quantity':
|
||||||
|
return element.arrvariazioni?.[0]?.quantita;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFieldClass(element: any, field: any): string {
|
||||||
|
switch (field.field) {
|
||||||
|
case 'trafiletto':
|
||||||
|
return element.productInfo?.descr_trafiletto_catalogo?.length > 100
|
||||||
|
? 'text-green'
|
||||||
|
: 'text-red';
|
||||||
|
|
||||||
|
case 'stato':
|
||||||
|
if (products.isProssimaUscita(element.productInfo)) {
|
||||||
|
return 'bg-purple-3';
|
||||||
|
}
|
||||||
|
if (products.isPrevendita(element.productInfo)) {
|
||||||
|
return 'bg-blue-3';
|
||||||
|
}
|
||||||
|
if (products.isNonVendibile(element.productInfo)) {
|
||||||
|
return 'bg-grey';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
|
||||||
|
case 'quantity':
|
||||||
|
if (products.isPubblicato(element.productInfo)) {
|
||||||
|
if (products.isQtaLimitata(element)) {
|
||||||
|
return 'bg-yellow';
|
||||||
|
}
|
||||||
|
if (products.isInEsaurendo(element)) {
|
||||||
|
return 'bg-orange';
|
||||||
|
}
|
||||||
|
if (products.isEsaurito(element)) {
|
||||||
|
return 'text-white bg-red-10';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
|
||||||
|
case 'rank3M':
|
||||||
|
case 'rank6M':
|
||||||
|
case 'rank1Y':
|
||||||
|
case 'pagine':
|
||||||
|
case 'totVen':
|
||||||
|
case 'totFat':
|
||||||
|
case 'fatLast6M':
|
||||||
|
case 'fatLast1Y':
|
||||||
|
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFieldStyle(element: any, field: any): Record<string, string> {
|
||||||
|
switch (field.field) {
|
||||||
|
case 'image':
|
||||||
|
return {
|
||||||
|
width: '50px',
|
||||||
|
height: '50px'
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'rank3M':
|
||||||
|
case 'rank6M':
|
||||||
|
case 'rank1Y':
|
||||||
|
case 'pagine':
|
||||||
|
case 'totVen':
|
||||||
|
case 'totFat':
|
||||||
|
case 'fatLast6M':
|
||||||
|
case 'fatLast1Y':
|
||||||
|
case 'quantity':
|
||||||
|
return {
|
||||||
|
textAlign: 'right'
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'trafiletto':
|
||||||
|
return {
|
||||||
|
textAlign: 'center'
|
||||||
|
};
|
||||||
|
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let cookieValue: [] | null = null;
|
let cookieValue: [] | null = null;
|
||||||
try {
|
try {
|
||||||
cookieValue = tools.getCookie("selColCat");
|
cookieValue = tools.getCookie("selColCat");
|
||||||
@@ -147,7 +309,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
// 3. Funzione per verificare se una colonna è visibile (isColumnVisible)
|
// 3. Funzione per verificare se una colonna è visibile (isColumnVisible)
|
||||||
const isColumnVisible = (column) => {
|
const isColumnVisible = (column) => {
|
||||||
return selectedColumns.value.includes(column);
|
const ok = allColumns.some((col) => col.name === column) && (!props.optcatalogo.showListaArgomenti || (props.optcatalogo.showListaArgomenti && !column.edit))
|
||||||
|
return selectedColumns.value.includes(column) && ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione per eliminare un prodotto
|
// Funzione per eliminare un prodotto
|
||||||
@@ -270,18 +433,18 @@ export default defineComponent({
|
|||||||
sortDirection.value = 1
|
sortDirection.value = 1
|
||||||
}
|
}
|
||||||
internalProducts.value = internalProducts.value.sort((a: any, b: any) => {
|
internalProducts.value = internalProducts.value.sort((a: any, b: any) => {
|
||||||
const aVal = a.productInfo?.[sortAttributeToSort] ?? ''
|
const aVal = getFieldValue(a, { field: sortAttributeToSort });
|
||||||
const bVal = b.productInfo?.[sortAttributeToSort] ?? ''
|
const bVal = getFieldValue(b, { field: sortAttributeToSort });
|
||||||
if (aVal instanceof Date && bVal instanceof Date) {
|
if (aVal instanceof Date && bVal instanceof Date) {
|
||||||
return sortDirection.value === 1 ? aVal.getTime() - bVal.getTime() : bVal.getTime() - aVal.getTime()
|
return sortDirection.value === 1 ? aVal.getTime() - bVal.getTime() : bVal.getTime() - aVal.getTime();
|
||||||
}
|
}
|
||||||
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
||||||
return sortDirection.value === 1 ? aVal - bVal : bVal - aVal
|
return sortDirection.value === 1 ? aVal - bVal : bVal - aVal;
|
||||||
}
|
}
|
||||||
if (typeof aVal === 'string' && typeof bVal === 'string') {
|
if (typeof aVal === 'string' && typeof bVal === 'string') {
|
||||||
return sortDirection.value === 1 ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal)
|
return sortDirection.value === 1 ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
||||||
}
|
}
|
||||||
return sortDirection.value === 1 ? String(aVal).localeCompare(String(bVal)) : String(bVal).localeCompare(String(aVal))
|
return sortDirection.value === 1 ? String(aVal).localeCompare(String(bVal)) : String(bVal).localeCompare(String(aVal));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,6 +453,34 @@ export default defineComponent({
|
|||||||
emit('rigenera')
|
emit('rigenera')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFieldClick(element: any, field: any): (() => void) | null {
|
||||||
|
switch (field.field) {
|
||||||
|
case 'image':
|
||||||
|
return () => showProduct(element);
|
||||||
|
|
||||||
|
case 'name':
|
||||||
|
case 'authors':
|
||||||
|
case 'isbn':
|
||||||
|
return () => showProduct(element);
|
||||||
|
|
||||||
|
case 'stato':
|
||||||
|
return () => {
|
||||||
|
// esempio: mostra dettagli dello stato
|
||||||
|
console.log('Stato prodotto:', element.productInfo?.idStatoProdotto);
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'quantity':
|
||||||
|
return () => {
|
||||||
|
// esempio: mostra log disponibilità
|
||||||
|
console.log('Quantità disponibile:', element.arrvariazioni?.[0]?.quantita);
|
||||||
|
};
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -324,6 +515,10 @@ export default defineComponent({
|
|||||||
sortTable,
|
sortTable,
|
||||||
sortAttribute,
|
sortAttribute,
|
||||||
sortDirection,
|
sortDirection,
|
||||||
|
getFieldValue,
|
||||||
|
getFieldClass,
|
||||||
|
getFieldStyle,
|
||||||
|
getFieldClick,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -60,176 +60,86 @@
|
|||||||
<tr
|
<tr
|
||||||
:key="element._id"
|
:key="element._id"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-grey-2': internalProducts.indexOf(element) % 2 === 1,
|
'bg-grey-3': internalProducts.indexOf(element) % 2 === 1,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<!-- Icona Drag Handle -->
|
<template
|
||||||
<td v-if="isColumnVisible('pos')">
|
v-for="field in allColumns"
|
||||||
{{
|
:key="field.name"
|
||||||
// put index in the first column
|
|
||||||
internalProducts.indexOf(element) + 1
|
|
||||||
}}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
v-if="isColumnVisible('drag')"
|
|
||||||
class="drag-handle"
|
|
||||||
>
|
>
|
||||||
<q-icon
|
<!-- Icona Drag Handle -->
|
||||||
name="drag_handle"
|
<td v-if="field.name === 'pos' && isColumnVisible('pos')">
|
||||||
size="32px"
|
{{
|
||||||
color="primary"
|
// put index in the first column
|
||||||
/>
|
internalProducts.indexOf(element) + 1
|
||||||
</td>
|
}}
|
||||||
|
</td>
|
||||||
<!-- Immagine Piccola -->
|
<td
|
||||||
<td v-if="isColumnVisible('image')">
|
v-else-if="field.name === 'drag' && isColumnVisible('drag')"
|
||||||
<q-img
|
class="drag-handle"
|
||||||
:src="
|
|
||||||
element.productInfo?.imagefile
|
|
||||||
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile)
|
|
||||||
: element.productInfo?.image_link
|
|
||||||
"
|
|
||||||
style="width: 50px; height: 50px"
|
|
||||||
class="rounded-borders cursor-pointer"
|
|
||||||
@click="showProduct(element)"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<!-- Titolo -->
|
|
||||||
<td v-if="isColumnVisible('name')">{{ element.productInfo?.name }}</td>
|
|
||||||
|
|
||||||
<!-- Autore -->
|
|
||||||
<td v-if="isColumnVisible('authors')">{{ formatAuthors(element.productInfo?.authors) }}</td>
|
|
||||||
|
|
||||||
<!-- ISBN -->
|
|
||||||
<td v-if="isColumnVisible('isbn')">{{ element.isbn }}</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')">{{ tools.formatCatProds(element.productInfo?.catprods) }}</td>
|
|
||||||
<!-- Collana -->
|
|
||||||
<td v-if="isColumnVisible('idCollana')">{{ tools.formatCollane(element.productInfo?.idCollana) }}</td>
|
|
||||||
<td
|
|
||||||
v-if="isColumnVisible('stato')"
|
|
||||||
:class="{
|
|
||||||
'bg-purple-3': products.isProssimaUscita(element.productInfo),
|
|
||||||
'bg-grey': products.isNonVendibile(element.productInfo),
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
{{ products.getDescrStatiProdottoByIdStatoProdotto(element.productInfo.idStatoProdotto || '') }}
|
|
||||||
</td>
|
|
||||||
<td v-if="isColumnVisible('tipologia')">
|
|
||||||
{{ products.getDescrByIdTipologia(element.arrvariazioni[0].idTipologia || '') }}
|
|
||||||
</td>
|
|
||||||
<td v-if="isColumnVisible('tipoformato')">
|
|
||||||
{{ products.getDescrByIdTipoFormato(element.arrvariazioni[0].idTipoFormato || '') }}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td v-if="isColumnVisible('date_pub')">{{ tools.getstrDate(element.productInfo?.date_pub) }}</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('fatLast6M')"
|
|
||||||
style="text-align: right"
|
|
||||||
>
|
|
||||||
{{ element.productInfo?.fatLast6M }}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
v-if="isColumnVisible('fatLast1Y')"
|
|
||||||
style="text-align: right"
|
|
||||||
>
|
|
||||||
{{ element.productInfo?.fatLast1Y }}
|
|
||||||
</td>
|
|
||||||
<td v-if="isColumnVisible('ult_ord')">{{ tools.getstrDate(element.productInfo?.dataUltimoOrdine) }}</td>
|
|
||||||
|
|
||||||
<!-- Quantità -->
|
|
||||||
<td
|
|
||||||
v-if="isColumnVisible('quantity')"
|
|
||||||
style="text-align: right"
|
|
||||||
:class="{
|
|
||||||
'bg-yellow': products.isPubblicato(element.productInfo) && products.isQtaLimitata(element),
|
|
||||||
'bg-orange': products.isPubblicato(element.productInfo) && products.isInEsaurendo(element),
|
|
||||||
'text-white bg-red-10': products.isPubblicato(element.productInfo) && products.isEsaurito(element),
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
{{ element.arrvariazioni[0].quantita }}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<!-- Azioni -->
|
|
||||||
<td v-if="isColumnVisible('actions')">
|
|
||||||
<q-btn-dropdown
|
|
||||||
label="Azioni"
|
|
||||||
color="primary"
|
|
||||||
flat
|
|
||||||
>
|
>
|
||||||
<q-list>
|
<q-icon
|
||||||
<q-item
|
name="drag_handle"
|
||||||
clickable
|
size="32px"
|
||||||
v-close-popup
|
color="primary"
|
||||||
@click="modifyProduct(element)"
|
/>
|
||||||
>
|
</td>
|
||||||
<q-item-section>
|
|
||||||
<q-item-label>Modifica</q-item-label>
|
<!-- Immagine Piccola -->
|
||||||
</q-item-section>
|
<td v-else-if="field.name === 'image' && isColumnVisible('image')">
|
||||||
</q-item>
|
<q-img
|
||||||
<q-item
|
:src="
|
||||||
clickable
|
element.productInfo?.imagefile
|
||||||
v-close-popup
|
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile)
|
||||||
@click="removeProduct(element)"
|
: element.productInfo?.image_link
|
||||||
>
|
"
|
||||||
<q-item-section>
|
style="width: 50px; height: 50px"
|
||||||
<q-item-label>Elimina</q-item-label>
|
class="rounded-borders cursor-pointer"
|
||||||
</q-item-section>
|
@click="showProduct(element)"
|
||||||
</q-item>
|
/>
|
||||||
</q-list>
|
</td>
|
||||||
</q-btn-dropdown>
|
|
||||||
</td>
|
<td
|
||||||
</tr>
|
v-else-if="isColumnVisible(field.name)"
|
||||||
</template>
|
:class="getFieldClass(element, field)"
|
||||||
|
:style="getFieldStyle(element, field)"
|
||||||
|
@click="getFieldClick(element, field)?.()"
|
||||||
|
>
|
||||||
|
{{ getFieldValue(element, field) }}
|
||||||
|
</td>
|
||||||
|
<!-- Azioni -->
|
||||||
|
<td v-else-if="field.name === 'actions' && isColumnVisible('actions')">
|
||||||
|
<q-btn-dropdown
|
||||||
|
label="Azioni"
|
||||||
|
color="primary"
|
||||||
|
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
|
||||||
|
@click="removeProduct(element)"
|
||||||
|
>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label>Elimina</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-btn-dropdown>
|
||||||
|
</td>
|
||||||
|
</template>
|
||||||
|
</tr></template
|
||||||
|
>
|
||||||
|
>
|
||||||
</draggable>
|
</draggable>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -242,15 +242,25 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function naviga(path: string) {
|
function naviga(path: string) {
|
||||||
router.push(path)
|
router.push(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
function collabel(rec: any) {
|
function collabel(rec: any) {
|
||||||
// console.log('Record:', rec)
|
console.log('Record:', rec)
|
||||||
let label = ''
|
let label = ''
|
||||||
if (rec && rec.productInfo) {
|
if (rec && rec.productInfo) {
|
||||||
label = `${rec.productInfo.name} - ${rec.productInfo.authors.map((a: any) => a.name + ' ' + a.surname).join(', ')}`
|
if (productStore.isNovitaById(rec.productInfo.date_pub))
|
||||||
|
label += `🌟 `
|
||||||
|
|
||||||
|
label += `${rec.productInfo.name}`;
|
||||||
|
if (Array.isArray(rec.productInfo.authors)) {
|
||||||
|
const authors = rec.productInfo.authors.map((a: any) => `${a.name} ${a.surname}`).join(', ');
|
||||||
|
label += ` - (${authors})`;
|
||||||
|
} else {
|
||||||
|
label += rec.productInfo.authors ? ` - (${rec.productInfo.authors.name} ${rec.productInfo.authors.surname}) ` : '';
|
||||||
|
}
|
||||||
if (rec.productInfo.idStatoProdotto) {
|
if (rec.productInfo.idStatoProdotto) {
|
||||||
if (!productStore.isPubblicatoById(rec.productInfo.idStatoProdotto))
|
if (!productStore.isPubblicatoById(rec.productInfo.idStatoProdotto))
|
||||||
label += ' (' + productStore.getDescrStatiProdottoByIdStatoProdotto(rec.productInfo.idStatoProdotto || '') + ')'
|
label += ' (' + productStore.getDescrStatiProdottoByIdStatoProdotto(rec.productInfo.idStatoProdotto || '') + ')'
|
||||||
@@ -258,83 +268,83 @@ export default defineComponent({
|
|||||||
if (productStore.isEsaurito(rec)) {
|
if (productStore.isEsaurito(rec)) {
|
||||||
label += ' (Attualmente non disponibile)'
|
label += ' (Attualmente non disponibile)'
|
||||||
}
|
}
|
||||||
// console.log('Computed label:', label)
|
// console.log('Computed label:', label)
|
||||||
|
}
|
||||||
|
return label
|
||||||
}
|
}
|
||||||
return label
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertProd() {
|
function insertProd() {
|
||||||
// console.log('insertProd')
|
// console.log('insertProd')
|
||||||
emit('insert', myproduct.value)
|
emit('insert', myproduct.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickClose() {
|
function clickClose() {
|
||||||
searchList.value[0].value = ''
|
searchList.value[0].value = ''
|
||||||
myproduct.value = null
|
myproduct.value = null
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
|
||||||
|
|
||||||
function updateproductmodif(element: IProduct) {
|
|
||||||
console.log('CSEARCHPRODUCT: updateproductmodif')
|
|
||||||
emit('updateproductmodif', element)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function searchOnGM(mystr: string) {
|
|
||||||
// refreshSingleBookFromGM({usaDBGMLocale: false})
|
|
||||||
const options = {
|
|
||||||
|
|
||||||
}
|
|
||||||
const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: '', isbn: mystr, ...options })
|
|
||||||
if (ris) {
|
|
||||||
|
|
||||||
const id = getSearchId()
|
|
||||||
loadProduct(id)
|
|
||||||
updateproductmodif(myproduct.value)
|
|
||||||
|
|
||||||
// await updateproduct(false)
|
|
||||||
if (ris.error) {
|
|
||||||
tools.showNegativeNotif($q, ris.error)
|
|
||||||
} else {
|
|
||||||
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// updatefromgm.value = false
|
function updateproductmodif(element: IProduct) {
|
||||||
}
|
console.log('CSEARCHPRODUCT: updateproductmodif')
|
||||||
|
emit('updateproductmodif', element)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
async function searchOnGM(mystr: string) {
|
||||||
|
// refreshSingleBookFromGM({usaDBGMLocale: false})
|
||||||
|
const options = {
|
||||||
|
|
||||||
onMounted(mounted)
|
}
|
||||||
|
const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: '', isbn: mystr, ...options })
|
||||||
|
if (ris) {
|
||||||
|
|
||||||
return {
|
const id = getSearchId()
|
||||||
userStore,
|
loadProduct(id)
|
||||||
costanti,
|
updateproductmodif(myproduct.value)
|
||||||
tools,
|
|
||||||
toolsext,
|
// await updateproduct(false)
|
||||||
search,
|
if (ris.error) {
|
||||||
shared_consts,
|
tools.showNegativeNotif($q, ris.error)
|
||||||
productStore,
|
} else {
|
||||||
t,
|
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
|
||||||
loadpage,
|
}
|
||||||
refreshpage,
|
|
||||||
show_hide,
|
// updatefromgm.value = false
|
||||||
searchList,
|
}
|
||||||
fieldsTable,
|
|
||||||
mycolumns,
|
}
|
||||||
naviga,
|
|
||||||
myproduct,
|
onMounted(mounted)
|
||||||
optcatalogo,
|
|
||||||
idPage,
|
return {
|
||||||
selauthor,
|
userStore,
|
||||||
valoriopt,
|
costanti,
|
||||||
labelcombo,
|
tools,
|
||||||
searchText,
|
toolsext,
|
||||||
insertProd,
|
search,
|
||||||
focus,
|
shared_consts,
|
||||||
clickClose,
|
productStore,
|
||||||
saveSearch,
|
t,
|
||||||
updateproductmodif,
|
loadpage,
|
||||||
searchOnGM,
|
refreshpage,
|
||||||
}
|
show_hide,
|
||||||
|
searchList,
|
||||||
|
fieldsTable,
|
||||||
|
mycolumns,
|
||||||
|
naviga,
|
||||||
|
myproduct,
|
||||||
|
optcatalogo,
|
||||||
|
idPage,
|
||||||
|
selauthor,
|
||||||
|
valoriopt,
|
||||||
|
labelcombo,
|
||||||
|
searchText,
|
||||||
|
insertProd,
|
||||||
|
focus,
|
||||||
|
clickClose,
|
||||||
|
saveSearch,
|
||||||
|
updateproductmodif,
|
||||||
|
searchOnGM,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -2034,6 +2034,19 @@ h3 {
|
|||||||
/* Assicurati che sia sopra gli altri elementi */
|
/* Assicurati che sia sopra gli altri elementi */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-edit-floating {
|
||||||
|
position: relative;
|
||||||
|
top: 4px;
|
||||||
|
right: 0px;
|
||||||
|
z-index: 10;
|
||||||
|
opacity: 0.5;
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-edit-floating:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.marker-mini-icon {
|
.marker-mini-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import { i18n } from 'src/boot/i18n' // Importa l'istanza di i18n configurata in
|
|||||||
import { useUserStore } from '@store/UserStore'
|
import { useUserStore } from '@store/UserStore'
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import type { IDataPass, IProduct, IProductInfo, ISpecialField, IVariazione } from '@model';
|
import type { ICatalog, IDataPass, IProduct, IProductInfo, ISpecialField, IVariazione } from '@model';
|
||||||
import { tools } from '../store/Modules/tools'
|
import { tools } from '../store/Modules/tools'
|
||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti'
|
||||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||||
|
|
||||||
import { useProducts } from '@store/Products'
|
import { useProducts } from '@store/Products'
|
||||||
|
import { useCatalogStore } from '@store/CatalogStore'
|
||||||
|
|
||||||
const { t } = i18n.global;
|
const { t } = i18n.global;
|
||||||
|
|
||||||
@@ -203,6 +204,13 @@ export default function () {
|
|||||||
const myfield = key as keyof IVariazione
|
const myfield = key as keyof IVariazione
|
||||||
productStore.products[idprod].arrvariazioni[0][myfield] = value
|
productStore.products[idprod].arrvariazioni[0][myfield] = value
|
||||||
}
|
}
|
||||||
|
} else if (table === 'catalogs') {
|
||||||
|
const catalogStore = useCatalogStore()
|
||||||
|
const idcat = catalogStore.catalogs.findIndex((rec: ICatalog) => rec._id === id)
|
||||||
|
if (idcat >= 0 && key) {
|
||||||
|
const myfield = key as keyof ICatalog
|
||||||
|
catalogStore.catalogs[idcat][myfield] = value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('mydatatosave', mydatatosave)
|
console.log('mydatatosave', mydatatosave)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export interface ICatalog {
|
|||||||
active?: boolean
|
active?: boolean
|
||||||
title: string
|
title: string
|
||||||
foto_collana?: IImg,
|
foto_collana?: IImg,
|
||||||
idCollane?: number[]
|
idCollane?: string[]
|
||||||
argomenti?: string[]
|
argomenti?: string[]
|
||||||
editore?: string[]
|
editore?: string[]
|
||||||
collana_info?: ICollana
|
collana_info?: ICollana
|
||||||
|
|||||||
@@ -811,7 +811,7 @@ export interface IMyScheda {
|
|||||||
idTipologie?: number[]
|
idTipologie?: number[]
|
||||||
editore?: string[]
|
editore?: string[]
|
||||||
argomenti?: string[]
|
argomenti?: string[]
|
||||||
idCollane?: number[]
|
idCollane?: string[]
|
||||||
author?: string
|
author?: string
|
||||||
sort_field?: string
|
sort_field?: string
|
||||||
sort_dir?: number
|
sort_dir?: number
|
||||||
@@ -860,7 +860,7 @@ export interface IOptCatalogo {
|
|||||||
Categoria?: string[]
|
Categoria?: string[]
|
||||||
editore?: string[]
|
editore?: string[]
|
||||||
argomenti?: string[]
|
argomenti?: string[]
|
||||||
idCollane?: number[]
|
idCollane?: string[]
|
||||||
sort_field?: string
|
sort_field?: string
|
||||||
sort_dir?: number
|
sort_dir?: number
|
||||||
pdf?: boolean
|
pdf?: boolean
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ export interface IProductInfo {
|
|||||||
note?: string
|
note?: string
|
||||||
idAuthors?: string[]
|
idAuthors?: string[]
|
||||||
authors?: string[]
|
authors?: string[]
|
||||||
idCollana?: number
|
idCollana?: string
|
||||||
collana?: ICollana
|
collana?: ICollana
|
||||||
collezione?: string
|
|
||||||
idPublisher?: string
|
idPublisher?: string
|
||||||
ListaArgomenti?: string
|
ListaArgomenti?: string
|
||||||
publisher?: IPublisher
|
publisher?: IPublisher
|
||||||
@@ -83,7 +82,6 @@ export interface IVariazione {
|
|||||||
availability?: number
|
availability?: number
|
||||||
formato?: string
|
formato?: string
|
||||||
misure?: string
|
misure?: string
|
||||||
edizione?: string
|
|
||||||
ristampa?: string
|
ristampa?: string
|
||||||
pagine?: number
|
pagine?: number
|
||||||
tipologia?: string
|
tipologia?: string
|
||||||
@@ -200,6 +198,7 @@ export interface IProductsState {
|
|||||||
isPubblicatoById?: (idStatoProdotto: number) => boolean;
|
isPubblicatoById?: (idStatoProdotto: number) => boolean;
|
||||||
isProssimaUscitaById?: (idStatoProdotto: number) => boolean;
|
isProssimaUscitaById?: (idStatoProdotto: number) => boolean;
|
||||||
isPrevenditaById?: (idStatoProdotto: number) => boolean;
|
isPrevenditaById?: (idStatoProdotto: number) => boolean;
|
||||||
|
isNovitaById?: (date_pub: Date) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProducer {
|
export interface IProducer {
|
||||||
|
|||||||
@@ -533,6 +533,14 @@ export const costanti = {
|
|||||||
SOLO_PROSSIMA_USCITA: '2',
|
SOLO_PROSSIMA_USCITA: '2',
|
||||||
PREVENDITA: '3',
|
PREVENDITA: '3',
|
||||||
NON_VENDIBILE: '4',
|
NON_VENDIBILE: '4',
|
||||||
}
|
},
|
||||||
|
|
||||||
|
NO_CATEGORY: '__NOCATEGORY__',
|
||||||
|
|
||||||
|
VISUCAMPI: {
|
||||||
|
PER_TUTTI: 0,
|
||||||
|
PER_EDITORE: 1,
|
||||||
|
PER_ADMIN: 16,
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -667,6 +667,7 @@ export const colTableTipologie = [
|
|||||||
AddCol(DuplicateRec),
|
AddCol(DuplicateRec),
|
||||||
]
|
]
|
||||||
export const colTableCollane = [
|
export const colTableCollane = [
|
||||||
|
AddCol({ name: '_id', label_trans: 'catalogo.id', fieldtype: costanti.FieldType.string }),
|
||||||
AddCol({ name: 'idCollana', label_trans: 'collane.idCollana', fieldtype: costanti.FieldType.number }),
|
AddCol({ name: 'idCollana', label_trans: 'collane.idCollana', fieldtype: costanti.FieldType.number }),
|
||||||
AddCol({ name: 'title', label_trans: 'collane.title' }),
|
AddCol({ name: 'title', label_trans: 'collane.title' }),
|
||||||
AddCol(DeleteRec),
|
AddCol(DeleteRec),
|
||||||
|
|||||||
@@ -9145,6 +9145,8 @@ export const tools = {
|
|||||||
},
|
},
|
||||||
arrotonda2Dec(number: any): string {
|
arrotonda2Dec(number: any): string {
|
||||||
let num = ''
|
let num = ''
|
||||||
|
if (!number)
|
||||||
|
return ''
|
||||||
try {
|
try {
|
||||||
if (number)
|
if (number)
|
||||||
num = number.toFixed(2)
|
num = number.toFixed(2)
|
||||||
@@ -9881,7 +9883,7 @@ export const tools = {
|
|||||||
.join(", ");
|
.join(", ");
|
||||||
},
|
},
|
||||||
|
|
||||||
formatCollane(collane: number[] | number | undefined | null): string {
|
formatCollane(collane: string[] | string): string {
|
||||||
if (!collane) {
|
if (!collane) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -9891,13 +9893,13 @@ export const tools = {
|
|||||||
// Estrai le collane e uniscile con ', '
|
// Estrai le collane e uniscile con ', '
|
||||||
return collane
|
return collane
|
||||||
.map((idcollana) => {
|
.map((idcollana) => {
|
||||||
const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll.idCollana === idcollana)
|
const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll._id === idcollana)
|
||||||
return reccoll ? `${reccoll.title ?? ""}`.trim() : ""
|
return reccoll ? `${reccoll.title ?? ""}`.trim() : ""
|
||||||
})
|
})
|
||||||
.filter((name) => name.length > 0) // Filtra eventuali nomi vuoti
|
.filter((name) => name.length > 0) // Filtra eventuali nomi vuoti
|
||||||
.join(", ");
|
.join(", ");
|
||||||
} else {
|
} else {
|
||||||
const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll.idCollana === collane)
|
const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll._id === collane)
|
||||||
return reccoll ? `${reccoll.title}` : ''
|
return reccoll ? `${reccoll.title}` : ''
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd, IText, IOptCatalogo, ICatalog, ICatPrTotali, ISingleProductOrdered, ISchedaSingola, IMyScheda, IElementiScheda, T_Web_StatiProdotto, T_Web_Tipologie, T_WEB_TipiFormato } from 'model'
|
import type { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd, IText, IOptCatalogo, ICatalog, ICatPrTotali, ISingleProductOrdered, ISchedaSingola, IMyScheda, IElementiScheda, T_Web_StatiProdotto, T_Web_Tipologie, T_WEB_TipiFormato, IPublisher } from 'model'
|
||||||
|
|
||||||
import { Api } from '@api'
|
import { Api } from '@api'
|
||||||
import { serv_constants } from '@src/store/Modules/serv_constants'
|
import { serv_constants } from '@src/store/Modules/serv_constants'
|
||||||
@@ -198,11 +198,21 @@ export const useProducts = defineStore('Products', {
|
|||||||
// 34 - In Prevendita
|
// 34 - In Prevendita
|
||||||
return (idStatoProdotto === 34)
|
return (idStatoProdotto === 34)
|
||||||
},
|
},
|
||||||
|
isNovitaById: (state: IProductsState) => (date_pub: Date): boolean => {
|
||||||
|
const sixMonthsAgo = new Date();
|
||||||
|
sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() - 6);
|
||||||
|
return new Date(date_pub).getTime() > sixMonthsAgo.getTime();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
isPubblicato: (state: IProductsState) => (productInfo: IProductInfo): boolean => {
|
isPubblicato: (state: IProductsState) => (productInfo: IProductInfo): boolean => {
|
||||||
return state.isPubblicatoById(productInfo.idStatoProdotto)
|
return state.isPubblicatoById(productInfo.idStatoProdotto)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isNovita: (state: IProductsState) => (productInfo: IProductInfo): boolean => {
|
||||||
|
return state.isNovitaById(productInfo.date_pub)
|
||||||
|
},
|
||||||
|
|
||||||
isNonVendibile: (state: IProductsState) => (productInfo: IProductInfo): boolean => {
|
isNonVendibile: (state: IProductsState) => (productInfo: IProductInfo): boolean => {
|
||||||
return !state.isPubblicatoById(productInfo.idStatoProdotto) && !state.isProssimaUscitaById(productInfo.idStatoProdotto)
|
return !state.isPubblicatoById(productInfo.idStatoProdotto) && !state.isProssimaUscitaById(productInfo.idStatoProdotto)
|
||||||
},
|
},
|
||||||
@@ -220,6 +230,11 @@ export const useProducts = defineStore('Products', {
|
|||||||
return (ctrec) ? ctrec.Descrizione : ''
|
return (ctrec) ? ctrec.Descrizione : ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getCasaEditriceByIdPublisher: (state: IProductsState) => (idPublisher: string): string => {
|
||||||
|
const rectrovato: IPublisher = state.publishers.find((editore: IPublisher) => editore._id === idPublisher)
|
||||||
|
return (rectrovato) ? rectrovato.name : ''
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
getDescrByIdTipologia: (state: IProductsState) => (idTipologia: number): string => {
|
getDescrByIdTipologia: (state: IProductsState) => (idTipologia: number): string => {
|
||||||
const ctrec = state.tipologie.find((mystatus: T_Web_Tipologie) => mystatus.IdTipologia === idTipologia)
|
const ctrec = state.tipologie.find((mystatus: T_Web_Tipologie) => mystatus.IdTipologia === idTipologia)
|
||||||
@@ -1548,8 +1563,8 @@ export const useProducts = defineStore('Products', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (testo.contenuto.includes('{prezzo}') || testo.contenuto.includes('{prezzo_scontato}')) {
|
if (testo.contenuto.includes('{prezzo}') || testo.contenuto.includes('{prezzo_scontato}')) {
|
||||||
const prezzo = tools.arrotonda2Dec(myproduct.arrvariazioni![0].price) || '';
|
const prezzo = tools.arrotonda2Dec(myproduct.arrvariazioni?.[0]?.price) || '';
|
||||||
const prezzo_scontato = tools.arrotonda2Dec(myproduct.arrvariazioni![0].sale_price) || '';
|
const prezzo_scontato = tools.arrotonda2Dec(myproduct.arrvariazioni?.[0]?.sale_price) || '';
|
||||||
replacements['{prezzo}'] = prezzo;
|
replacements['{prezzo}'] = prezzo;
|
||||||
replacements['{prezzo_scontato}'] = prezzo_scontato;
|
replacements['{prezzo_scontato}'] = prezzo_scontato;
|
||||||
}
|
}
|
||||||
@@ -1557,9 +1572,9 @@ export const useProducts = defineStore('Products', {
|
|||||||
// Additional replacements based on the content
|
// Additional replacements based on the content
|
||||||
const keysToCheck = [
|
const keysToCheck = [
|
||||||
'{titolo}', '{sottotitolo}', '{categoria}', '{sottocategoria}', '{descr_categoria}',
|
'{titolo}', '{sottotitolo}', '{categoria}', '{sottocategoria}', '{descr_categoria}',
|
||||||
'{pagine}', '{isbn}', '{misure}', '{edizione', '{ristampa}', '{argomento}', '{date_pub}', '{date_updated_fromGM}', '{ranking_globale}',
|
'{pagine}', '{isbn}', '{misure}', '{edizione}', '{ristampa}', '{argomento}', '{date_pub}', '{date_updated_fromGM}', '{ranking_globale}',
|
||||||
'{venduti}', '{formato}', '{tipologia}', '{stato}', '{scale}', '{descr_trafiletto_catalogo}',
|
'{venduti}', '{formato}', '{tipologia}', '{stato}', '{scale}', '{descr_trafiletto_catalogo}',
|
||||||
'{link_macro}', '{qta}', '{image_link}', '{imagefile}', '{debug}'
|
'{link_macro}', '{qta}', '{image_link}', '{imagefile}', '{casaeditrice}', '{debug}'
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const key of keysToCheck) {
|
for (const key of keysToCheck) {
|
||||||
@@ -1578,19 +1593,22 @@ export const useProducts = defineStore('Products', {
|
|||||||
replacements[key] = myproduct.productInfo.catprods && myproduct.productInfo.catprods.length > 0 ? this.getCatProdDescrStrByIdCatProd(myproduct.productInfo.catprods![0].name) : '';
|
replacements[key] = myproduct.productInfo.catprods && myproduct.productInfo.catprods.length > 0 ? this.getCatProdDescrStrByIdCatProd(myproduct.productInfo.catprods![0].name) : '';
|
||||||
break;
|
break;
|
||||||
case '{pagine}':
|
case '{pagine}':
|
||||||
replacements[key] = myproduct.arrvariazioni![0].pagine || '';
|
replacements[key] = myproduct.arrvariazioni?.[0]?.pagine || '';
|
||||||
break;
|
break;
|
||||||
case '{isbn}':
|
case '{isbn}':
|
||||||
replacements[key] = myproduct.productInfo.code || '';
|
replacements[key] = myproduct.productInfo.code || '';
|
||||||
break;
|
break;
|
||||||
case '{misure}':
|
case '{misure}':
|
||||||
replacements[key] = myproduct.arrvariazioni![0].misure || '';
|
replacements[key] = myproduct.arrvariazioni?.[0]?.misure || '';
|
||||||
|
break;
|
||||||
|
case '{casaeditrice}':
|
||||||
|
replacements[key] = this.getCasaEditriceByIdPublisher(myproduct.productInfo.idPublisher)
|
||||||
break;
|
break;
|
||||||
case '{edizione}':
|
case '{edizione}':
|
||||||
replacements[key] = myproduct.arrvariazioni![0].edizione || '';
|
replacements[key] = myproduct.arrvariazioni?.[0]?.edizione || '';
|
||||||
break;
|
break;
|
||||||
case '{ristampa}':
|
case '{ristampa}':
|
||||||
replacements[key] = myproduct.arrvariazioni![0].ristampa || '';
|
replacements[key] = myproduct.arrvariazioni?.[0]?.ristampa || '';
|
||||||
break;
|
break;
|
||||||
case '{argomento}':
|
case '{argomento}':
|
||||||
replacements[key] = this.getCatProdsStrByCatProds(myproduct.productInfo.catprods!) || '';
|
replacements[key] = this.getCatProdsStrByCatProds(myproduct.productInfo.catprods!) || '';
|
||||||
@@ -1608,10 +1626,10 @@ export const useProducts = defineStore('Products', {
|
|||||||
replacements[key] = myproduct.productInfo.totVen! || '0';
|
replacements[key] = myproduct.productInfo.totVen! || '0';
|
||||||
break;
|
break;
|
||||||
case '{formato}':
|
case '{formato}':
|
||||||
replacements[key] = this.getDescrByIdTipoFormato(myproduct.arrvariazioni[0].idTipoFormato || 0)
|
replacements[key] = this.getDescrByIdTipoFormato(myproduct.arrvariazioni?.[0]?.idTipoFormato || 0)
|
||||||
break;
|
break;
|
||||||
case '{tipologia}':
|
case '{tipologia}':
|
||||||
replacements[key] = this.getDescrByIdTipologia(myproduct.arrvariazioni[0].idTipologia || 0);
|
replacements[key] = this.getDescrByIdTipologia(myproduct.arrvariazioni?.[0]?.idTipologia || 0);
|
||||||
break;
|
break;
|
||||||
case '{stato}':
|
case '{stato}':
|
||||||
replacements[key] = this.getDescrStatiProdottoByIdStatoProdotto(myproduct.productInfo.idStatoProdotto || '');
|
replacements[key] = this.getDescrStatiProdottoByIdStatoProdotto(myproduct.productInfo.idStatoProdotto || '');
|
||||||
@@ -1623,7 +1641,7 @@ export const useProducts = defineStore('Products', {
|
|||||||
replacements[key] = myproduct.productInfo.link_macro || '';
|
replacements[key] = myproduct.productInfo.link_macro || '';
|
||||||
break;
|
break;
|
||||||
case '{qta}':
|
case '{qta}':
|
||||||
replacements[key] = myproduct.arrvariazioni![0].quantita || '';
|
replacements[key] = myproduct.arrvariazioni?.[0]?.quantita || '';
|
||||||
break;
|
break;
|
||||||
case '{image_link}':
|
case '{image_link}':
|
||||||
replacements[key] = myproduct.productInfo.image_link || '';
|
replacements[key] = myproduct.productInfo.image_link || '';
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
else if (table === 'departments') ris = state.departments
|
else if (table === 'departments') ris = state.departments
|
||||||
else if (table === 'categorys') ris = state.categories
|
else if (table === 'categorys') ris = state.categories
|
||||||
else if (table === 'catprods') ris = Products.catprods
|
else if (table === 'catprods') ris = Products.catprods
|
||||||
|
else if (table === 'collanas') ris = Products.collane
|
||||||
else if (table === 'subcatprods') ris = Products.subcatprods
|
else if (table === 'subcatprods') ris = Products.subcatprods
|
||||||
else if (table === 'catprods_gas') ris = Products.catprods_gas
|
else if (table === 'catprods_gas') ris = Products.catprods_gas
|
||||||
else if (table === 'authors') ris = Products.authors
|
else if (table === 'authors') ris = Products.authors
|
||||||
@@ -494,8 +495,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
return state.sectorgoods
|
return state.sectorgoods
|
||||||
else if (table === 'catgrps')
|
else if (table === 'catgrps')
|
||||||
return state.catgrps
|
return state.catgrps
|
||||||
else if (table === 'collanas')
|
|
||||||
return Products.collane
|
|
||||||
else if (table === 'schedeopt')
|
else if (table === 'schedeopt')
|
||||||
return Products.getSchedeOpt(state.myschedas)
|
return Products.getSchedeOpt(state.myschedas)
|
||||||
else if (table === 'provinces')
|
else if (table === 'provinces')
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
@click="EseguiFunz('MigrateMSSQLToMongoDb')"
|
@click="EseguiFunz('MigrateMSSQLToMongoDb')"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
label="Aggiorna Statistiche Fatturato"
|
label="Aggiorna Statistiche Fatturato e Vendite"
|
||||||
color="positive"
|
color="positive"
|
||||||
@click="EseguiFunz('UpdateStatFatturato')"
|
@click="EseguiFunz('UpdateStatFatturato')"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { CProductCard } from '@src/components/CProductCard'
|
|||||||
|
|
||||||
import { CMyDialog } from '@src/components/CMyDialog'
|
import { CMyDialog } from '@src/components/CMyDialog'
|
||||||
import { CMySelect } from '@src/components/CMySelect'
|
import { CMySelect } from '@src/components/CMySelect'
|
||||||
|
import { CMyValueDb } from '@src/components/CMyValueDb'
|
||||||
import { CProductTable } from '@src/components/CProductTable'
|
import { CProductTable } from '@src/components/CProductTable'
|
||||||
import { CSearchProduct } from '@src/components/CSearchProduct'
|
import { CSearchProduct } from '@src/components/CSearchProduct'
|
||||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||||
@@ -40,6 +41,7 @@ export default defineComponent({
|
|||||||
components: {
|
components: {
|
||||||
CContainerCatalogoCard, CProductCard,
|
CContainerCatalogoCard, CProductCard,
|
||||||
CSelectUserActive, CMySelect, CProductTable, CSearchProduct, CMyDialog,
|
CSelectUserActive, CMySelect, CProductTable, CSearchProduct, CMyDialog,
|
||||||
|
CMyValueDb,
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'updateCatalogo'],
|
emits: ['update:modelValue', 'updateCatalogo'],
|
||||||
props: {
|
props: {
|
||||||
@@ -105,11 +107,16 @@ export default defineComponent({
|
|||||||
}, { deep: false });
|
}, { deep: false });
|
||||||
|
|
||||||
watch(optrigenera.value, (newVal) => {
|
watch(optrigenera.value, (newVal) => {
|
||||||
tools.setCookie(showListaArgomenti.value ? 'INC_ES' : 'VIS_DISP', newVal.visibilitaDisp);
|
tools.setCookie((showListaArgomenti.value ? 'INC_ES_' : '') +'VIS_DISP', newVal.visibilitaDisp);
|
||||||
|
tools.setCookie((showListaArgomenti.value ? 'INC_ES_' : '') +'VIS_STATO', newVal.stato);
|
||||||
if (showListaArgomenti.value)
|
if (showListaArgomenti.value)
|
||||||
calcArrProducts()
|
calcArrProducts()
|
||||||
}, { deep: true });
|
}, { deep: true });
|
||||||
|
|
||||||
|
const getCatalogoByMyPage = computed(() => {
|
||||||
|
return catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage)
|
||||||
|
})
|
||||||
|
|
||||||
/*watch(optcatalogo, (newValue) => {
|
/*watch(optcatalogo, (newValue) => {
|
||||||
emit('update:modelValue', newValue);
|
emit('update:modelValue', newValue);
|
||||||
}, { deep: true });*/
|
}, { deep: true });*/
|
||||||
@@ -210,10 +217,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const getCatalogoByMyPage = computed(() => {
|
|
||||||
return catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage)
|
|
||||||
})
|
|
||||||
|
|
||||||
const lista_prodotti = computed(() => {
|
const lista_prodotti = computed(() => {
|
||||||
const arr = catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage)
|
const arr = catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage)
|
||||||
return arr?.lista_prodotti
|
return arr?.lista_prodotti
|
||||||
@@ -331,6 +334,15 @@ export default defineComponent({
|
|||||||
|
|
||||||
return trovatocatalogo ? trovatocatalogo.title : 'Catalogo'
|
return trovatocatalogo ? trovatocatalogo.title : 'Catalogo'
|
||||||
}
|
}
|
||||||
|
function getReferentiCatalogo(): string {
|
||||||
|
const trovatocatalogo = getCatalogoByMyPage.value
|
||||||
|
|
||||||
|
if (trovatocatalogo && trovatocatalogo.referenti && trovatocatalogo.referenti.length > 0) {
|
||||||
|
return trovatocatalogo.referenti.join(', ');
|
||||||
|
} else {
|
||||||
|
return '[Nessun Referente]';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getImgIntroCatalogo(scheda: IMyScheda): IImg {
|
function getImgIntroCatalogo(scheda: IMyScheda): IImg {
|
||||||
const trovatocatalogo = getCatalogoByMyPage.value
|
const trovatocatalogo = getCatalogoByMyPage.value
|
||||||
@@ -396,8 +408,8 @@ export default defineComponent({
|
|||||||
return { imagefile, fit }
|
return { imagefile, fit }
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIdCollaneDaFiltrare(def_idCollane?: number[]) {
|
function getIdCollaneDaFiltrare(def_idCollane?: string[]) {
|
||||||
let idCollane: number[] = []
|
let idCollane: string[] = []
|
||||||
|
|
||||||
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
|
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
|
||||||
const trovatocatalogo = getCatalogoByMyPage.value
|
const trovatocatalogo = getCatalogoByMyPage.value
|
||||||
@@ -475,7 +487,7 @@ export default defineComponent({
|
|||||||
filtroExcludeProductTypes: number[],
|
filtroExcludeProductTypes: number[],
|
||||||
filtroidTipologie: number[],
|
filtroidTipologie: number[],
|
||||||
editore: string[],
|
editore: string[],
|
||||||
idCollane: ICollana[],
|
idCollane: string[],
|
||||||
arrargomstr: any[],
|
arrargomstr: any[],
|
||||||
catstr: string,
|
catstr: string,
|
||||||
gasselstr: string,
|
gasselstr: string,
|
||||||
@@ -531,7 +543,11 @@ export default defineComponent({
|
|||||||
hasArgomentiCat = (product.productInfo.idCatProds || []).some((idCat: any) => arrargomstr.includes(idCat));
|
hasArgomentiCat = (product.productInfo.idCatProds || []).some((idCat: any) => arrargomstr.includes(idCat));
|
||||||
hasCategoria = true;
|
hasCategoria = true;
|
||||||
} else {
|
} else {
|
||||||
hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr));
|
if (catstr === costanti.NO_CATEGORY) {
|
||||||
|
hasCategoria = product.productInfo.idCatProds?.length === 0
|
||||||
|
} else {
|
||||||
|
hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtri per autore
|
// Filtri per autore
|
||||||
@@ -559,7 +575,7 @@ export default defineComponent({
|
|||||||
// Filtri per collana
|
// Filtri per collana
|
||||||
const hasCollana = boolfiltroVuotoCollane
|
const hasCollana = boolfiltroVuotoCollane
|
||||||
? true
|
? true
|
||||||
: (idCollane || []).some((item: ICollana) => product.productInfo.idCollana === item.idCollana)
|
: (idCollane || []).includes(product.productInfo.idCollana?.toString())
|
||||||
|
|
||||||
// Filtri per GAS
|
// Filtri per GAS
|
||||||
const productgassel = !gasselstr || (cosaValue === shared_consts.PROD.GAS && product.idGasordine === gasselstr);
|
const productgassel = !gasselstr || (cosaValue === shared_consts.PROD.GAS && product.idGasordine === gasselstr);
|
||||||
@@ -1035,11 +1051,14 @@ export default defineComponent({
|
|||||||
async function mounted() {
|
async function mounted() {
|
||||||
// console.log('mounted Catalogo')
|
// console.log('mounted Catalogo')
|
||||||
|
|
||||||
|
generatinglist.value = true
|
||||||
|
|
||||||
cat.value = tools.getCookie(getKeyCatAtLoad(), '')
|
cat.value = tools.getCookie(getKeyCatAtLoad(), '')
|
||||||
|
|
||||||
tabcatalogo.value = tools.getCookie('TAB_CAT', 'visu')
|
tabcatalogo.value = tools.getCookie('TAB_CAT', 'visu')
|
||||||
|
|
||||||
optrigenera.value.visibilitaDisp = tools.getCookie(showListaArgomenti.value ? 'INC_ES' : 'VIS_DISP', 'tutti')
|
optrigenera.value.visibilitaDisp = tools.getCookie((showListaArgomenti.value ? 'INC_ES_' : '') + 'VIS_DISP', costanti.DISP.DISPONIBILI)
|
||||||
|
optrigenera.value.stato = tools.getCookie((showListaArgomenti.value ? 'INC_ES_' : '') +'VIS_STATO', costanti.STATO.IN_COMMERCIO)
|
||||||
|
|
||||||
loadpage.value = false
|
loadpage.value = false
|
||||||
await productStore.loadProducts()
|
await productStore.loadProducts()
|
||||||
@@ -1097,7 +1116,7 @@ export default defineComponent({
|
|||||||
value: rec._id,
|
value: rec._id,
|
||||||
icon: rec.icon,
|
icon: rec.icon,
|
||||||
color: rec.color,
|
color: rec.color,
|
||||||
})),
|
})).concat({ label: '[Senza Argomento]', value: costanti.NO_CATEGORY, icon: undefined, color: undefined }),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1451,6 +1470,8 @@ export default defineComponent({
|
|||||||
generatinglist,
|
generatinglist,
|
||||||
optDisp,
|
optDisp,
|
||||||
optStato,
|
optStato,
|
||||||
|
getCatalogoByMyPage,
|
||||||
|
getReferentiCatalogo,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user