forked from verdnatura/salix-front
feat: refs #6943 wip consumption filter
This commit is contained in:
parent
f723e6f058
commit
aab823abd5
|
@ -1,13 +1,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue';
|
||||||
|
import { useStateStore } from 'src/stores/useStateStore';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<h5 class="flex justify-center color-vn-label">
|
<Teleport to="#right-panel" v-if="useStateStore().isHeaderMounted()">
|
||||||
{{ t('Enter a new search') }}
|
<CustomerConsumptionFilter data-key="CustomerConsumption" />
|
||||||
</h5>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import { QItem } from 'quasar';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import { QItemSection } from 'quasar';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params }">
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.item')"
|
||||||
|
v-model="params.itemId"
|
||||||
|
is-outlined
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.buyerId"
|
||||||
|
url="TicketRequests/getItemTypeWorker"
|
||||||
|
:label="t('params.buyer')"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<!--It's required to include the relation category !! There's 413 records in production-->
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.typeId"
|
||||||
|
url="ItemTypes"
|
||||||
|
:label="t('params.type')"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
>
|
||||||
|
</VnSelect>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
url="ItemCategories"
|
||||||
|
:label="t('params.category')"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
v-model="params.categoryId"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
item: Item id
|
||||||
|
buyer: Buyer
|
||||||
|
type: Type
|
||||||
|
category: Category
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
item: Id artículo
|
||||||
|
buyer: Comprador
|
||||||
|
type: Tipo
|
||||||
|
category: Categoría
|
||||||
|
</i18n>
|
|
@ -11,10 +11,12 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { dialogRef } = useDialogPluginComponent();
|
const { dialogRef } = useDialogPluginComponent();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
companyId: {
|
companyId: {
|
||||||
|
@ -55,12 +57,12 @@ const filterClientFindOne = {
|
||||||
id: route.params.id,
|
id: route.params.id,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialData = reactive({
|
const initialData = reactive({
|
||||||
amountPaid: $props.totalCredit,
|
amountPaid: $props.totalCredit,
|
||||||
clientFk: route.params.id,
|
clientFk: route.params.id,
|
||||||
companyFk: $props.companyId,
|
companyFk: $props.companyId,
|
||||||
email: clientFindOne.value.email,
|
email: clientFindOne.value.email,
|
||||||
|
bankFk: user.value.localBankFk,
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
|
|
Loading…
Reference in New Issue