From 6d0efaadb9c505fac2da21601b0be7c9d9cda933 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Fri, 18 Apr 2025 13:23:52 +0200 Subject: [PATCH] =?UTF-8?q?-=20aggiornamento=20cataloghi.=20possibilit?= =?UTF-8?q?=C3=A0=20di=20estrapolare=20i=20dati=20da=20GM=20direttamente?= =?UTF-8?q?=20-=20migrazione=20delle=20tabelle=20di=20GM=20in=20locale=20-?= =?UTF-8?q?=20corretto=20l'ordinamento=20del=20Catalogo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/db/lang/ws_it.js | 1 + src/components/CCatalogoCard/CCatalogoCard.ts | 23 ++- .../CCatalogoCard/CCatalogoCard.vue | 64 ++++++++- src/components/CProductTable/CProductTable.ts | 4 +- .../CProductTable/CProductTable.vue | 24 +++- .../CSchedaProdotto/CSchedaProdotto.ts | 2 +- src/db/lang/ws_it.js | 1 + src/model/Products.ts | 9 +- src/router/routesAdmin.ts | 13 ++ src/store/Products.ts | 55 ++++++-- src/store/globalStore.ts | 10 +- src/views/admin/dbopmacro/dbopmacro.scss | 36 +++++ src/views/admin/dbopmacro/dbopmacro.ts | 131 ++++++++++++++++++ src/views/admin/dbopmacro/dbopmacro.vue | 80 +++++++++++ src/views/admin/dbopmacro/index.ts | 1 + src/views/ecommerce/catalogo/catalogo.ts | 71 +++------- 16 files changed, 452 insertions(+), 73 deletions(-) create mode 100755 src/views/admin/dbopmacro/dbopmacro.scss create mode 100755 src/views/admin/dbopmacro/dbopmacro.ts create mode 100755 src/views/admin/dbopmacro/dbopmacro.vue create mode 100755 src/views/admin/dbopmacro/index.ts diff --git a/scripts/_ALL_SITES/comunitanuovomondo.app/src/db/lang/ws_it.js b/scripts/_ALL_SITES/comunitanuovomondo.app/src/db/lang/ws_it.js index 15a48e2d..0b8c0bca 100755 --- a/scripts/_ALL_SITES/comunitanuovomondo.app/src/db/lang/ws_it.js +++ b/scripts/_ALL_SITES/comunitanuovomondo.app/src/db/lang/ws_it.js @@ -84,6 +84,7 @@ const msg_website_it = { eventodef: 'Evento:', prova: 'prova', dbop: 'Operazioni', + dbopmacro: 'Operazioni Macro', projall: 'Comunitari', groups: 'Lista Gruppi', projectsShared: 'Condivisi da me', diff --git a/src/components/CCatalogoCard/CCatalogoCard.ts b/src/components/CCatalogoCard/CCatalogoCard.ts index ecf9de3f..d4241cce 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.ts +++ b/src/components/CCatalogoCard/CCatalogoCard.ts @@ -648,7 +648,7 @@ export default defineComponent({ loading.value = true updatefromgm.value = true field_updated_fromGM.value = '' - const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!) + const ris = await globalStore.updateLocalDbFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!, myproduct.value.isbn) if (ris) { field_updated_fromGM.value = t('dbgm.updateLocalDb_OK') @@ -659,12 +659,28 @@ export default defineComponent({ } } - async function refreshAllDataBookFromGM() { + async function refreshAllDataBookFromGM(options: any) { if (myproduct.value) { loading.value = true updatefromgm.value = true field_updated_fromGM.value = '' - const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli(myproduct.value.productInfo.sku!) + const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: myproduct.value.productInfo.sku!, isbn: myproduct.value.productInfo.code, ...options, caricatutti: true }) + 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 refreshSingleBookFromGM(options: any) { + if (myproduct.value) { + loading.value = true + updatefromgm.value = true + field_updated_fromGM.value = '' + const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: myproduct.value.productInfo.sku!, isbn: myproduct.value.productInfo.code, ...options }) if (ris) { field_updated_fromGM.value = t('dbgm.updateLocalDb_OK') @@ -760,6 +776,7 @@ export default defineComponent({ updatetogm, refreshDataFromGM, refreshAllDataBookFromGM, + refreshSingleBookFromGM, loading, } } diff --git a/src/components/CCatalogoCard/CCatalogoCard.vue b/src/components/CCatalogoCard/CCatalogoCard.vue index 4f14e0b9..ca0e20b0 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.vue +++ b/src/components/CCatalogoCard/CCatalogoCard.vue @@ -163,7 +163,7 @@ " clickable v-close-popup - @click="refreshAllDataBookFromGM()" + @click="refreshSingleBookFromGM({usaDBGMLocale: false})" > - Riaggiorna Tutto il Libro da GM + Riaggiorna il Libro da GM + + + + + + Riaggiorna il Libro da DBLocale + + + 0 ? cookieValue : ["drag", "image", "name", "authors", "catprods", "isbn", "actions"]); + const selectedColumns = ref(cookieValue.length > 0 ? cookieValue : ["pos", "drag", "image", "name", "authors", "catprods", "isbn", "actions"]); // 3. Funzione per verificare se una colonna è visibile (isColumnVisible) diff --git a/src/components/CProductTable/CProductTable.vue b/src/components/CProductTable/CProductTable.vue index 6b8eb08b..cb736fc6 100755 --- a/src/components/CProductTable/CProductTable.vue +++ b/src/components/CProductTable/CProductTable.vue @@ -40,8 +40,22 @@ @end="onDragEnd" >