- Ricerca Titolo per nome o autore o ISBN o codice articolo
This commit is contained in:
@@ -54,7 +54,7 @@ export default defineComponent({
|
||||
const idPage = ref('')
|
||||
const selauthor = ref('')
|
||||
|
||||
const searchList = ref(<any[]>[])
|
||||
const searchList = ref(<ISearchList[]>[])
|
||||
|
||||
const optcatalogo = ref<IOptCatalogo | null>(null);
|
||||
|
||||
@@ -99,6 +99,8 @@ export default defineComponent({
|
||||
myproduct.value = null
|
||||
}
|
||||
|
||||
console.log('myproduct.value', myproduct.value)
|
||||
|
||||
if (myproduct.value) {
|
||||
tools.setCookie(tools.COOK_LAST_PROD_SEARCH, myproduct.value._id.toString())
|
||||
} else {
|
||||
@@ -142,8 +144,8 @@ export default defineComponent({
|
||||
table: 'products',
|
||||
key: 'titolo',
|
||||
type: costanti.FieldType.select_by_server,
|
||||
value: myproduct.value?.productInfo?.name,
|
||||
// addall: true,
|
||||
value: myproduct.value,
|
||||
collabel: collabel,
|
||||
arrvalue: [],
|
||||
useinput: true,
|
||||
filter: null,
|
||||
@@ -161,6 +163,16 @@ export default defineComponent({
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
function collabel (rec: any) {
|
||||
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)
|
||||
}
|
||||
return label
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
myclass=""
|
||||
:icon_alternative="item.icon"
|
||||
:optval="fieldsTable.getKeyByTable(item.table)"
|
||||
:optlab="fieldsTable.getLabelByTable(item.table)"
|
||||
:optlab="item.collabel"
|
||||
:options="valoriopt(item, false)"
|
||||
:filter="item.filter"
|
||||
:filter_extra="item.filter_extra"
|
||||
|
||||
Reference in New Issue
Block a user