- aggiornato scheda e rigenera lista

- corretto filtro sulla Collana
This commit is contained in:
Surya Paolo
2025-04-29 02:30:00 +02:00
parent ec19bc3b87
commit 493ebf51f3
24 changed files with 1219 additions and 888 deletions

View File

@@ -242,15 +242,25 @@ export default defineComponent({
}
function naviga(path: string) {
router.push(path)
}
function collabel(rec: any) {
// console.log('Record:', rec)
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(', ')}`
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 (!productStore.isPubblicatoById(rec.productInfo.idStatoProdotto))
label += ' (' + productStore.getDescrStatiProdottoByIdStatoProdotto(rec.productInfo.idStatoProdotto || '') + ')'
@@ -258,83 +268,83 @@ export default defineComponent({
if (productStore.isEsaurito(rec)) {
label += ' (Attualmente non disponibile)'
}
// console.log('Computed label:', label)
// console.log('Computed label:', label)
}
return label
}
return label
}
function insertProd() {
// console.log('insertProd')
emit('insert', myproduct.value)
// console.log('insertProd')
emit('insert', myproduct.value)
}
function clickClose() {
searchList.value[0].value = ''
myproduct.value = null
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'))
function clickClose() {
searchList.value[0].value = ''
myproduct.value = null
emit('close')
}
// 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 {
userStore,
costanti,
tools,
toolsext,
search,
shared_consts,
productStore,
t,
loadpage,
refreshpage,
show_hide,
searchList,
fieldsTable,
mycolumns,
naviga,
myproduct,
optcatalogo,
idPage,
selauthor,
valoriopt,
labelcombo,
searchText,
insertProd,
focus,
clickClose,
saveSearch,
updateproductmodif,
searchOnGM,
}
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
}
}
onMounted(mounted)
return {
userStore,
costanti,
tools,
toolsext,
search,
shared_consts,
productStore,
t,
loadpage,
refreshpage,
show_hide,
searchList,
fieldsTable,
mycolumns,
naviga,
myproduct,
optcatalogo,
idPage,
selauthor,
valoriopt,
labelcombo,
searchText,
insertProd,
focus,
clickClose,
saveSearch,
updateproductmodif,
searchOnGM,
}
}
})