fix: fix front #1061

Merged
carlossa merged 9 commits from hotfix-irpfDaysOnWard into master 2024-12-16 11:05:35 +00:00
3 changed files with 40 additions and 120 deletions

View File

@ -1,42 +1,33 @@
<script setup>
import { ref, computed, onMounted, watch } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'composables/useArrayData';
import { dashIfEmpty, toCurrency } from 'filters/index';
import { toCurrency } from 'filters/index';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
import ItemRequestDenyForm from './ItemRequestDenyForm.vue';
import { toDate } from 'src/filters';
import VnTable from 'components/VnTable/VnTable.vue';
import VnInput from 'src/components/common/VnInput.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import ItemRequestFilter from './ItemRequestFilter.vue';
const { t } = useI18n();
const { notify } = useNotify();
const stateStore = useStateStore();
let filterParams = ref({});
const denyFormRef = ref(null);
const denyRequestId = ref(null);
const denyRequestIndex = ref(null);
const itemRequestsOptions = ref([]);
const arrayData = useArrayData('ItemRequests', {
url: 'TicketRequests/filter',
userParams: filterParams,
order: ['shippedDate ASC', 'isOk ASC'],
});
const store = arrayData.store;
const userParams = {
state: 'pending',
daysOnward: 7,
};
const tableRef = ref();
watch(
() => store.data,
(value) => (itemRequestsOptions.value = value)
);
onMounted(async () => {
stateStore.rightDrawer = true;
});
const columns = computed(() => [
{
@ -220,14 +211,14 @@ const onDenyAccept = (_, responseData) => {
denyRequestIndex.value = null;
tableRef.value.reload();
};
onMounted(async () => {
await arrayData.fetch({ append: false });
stateStore.rightDrawer = true;
});
</script>
<template>
<RightMenu>
<template #right-panel>
<ItemRequestFilter data-key="itemRequest" ref="tableRef" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="itemRequest"
@ -236,6 +227,7 @@ onMounted(async () => {
:columns="columns"
:user-params="userParams"
:is-editable="true"
:right-search="false"
auto-load
:disable-option="{ card: true }"
chip-locale="item.params"
@ -297,14 +289,17 @@ onMounted(async () => {
<template #moreFilterPanel="{ params }">
<VnInputNumber
carlossa marked this conversation as resolved Outdated
Outdated
Review

QUITAR

QUITAR
:label="t('params.scopeDays')"
v-model.number="params.scopeDays"
v-model.number="params.daysOnward"
@keyup.enter="(evt) => handleScopeDays(evt.target.value)"
@remove="handleScopeDays()"
class="q-px-xs q-pr-lg"
filled
dense
lazy-rules
is-outlined
/>
</template>
<template #column-denyOptions="{ row, rowIndex }">
<QTd class="sticky no-padding">
<QIcon

View File

@ -6,7 +6,6 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n();
const props = defineProps({
@ -42,20 +41,6 @@ const exprBuilder = (param, value) => {
};
}
};
const add = (paramsObj, key) => {
if (paramsObj[key] === undefined) {
paramsObj[key] = 1;
} else {
paramsObj[key]++;
}
};
const decrement = (paramsObj, key) => {
if (paramsObj[key] === 0) return;
paramsObj[key]--;
};
</script>
<template>
@ -79,8 +64,7 @@ const decrement = (paramsObj, key) => {
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span v-if="tag.label !== 'state'">{{ formatFn(tag.value) }}</span>
<span v-else>{{ t(`${tag.value}`) }}</span>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
@ -174,83 +158,6 @@ const decrement = (paramsObj, key) => {
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.myTeam"
:label="t('params.myTeam')"
@update:model-value="searchFn()"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QCard bordered>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.from')"
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.to')"
v-model="params.to"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.scopeDays"
:label="t('globals.daysOnward')"
type="number"
dense
outlined
rounded
:min="0"
>
<template #append>
<QBtn
icon="add"
flat
dense
size="12px"
shortcut="+"
@click="add(params, 'scopeDays')"
/>
<QBtn
icon="remove"
flat
dense
size="12px"
@click="decrement(params, 'scopeDays')"
/>
</template>
</VnInput>
</QItemSection>
</QItem>
<QIcon name="info" style="position: absolute; top: 4px; right: 4px">
<QTooltip max-width="300px">
{{ t('dateFiltersTooltip') }}
</QTooltip>
</QIcon>
</QCard>
<QItem>
<QItemSection>
<QCheckbox
:label="t('params.mine')"
v-model="params.mine"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
@ -267,6 +174,16 @@ const decrement = (paramsObj, key) => {
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.daysOnward')"
v-model="params.daysOnward"
lazy-rules
is-outlined
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>

View File

@ -23,6 +23,7 @@ const insertTag = () => {
workerPitCrudRef.value.insert();
};
const quasar = useQuasar();
const deleteRelative = async (id) => {
await new Promise((resolve) => {
quasar
@ -62,7 +63,6 @@ const deleteRelative = async (id) => {
>
<template #form="{ data }">
<QCard class="q-px-lg q-py-lg">
<VnTitle :text="t('IRPF')" />
<VnRow>
<VnInput
:label="t('familySituation')"
@ -100,8 +100,12 @@ const deleteRelative = async (id) => {
:label="t(`spousePension`)"
/>
</VnRow>
<VnRow>
<QCheckbox v-model="data.isDependend" :label="t(`isDependend`)" />
<VnRow wrap>
<QCheckbox
clearable
v-model="data.isDependend"
:label="t(`isDependend`)"
/>
<QCheckbox
v-model="data.hasHousingPaymentBefore"
:label="t(`hasHousingPaymentBefore`)"
@ -127,7 +131,11 @@ const deleteRelative = async (id) => {
:filter="{
where: { workerFk: route.params.id },
}"
:data-required="{ workerFk: route.params.id }"
:data-required="{
workerFk: route.params.id,
isJointCustody: false,
isDependend: false,
}"
:has-sub-toolbar="false"
>
<template #body="{ rows }">