fix: form readonly (personnel management)

This commit is contained in:
puriphatt 2024-06-27 04:42:48 +00:00
parent aa8e39b042
commit 77eeb0fe19
4 changed files with 37 additions and 74 deletions

View file

@ -120,9 +120,8 @@ watch(districtId, fetchSubDistrict);
<q-input <q-input
:for="`${id !== undefined ? `input-address-${id}` : 'input-address'}`" :for="`${id !== undefined ? `input-address-${id}` : 'input-address'}`"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:borderless="readonly"
hide-bottom-space hide-bottom-space
:label="$t('address')" :label="$t('address')"
class="col-12" class="col-12"
@ -142,9 +141,8 @@ watch(districtId, fetchSubDistrict);
:id="`${id !== undefined ? `select-province-${id}` : 'select-province'}`" :id="`${id !== undefined ? `select-province-${id}` : 'select-province'}`"
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:hide-dropdown-icon="readonly || sameWithEmployer" :hide-dropdown-icon="readonly || sameWithEmployer"
:borderless="readonly"
hide-bottom-space hide-bottom-space
emit-value emit-value
map-options map-options
@ -171,9 +169,8 @@ watch(districtId, fetchSubDistrict);
:id="`${id !== undefined ? `select-district-${id}` : 'select-district'}`" :id="`${id !== undefined ? `select-district-${id}` : 'select-district'}`"
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:hide-dropdown-icon="readonly || sameWithEmployer" :hide-dropdown-icon="readonly || sameWithEmployer"
:borderless="readonly"
hide-bottom-space hide-bottom-space
emit-value emit-value
map-options map-options
@ -199,9 +196,8 @@ watch(districtId, fetchSubDistrict);
:id="`${id !== undefined ? `select-sub-district-${id}` : 'select-sub-district'}`" :id="`${id !== undefined ? `select-sub-district-${id}` : 'select-sub-district'}`"
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:hide-dropdown-icon="readonly || sameWithEmployer" :hide-dropdown-icon="readonly || sameWithEmployer"
:borderless="readonly"
hide-bottom-space hide-bottom-space
emit-value emit-value
map-options map-options
@ -226,8 +222,7 @@ watch(districtId, fetchSubDistrict);
<q-input <q-input
:for="`${id !== undefined ? `input-zip-code-${id}` : 'input-zip-code'}`" :for="`${id !== undefined ? `input-zip-code-${id}` : 'input-zip-code'}`"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
readonly readonly
:label="$t('zipCode')" :label="$t('zipCode')"
class="col-3" class="col-3"
@ -242,8 +237,7 @@ watch(districtId, fetchSubDistrict);
:for="`${id !== undefined ? `input-address-en-${id}` : 'input-address-en'}`" :for="`${id !== undefined ? `input-address-en-${id}` : 'input-address-en'}`"
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
hide-bottom-space hide-bottom-space
:label="$t('address')" :label="$t('address')"
class="col-12" class="col-12"
@ -264,8 +258,7 @@ watch(districtId, fetchSubDistrict);
hide-bottom-space hide-bottom-space
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
:hide-dropdown-icon="readonly || sameWithEmployer" :hide-dropdown-icon="readonly || sameWithEmployer"
emit-value emit-value
map-options map-options
@ -292,8 +285,7 @@ watch(districtId, fetchSubDistrict);
hide-bottom-space hide-bottom-space
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
:hide-dropdown-icon="readonly || sameWithEmployer" :hide-dropdown-icon="readonly || sameWithEmployer"
emit-value emit-value
map-options map-options
@ -320,8 +312,7 @@ watch(districtId, fetchSubDistrict);
hide-bottom-space hide-bottom-space
:dense="dense" :dense="dense"
:readonly="readonly || sameWithEmployer" :readonly="readonly || sameWithEmployer"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
:hide-dropdown-icon="readonly || sameWithEmployer" :hide-dropdown-icon="readonly || sameWithEmployer"
emit-value emit-value
map-options map-options
@ -347,8 +338,7 @@ watch(districtId, fetchSubDistrict);
hide-bottom-space hide-bottom-space
:for="`${id !== undefined ? `input-zip-code-${id}` : 'input-zip-code'}`" :for="`${id !== undefined ? `input-zip-code-${id}` : 'input-zip-code'}`"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
readonly readonly
zip="zip-en" zip="zip-en"
:label="$t('zipCode')" :label="$t('zipCode')"

View file

@ -75,9 +75,8 @@ function deleteFile(name: string) {
<q-input <q-input
for="input-regis-no" for="input-regis-no"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:label="$t('formDialogInputRegisNo')" :label="$t('formDialogInputRegisNo')"
class="col-12" class="col-12"
v-model="registrationNo" v-model="registrationNo"
@ -103,9 +102,8 @@ function deleteFile(name: string) {
for="input-start-date" for="input-start-date"
:label="$t('formDialogInputStartDate')" :label="$t('formDialogInputStartDate')"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:model-value="startDate ? dateFormat(startDate) : ''" :model-value="startDate ? dateFormat(startDate) : ''"
> >
<template v-slot:prepend> <template v-slot:prepend>
@ -150,9 +148,8 @@ function deleteFile(name: string) {
for="input-retire-date" for="input-retire-date"
:label="$t('formDialogInputRetireDate')" :label="$t('formDialogInputRetireDate')"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:model-value="retireDate ? dateFormat(retireDate) : ''" :model-value="retireDate ? dateFormat(retireDate) : ''"
> >
<template v-slot:prepend> <template v-slot:prepend>
@ -179,10 +176,9 @@ function deleteFile(name: string) {
id="input-responsible-area" id="input-responsible-area"
v-if="userType === 'MESSENGER'" v-if="userType === 'MESSENGER'"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
:borderless="readonly"
emit-value emit-value
map-options map-options
options-dense options-dense
@ -202,9 +198,8 @@ function deleteFile(name: string) {
<q-input <q-input
for="input-discount-condition" for="input-discount-condition"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:label="$t('formDialogInputDiscount')" :label="$t('formDialogInputDiscount')"
class="col-12" class="col-12"
v-model="discountCondition" v-model="discountCondition"
@ -219,10 +214,9 @@ function deleteFile(name: string) {
<q-select <q-select
id="input-source-nationality" id="input-source-nationality"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
:borderless="readonly"
emit-value emit-value
map-options map-options
options-dense options-dense
@ -236,9 +230,8 @@ function deleteFile(name: string) {
<q-select <q-select
id="input-import-nationality" id="input-import-nationality"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options
@ -253,9 +246,8 @@ function deleteFile(name: string) {
<q-select <q-select
id="select-trainig-place" id="select-trainig-place"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options
@ -270,9 +262,8 @@ function deleteFile(name: string) {
<q-input <q-input
for="input-checkpoint" for="input-checkpoint"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:label="$t('formDialogInputCheckpoint')" :label="$t('formDialogInputCheckpoint')"
class="col-6" class="col-6"
v-model="checkpoint" v-model="checkpoint"
@ -280,9 +271,8 @@ function deleteFile(name: string) {
<q-input <q-input
for="input-checkpoint-en" for="input-checkpoint-en"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:label="$t('formDialogInputCheckpoint') + ' ENG'" :label="$t('formDialogInputCheckpoint') + ' ENG'"
class="col-6" class="col-6"
v-model="checkpointEN" v-model="checkpointEN"
@ -290,9 +280,8 @@ function deleteFile(name: string) {
<q-file <q-file
for="input-attchment" for="input-attchment"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
multiple multiple
append append
:label="$t('formDialogAttachment')" :label="$t('formDialogAttachment')"

View file

@ -36,9 +36,8 @@ async function selectHq(id: string) {
<q-select <q-select
id="select-hq-id" id="select-hq-id"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options
@ -56,9 +55,8 @@ async function selectHq(id: string) {
<q-select <q-select
id="select-br-id" id="select-br-id"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options
@ -75,8 +73,7 @@ async function selectHq(id: string) {
<q-input <q-input
for="input-username" for="input-username"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
:readonly="usernameReadonly" :readonly="usernameReadonly"
emit-value emit-value
map-options map-options
@ -93,9 +90,8 @@ async function selectHq(id: string) {
<q-select <q-select
id="select-user-type" id="select-user-type"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options
@ -112,9 +108,8 @@ async function selectHq(id: string) {
<q-select <q-select
id="select-user-role" id="select-user-role"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options

View file

@ -33,9 +33,8 @@ defineProps<{
<q-input <q-input
for="input-first-name" for="input-first-name"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
hide-bottom-space hide-bottom-space
class="col-3" class="col-3"
:label="$t('formDialogInputFirstName')" :label="$t('formDialogInputFirstName')"
@ -47,9 +46,8 @@ defineProps<{
<q-input <q-input
for="input-last-name" for="input-last-name"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
hide-bottom-space hide-bottom-space
class="col-3" class="col-3"
:label="$t('formDialogInputLastName')" :label="$t('formDialogInputLastName')"
@ -59,9 +57,8 @@ defineProps<{
<q-input <q-input
for="input-first-name-en" for="input-first-name-en"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
hide-bottom-space hide-bottom-space
class="col-3" class="col-3"
:label="$t('formDialogInputFirstNameEN')" :label="$t('formDialogInputFirstNameEN')"
@ -73,9 +70,8 @@ defineProps<{
<q-input <q-input
for="input-last-name-en" for="input-last-name-en"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
hide-bottom-space hide-bottom-space
class="col-3" class="col-3"
:label="$t('formDialogInputLastNameEN')" :label="$t('formDialogInputLastNameEN')"
@ -88,9 +84,8 @@ defineProps<{
v-if="!employee" v-if="!employee"
for="input-telephone" for="input-telephone"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
class="col-6" class="col-6"
:label="$t('formDialogInputTelephone')" :label="$t('formDialogInputTelephone')"
v-model="telephoneNo" v-model="telephoneNo"
@ -100,9 +95,8 @@ defineProps<{
v-if="!employee" v-if="!employee"
for="input-email" for="input-email"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:label="$t('formDialogInputEmail')" :label="$t('formDialogInputEmail')"
class="col-6" class="col-6"
v-model="email" v-model="email"
@ -111,10 +105,9 @@ defineProps<{
v-if="!employee" v-if="!employee"
id="select-gender" id="select-gender"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
:borderless="readonly"
emit-value emit-value
map-options map-options
:label="$t('formDialogInputGender')" :label="$t('formDialogInputGender')"
@ -148,9 +141,8 @@ defineProps<{
hide-bottom-space hide-bottom-space
:label="$t('formDialogInputBirthDate')" :label="$t('formDialogInputBirthDate')"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:model-value="birthDate ? dateFormat(birthDate) : ''" :model-value="birthDate ? dateFormat(birthDate) : ''"
:rules="[ :rules="[
(val: string) => (val: string) =>
@ -171,8 +163,7 @@ defineProps<{
<q-input <q-input
for="input-age" for="input-age"
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:borderless="readonly"
readonly readonly
:label="$t('formDialogInputAge')" :label="$t('formDialogInputAge')"
class="col-3" class="col-3"
@ -183,10 +174,9 @@ defineProps<{
id="select-gender" id="select-gender"
hide-bottom-space hide-bottom-space
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
:borderless="readonly"
emit-value emit-value
map-options map-options
:label="$t('formDialogInputGender')" :label="$t('formDialogInputGender')"
@ -205,9 +195,8 @@ defineProps<{
id="select-nationality" id="select-nationality"
hide-bottom-space hide-bottom-space
:dense="dense" :dense="dense"
:outlined="readonly ? false : outlined" outlined
:readonly="readonly" :readonly="readonly"
:borderless="readonly"
:hide-dropdown-icon="readonly" :hide-dropdown-icon="readonly"
emit-value emit-value
map-options map-options