- scheda prodotto migliorata
- aggiornamento filtri
This commit is contained in:
@@ -10,6 +10,7 @@ import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import type { IColGridTable } from 'model';
|
||||
import { IOperators } from 'model'
|
||||
import { tools } from '@tools'
|
||||
import { useProducts } from 'app/src/store/Products';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMySelect',
|
||||
@@ -177,6 +178,8 @@ export default defineComponent({
|
||||
const selectMultiple = ref(null)
|
||||
const selectGeneric = ref(null)
|
||||
|
||||
const productStore = useProducts()
|
||||
|
||||
const mystr = ref('')
|
||||
|
||||
const valoriload = computed(() => {
|
||||
@@ -829,6 +832,20 @@ export default defineComponent({
|
||||
emit('searchOnGM', mystr)
|
||||
}
|
||||
|
||||
function applyLabelColorBasedOnProductStatus(myrec: any) {
|
||||
let classi = ''
|
||||
if (props.tablesel === 'products') {
|
||||
if (productStore.isNonVendibile(myrec)) {
|
||||
classi = 'bg-grey'
|
||||
}
|
||||
if (!productStore.isDisponibile(myrec)) {
|
||||
classi = 'bg-red-1'
|
||||
}
|
||||
}
|
||||
return classi
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
|
||||
@@ -850,6 +867,7 @@ export default defineComponent({
|
||||
clear,
|
||||
mystr,
|
||||
searchOnGM,
|
||||
applyLabelColorBasedOnProductStatus,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -147,8 +147,9 @@
|
||||
</template>
|
||||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
<q-item-section :class="applyLabelColorBasedOnProductStatus(scope.opt)">
|
||||
<q-item-label >
|
||||
|
||||
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
Reference in New Issue
Block a user