Aggiornamento cataloghi...
This commit is contained in:
@@ -115,7 +115,9 @@ export default defineComponent({
|
||||
|
||||
const apriSchedaPDF = ref(false)
|
||||
const visufromgm = ref(false)
|
||||
const updatelocaldb = ref(false)
|
||||
const updatefromgm = ref(false)
|
||||
const updatetogm = ref(false)
|
||||
const showQtaDisponibile = ref(false)
|
||||
const field_updated_fromGM = ref('')
|
||||
|
||||
@@ -312,7 +314,7 @@ export default defineComponent({
|
||||
|
||||
if (carica) {
|
||||
myproduct.value = null;
|
||||
updateproductmodif()
|
||||
updateproductmodif(null)
|
||||
}
|
||||
|
||||
// products.updateQuantityAvailable(myproduct.value._id)
|
||||
@@ -334,9 +336,9 @@ export default defineComponent({
|
||||
console.log('CCATALOGOCARD: updateproductmodif')
|
||||
try {
|
||||
if (element?._id) {
|
||||
myproduct.value = await products.getProductById(element?._id)
|
||||
myproduct.value = await products.getProductById(element?._id, true)
|
||||
} else {
|
||||
myproduct.value = await products.getProductById(props.id)
|
||||
myproduct.value = await products.getProductById(props.id, true)
|
||||
}
|
||||
|
||||
updateLabel()
|
||||
@@ -627,8 +629,8 @@ export default defineComponent({
|
||||
function isProductBestseller() {
|
||||
|
||||
try {
|
||||
//return myproduct.value!.productInfo.rank1Y! > 0 && (myproduct.value!.productInfo.rank1Y! < props.scheda.etichette?.bestseller?.primiNInClassifica!)
|
||||
return myproduct.value!.indiceRanking! > 0 && (myproduct.value!.indiceRanking! < props.scheda.etichette?.bestseller?.primiNInClassifica)
|
||||
// diventa un bestseller quando il rank6M è tra i primi 10 ordinandoli per rank6M
|
||||
return myproduct.value!.productInfo.rank6M! > 0 && (myproduct.value!.productInfo.rank6M!)
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
@@ -643,6 +645,19 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
async function refreshDataFromGM() {
|
||||
if (myproduct.value) {
|
||||
loading.value = true
|
||||
updatefromgm.value = true
|
||||
field_updated_fromGM.value = ''
|
||||
const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!)
|
||||
if (ris) {
|
||||
field_updated_fromGM.value = t('dbgm.updateLocalDb_OK')
|
||||
|
||||
await updateproduct(false)
|
||||
tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK'))
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
async function refreshFieldFromGM(field: string) {
|
||||
@@ -653,7 +668,6 @@ export default defineComponent({
|
||||
field_updated_fromGM.value = await globalStore.getGM_FieldOf_T_Web_Articoli(myproduct.value.productInfo.sku!, field, shared_consts.CmdQueryMs.GET)
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
@@ -728,8 +742,10 @@ export default defineComponent({
|
||||
showQtaDisponibile,
|
||||
field_updated_fromGM,
|
||||
refreshFieldFromGM,
|
||||
updatetogm,
|
||||
refreshDataFromGM,
|
||||
loading,
|
||||
updatelocaldb,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user