- fix RIS in pendenti, se troppi msg, non compariva piu

- cataloghi, ricerca pickup
This commit is contained in:
Surya Paolo
2024-05-09 23:36:58 +02:00
parent 58f53f8c52
commit faf0fabfb0
68 changed files with 1776 additions and 188 deletions

View File

@@ -329,8 +329,8 @@ export default defineComponent({
if (props.addall) {
let myobj: any = {}
if (typeof props.optlab === 'string') {
myobj[props.optlab] = '(Tutti)'
myobj[props.optval] = costanti.FILTER_TUTTI
myobj = tools.setRecordByField(props.optlab, myobj, '(Tutti)')
myobj = tools.setRecordByField(props.optval, myobj, costanti.FILTER_TUTTI)
}
arrtempOpt.value.push(myobj)
@@ -495,8 +495,8 @@ export default defineComponent({
if (props.addall) {
let myobj: any = {}
if (typeof props.optlab === 'string') {
myobj[props.optlab] = '(Tutti)'
myobj[props.optval] = costanti.FILTER_TUTTI
myobj = tools.setRecordByField(props.optlab, myobj, '(Tutti)')
myobj = tools.setRecordByField(props.optval, myobj, costanti.FILTER_TUTTI)
}
if (myarr)
@@ -570,7 +570,17 @@ export default defineComponent({
if (val === '') {
valori.value = myarr
} else {
valori.value = myarr.filter((v: any) => v[`${props.optlab}`].toLowerCase().indexOf(mystr) > -1)
let optlab: any = props.optlab ? '' + props.optlab : ''
if (optlab) {
valori.value = myarr.filter((v: any) => {
let mioval = tools.getRecordByField(optlab, v)
if (mioval)
return mioval.toLowerCase().indexOf(mystr) > -1
else
return false
})
}
}
}
@@ -604,8 +614,6 @@ export default defineComponent({
myarr = await globalStore.loadPickup({ table: props.tablesel, search: mystr.trim(), filter: props.filter_extra })
}
if (myarr === null) {
console.log('@@@ VALORI VALUE XXX', valori.value)
valori.value = arrtempOpt.value
@@ -619,8 +627,8 @@ export default defineComponent({
if (props.addall) {
let myobj: any = {}
if (typeof props.optlab === 'string') {
myobj[props.optlab] = '(Tutti)'
myobj[props.optval] = costanti.FILTER_TUTTI
myobj = tools.setRecordByField(props.optlab, myobj, '(Tutti)')
myobj = tools.setRecordByField(props.optval, myobj, costanti.FILTER_TUTTI)
}
myarr = [myobj, ...myarr]
@@ -714,11 +722,11 @@ export default defineComponent({
} else {
done(recfound[myid], 'add-unique')
}
/* if (props.multiple || props.multiselect_by_server) {
console.log('arrout (2)', arrout)
changeval(arrout)
}
}*/
}

View File

@@ -50,7 +50,12 @@
:text-color="$q.dark.isActive ? `white` : `black`"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" icon="" size="12px"/>
<q-avatar
color="primary"
text-color="white"
icon=""
size="12px"
/>
{{ scope.opt[fieldsTable.getLabelByTable(tablesel)] }}
</q-chip>
</div>
@@ -58,18 +63,20 @@
<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 :model-value="selected" @update:model-value="toggleOption(opt)"/>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div v-else-if="pickup">
<q-select
@@ -92,6 +99,14 @@
@filter="filterFn"
v-bind="$attrs"
>
<template v-slot:append>
<q-icon
v-if="myvalue !== ''"
class="cursor-pointer"
name="clear"
@click.stop.prevent="myvalue = ''"
/>
</template>
<template v-if="getIcon()" v-slot:prepend>
<q-icon size="xs" :name="getIcon()" />
</template>
@@ -105,7 +120,9 @@
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label> {{ tools.getValueByFunzOrVal(scope.opt,optlab) }}</q-item-label>
<q-item-label>
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}</q-item-label
>
</q-item-section>
</q-item>
</template>
@@ -133,16 +150,15 @@
:options="valori"
:option-value="optval"
:option-label="optlab"
:dense="dense">
:dense="dense"
>
<!--options-selected-class="text-deep-blue"-->
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template
v-slot:selected-item="scope">
<div v-if="tools.getValueByFunzOrVal(scope.opt,optlab)">
<template v-slot:selected-item="scope">
<div v-if="tools.getValueByFunzOrVal(scope.opt, optlab)">
<q-chip
removable
dense
@@ -151,27 +167,38 @@
:color="$q.dark.isActive ? `black` : `white`"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" :icon="scope.opt.icon ? scope.opt.icon : ''" size="12px"/>
<q-avatar
color="primary"
text-color="white"
:icon="scope.opt.icon ? scope.opt.icon : ''"
size="12px"
/>
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
</q-chip>
</div>
</template>
<template
v-if="withToggle"
v-slot:option="{ itemProps, opt, selected, toggleOption }">
v-slot:option="{ itemProps, opt, selected, toggleOption }"
>
<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 :model-value="selected" @update:model-value="toggleOption(opt)"/>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div v-else>
<q-select
@@ -194,24 +221,27 @@
input-debounce="0"
map-options
v-bind="$attrs"
:class="myclass ? myclass : 'combowidth'">
:class="myclass ? myclass : 'combowidth'"
>
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section avatar>
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/>
<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>
</q-select>
</div>
</div>
</template>