- aggiornamento Cataloghi

- Gestione delle versioni del prodotto ("Nuovi","Usati","Epub", ecc..)
This commit is contained in:
Surya Paolo
2024-06-20 17:22:46 +02:00
parent 49d51712bd
commit 2ffcf56625
55 changed files with 659 additions and 400 deletions

View File

@@ -12,7 +12,7 @@ import { CPrice } from '../CPrice'
import { func_tools, toolsext } from '@store/Modules/toolsext'
import { IBaseOrder, IGasordine, IOrder, IOrderCart, IProduct, IVariazione } from '@src/model'
import { IBaseOrder, ICatalogo, IGasordine, IOrder, IOrderCart, IProduct, IVariazione } from '@src/model'
import { tools } from '@store/Modules/tools'
import { useProducts } from '@store/Products'
@@ -28,7 +28,7 @@ import 'vue3-pdf-app/dist/icons/main.css'
export default defineComponent({
name: 'CCatalogoCard',
emits: ['selauthor'],
emits: ['selauthor', 'opendetail'],
props: {
product: {
type: Object as PropType<IProduct | null>,
@@ -54,7 +54,19 @@ export default defineComponent({
type: Object,
required: false,
default: () => { }
}
},
optcatalogo: {
type: Object as PropType<ICatalogo>,
required: false,
default: () => ({
//++AddCATALOGO_FIELDS
productTypes: [0],
excludeproductTypes: [],
formato: [],
Categoria: [],
Editore: [],
}),
},
},
components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice },
setup(props, { emit }) {
@@ -477,6 +489,19 @@ export default defineComponent({
emit('selauthor', id, autore)
}
function click_opendetail(id: any, autore: any) {
emit('opendetail')
}
function escludiArticolo(variazione: IVariazione) {
let hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (variazione.arrversioni || []).every((item: any) => props.optcatalogo.excludeproductTypes.includes(item)))
return hasExcludeProductTypes
}
function checkIfVariazioneDaVisu(variazione: IVariazione) {
return !escludiArticolo(variazione)
}
onMounted(mounted)
onBeforeUnmount(beforeDestroy)
@@ -531,6 +556,8 @@ export default defineComponent({
indvariazSel,
checkifCartEnable,
click_author,
click_opendetail,
checkIfVariazioneDaVisu,
}
}
})