PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { defineComponent, ref, toRef, computed, PropType, watch, onMounted, reactive, onBeforeUnmount } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, ref, toRef, computed, watch, onMounted, reactive, onBeforeUnmount } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
@@ -7,6 +8,7 @@ import { useQuasar } from 'quasar'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { CCardState } from '../CCardState'
|
||||
import { CCopyBtn } from '../CCopyBtn'
|
||||
import { CViewTable } from '../CViewTable'
|
||||
import { CMyValueDb } from '../CMyValueDb'
|
||||
import { CPrice } from '../CPrice'
|
||||
import { CText } from '../CText'
|
||||
@@ -16,11 +18,14 @@ import { CBarCode } from '../CBarCode'
|
||||
|
||||
import { func_tools, toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
import {
|
||||
IBaseOrder, IOptCatalogo, IGasordine, IMyScheda, IOrder, IOrderCart,
|
||||
import type {
|
||||
IOptCatalogo, IGasordine, IMyScheda, IOrder, IOrderCart,
|
||||
IProduct, IVariazione
|
||||
} from '@src/model';
|
||||
import {
|
||||
IBaseOrder
|
||||
} from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { tools } from '@tools'
|
||||
import { useProducts } from '@store/Products'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
@@ -81,8 +86,8 @@ export default defineComponent({
|
||||
},
|
||||
components: {
|
||||
CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice, CBarCode, CLabel,
|
||||
CText
|
||||
},
|
||||
CText, CViewTable
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -92,7 +97,7 @@ export default defineComponent({
|
||||
|
||||
const listord = ref(<IOrderCart[]>[])
|
||||
const sumval = ref(0)
|
||||
const editOn = ref(false)
|
||||
const loading = ref(false)
|
||||
|
||||
const indvariazSel = ref(-1)
|
||||
|
||||
@@ -103,10 +108,24 @@ export default defineComponent({
|
||||
const fullscreenImage = ref(<any>null)
|
||||
|
||||
const apriSchedaPDF = ref(false)
|
||||
const visufromgm = ref(false)
|
||||
const updatefromgm = ref(false)
|
||||
const showQtaDisponibile = ref(false)
|
||||
const field_updated_fromGM = ref('')
|
||||
|
||||
// Crea una copia locale reattiva di modelValue
|
||||
const optcatalogo = ref<IOptCatalogo>({ ...props.modelValue });
|
||||
|
||||
const editOn = computed({
|
||||
get(): boolean {
|
||||
return globalStore.editOn ? globalStore.editOn : false
|
||||
},
|
||||
|
||||
set(value: boolean) {
|
||||
return tools.updateEditOn(value)
|
||||
}
|
||||
})
|
||||
|
||||
// Watcher per sincronizzare le modifiche di modelValue
|
||||
watch(() => props.modelValue, (newVal) => {
|
||||
optcatalogo.value = { ...newVal };
|
||||
@@ -123,8 +142,8 @@ export default defineComponent({
|
||||
updateCatalogoPadre()
|
||||
};
|
||||
|
||||
let myorder = reactive(<IOrder>{
|
||||
idapp: process.env.APP_ID,
|
||||
const myorder = reactive(<IOrder>{
|
||||
idapp: tools.getEnv('VITE_APP_ID'),
|
||||
quantity: 0,
|
||||
quantitypreordered: 0,
|
||||
idStorehouse: '',
|
||||
@@ -157,7 +176,7 @@ export default defineComponent({
|
||||
return products.replaceKeyWordsByProduct(
|
||||
optcatalogo.value,
|
||||
myproduct.value!,
|
||||
props.scheda!.testo_right!,
|
||||
props.scheda.testo_right!,
|
||||
props.idPage,
|
||||
)
|
||||
})
|
||||
@@ -165,7 +184,7 @@ export default defineComponent({
|
||||
return products.replaceKeyWordsByProduct(
|
||||
optcatalogo.value,
|
||||
myproduct.value!,
|
||||
props.scheda!.testo_right_attaccato!,
|
||||
props.scheda.testo_right_attaccato!,
|
||||
props.idPage,
|
||||
)
|
||||
})
|
||||
@@ -182,7 +201,7 @@ export default defineComponent({
|
||||
return products.replaceKeyWordsByProduct(
|
||||
optcatalogo.value,
|
||||
myproduct.value!,
|
||||
props.scheda!.testo_bottom!,
|
||||
props.scheda.testo_bottom!,
|
||||
props.idPage,
|
||||
)
|
||||
})
|
||||
@@ -203,11 +222,7 @@ export default defineComponent({
|
||||
|
||||
|
||||
function iconWhishlist(order: IProduct) {
|
||||
if (true) {
|
||||
return 'far fa-heart'
|
||||
} else {
|
||||
return 'fas fa-heart'
|
||||
}
|
||||
return 'fas fa-heart'
|
||||
}
|
||||
async function addtoCart(add: boolean) {
|
||||
|
||||
@@ -309,7 +324,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
async function updateproductmodif() {
|
||||
console.log('updateproductmodif')
|
||||
// console.log('updateproductmodif')
|
||||
try {
|
||||
myproduct.value = await products.getProductById(props.id)
|
||||
|
||||
@@ -437,7 +452,7 @@ export default defineComponent({
|
||||
|
||||
// console.log('Load', myproduct.value.name)
|
||||
|
||||
if (!!myproduct.value) {
|
||||
if (myproduct.value) {
|
||||
arrordersCart.value = products.getOrdersCartInAttesaByIdProduct(myproduct.value._id)
|
||||
|
||||
if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) {
|
||||
@@ -575,7 +590,7 @@ export default defineComponent({
|
||||
emit('opendetail')
|
||||
}
|
||||
function escludiArticolo(variazione: IVariazione) {
|
||||
let hasExcludeProductTypes = !optcatalogo.value.excludeproductTypes || (optcatalogo.value.excludeproductTypes && (optcatalogo.value.excludeproductTypes.includes(variazione.versione!)))
|
||||
const hasExcludeProductTypes = !optcatalogo.value.excludeproductTypes || (optcatalogo.value.excludeproductTypes && (optcatalogo.value.excludeproductTypes.includes(variazione.versione!)))
|
||||
|
||||
return hasExcludeProductTypes
|
||||
}
|
||||
@@ -602,7 +617,7 @@ export default defineComponent({
|
||||
|
||||
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!)
|
||||
return myproduct.value!.indiceRanking! > 0 && (myproduct.value!.indiceRanking! < props.scheda.etichette?.bestseller?.primiNInClassifica)
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
@@ -616,6 +631,20 @@ export default defineComponent({
|
||||
return optcatalogo.value.areadistampa!.scale
|
||||
}
|
||||
|
||||
async function refreshDataFromGM() {
|
||||
|
||||
}
|
||||
async function refreshFieldFromGM(field: string) {
|
||||
if (myproduct.value) {
|
||||
loading.value = true
|
||||
updatefromgm.value = true
|
||||
field_updated_fromGM.value = ''
|
||||
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)
|
||||
onBeforeUnmount(beforeDestroy)
|
||||
|
||||
@@ -683,6 +712,13 @@ export default defineComponent({
|
||||
getScale,
|
||||
updateCatalogo,
|
||||
optcatalogo,
|
||||
visufromgm,
|
||||
updatefromgm,
|
||||
showQtaDisponibile,
|
||||
field_updated_fromGM,
|
||||
refreshFieldFromGM,
|
||||
refreshDataFromGM,
|
||||
loading,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -118,19 +118,84 @@
|
||||
@click="click_opendetail()"
|
||||
/>
|
||||
</a>
|
||||
<q-btn
|
||||
v-if="
|
||||
(tools.isManager() || tools.isEditor()) &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
globalStore.editOn
|
||||
"
|
||||
icon="fas fa-pencil-alt"
|
||||
color="primary"
|
||||
@click.stop="modifOn = !modifOn"
|
||||
dense
|
||||
style="position: absolute; top: 0px; left: 0px; z-index: 3"
|
||||
>
|
||||
</q-btn>
|
||||
<q-card-actions align="center" class="q-pa-none absolute-top-left">
|
||||
<div class="row justify-center">
|
||||
<q-fab
|
||||
v-if="
|
||||
(tools.isManager() || tools.isEditor()) &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
editOn
|
||||
"
|
||||
color="primary"
|
||||
icon="fas fa-pencil-alt"
|
||||
direction="up"
|
||||
flat
|
||||
dense
|
||||
>
|
||||
<q-fab-action
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
editOn
|
||||
"
|
||||
icon="fas fa-pencil-alt"
|
||||
label="Aggiorna da GM"
|
||||
color="accent"
|
||||
@click="refreshDataFromGM()"
|
||||
/>
|
||||
<q-fab-action
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
editOn
|
||||
"
|
||||
icon="fas fa-pencil-alt"
|
||||
label="Visualizza su GM"
|
||||
color="positive"
|
||||
@click="
|
||||
showQtaDisponibile = false;
|
||||
visufromgm = true;
|
||||
"
|
||||
/>
|
||||
<q-fab-action
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
editOn
|
||||
"
|
||||
icon="fas fa-eye"
|
||||
label="Vedi Numero di Pagine (Da GM)"
|
||||
color="positive"
|
||||
@click="refreshFieldFromGM('Pagine')"
|
||||
/>
|
||||
<q-fab-action
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
editOn
|
||||
"
|
||||
icon="fas fa-pencil-alt"
|
||||
label="Visualizza su GM (Tutti i campi)"
|
||||
color="positive"
|
||||
@click="
|
||||
showQtaDisponibile = true;
|
||||
visufromgm = true;
|
||||
"
|
||||
/>
|
||||
<q-fab-action
|
||||
v-if="
|
||||
(tools.isManager() || tools.isEditor()) &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
editOn
|
||||
"
|
||||
label="Modifica"
|
||||
icon="fas fa-pencil-alt"
|
||||
color="primary"
|
||||
@click="modifOn = !modifOn"
|
||||
/>
|
||||
</q-fab>
|
||||
</div>
|
||||
</q-card-actions>
|
||||
</div>
|
||||
|
||||
<!-- Testo sotto all'immagine -->
|
||||
@@ -172,9 +237,7 @@
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
:format="scheda.barcode.format"
|
||||
:fontsize="
|
||||
scheda.barcode.font?.size
|
||||
"
|
||||
:fontsizeprop="scheda.barcode.font?.size"
|
||||
:gap="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.gap)
|
||||
"
|
||||
@@ -186,7 +249,9 @@
|
||||
)
|
||||
)
|
||||
"
|
||||
:widthlines="tools.adjustSize(optcatalogo, scheda.barcode.widthlines)"
|
||||
:widthlines="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.widthlines)
|
||||
"
|
||||
:height="
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
@@ -251,9 +316,7 @@
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
:format="scheda.barcode.format"
|
||||
:fontsize="
|
||||
scheda.barcode.font?.size
|
||||
"
|
||||
:fontsizeprop="scheda.barcode.font?.size"
|
||||
:gap="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.gap)
|
||||
"
|
||||
@@ -265,7 +328,9 @@
|
||||
)
|
||||
)
|
||||
"
|
||||
:widthlines="tools.adjustSize(optcatalogo, scheda.barcode.widthlines)"
|
||||
:widthlines="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.widthlines)
|
||||
"
|
||||
:height="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.height)
|
||||
"
|
||||
@@ -347,7 +412,7 @@
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ t('ecomm.listaord') }} - {{ myproduct.productInfo.name }}
|
||||
{{ t("ecomm.listaord") }} - {{ myproduct.productInfo.name }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
@@ -652,7 +717,11 @@
|
||||
</div>
|
||||
<div class="boxtitleval">
|
||||
<div class="etichetta">Argomenti:</div>
|
||||
{{ products.getCatProdsStrByCatProds(myproduct.productInfo.idCatProds) }}
|
||||
{{
|
||||
products.getCatProdsStrByCatProds(
|
||||
myproduct.productInfo.idCatProds
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -838,6 +907,43 @@
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog v-if="visufromgm && myproduct" v-model="visufromgm">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Visu </q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<CViewTable
|
||||
:options="{
|
||||
nameTable: 'T_Web_Articoli',
|
||||
campispeciali: true,
|
||||
numrec: 100,
|
||||
where: 'T.IdArticolo =' + myproduct.productInfo.sku,
|
||||
showQtaDisponibile,
|
||||
outhtml: true,
|
||||
}"
|
||||
>
|
||||
</CViewTable>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog v-if="updatefromgm && myproduct" v-model="updatefromgm">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Aggiorna da GM: </q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<q-inner-loading id="spinner" :showing="loading">
|
||||
<q-spinner-tail color="primary" size="4em"> </q-spinner-tail>
|
||||
</q-inner-loading>
|
||||
<br />
|
||||
Valore: {{ field_updated_fromGM }}
|
||||
<br />
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -845,5 +951,5 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CCatalogoCard.scss';
|
||||
@import "./CCatalogoCard.scss";
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user