aggiornamento scontistica, corretto errori

This commit is contained in:
Surya Paolo
2023-12-16 18:40:24 +01:00
parent 38f4c73ab3
commit fa544bc30c
10 changed files with 68 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ PROVA_PAOLO=""
LANG_DEFAULT="it"
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
MONGODB_HOST="https://srv.piuchebuono.app:3000"
MONGODB_HOST="https://piuchebuono.app:3000"
LOGO_REG='piuchebuono-logo-full.png'
TEST_NAME=""
TEST_SURNAME=""

View File

@@ -10,7 +10,7 @@ PROVA_PAOLO=""
LANG_DEFAULT="it"
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
MONGODB_HOST="https://srv.piuchebuono.app:3001"
MONGODB_HOST="https://piuchebuono.app:3001"
LOGO_REG='piuchebuono-logo-full.png'
TEST_NAME=""
TEST_SURNAME=""

View File

@@ -28,3 +28,8 @@
font-weight: bold;
font-size: 1.2rem;
}
.prod_sconti {
font-size: 1.1rem;
color: blue;
}

View File

@@ -51,6 +51,15 @@
myproduct.after_price
}}</span>
</q-item-label>
<q-item-label v-if="myproduct.scontisticas && myproduct.scontisticas.length > 0">
<div
class="prod_sconti"
v-for="(sconti, index) of myproduct.scontisticas"
:key="index"
>
{{ sconti.description }}
</div>
</q-item-label>
</q-item-section>
</q-item>
</q-list>
@@ -129,8 +138,11 @@
tools.isManager() && myproduct.QuantitaOrdinateInAttesa > 0
"
>
{{ $t('ecomm.qta_in_attesa', {qty: myproduct.QuantitaOrdinateInAttesa }) }}
{{
$t('ecomm.qta_in_attesa', {
qty: myproduct.QuantitaOrdinateInAttesa,
})
}}
</div>
</div>
</q-item-label>

View File

@@ -7,6 +7,8 @@ export interface IProduct {
idProducer?: string,
idProvider?: string,
idStorehouses?: string[],
idScontisticas?: string[],
scontisticas: IScontistica[],
producer?: IProducer,
storehouses: IStorehouse[],
provider?: IProvider,
@@ -45,6 +47,7 @@ export interface IOrder {
idProducer?: string
idProvider?: string
idStorehouse?: string
idScontisticas?: string[]
price?: number
after_price?: string
color?: string
@@ -55,6 +58,7 @@ export interface IOrder {
product?: IProduct
producer?: IProducer
storehouse?: IStorehouse
scontisticas?: IScontistica[]
provider?: IProvider
date_created?: Date
date_checkout?: Date

View File

@@ -3566,7 +3566,7 @@ export const fieldsTable = {
label: 'Scontistica',
columns: colTableScontistica,
colkey: '_id',
collabel: 'code',
collabel: 'description',
},
{
value: 'sharewithus',

View File

@@ -44,7 +44,7 @@ export const useProducts = defineStore('Products', {
getProduct: (state: IProductsState) => (code: string): IProduct => {
const prod = state.products.find((prod: IProduct) => prod.code === code)
return prod ? prod : { storehouses: [] }
return prod ? prod : { storehouses: [], scontisticas: [] }
},
getCart: (state: IProductsState) => (): ICart => {
@@ -151,6 +151,8 @@ export const useProducts = defineStore('Products', {
active: false,
idProducer: '',
idStorehouses: [],
idScontisticas: [],
scontisticas: [],
idProvider: '',
producer: {},
storehouses: [],
@@ -191,7 +193,6 @@ export const useProducts = defineStore('Products', {
idapp: process.env.APP_ID,
idProduct: product._id,
idProducer: product.idProducer,
idProvider: product.idProvider,
status: shared_consts.OrderStatus.IN_CART,
price: product.price,
after_price: product.after_price,
@@ -201,7 +202,7 @@ export const useProducts = defineStore('Products', {
quantity: order.quantity,
idStorehouse: order.idStorehouse,
idScontisticas: product.idScontisticas,
}
if (product.storehouses.length === 1) {

View File

@@ -120,8 +120,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
resps: [],
workers: [],
storehouses: [],
providers: [],
scontisticas: [],
providers: [],
departments: [],
categories: [],
sharewithus: [],

View File

@@ -10,6 +10,7 @@ import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { CProductCard } from '@src/components/CProductCard'
import { IProduct } from '@src/model'
export default defineComponent({
@@ -24,12 +25,24 @@ export default defineComponent({
const $q = useQuasar()
const { t } = useI18n()
const search = ref('')
function mounted() {
// Inizializza
productStore.loadProducts()
}
function getProducts() {
return productStore.getProducts()
let arrprod = productStore.getProducts()
if (!search.value) {
return arrprod
}
let lowerSearchText = search.value.toLowerCase();
return arrprod.filter((product: IProduct) => {
let lowerName = product.name!.toLowerCase();
return product.code!.includes(search.value) || lowerName.includes(lowerSearchText);
});
}
onMounted(mounted)
@@ -40,6 +53,7 @@ export default defineComponent({
tools,
toolsext,
getProducts,
search,
}
}
})

View File

@@ -2,8 +2,28 @@
<q-page>
<div class="panel">
<div class="container">
<div
class="q-gutter-y-md column text-center q-mx-auto"
style="width: 350px; max-width: 100%"
>
<q-input
filled
stack-label
label="Inserisci il codice o il testo"
v-model="search"
class="q-ml-md"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</div>
<div class="row">
<div class="q-pa-md row items-start q-gutter-md" v-for="(product, index) in getProducts()" :key="index">
<div
class="q-pa-md row items-start q-gutter-md"
v-for="(product, index) in getProducts()"
:key="index"
>
<CProductCard :code="product.code" :complete="false" />
</div>
</div>
@@ -13,7 +33,6 @@
</template>
<script lang="ts" src="./productsList.ts">
</script>
<style lang="scss" scoped>