Record count
gitea/salix-front/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan 2022-11-07 13:15:11 +01:00
parent 765b3e9f08
commit 67332ebcf0
5 changed files with 32 additions and 9 deletions

View File

@ -29,8 +29,8 @@ const $props = defineProps({
}, },
}); });
defineExpose({ fetch });
const emit = defineEmits(['onFetch']); const emit = defineEmits(['onFetch']);
defineExpose({ fetch });
onMounted(async () => { onMounted(async () => {
if ($props.autoLoad) { if ($props.autoLoad) {

View File

@ -44,7 +44,7 @@ const $props = defineProps({
}, },
}); });
defineEmits(['onNavigate']); const emit = defineEmits(['onFetch', 'onPaginate']);
defineExpose({ refresh }); defineExpose({ refresh });
onMounted(() => { onMounted(() => {
@ -116,6 +116,9 @@ async function paginate() {
pagination.value.descending = descending; pagination.value.descending = descending;
isLoading.value = false; isLoading.value = false;
emit('onFetch', rows);
emit('onPaginate', data);
} }
async function refresh() { async function refresh() {
@ -134,6 +137,8 @@ async function refresh() {
rows.value = data; rows.value = data;
isLoading.value = false; isLoading.value = false;
emit('onFetch', rows);
} }
async function onLoad(...params) { async function onLoad(...params) {

View File

@ -202,7 +202,8 @@ export default {
state: 'State' state: 'State'
}, },
rmaList: { rmaList: {
code: 'Code' code: 'Code',
records: 'records'
}, },
rma: { rma: {
user: 'User', user: 'User',

View File

@ -201,7 +201,8 @@ export default {
state: 'Estado' state: 'Estado'
}, },
rmaList: { rmaList: {
code: 'Código' code: 'Código',
records: 'registros'
}, },
rma: { rma: {
user: 'Usuario', user: 'Usuario',

View File

@ -8,12 +8,22 @@ import Paginate from 'src/components/Paginate.vue';
const quasar = useQuasar(); const quasar = useQuasar();
const { t } = useI18n(); const { t } = useI18n();
const rmas = ref([]);
const card = ref(null); const card = ref(null);
function onFetch(data) {
rmas.value = data.value;
}
const newRma = ref({ const newRma = ref({
code: '', code: '',
crated: new Date(), crated: new Date(),
}); });
function onInputUpdate(value) {
newRma.value.code = value.toUpperCase();
}
function submit() { function submit() {
const formData = newRma.value; const formData = newRma.value;
if (formData.code === '') return; if (formData.code === '') return;
@ -62,18 +72,24 @@ function hide() {
<q-page-sticky expand position="top" :offset="[16, 16]"> <q-page-sticky expand position="top" :offset="[16, 16]">
<q-card class="card q-pa-md"> <q-card class="card q-pa-md">
<q-form @submit="submit"> <q-form @submit="submit">
<q-input v-model="newRma.code" :label="t('claim.rmaList.code')" class="q-mb-md" autofocus /> <q-input
<!-- <div class="text-caption">$(0) entries</div> --> v-model="newRma.code"
:label="t('claim.rmaList.code')"
@update:model-value="onInputUpdate"
class="q-mb-md"
autofocus
/>
<div class="text-caption">{{ rmas.length }} {{ t('claim.rmaList.records') }}</div>
</q-form> </q-form>
</q-card> </q-card>
</q-page-sticky> </q-page-sticky>
<paginate ref="card" url="/ClaimRmas" sort-by="id DESC" auto-load> <paginate ref="card" url="/ClaimRmas" @on-fetch="onFetch" sort-by="id DESC" auto-load>
<template #body="{ rows }"> <template #body="{ rows }">
<q-card class="card"> <q-card class="card">
<template v-for="row of rows" :key="row.id"> <template v-for="row of rows" :key="row.code">
<q-item class="q-pa-none items-start"> <q-item class="q-pa-none items-start">
<q-item-section class="q-pa-md" @click="navigate(row.id)"> <q-item-section class="q-pa-md">
<q-list> <q-list>
<q-item class="q-pa-none"> <q-item class="q-pa-none">
<q-item-section> <q-item-section>