feat: refs #8277 add agricultural and account type fields, enhance filtering options, and update localization
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
ba38c42140
commit
9b3fc52377
|
@ -367,7 +367,7 @@ function getCaption(opt) {
|
|||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
v-show="isClearable && value"
|
||||
v-show="isClearable && value != null && value !== ''"
|
||||
name="close"
|
||||
@click="
|
||||
() => {
|
||||
|
@ -382,7 +382,7 @@ function getCaption(opt) {
|
|||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<div v-if="slotName == 'append'">
|
||||
<QIcon
|
||||
v-show="isClearable && value"
|
||||
v-show="isClearable && value != null && value !== ''"
|
||||
name="close"
|
||||
@click.stop="
|
||||
() => {
|
||||
|
@ -407,7 +407,7 @@ function getCaption(opt) {
|
|||
<QItemLabel>
|
||||
{{ opt[optionLabel] }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption v-if="getCaption(opt)">
|
||||
<QItemLabel caption v-if="getCaption(opt) !== false">
|
||||
{{ `#${getCaption(opt)}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
|
|
|
@ -1,16 +1,44 @@
|
|||
<script setup>
|
||||
import { ref, computed, markRaw } from 'vue';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import { ref, computed, markRaw, useTemplateRef, onBeforeMount } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { toDate, toCurrency } from 'src/filters';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||
import EntryDescriptorProxy from './Card/EntryDescriptorProxy.vue';
|
||||
import SupplierDescriptorProxy from '../Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const MAXDAYS = 365;
|
||||
const DEFAULTDAYS = 60;
|
||||
const dataKey = 'entryControl';
|
||||
const url = 'Entries/control';
|
||||
let arrayData = useArrayData(dataKey);
|
||||
const daysAgo = ref();
|
||||
const table = useTemplateRef('table');
|
||||
const companies = ref([]);
|
||||
const countries = ref([]);
|
||||
const entryTypes = ref([]);
|
||||
const entryAccounts = ref([]);
|
||||
const warehouses = ref([]);
|
||||
const columns = computed(() => [
|
||||
{
|
||||
name: 'id',
|
||||
label: t('entry.control.id'),
|
||||
isId: true,
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'invoiceNumber',
|
||||
label: t('entry.control.invoiceNumber'),
|
||||
},
|
||||
{
|
||||
name: 'company',
|
||||
label: t('globals.company'),
|
||||
|
@ -21,6 +49,15 @@ const columns = computed(() => [
|
|||
options: companies.value,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'warehouse',
|
||||
label: t('globals.warehouse'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'warehouseInFk',
|
||||
options: warehouses.value,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'gestDocFk',
|
||||
label: t('entry.control.gestDocFk'),
|
||||
|
@ -36,10 +73,6 @@ const columns = computed(() => [
|
|||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'invoiceNumber',
|
||||
label: t('entry.control.invoiceNumber'),
|
||||
},
|
||||
{
|
||||
name: 'reference',
|
||||
label: t('entry.control.reference'),
|
||||
|
@ -62,14 +95,6 @@ const columns = computed(() => [
|
|||
name: 'landed',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'id',
|
||||
label: t('entry.control.id'),
|
||||
isId: true,
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'invoiceInFk',
|
||||
label: t('entry.control.invoiceInFk'),
|
||||
|
@ -108,6 +133,20 @@ const columns = computed(() => [
|
|||
{
|
||||
name: 'payDem',
|
||||
label: t('entry.control.payDem'),
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
name: 'payDem',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'accountType',
|
||||
label: t('entry.control.accountType'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'accountType',
|
||||
options: entryAccounts.value,
|
||||
optionLabel: 'account',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'amount',
|
||||
|
@ -118,6 +157,11 @@ const columns = computed(() => [
|
|||
name: 'amount',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'isAgricultural',
|
||||
label: t('entry.control.isAgricultural'),
|
||||
component: 'checkbox',
|
||||
},
|
||||
{
|
||||
name: 'isBooked',
|
||||
label: t('entry.control.isBooked'),
|
||||
|
@ -133,18 +177,10 @@ const columns = computed(() => [
|
|||
// label: t('entry.travelFk'),
|
||||
// },
|
||||
// {
|
||||
// name: 'landed',
|
||||
// label: t('entry.landed'),
|
||||
// },
|
||||
// {
|
||||
// name: 'agencyMode',
|
||||
// label: t('entry.agencyMode'),
|
||||
// format: (row) => row.agencyMode,
|
||||
// },
|
||||
{
|
||||
name: 'isAgricultural',
|
||||
label: t('entry.isAgricultural'),
|
||||
},
|
||||
// {
|
||||
// name: 'account',
|
||||
// label: t('globals.account'),
|
||||
|
@ -154,6 +190,20 @@ const columns = computed(() => [
|
|||
// label: t('globals.nickname'),
|
||||
// },
|
||||
]);
|
||||
|
||||
onBeforeMount(() => {
|
||||
const curParams = JSON.parse(route.query[dataKey] ?? '{}');
|
||||
const val = curParams.daysAgo ?? DEFAULTDAYS;
|
||||
route.query[dataKey] = JSON.stringify({ ...curParams, daysAgo: val });
|
||||
daysAgo.value = val;
|
||||
});
|
||||
|
||||
function filterByDaysAgo(val) {
|
||||
if (!val || val > MAXDAYS) val = MAXDAYS;
|
||||
daysAgo.value = val;
|
||||
arrayData.store.userParams.daysAgo = daysAgo.value;
|
||||
table.value.reload();
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -168,20 +218,65 @@ const columns = computed(() => [
|
|||
@on-fetch="(data) => (companies = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
:filter="{ fields: ['id', 'name'] }"
|
||||
@on-fetch="(data) => (warehouses = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="EntryTypes"
|
||||
:filter="{ fields: ['code', 'description'] }"
|
||||
@on-fetch="(data) => (entryTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnTable
|
||||
data-key="entryControl"
|
||||
url="Entries/control"
|
||||
:columns
|
||||
<FetchData
|
||||
url="EntryAccounts"
|
||||
:filter="{ fields: ['id', 'account'] }"
|
||||
@on-fetch="(data) => (entryAccounts = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnSearchbar
|
||||
:data-key
|
||||
:url
|
||||
:label="t('entry.control.search')"
|
||||
:info="t('entry.control.searchInfo')"
|
||||
/>
|
||||
<VnTable
|
||||
:data-key
|
||||
:columns
|
||||
:search-url="dataKey"
|
||||
ref="table"
|
||||
:url
|
||||
:disable-option="{ card: true }"
|
||||
redirect="Entry"
|
||||
:order="['landed DESC']"
|
||||
:right-search="false"
|
||||
/>
|
||||
:user-params="{ daysAgo }"
|
||||
>
|
||||
<template #top-left>
|
||||
<VnInputNumber
|
||||
v-model="daysAgo"
|
||||
:label="$t('globals.daysAgo')"
|
||||
dense
|
||||
:step="1"
|
||||
:decimal-places="0"
|
||||
@update:model-value="filterByDaysAgo"
|
||||
debounce="500"
|
||||
:title="t('entry.control.daysAgo')"
|
||||
/>
|
||||
</template>
|
||||
<template #column-id="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.id }}
|
||||
<EntryDescriptorProxy :id="row.id" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-supplier="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.supplier }}
|
||||
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
|
|
@ -134,6 +134,11 @@ entry:
|
|||
isBooked: B
|
||||
received: R
|
||||
entryType: Entry type
|
||||
isAgricultural: Agricultural
|
||||
accountType: Account type
|
||||
daysAgo: Max 360 days
|
||||
search: Search
|
||||
searchInfo: You can search by supplier name or nickname
|
||||
entryFilter:
|
||||
params:
|
||||
isExcludedFromAvailable: Excluded from available
|
||||
|
|
|
@ -84,6 +84,11 @@ entry:
|
|||
isBooked: C
|
||||
received: R
|
||||
entryType: Tipo de entrada
|
||||
isAgricultural: Agricultural
|
||||
accountType: Tipo de cuenta
|
||||
daysAgo: Máximo 360 días
|
||||
search: Buscar
|
||||
searchInfo: Puedes buscar por nombre o alias de proveedor
|
||||
params:
|
||||
entryFk: Entrada
|
||||
observationTypeFk: Tipo de observación
|
||||
|
|
Loading…
Reference in New Issue