- scheda prodotto migliorata

- aggiornamento filtri
This commit is contained in:
Surya Paolo
2025-04-24 01:03:20 +02:00
parent fc015404a6
commit 8d6c53803e
18 changed files with 420 additions and 152 deletions

View File

@@ -299,7 +299,7 @@ export default defineComponent({
}
async function updateproduct(atload: boolean) {
async function updateproduct(atload: boolean, forza?: boolean) {
let carica = true
@@ -313,7 +313,7 @@ export default defineComponent({
if (carica) {
myproduct.value = null;
updateproductmodif(null)
updateproductmodif(null, forza)
}
// products.updateQuantityAvailable(myproduct.value._id)
@@ -331,13 +331,13 @@ export default defineComponent({
}
async function updateproductmodif(element: any) {
async function updateproductmodif(element: any, forza?: boolean) {
console.log('CCATALOGOCARD: updateproductmodif')
try {
if (element?._id) {
myproduct.value = await products.getProductById(element?._id, true)
myproduct.value = await products.getProductById(element?._id, forza)
} else {
myproduct.value = await products.getProductById(props.id, true)
myproduct.value = await products.getProductById(props.id, forza)
}
updateLabel()
@@ -458,7 +458,7 @@ export default defineComponent({
async function load() {
indvariazSel.value = -1
initproduct()
await updateproduct(true)
await updateproduct(true, true)
labelDataArrivoMerce.value = ''
labelDataRitiro.value = ''
@@ -643,7 +643,7 @@ export default defineComponent({
return optcatalogo.value.areadistampa!.scale
}
async function refreshDataFromGM() {
/*async function refreshDataFromGM() {
if (myproduct.value) {
loading.value = true
updatefromgm.value = true
@@ -659,8 +659,9 @@ export default defineComponent({
loading.value = false
}
}
async function refreshAllDataBookFromGM(options: any) {
}*/
/*async function refreshAllDataBookFromGM(options: any) {
if (myproduct.value) {
loading.value = true
updatefromgm.value = true
@@ -669,14 +670,15 @@ export default defineComponent({
if (ris) {
// field_updated_fromGM.value = t('dbgm.updateLocalDb_OK')
await updateproduct(false)
await updateproduct(false, false)
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
updatefromgm.value = false
}
loading.value = false
}
}
}*/
async function refreshSingleBookFromGM(options: any) {
if (myproduct.value) {
loading.value = true
@@ -686,8 +688,13 @@ export default defineComponent({
if (ris) {
// field_updated_fromGM.value = t('dbgm.updateLocalDb_OK')
await updateproduct(false)
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
if (ris.error) {
tools.showNegativeNotif($q, ris.error)
} else {
await updateproduct(false, false)
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
}
updatefromgm.value = false
}
loading.value = false
@@ -777,8 +784,8 @@ export default defineComponent({
field_updated_fromGM,
refreshFieldFromGM,
updatetogm,
refreshDataFromGM,
refreshAllDataBookFromGM,
// refreshDataFromGM,
// refreshAllDataBookFromGM,
refreshSingleBookFromGM,
loading,
}

View File

@@ -138,7 +138,7 @@
</q-item-section>
</q-item>
<q-item
<!--<q-item
v-if="
tools.isManager() && !optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)
"
@@ -156,7 +156,7 @@
<q-item-section>
<q-item-label>Carica da GM</q-item-label>
</q-item-section>
</q-item>
</q-item>-->
<q-item
v-if="
tools.isManager() && !optcatalogo.generazionePDFInCorso && (editOn || options.show_edit_book)