0
0
Fork 0

refactor: refs #6273 replace QBtnGroup with QRadio for worker type selection

This commit is contained in:
Jorge Penadés 2024-06-04 09:33:51 +02:00
parent de4ea6271b
commit 0b0754f76e
2 changed files with 47 additions and 61 deletions

View File

@ -93,23 +93,8 @@ onMounted(async () => {
<QPage> <QPage>
<VnSubToolbar> <VnSubToolbar>
<template #st-data> <template #st-data>
<QBtnGroup> <QRadio v-model="isFreelancer" :val="false" :label="`${t('Internal')}`" />
<QBtn <QRadio v-model="isFreelancer" :val="true" :label="`${t('External')}`" />
:label="`${t('globals.worker')}`"
:title="`${t('globals.worker')}`"
color="primary"
icon="vn:worker"
@click="isFreelancer = false"
/>
<QBtn
:label="`${t('Freelancer')}`"
:title="`${t('Freelancer')}`"
flat
color="primary"
icon="person"
@click="isFreelancer = true"
/>
</QBtnGroup>
</template> </template>
</VnSubToolbar> </VnSubToolbar>
<FormModel <FormModel
@ -130,52 +115,10 @@ onMounted(async () => {
:rules="validate('Worker.lastNames')" :rules="validate('Worker.lastNames')"
/> />
<VnInput <VnInput
v-show="isFreelancer"
v-model="data.code" v-model="data.code"
:label="t('worker.create.code')" :label="t('worker.create.code')"
:rules="validate('Worker.code')" :rules="validate('Worker.code')"
/> />
<VnInputDate
v-show="!isFreelancer"
v-model="data.birth"
:label="t('worker.create.birth')"
:rules="validate('Worker.birth')"
/>
</VnRow>
<VnRow v-show="!isFreelancer">
<VnInput
v-model="data.fi"
:label="t('worker.create.fi')"
:rules="validate('Worker.fi')"
/>
<VnInput
v-model="data.code"
:label="t('worker.create.code')"
:rules="validate('Worker.code')"
/>
<VnInput
v-model="data.phone"
:label="t('worker.create.phone')"
:rules="validate('Worker.phone')"
/>
</VnRow>
<VnRow v-show="!isFreelancer">
<VnLocation
:rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant']"
:options="postcodesOptions"
v-model="data.location"
@update:model-value="(location) => handleLocation(data, location)"
>
</VnLocation>
</VnRow>
<VnRow>
<VnInput
v-show="!isFreelancer"
:label="t('worker.create.street')"
v-model="data.street"
:rules="validate('Worker.street')"
/>
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnInput <VnInput
@ -221,7 +164,46 @@ onMounted(async () => {
</template> </template>
</VnSelect> </VnSelect>
</VnRow> </VnRow>
<VnRow v-show="!isFreelancer"> <VnRow>
<VnInput
v-model="data.fi"
:label="t('worker.create.fi')"
:rules="validate('Worker.fi')"
:disable="isFreelancer"
/>
<VnInputDate
v-model="data.birth"
:label="t('worker.create.birth')"
:rules="validate('Worker.birth')"
:disable="isFreelancer"
/>
<VnInput
v-model="data.phone"
:label="t('worker.create.phone')"
:rules="validate('Worker.phone')"
:disable="isFreelancer"
/>
</VnRow>
<VnRow>
<VnLocation
:rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant']"
:options="postcodesOptions"
v-model="data.location"
@update:model-value="(location) => handleLocation(data, location)"
:disable="isFreelancer"
>
</VnLocation>
</VnRow>
<VnRow>
<VnInput
:label="t('worker.create.street')"
v-model="data.street"
:rules="validate('Worker.street')"
:disable="isFreelancer"
/>
</VnRow>
<VnRow>
<VnSelect <VnSelect
:label="t('worker.create.payMethods')" :label="t('worker.create.payMethods')"
v-model="data.payMethodFk" v-model="data.payMethodFk"
@ -231,11 +213,13 @@ onMounted(async () => {
map-options map-options
hide-selected hide-selected
:rules="validate('Worker.payMethodFk')" :rules="validate('Worker.payMethodFk')"
:disable="isFreelancer"
/> />
<VnInput <VnInput
v-model="data.iban" v-model="data.iban"
:label="t('worker.create.iban')" :label="t('worker.create.iban')"
:rules="validate('Worker.iban')" :rules="validate('Worker.iban')"
:disable="isFreelancer"
> >
<template #append> <template #append>
<QIcon name="info" class="cursor-info"> <QIcon name="info" class="cursor-info">
@ -252,6 +236,7 @@ onMounted(async () => {
hide-selected hide-selected
:roles-allowed-to-create="['salesAssistant', 'hr']" :roles-allowed-to-create="['salesAssistant', 'hr']"
:rules="validate('Worker.bankEntity')" :rules="validate('Worker.bankEntity')"
:disable="isFreelancer"
> >
<template #form> <template #form>
<CreateBankEntityForm <CreateBankEntityForm

View File

@ -1,4 +1,5 @@
Search worker: Buscar trabajador Search worker: Buscar trabajador
You can search by worker id or name: Puedes buscar por id o nombre del trabajador You can search by worker id or name: Puedes buscar por id o nombre del trabajador
Freelancer: Autónomo
Locker: Taquilla Locker: Taquilla
Internal: Interno
External: Externo