0
0
Fork 0

Merge pull request '#6900 add Serial' (!610) from 6900-addSerial into test

Reviewed-on: verdnatura/salix-front#610
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-08-14 14:20:40 +00:00
commit a564f94e30
6 changed files with 143 additions and 7 deletions

View File

@ -117,14 +117,17 @@ async function search(evt) {
isLoading.value = true; isLoading.value = true;
const filter = { ...userParams.value, ...$props.modelValue }; const filter = { ...userParams.value, ...$props.modelValue };
store.userParamsChanged = true; store.userParamsChanged = true;
const { params: newParams } = await arrayData.addFilter({ try {
params: filter, const { params: newParams } = await arrayData.addFilter({
}); params: filter,
userParams.value = newParams; });
userParams.value = newParams;
if (!$props.showAll && !Object.values(filter).length) store.data = []; if (!$props.showAll && !Object.values(filter).length) store.data = [];
} finally {
isLoading.value = false;
}
isLoading.value = false;
emit('search'); emit('search');
} }

View File

@ -251,6 +251,7 @@ globals:
privileges: Privileges privileges: Privileges
ldap: LDAP ldap: LDAP
samba: Samba samba: Samba
serial: Serial
created: Created created: Created
worker: Worker worker: Worker
now: Now now: Now

View File

@ -253,6 +253,7 @@ globals:
packages: Bultos packages: Bultos
ldap: LDAP ldap: LDAP
samba: Samba samba: Samba
serial: Facturas por serie
created: Fecha creación created: Fecha creación
worker: Trabajador worker: Trabajador
now: Ahora now: Ahora

View File

@ -0,0 +1,68 @@
<script setup>
import { ref, computed, onBeforeMount } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import InvoiceInSerialFilter from './InvoiceInSerialFilter.vue';
const { t } = useI18n();
const cols = computed(() => [
{
align: 'left',
name: 'serial',
label: t('Serial'),
columnFilter: false,
},
{
align: 'left',
name: 'pending',
label: t('Pending'),
columnFilter: false,
},
{
align: 'left',
name: 'total',
label: 'Total',
columnFilter: false,
},
]);
const daysAgo = ref();
onBeforeMount(async () => {
const tableParam = useRoute().query.table;
if (tableParam) daysAgo.value = JSON.parse(tableParam).daysAgo;
else
daysAgo.value = (
await axios.get('InvoiceInConfigs/findOne', {
params: { filter: { fields: ['daysAgo'] } },
})
).data?.daysAgo;
});
</script>
<template>
<RightMenu>
<template #right-panel>
<InvoiceInSerialFilter data-key="InvoiceInSerial" />
</template>
</RightMenu>
<VnTable
v-if="!isNaN(daysAgo)"
data-key="InvoiceInSerial"
url="InvoiceIns/getSerial"
:columns="cols"
:right-search="false"
:user-params="{ daysAgo }"
:disable-option="{ card: true }"
auto-load
/>
</template>
<i18n>
es:
Serial: Serie
Pending: Pendiente
</i18n>

View File

@ -0,0 +1,53 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
defineProps({ dataKey: { type: String, required: true } });
const { t } = useI18n();
</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>
<VnInputNumber
v-model="params.daysAgo"
:label="t('params.daysAgo')"
outlined
rounded
dense
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.serial"
:label="t('params.serial')"
outlined
rounded
dense
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
daysAgo: Last days
serial: serial
es:
params:
daysAgo: Últimos días
serial: serie
</i18n>

View File

@ -11,7 +11,7 @@ export default {
component: RouterView, component: RouterView,
redirect: { name: 'InvoiceInMain' }, redirect: { name: 'InvoiceInMain' },
menus: { menus: {
main: ['InvoiceInList'], main: ['InvoiceInList', 'InvoiceInSerial'],
card: [ card: [
'InvoiceInBasicData', 'InvoiceInBasicData',
'InvoiceInVat', 'InvoiceInVat',
@ -37,6 +37,16 @@ export default {
}, },
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'), component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
}, },
{
path: 'serial',
name: 'InvoiceInSerial',
meta: {
title: 'serial',
icon: 'view_list',
},
component: () =>
import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
},
{ {
path: 'create', path: 'create',
name: 'InvoiceInCreare', name: 'InvoiceInCreare',