Compare commits
No commits in common. "2c492e88d56c5e276b2650d4395b1629d3f8ae62" and "ec96f6bea71e5e800d2533143be5fd7e5119ae72" have entirely different histories.
2c492e88d5
...
ec96f6bea7
|
@ -91,10 +91,6 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
maxWidth: {
|
||||
type: [String, Boolean],
|
||||
default: '800px',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||
const modelValue = computed(
|
||||
|
@ -287,7 +283,6 @@ defineExpose({
|
|||
@submit="save"
|
||||
@reset="reset"
|
||||
class="q-pa-md"
|
||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||
id="formModel"
|
||||
>
|
||||
<QCard>
|
||||
|
@ -376,6 +371,7 @@ defineExpose({
|
|||
color: black;
|
||||
}
|
||||
#formModel {
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,6 @@ const mixinRules = [
|
|||
:rules="mixinRules"
|
||||
:lazy-rules="true"
|
||||
hide-bottom-space
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
||||
>
|
||||
<template v-if="$slots.prepend" #prepend>
|
||||
<slot name="prepend" />
|
||||
|
|
|
@ -306,7 +306,6 @@ function handleKeyDown(event) {
|
|||
:input-debounce="useURL ? '300' : '0'"
|
||||
:loading="isLoading"
|
||||
@virtual-scroll="onScroll"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
>
|
||||
<template v-if="isClearable" #append>
|
||||
<QIcon
|
||||
|
|
|
@ -298,7 +298,6 @@ globals:
|
|||
clientsActionsMonitor: Clients and actions
|
||||
serial: Serial
|
||||
medical: Mutual
|
||||
pit: IRPF
|
||||
RouteExtendedList: Router
|
||||
wasteRecalc: Waste recaclulate
|
||||
operator: Operator
|
||||
|
|
|
@ -303,7 +303,6 @@ globals:
|
|||
clientsActionsMonitor: Clientes y acciones
|
||||
serial: Facturas por serie
|
||||
medical: Mutua
|
||||
pit: IRPF
|
||||
wasteRecalc: Recalcular mermas
|
||||
operator: Operario
|
||||
parking: Parking
|
||||
|
|
|
@ -1,263 +0,0 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import axios from 'axios';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'src/components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import CrudModel from 'components/CrudModel.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
const { notify } = useNotify();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const disabilityGradesOptions = ref();
|
||||
const workerPitCrudRef = ref({});
|
||||
const insertTag = () => {
|
||||
workerPitCrudRef.value.insert();
|
||||
};
|
||||
const quasar = useQuasar();
|
||||
const deleteRelative = async (id) => {
|
||||
await new Promise((resolve) => {
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('Remove Relative'),
|
||||
message: t('Do you want to remove this relative?'),
|
||||
},
|
||||
})
|
||||
.onOk(() => {
|
||||
resolve(true);
|
||||
})
|
||||
.onCancel(() => {
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
await axios.delete(`WorkerRelatives/${id}`);
|
||||
workerPitCrudRef.value.reload();
|
||||
notify('Relative removed', 'positive');
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="DisabilityGrades"
|
||||
@on-fetch="(data) => (disabilityGradesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
||||
<FormModel
|
||||
url="WorkerIrpfs"
|
||||
:filter="{ where: { workerFk: route.params.id } }"
|
||||
auto-load
|
||||
data-key="workerIrpfs"
|
||||
:max-width="false"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<QCard class="q-px-lg q-py-lg">
|
||||
<VnTitle :text="t('IRPF')" />
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="t('familySituation')"
|
||||
clearable
|
||||
v-model="data.familySituation"
|
||||
/>
|
||||
<VnInput :label="t('spouseNif')" clearable v-model="data.spouseNif" />
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('disabilityGrades')"
|
||||
:options="disabilityGradesOptions"
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="data.disabilityGradeFk"
|
||||
id="disabilityGrades"
|
||||
data-cy="disabilityGrades"
|
||||
hide-selected
|
||||
/>
|
||||
|
||||
<VnInputDate
|
||||
:label="t('geographicMobilityDate')"
|
||||
v-model="data.geographicMobilityDate"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInput
|
||||
clearable
|
||||
v-model="data.childPension"
|
||||
:label="t(`childPension`)"
|
||||
/>
|
||||
<VnInput
|
||||
clearable
|
||||
v-model="data.spousePension"
|
||||
:label="t(`spousePension`)"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QCheckbox v-model="data.isDependend" :label="t(`isDependend`)" />
|
||||
<QCheckbox
|
||||
v-model="data.hasHousingPaymentBefore"
|
||||
:label="t(`hasHousingPaymentBefore`)"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QCheckbox
|
||||
v-model="data.hasHousingPaymentAfter"
|
||||
:label="t(`hasHousingPaymentAfter`)"
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="data.hasExtendedWorking"
|
||||
:label="t(`hasExtendedWorking`)"
|
||||
/>
|
||||
</VnRow>
|
||||
</QCard>
|
||||
|
||||
<CrudModel
|
||||
ref="workerPitCrudRef"
|
||||
data-key="workerPit"
|
||||
url="WorkerRelatives"
|
||||
auto-load
|
||||
:filter="{
|
||||
where: { workerFk: route.params.id },
|
||||
}"
|
||||
:data-required="{ workerFk: route.params.id }"
|
||||
:has-sub-toolbar="false"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QCard class="q-px-lg q-py-lg" flat>
|
||||
<div class="row no-wrap justify-between q-pb-md">
|
||||
<VnTitle :text="t('Relatives')" />
|
||||
<QBtnGroup push style="column-gap: 10px">
|
||||
<QBtn
|
||||
color="primary"
|
||||
icon="restart_alt"
|
||||
flat
|
||||
@click="workerPitCrudRef.reset"
|
||||
:disable="!workerPitCrudRef.hasChanges"
|
||||
:title="t('globals.reset')"
|
||||
/>
|
||||
<QBtn
|
||||
ref="saveButtonRef"
|
||||
color="primary"
|
||||
icon="save"
|
||||
@click="workerPitCrudRef.onSubmit"
|
||||
:disable="!workerPitCrudRef.hasChanges"
|
||||
:title="t('globals.save')"
|
||||
data-cy="workerPitRelativeSaveBtn"
|
||||
/>
|
||||
</QBtnGroup>
|
||||
</div>
|
||||
<div
|
||||
v-for="(row, index) in rows"
|
||||
:key="index"
|
||||
class="row no-wrap q-mb-lg q-gutter-lg"
|
||||
padding="none"
|
||||
>
|
||||
<VnSelect
|
||||
:options="[
|
||||
{ id: 0, name: 'Ascendiente' },
|
||||
{ id: 1, name: 'Descendiente' },
|
||||
]"
|
||||
:label="t('isDescendant')"
|
||||
v-model="row.isDescendant"
|
||||
class="q-gutter-xs q-mb-xs"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('disabilityGrades')"
|
||||
:options="disabilityGradesOptions"
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="row.disabilityGradeFk"
|
||||
class="q-gutter-xs q-mb-xs"
|
||||
/>
|
||||
<VnInput
|
||||
type="number"
|
||||
v-model="row.birthed"
|
||||
:label="t(`birthed`)"
|
||||
/>
|
||||
|
||||
<VnInput
|
||||
type="number"
|
||||
v-model="row.adoptionYear"
|
||||
:label="t(`adoptionYear`)"
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="row.isDependend"
|
||||
:label="t(`isDependend`)"
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="row.isJointCustody"
|
||||
:label="t(`isJointCustody`)"
|
||||
size="xs"
|
||||
/>
|
||||
<QBtn
|
||||
@click="deleteRelative(rows[0].id)"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
flat
|
||||
icon="delete"
|
||||
style="flex: 0"
|
||||
/>
|
||||
</div>
|
||||
<VnRow class="justify-left items-center">
|
||||
<QBtn
|
||||
@click="insertTag(rows)"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
style="flex: 0"
|
||||
data-cy="addRelative"
|
||||
/>
|
||||
</VnRow>
|
||||
</QCard>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</template>
|
||||
</FormModel>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
familySituation: Situación familiar
|
||||
disabilityGrades: Discapacidad
|
||||
geographicMobilityDate: Movilidad geografica
|
||||
childPension: Pensión hijos
|
||||
spousePension: Pensión cónyuge
|
||||
isDependend: Ayuda / Movilidad reducida
|
||||
spouseNif: NIF cónyuge
|
||||
hasHousingPaymentBefore: Pagos vivienda anterior 2011
|
||||
hasHousingPaymentAfter: Pagos vivienda posterior 2011
|
||||
hasExtendedWorking: Prolongación actividad laboral
|
||||
isDescendant: Descen/Ascen
|
||||
disabilityGradeFk: Discapacidad
|
||||
birthed: Año nacimiento
|
||||
adoptionYear: Año adopción
|
||||
isJointCustody: Computo por entero
|
||||
Relatives: Relacionados
|
||||
en:
|
||||
familySituation: Family Situation
|
||||
disabilityGrades: Disability Grades
|
||||
geographicMobilityDate: Geographic Mobility Date
|
||||
childPension: Child Pension
|
||||
spousePension: Spouse Pension
|
||||
isDependend: Dependent Suport / Reduced Mobility
|
||||
spouseNif: Spouse NIF (Tax ID)
|
||||
hasHousingPaymentBefore: Housing Payments Before 2011
|
||||
hasHousingPaymentAfter: Housing Payments After 2011
|
||||
hasExtendedWorking: Extended Work Activity
|
||||
isDescendant: Descendant/Ascendant
|
||||
disabilityGradeFk: Disability Grade
|
||||
birthed: Birth Year
|
||||
adoptionYear: Adoption Year
|
||||
isJointCustody: Joint custody
|
||||
Relatives: Relatives
|
||||
</i18n>
|
|
@ -24,7 +24,6 @@ export default {
|
|||
'WorkerDms',
|
||||
'WorkerTimeControl',
|
||||
'WorkerLocker',
|
||||
'WorkerPit',
|
||||
'WorkerBalance',
|
||||
'WorkerFormation',
|
||||
'WorkerMedical',
|
||||
|
@ -217,15 +216,6 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
||||
},
|
||||
{
|
||||
name: 'WorkerPit',
|
||||
path: 'pit',
|
||||
meta: {
|
||||
title: 'pit',
|
||||
icon: 'lock',
|
||||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
|
||||
},
|
||||
{
|
||||
name: 'WorkerOperator',
|
||||
path: 'operator',
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
describe('WorkerPit', () => {
|
||||
const familySituationInput = '[data-cy="Family Situation_input"]';
|
||||
const familySituation = '1';
|
||||
const childPensionInput = '[data-cy="Child Pension_input"]';
|
||||
const childPension = '120';
|
||||
const spouseNifInput = '[data-cy="Spouse Pension_input"]';
|
||||
const spouseNif = '65117125P';
|
||||
const spousePensionInput = '[data-cy="Spouse Pension_input"]';
|
||||
const spousePension = '120';
|
||||
const addRelative = '[data-cy="addRelative"]';
|
||||
const isDescendantSelect = '[data-cy="Descendant/Ascendant_select"]';
|
||||
const birthedInput = '[data-cy="Birth Year_input"]';
|
||||
const birthed = '2002';
|
||||
const adoptionYearInput = '[data-cy="Adoption Year_input"]';
|
||||
const adoptionYear = '2004';
|
||||
const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]';
|
||||
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/worker/1107/pit`);
|
||||
});
|
||||
|
||||
it('complete PIT', () => {
|
||||
cy.get(familySituationInput).type(familySituation);
|
||||
cy.get(childPensionInput).type(childPension);
|
||||
cy.get(spouseNifInput).type(spouseNif);
|
||||
cy.get(spousePensionInput).type(spousePension);
|
||||
cy.get(savePIT).click();
|
||||
});
|
||||
|
||||
it('complete relative', () => {
|
||||
cy.get(addRelative).click();
|
||||
cy.get(isDescendantSelect).type('{downArrow}{downArrow}{enter}');
|
||||
cy.get(birthedInput).type(birthed);
|
||||
cy.get(adoptionYearInput).type(adoptionYear);
|
||||
cy.get(saveRelative).click();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue