diff --git a/src/components/02_personnel-management/FormByType.vue b/src/components/02_personnel-management/FormByType.vue
index 526afa95..1537dc07 100644
--- a/src/components/02_personnel-management/FormByType.vue
+++ b/src/components/02_personnel-management/FormByType.vue
@@ -1,13 +1,13 @@
@@ -218,136 +172,108 @@ watch(
class="row col-12 q-col-gutter-sm"
style="margin-left: 0px; padding-left: 0px"
>
- (typeof v === 'string' ? (sourceNationality = v) : '')
"
- @clear="sourceNationality = ''"
- >
-
-
-
- {{ $t('general.noData') }}
-
-
-
-
-
+ (typeof v === 'string' ? (importNationality = v) : '')
"
- @clear="importNationality = ''"
- >
-
-
-
- {{ $t('general.noData') }}
-
-
-
-
-
+ (typeof v === 'string' ? (trainingPlace = v) : '')
"
- @clear="trainingPlace = ''"
- >
-
-
-
- {{ $t('general.noData') }}
-
-
-
-
-
+ (typeof v === 'string' ? (checkpoint = v) : '')
"
- @clear="checkpoint = ''"
+ />
+ (typeof v === 'string' ? (checkpoint = v) : '')
+ "
+ />
+
+ (typeof v === 'string' ? (agencyStatus = v) : '')
+ "
/>
(typeof v === 'string' ? (checkpointEN = v) : '')
+ (v) => (typeof v === 'string' ? (remark = v) : '')
"
- @clear="checkpointEN = ''"
+ @clear="remark = ''"
/>
diff --git a/src/components/02_personnel-management/FormPerson.vue b/src/components/02_personnel-management/FormPerson.vue
index cfc6dff8..0204bb47 100644
--- a/src/components/02_personnel-management/FormPerson.vue
+++ b/src/components/02_personnel-management/FormPerson.vue
@@ -41,6 +41,12 @@ let prefixNameFilter: (
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
) => void;
+const prefixNameOptionsEn = ref[]>([]);
+let prefixNameFilterEn: (
+ value: string,
+ update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
+) => void;
+
const genderOptions = ref[]>([]);
let genderFilter: (
value: string,
@@ -55,7 +61,9 @@ let nationalityFilter: (
function matPreFixName() {
if (gender.value === 'male') prefixName.value = 'mr';
- if (gender.value === 'female') prefixName.value = 'mrs';
+ if (gender.value === 'female' && prefixName.value === 'mr') {
+ prefixName.value = 'mrs';
+ }
}
onMounted(() => {
@@ -64,6 +72,13 @@ onMounted(() => {
prefixNameOptions,
'label',
);
+
+ prefixNameFilterEn = selectFilterOptionRefMod(
+ ref(optionStore.rawOption?.eng.prefix),
+ prefixNameOptionsEn,
+ 'label',
+ );
+
genderFilter = selectFilterOptionRefMod(
ref(optionStore.globalOption?.gender),
genderOptions,
@@ -94,6 +109,12 @@ watch(
nationalityOptions,
'label',
);
+
+ prefixNameFilterEn = selectFilterOptionRefMod(
+ ref(optionStore.rawOption?.eng.prefix),
+ prefixNameOptionsEn,
+ 'label',
+ );
},
);
@@ -175,6 +196,7 @@ watch(
(v) => (typeof v === 'string' ? (prefixName = v) : '')
"
@clear="prefixName = ''"
+ :rules="[(val: string) => !!val || $t('form.error.required')]"
>
@@ -194,7 +216,11 @@ watch(
class="col"
:label="$t('personnel.form.firstName')"
v-model="firstName"
- :rules="[(val: string) => !!val || $t('form.error.required')]"
+ :rules="
+ employee
+ ? []
+ : [(val: string) => !!val || $t('form.error.required')]
+ "
/>
- (typeof v === 'string' ? (prefixName = v) : '')
"
@clear="prefixName = ''"
- />
+ :rules="[(val: string) => !!val || $t('form.error.required')]"
+ >
+
+
+
+ {{ $t('general.noData') }}
+
+
+
+
@@ -392,11 +446,15 @@ watch(
:readonly="readonly"
:label="$t('form.birthDate')"
:disabled-dates="disabledAfterToday"
- :rules="[
- (val: string) =>
- !!val ||
- $t('form.error.selectField', { field: $t('form.birthDate') }),
- ]"
+ :rules="
+ employee
+ ? []
+ : [
+ (val: string) =>
+ !!val ||
+ $t('form.error.selectField', { field: $t('form.birthDate') }),
+ ]
+ "
/>
@@ -511,7 +568,6 @@ watch(
:hide-dropdown-icon="readonly"
:for="`${prefixId}-select-nationality`"
:label="$t('general.nationality')"
- :rules="[(val: string) => !!val || $t('form.error.required')]"
@filter="nationalityFilter"
>
diff --git a/src/components/03_customer-management/FormEmployeeOther.vue b/src/components/03_customer-management/FormEmployeeOther.vue
index 3e9a4a89..f2c32c63 100644
--- a/src/components/03_customer-management/FormEmployeeOther.vue
+++ b/src/components/03_customer-management/FormEmployeeOther.vue
@@ -106,7 +106,7 @@ const employeeOther = defineModel('employeeOther');
:readonly="readonly || employeeOther.statusSave"
hide-bottom-space
class="col-md-3 col-6"
- :label="$t('form.firstName')"
+ :label="$t('general.nativeLanguage', { msg: $t('form.firstName') })"
:model-value="employeeOther.fatherFirstName"
@update:model-value="
(v) =>
@@ -122,7 +122,7 @@ const employeeOther = defineModel('employeeOther');
:readonly="readonly || employeeOther.statusSave"
hide-bottom-space
class="col-md-3 col-6"
- :label="$t('form.lastName')"
+ :label="$t('general.nativeLanguage', { msg: $t('form.lastName') })"
:model-value="employeeOther.fatherLastName"
@update:model-value="
(v) =>
@@ -177,7 +177,7 @@ const employeeOther = defineModel('employeeOther');
:readonly="readonly || employeeOther.statusSave"
hide-bottom-space
class="col-md-3 col-6"
- :label="$t('form.firstName')"
+ :label="$t('general.nativeLanguage', { msg: $t('form.firstName') })"
:model-value="employeeOther.motherFirstName"
@update:model-value="
(v) =>
@@ -193,7 +193,7 @@ const employeeOther = defineModel('employeeOther');
:readonly="readonly || employeeOther.statusSave"
hide-bottom-space
class="col-md-3 col-6"
- :label="$t('form.lastName')"
+ :label="$t('general.nativeLanguage', { msg: $t('form.lastName') })"
:model-value="employeeOther.motherLastName"
@update:model-value="
(v) =>
diff --git a/src/components/03_customer-management/FormEmployeePassport.vue b/src/components/03_customer-management/FormEmployeePassport.vue
index 1eb9096d..5fe21b52 100644
--- a/src/components/03_customer-management/FormEmployeePassport.vue
+++ b/src/components/03_customer-management/FormEmployeePassport.vue
@@ -103,7 +103,7 @@ onMounted(() => {
'label',
);
passportIssuingCountryFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption.nationality),
+ ref(optionStore.rawOption?.eng.nationality),
passportIssuingCountryOptions,
'label',
);
@@ -121,13 +121,13 @@ onMounted(() => {
);
genderFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption?.gender),
+ ref(optionStore.rawOption?.eng.gender),
genderOptions,
'label',
);
nationalityFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption?.nationality),
+ ref(optionStore.rawOption?.eng.nationality),
nationalityOptions,
'label',
);
@@ -152,7 +152,7 @@ watch(
);
passportIssuingCountryFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption.nationality),
+ ref(optionStore.rawOption?.eng.nationality),
passportIssuingCountryOptions,
'label',
);
@@ -164,13 +164,13 @@ watch(
);
genderFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption?.gender),
+ ref(optionStore.rawOption?.eng.gender),
genderOptions,
'label',
);
nationalityFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption?.nationality),
+ ref(optionStore.rawOption?.eng.nationality),
nationalityOptions,
'label',
);
diff --git a/src/components/03_customer-management/FormEmployeeVisa.vue b/src/components/03_customer-management/FormEmployeeVisa.vue
index a441ae65..876c7a52 100644
--- a/src/components/03_customer-management/FormEmployeeVisa.vue
+++ b/src/components/03_customer-management/FormEmployeeVisa.vue
@@ -92,7 +92,7 @@ let workerTypeFilter: (
onMounted(() => {
visaTypeFilter = selectFilterOptionRefMod(
- ref(optionStore.globalOption?.nationality),
+ ref(optionStore.globalOption?.visaType),
visaTypeOptions,
'label',
);
diff --git a/src/components/03_customer-management/employee/BasicInformation.vue b/src/components/03_customer-management/employee/BasicInformation.vue
index 98b42a12..da9a0c58 100644
--- a/src/components/03_customer-management/employee/BasicInformation.vue
+++ b/src/components/03_customer-management/employee/BasicInformation.vue
@@ -3,6 +3,7 @@ import { QSelect } from 'quasar';
import { CustomerBranch } from 'stores/customer/types';
import { selectFilterOptionRefMod } from 'stores/utils';
import { onMounted, ref, watch } from 'vue';
+import SelectCustomer from 'components/shared/select/SelectCustomer.vue';
import {
EditButton,
DeleteButton,
@@ -11,6 +12,7 @@ import {
} from 'components/button';
import { useI18n } from 'vue-i18n';
import useOptionStore from 'stores/options';
+import { formatAddress } from 'src/utils/address';
const { locale } = useI18n();
@@ -21,6 +23,13 @@ const optionsBranch = defineModel<{ id: string; name: string }[]>(
);
// employee
+
+const customerBranchId = defineModel('customerBranchId');
+
+const currentCustomerBranch = defineModel(
+ 'currentCustomerBranch',
+);
+
const customerBranch = defineModel<{
id: string;
address: string;
@@ -107,180 +116,14 @@ defineEmits<{
diff --git a/src/components/CanvasComponent.vue b/src/components/CanvasComponent.vue
index 72e63c4d..66996697 100644
--- a/src/components/CanvasComponent.vue
+++ b/src/components/CanvasComponent.vue
@@ -93,13 +93,6 @@ function clearUpload() {
imgUrl.value = '';
}
-watch(
- () => tab.value,
- async () => {
- await initializeSignaturePad();
- },
-);
-
onMounted(async () => {
await initializeSignaturePad();
});
diff --git a/src/components/shared/select/SelectCustomer.vue b/src/components/shared/select/SelectCustomer.vue
index 8adecb3c..f6fbf9cd 100644
--- a/src/components/shared/select/SelectCustomer.vue
+++ b/src/components/shared/select/SelectCustomer.vue
@@ -158,7 +158,7 @@ onMounted(async () => {