refactor: employee mid name and prefix
This commit is contained in:
parent
c3c98c1980
commit
cf97ffd8de
4 changed files with 40 additions and 14 deletions
|
|
@ -11,15 +11,15 @@ const optionStore = useOptionStore();
|
||||||
const prefixName = defineModel<string | null>('prefixName');
|
const prefixName = defineModel<string | null>('prefixName');
|
||||||
const firstName = defineModel<string>('firstName');
|
const firstName = defineModel<string>('firstName');
|
||||||
const lastName = defineModel<string>('lastName');
|
const lastName = defineModel<string>('lastName');
|
||||||
const firstNameEN = defineModel<string>('firstNameEn');
|
const firstNameEN = defineModel<string>('firstNameEN');
|
||||||
const lastNameEN = defineModel<string>('lastNameEn');
|
const lastNameEN = defineModel<string>('lastNameEN');
|
||||||
const telephoneNo = defineModel<string>('telephoneNo');
|
const telephoneNo = defineModel<string>('telephoneNo');
|
||||||
const email = defineModel<string>('email');
|
const email = defineModel<string>('email');
|
||||||
const gender = defineModel<string>('gender');
|
const gender = defineModel<string>('gender');
|
||||||
const birthDate = defineModel<Date | string | null>('birthDate');
|
const birthDate = defineModel<Date | string | null>('birthDate');
|
||||||
const nationality = defineModel<string>('nationality');
|
const nationality = defineModel<string>('nationality');
|
||||||
const midName = defineModel<string | null>('midName');
|
const midName = defineModel<string | null>('midName');
|
||||||
const midNameEn = defineModel<string | null>('midNameEn');
|
const midNameEN = defineModel<string | null>('midNameEN');
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
dense?: boolean;
|
dense?: boolean;
|
||||||
|
|
@ -154,7 +154,7 @@ watch(
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
lazy-rules="ondemand"
|
lazy-rules="ondemand"
|
||||||
:for="`${prefixId}-input-first-name`"
|
:for="`${prefixId}-input-mid-name`"
|
||||||
:dense="dense"
|
:dense="dense"
|
||||||
outlined
|
outlined
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
|
|
@ -216,21 +216,20 @@ watch(
|
||||||
v-model="firstNameEN"
|
v-model="firstNameEN"
|
||||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
lazy-rules="ondemand"
|
lazy-rules="ondemand"
|
||||||
:for="`${prefixId}-input-first-name-en`"
|
:for="`${prefixId}-input-mid-name-en`"
|
||||||
:dense="dense"
|
:dense="dense"
|
||||||
outlined
|
outlined
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
class="col-md-3 col-6"
|
class="col-md-3 col-6"
|
||||||
:label="$t('personnel.form.middleNameEN')"
|
:label="$t('personnel.form.middleNameEN')"
|
||||||
:model-value="readonly ? midNameEn || '-' : midNameEn"
|
:model-value="readonly ? midNameEN || '-' : midNameEN"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(v) => (typeof v === 'string' ? (midNameEn = v) : '')
|
(v) => (typeof v === 'string' ? (midNameEN = v) : '')
|
||||||
"
|
"
|
||||||
@clear="midNameEn = ''"
|
@clear="midNameEN = ''"
|
||||||
/>
|
/>
|
||||||
<q-input
|
<q-input
|
||||||
lazy-rules="ondemand"
|
lazy-rules="ondemand"
|
||||||
|
|
|
||||||
|
|
@ -1257,8 +1257,8 @@ const emptyCreateDialog = ref(false);
|
||||||
code: props.row.code,
|
code: props.row.code,
|
||||||
name:
|
name:
|
||||||
$i18n.locale === 'eng'
|
$i18n.locale === 'eng'
|
||||||
? `${props.row.firstName} ${props.row.lastName} `.trim()
|
? `${props.row.firstNameEN} ${props.row.lastNameEN} `.trim()
|
||||||
: `${props.row.firstNameEN} ${props.row.lastNameEN} `.trim(),
|
: `${props.row.firstName} ${props.row.lastName} `.trim(),
|
||||||
img:
|
img:
|
||||||
props.row.imageUrl ||
|
props.row.imageUrl ||
|
||||||
'/images/customer-' +
|
'/images/customer-' +
|
||||||
|
|
@ -1557,6 +1557,7 @@ const emptyCreateDialog = ref(false);
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- add customer -->
|
||||||
<DialogForm
|
<DialogForm
|
||||||
v-model:modal="emptyCreateDialog"
|
v-model:modal="emptyCreateDialog"
|
||||||
:title="$t('customer.employerType')"
|
:title="$t('customer.employerType')"
|
||||||
|
|
@ -1855,6 +1856,7 @@ const emptyCreateDialog = ref(false);
|
||||||
</div>
|
</div>
|
||||||
</DialogContainer>
|
</DialogContainer>
|
||||||
|
|
||||||
|
<!-- add employee -->
|
||||||
<DialogForm
|
<DialogForm
|
||||||
hideFooter
|
hideFooter
|
||||||
:title="$t('form.title.create', { name: $t('customer.employee') })"
|
:title="$t('form.title.create', { name: $t('customer.employee') })"
|
||||||
|
|
@ -2108,10 +2110,13 @@ const emptyCreateDialog = ref(false);
|
||||||
separator
|
separator
|
||||||
title="customerEmployee.form.group.personalInfo"
|
title="customerEmployee.form.group.personalInfo"
|
||||||
v-model:open="employeeFormState.dialogModal"
|
v-model:open="employeeFormState.dialogModal"
|
||||||
|
v-model:prefixName="employeeFormState.namePrefix"
|
||||||
v-model:firstName="currentFromDataEmployee.firstName"
|
v-model:firstName="currentFromDataEmployee.firstName"
|
||||||
v-model:lastName="currentFromDataEmployee.lastName"
|
v-model:lastName="currentFromDataEmployee.lastName"
|
||||||
v-model:firstNameEN="currentFromDataEmployee.firstNameEN"
|
v-model:firstNameEN="currentFromDataEmployee.firstNameEN"
|
||||||
v-model:lastNameEN="currentFromDataEmployee.lastNameEN"
|
v-model:lastNameEN="currentFromDataEmployee.lastNameEN"
|
||||||
|
v-model:midName="currentFromDataEmployee.middleName"
|
||||||
|
v-model:midNameEN="currentFromDataEmployee.middleNameEN"
|
||||||
v-model:gender="currentFromDataEmployee.gender"
|
v-model:gender="currentFromDataEmployee.gender"
|
||||||
v-model:birthDate="currentFromDataEmployee.dateOfBirth"
|
v-model:birthDate="currentFromDataEmployee.dateOfBirth"
|
||||||
v-model:nationality="currentFromDataEmployee.nationality"
|
v-model:nationality="currentFromDataEmployee.nationality"
|
||||||
|
|
@ -2379,7 +2384,7 @@ const emptyCreateDialog = ref(false);
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ImageUploadDialog>
|
</ImageUploadDialog>
|
||||||
<!-- นายจ้าง -->
|
<!-- นายจ้าง edit customer -->
|
||||||
<DrawerInfo
|
<DrawerInfo
|
||||||
hide-action
|
hide-action
|
||||||
v-model:drawer-open="customerFormState.drawerModal"
|
v-model:drawer-open="customerFormState.drawerModal"
|
||||||
|
|
@ -2395,6 +2400,11 @@ const emptyCreateDialog = ref(false);
|
||||||
? 'app-bg-female text-white'
|
? 'app-bg-female text-white'
|
||||||
: ''
|
: ''
|
||||||
"
|
"
|
||||||
|
:close="
|
||||||
|
() => {
|
||||||
|
customerFormState.drawerModal = false;
|
||||||
|
}
|
||||||
|
"
|
||||||
:submit="
|
:submit="
|
||||||
async () => {
|
async () => {
|
||||||
await customerFormStore.submitFormCustomer();
|
await customerFormStore.submitFormCustomer();
|
||||||
|
|
@ -2655,6 +2665,11 @@ const emptyCreateDialog = ref(false);
|
||||||
<DrawerInfo
|
<DrawerInfo
|
||||||
hide-action
|
hide-action
|
||||||
v-model:drawer-open="employeeFormState.drawerModal"
|
v-model:drawer-open="employeeFormState.drawerModal"
|
||||||
|
:close="
|
||||||
|
() => {
|
||||||
|
employeeFormState.drawerModal = false;
|
||||||
|
}
|
||||||
|
"
|
||||||
:title="
|
:title="
|
||||||
employeeFormState.currentEmployee
|
employeeFormState.currentEmployee
|
||||||
? $i18n.locale === 'eng'
|
? $i18n.locale === 'eng'
|
||||||
|
|
@ -2913,10 +2928,13 @@ const emptyCreateDialog = ref(false);
|
||||||
separator
|
separator
|
||||||
title="customerEmployee.form.group.personalInfo"
|
title="customerEmployee.form.group.personalInfo"
|
||||||
:readonly="!employeeFormState.isEmployeeEdit"
|
:readonly="!employeeFormState.isEmployeeEdit"
|
||||||
|
v-model:prefixName="currentFromDataEmployee.namePrefix"
|
||||||
v-model:firstName="currentFromDataEmployee.firstName"
|
v-model:firstName="currentFromDataEmployee.firstName"
|
||||||
v-model:lastName="currentFromDataEmployee.lastName"
|
v-model:lastName="currentFromDataEmployee.lastName"
|
||||||
v-model:firstNameEN="currentFromDataEmployee.firstNameEN"
|
v-model:firstNameEN="currentFromDataEmployee.firstNameEN"
|
||||||
v-model:lastNameEN="currentFromDataEmployee.lastNameEN"
|
v-model:lastNameEN="currentFromDataEmployee.lastNameEN"
|
||||||
|
v-model:midName="currentFromDataEmployee.middleName"
|
||||||
|
v-model:midNameEN="currentFromDataEmployee.middleNameEN"
|
||||||
v-model:gender="currentFromDataEmployee.gender"
|
v-model:gender="currentFromDataEmployee.gender"
|
||||||
v-model:birthDate="currentFromDataEmployee.dateOfBirth"
|
v-model:birthDate="currentFromDataEmployee.dateOfBirth"
|
||||||
v-model:nationality="currentFromDataEmployee.nationality"
|
v-model:nationality="currentFromDataEmployee.nationality"
|
||||||
|
|
@ -2931,6 +2949,9 @@ const emptyCreateDialog = ref(false);
|
||||||
v-model:districtId="currentFromDataEmployee.districtId"
|
v-model:districtId="currentFromDataEmployee.districtId"
|
||||||
v-model:subDistrictId="currentFromDataEmployee.subDistrictId"
|
v-model:subDistrictId="currentFromDataEmployee.subDistrictId"
|
||||||
v-model:zipCode="currentFromDataEmployee.zipCode"
|
v-model:zipCode="currentFromDataEmployee.zipCode"
|
||||||
|
v-model:sameWithEmployer="
|
||||||
|
employeeFormState.formDataEmployeeSameAddr
|
||||||
|
"
|
||||||
:readonly="!employeeFormState.isEmployeeEdit"
|
:readonly="!employeeFormState.isEmployeeEdit"
|
||||||
prefix-id="drawer-info-personnel"
|
prefix-id="drawer-info-personnel"
|
||||||
dense
|
dense
|
||||||
|
|
@ -3209,8 +3230,8 @@ const emptyCreateDialog = ref(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-inactive {
|
.status-inactive {
|
||||||
--_branch-status-color: var(--red-4-hsl);
|
--_branch-status-color: var(--stone-5-hsl);
|
||||||
--_branch-badge-bg: var(--red-4-hsl);
|
--_branch-badge-bg: var(--stone-5-hsl);
|
||||||
filter: grayscale(0.5);
|
filter: grayscale(0.5);
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -497,10 +497,13 @@ export const useEmployeeForm = defineStore('form-employee', () => {
|
||||||
nationality: '',
|
nationality: '',
|
||||||
status: 'CREATED',
|
status: 'CREATED',
|
||||||
|
|
||||||
|
namePrefix: '',
|
||||||
firstName: '',
|
firstName: '',
|
||||||
firstNameEN: '',
|
firstNameEN: '',
|
||||||
lastName: '',
|
lastName: '',
|
||||||
lastNameEN: '',
|
lastNameEN: '',
|
||||||
|
middleName: '',
|
||||||
|
middleNameEN: '',
|
||||||
|
|
||||||
addressEN: '',
|
addressEN: '',
|
||||||
address: '',
|
address: '',
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,13 @@ export type EmployeeCreate = {
|
||||||
gender: string;
|
gender: string;
|
||||||
nationality: string;
|
nationality: string;
|
||||||
|
|
||||||
|
namePrefix: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
firstNameEN: string;
|
firstNameEN: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
lastNameEN: string;
|
lastNameEN: string;
|
||||||
|
middleName?: string;
|
||||||
|
middleNameEN?: string;
|
||||||
|
|
||||||
addressEN: string;
|
addressEN: string;
|
||||||
address: string;
|
address: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue