Merge branch 'dev/phat-2' into develop
This commit is contained in:
commit
6afe1802f3
11 changed files with 909 additions and 767 deletions
20
src/components/01_branch-management/FormLocation.vue
Normal file
20
src/components/01_branch-management/FormLocation.vue
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const location = defineModel<string>('qr');
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
title?: string;
|
||||||
|
dense?: boolean;
|
||||||
|
outlined?: boolean;
|
||||||
|
readonly?: boolean;
|
||||||
|
separator?: boolean;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="col-3 app-text-muted">• ข้อมูลที่อยู่สำนักงานใหญ่</div>
|
||||||
|
<div class="col-9 row">Location</div>
|
||||||
|
<q-separator
|
||||||
|
v-if="separator"
|
||||||
|
class="col-12 q-mt-xl q-mb-md"
|
||||||
|
style="padding-block: 0.5px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
20
src/components/01_branch-management/FormQr.vue
Normal file
20
src/components/01_branch-management/FormQr.vue
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const qr = defineModel<string>('qr');
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
title?: string;
|
||||||
|
dense?: boolean;
|
||||||
|
outlined?: boolean;
|
||||||
|
readonly?: boolean;
|
||||||
|
separator?: boolean;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="col-3 app-text-muted">• ข้อมูลที่อยู่สำนักงานใหญ่</div>
|
||||||
|
<div class="col-9 row">QRCode</div>
|
||||||
|
<q-separator
|
||||||
|
v-if="separator"
|
||||||
|
class="col-12 q-mt-xl q-mb-md"
|
||||||
|
style="padding-block: 0.5px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
270
src/components/02_personnel-management/FormAddress.vue
Normal file
270
src/components/02_personnel-management/FormAddress.vue
Normal file
|
|
@ -0,0 +1,270 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import useAddressStore, {
|
||||||
|
District,
|
||||||
|
Province,
|
||||||
|
SubDistrict,
|
||||||
|
} from 'src/stores/address';
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
title?: string;
|
||||||
|
addressTitle?: string;
|
||||||
|
addressTitleEN?: string;
|
||||||
|
dense?: boolean;
|
||||||
|
outlined?: boolean;
|
||||||
|
readonly?: boolean;
|
||||||
|
separator?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const adrressStore = useAddressStore();
|
||||||
|
const address = defineModel('address', { default: '' });
|
||||||
|
const addressEN = defineModel('addressEN', { default: '' });
|
||||||
|
const provinceId = defineModel<string | null | undefined>('provinceId');
|
||||||
|
const districtId = defineModel<string | null | undefined>('districtId');
|
||||||
|
const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
|
||||||
|
const zipCode = defineModel<string>('zipCode', { default: '' });
|
||||||
|
|
||||||
|
const addrOptions = ref<{
|
||||||
|
provinceOps?: Province[];
|
||||||
|
districtOps?: District[];
|
||||||
|
subDistrictOps?: SubDistrict[];
|
||||||
|
}>({});
|
||||||
|
|
||||||
|
async function fetchProvince() {
|
||||||
|
const result = await adrressStore.fetchProvince();
|
||||||
|
if (result) {
|
||||||
|
addrOptions.value.provinceOps = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchDistrict(id: string | undefined) {
|
||||||
|
if (id) {
|
||||||
|
const result = await adrressStore.fetchDistrictByProvinceId(id);
|
||||||
|
if (result) {
|
||||||
|
addrOptions.value.districtOps = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchSubDistrict(id: string | undefined) {
|
||||||
|
if (id) {
|
||||||
|
const result = await adrressStore.fetchSubDistrictByProvinceId(id);
|
||||||
|
if (result) {
|
||||||
|
addrOptions.value.subDistrictOps = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function selectProvince(id: string) {
|
||||||
|
if (!id) return;
|
||||||
|
districtId.value = undefined;
|
||||||
|
subDistrictId.value = undefined;
|
||||||
|
addrOptions.value.districtOps = [];
|
||||||
|
addrOptions.value.subDistrictOps = [];
|
||||||
|
zipCode.value = '';
|
||||||
|
await fetchDistrict(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function selectDistrict(id: string) {
|
||||||
|
if (!id) return;
|
||||||
|
subDistrictId.value = undefined;
|
||||||
|
zipCode.value = '';
|
||||||
|
await fetchSubDistrict(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function selectSubDistrict(id: string) {
|
||||||
|
if (!id) return;
|
||||||
|
zipCode.value =
|
||||||
|
addrOptions.value.subDistrictOps
|
||||||
|
?.filter((x) => x.id === id)
|
||||||
|
.map((x) => x.zipCode)[0] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await fetchProvince();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="col-12 app-text-muted">
|
||||||
|
• {{ title || 'ข้อมูลที่อยู่พนักงาน' }}
|
||||||
|
</div>
|
||||||
|
<div class="col-12 row q-col-gutter-y-md">
|
||||||
|
<div class="col-3 q-pl-xl app-text-muted">
|
||||||
|
{{ addressTitle || 'ที่อยู่' }}
|
||||||
|
</div>
|
||||||
|
<div class="col-9 row q-col-gutter-md">
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
id="addr-input"
|
||||||
|
:label="$t('address')"
|
||||||
|
class="col-12"
|
||||||
|
v-model="address"
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
(val && val.length > 0) || $t('formDialogInputAddressValidate'),
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
id="select-province"
|
||||||
|
v-model="provinceId"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
:label="$t('province')"
|
||||||
|
class="col-3"
|
||||||
|
:options="addrOptions.provinceOps"
|
||||||
|
@update:model-value="(v: string) => selectProvince(v)"
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
(val && val.length > 0) || $t('formDialogInputProvinceValidate'),
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
id="select-district"
|
||||||
|
v-model="districtId"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
:label="$t('district')"
|
||||||
|
class="col-3"
|
||||||
|
:options="addrOptions.districtOps"
|
||||||
|
@update:model-value="(v: string) => selectDistrict(v)"
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
(val && val.length > 0) || $t('formDialogInputDistrictValidate'),
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
id="select-sub-district"
|
||||||
|
v-model="subDistrictId"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
:label="$t('subDistrict')"
|
||||||
|
class="col-3"
|
||||||
|
:options="addrOptions.subDistrictOps"
|
||||||
|
@update:model-value="(v: string) => selectSubDistrict(v)"
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
(val && val.length > 0) || $t('formDialogInputSubDistrictValidate'),
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
readonly
|
||||||
|
id="zip"
|
||||||
|
:label="$t('zipCode')"
|
||||||
|
class="col-3"
|
||||||
|
v-model="zipCode"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-3 q-pl-xl app-text-muted">
|
||||||
|
{{ addressTitleEN || 'ที่อยู่ ภาษาอังกฤษ' }}
|
||||||
|
</div>
|
||||||
|
<div class="col-9 row q-col-gutter-md">
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
hide-bottom-space
|
||||||
|
id="addr-en-input"
|
||||||
|
:label="$t('address')"
|
||||||
|
class="col-12"
|
||||||
|
v-model="addressEN"
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
(val && val.length > 0) || $t('formDialogInputAddressValidate'),
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
id="select-province-en"
|
||||||
|
v-model="provinceId"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nameEN"
|
||||||
|
:label="$t('province')"
|
||||||
|
class="col-3"
|
||||||
|
:options="addrOptions.provinceOps"
|
||||||
|
@update:model-value="(v: string) => selectProvince(v)"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
id="select-district-en"
|
||||||
|
v-model="districtId"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nameEN"
|
||||||
|
:label="$t('district')"
|
||||||
|
class="col-3"
|
||||||
|
:options="addrOptions.districtOps"
|
||||||
|
@update:model-value="(v: string) => selectDistrict(v)"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:readonly="readonly"
|
||||||
|
:outlined="outlined"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
id="select-sub-district-en"
|
||||||
|
v-model="subDistrictId"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nameEN"
|
||||||
|
:label="$t('subDistrict')"
|
||||||
|
class="col-3"
|
||||||
|
:options="addrOptions.subDistrictOps"
|
||||||
|
@update:model-value="(v: string) => selectSubDistrict(v)"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
readonly
|
||||||
|
zip="zip-en"
|
||||||
|
:label="$t('zipCode')"
|
||||||
|
class="col-3"
|
||||||
|
v-model="zipCode"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<q-separator
|
||||||
|
v-if="separator"
|
||||||
|
class="col-12 q-mb-md"
|
||||||
|
style="padding-block: 0.5px; margin-top: 32px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
@ -5,13 +5,9 @@ import { dateFormat } from 'src/utils/datetime';
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const userType = defineModel<string>('userType');
|
const userType = defineModel<string>('userType');
|
||||||
const telephoneNo = defineModel<string>('telephoneNo');
|
|
||||||
const gender = defineModel<string>('gender');
|
|
||||||
const email = defineModel<string>('email');
|
|
||||||
const registrationNo = defineModel<string | null>('registrationNo');
|
const registrationNo = defineModel<string | null>('registrationNo');
|
||||||
const startDate = defineModel<Date | null>('startDate');
|
const startDate = defineModel<Date | null>('startDate');
|
||||||
const retireDate = defineModel<Date | null>('retireDate');
|
const retireDate = defineModel<Date | null>('retireDate');
|
||||||
const birthDate = defineModel<Date | null>('birthDate');
|
|
||||||
const responsibleArea = defineModel<string>('responsibleArea');
|
const responsibleArea = defineModel<string>('responsibleArea');
|
||||||
const discountCondition = defineModel<string | null | undefined>(
|
const discountCondition = defineModel<string | null | undefined>(
|
||||||
'discountCondition',
|
'discountCondition',
|
||||||
|
|
@ -34,285 +30,211 @@ defineProps<{
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-input
|
<div v-if="userType" class="col-3 app-text-muted">• ข้อมูลการทำงาน</div>
|
||||||
:dense="dense"
|
<div class="col-9 row q-col-gutter-md">
|
||||||
:outlined="outlined"
|
<div
|
||||||
:readonly="readonly"
|
v-if="userType === 'USER' || userType === 'MESSENGER'"
|
||||||
class="col-3"
|
class="row col-12 q-col-gutter-md"
|
||||||
label="เบอร์โทร"
|
style="margin-left: 0px; padding-left: 0px"
|
||||||
v-model="telephoneNo"
|
|
||||||
mask="##########"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
label="เพศ"
|
|
||||||
class="col-3"
|
|
||||||
bg-color="white"
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
v-model="gender"
|
|
||||||
:options="userStore.userOption.genderOpts"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
label="อีเมล"
|
|
||||||
class="col-6"
|
|
||||||
v-model="email"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
v-if="userType === 'USER' || userType === 'MESSENGER'"
|
|
||||||
class="row col-12 q-col-gutter-md"
|
|
||||||
style="margin-left: 0px; padding-left: 0px"
|
|
||||||
>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
label="เลขประจำตัว นจ. 16 (เลขที่ขึ้นทะเบียน)"
|
|
||||||
class="col-12"
|
|
||||||
v-model="registrationNo"
|
|
||||||
/>
|
|
||||||
<VueDatePicker
|
|
||||||
utc
|
|
||||||
autoApply
|
|
||||||
v-model="startDate"
|
|
||||||
:locale="'th'"
|
|
||||||
:enableTimePicker="false"
|
|
||||||
:disabled="readonly"
|
|
||||||
class="col-6"
|
|
||||||
>
|
>
|
||||||
<template #year="{ value }">
|
<q-input
|
||||||
{{ value + 543 }}
|
:dense="dense"
|
||||||
</template>
|
:outlined="outlined"
|
||||||
<template #trigger>
|
:readonly="readonly"
|
||||||
<q-input
|
label="เลขประจำตัว นจ. 16 (เลขที่ขึ้นทะเบียน)"
|
||||||
label="วันที่เริ่มงาน"
|
class="col-12"
|
||||||
:dense="dense"
|
v-model="registrationNo"
|
||||||
:outlined="outlined"
|
/>
|
||||||
:readonly="readonly"
|
<VueDatePicker
|
||||||
:model-value="startDate ? dateFormat(startDate) : ''"
|
utc
|
||||||
>
|
autoApply
|
||||||
<template v-slot:prepend>
|
v-model="startDate"
|
||||||
<q-icon
|
:locale="'th'"
|
||||||
size="xs"
|
:enableTimePicker="false"
|
||||||
name="mdi-calendar-blank-outline"
|
:disabled="readonly"
|
||||||
class="cursor-pointer"
|
class="col-6"
|
||||||
color="primary"
|
>
|
||||||
/>
|
<template #year="{ value }">
|
||||||
</template>
|
{{ value + 543 }}
|
||||||
<template v-slot:append>
|
</template>
|
||||||
<q-icon
|
<template #trigger>
|
||||||
v-if="startDate && !readonly"
|
<q-input
|
||||||
name="mdi-close"
|
label="วันที่เริ่มงาน"
|
||||||
class="cursor-pointer"
|
:dense="dense"
|
||||||
size="xs"
|
:outlined="outlined"
|
||||||
@click="startDate = undefined"
|
:readonly="readonly"
|
||||||
/>
|
:model-value="startDate ? dateFormat(startDate) : ''"
|
||||||
</template>
|
>
|
||||||
</q-input>
|
<template v-slot:prepend>
|
||||||
</template>
|
<q-icon
|
||||||
</VueDatePicker>
|
size="xs"
|
||||||
|
name="mdi-calendar-blank-outline"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
v-if="startDate && !readonly"
|
||||||
|
name="mdi-close"
|
||||||
|
class="cursor-pointer"
|
||||||
|
size="xs"
|
||||||
|
@click="startDate = undefined"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</VueDatePicker>
|
||||||
|
|
||||||
<VueDatePicker
|
<VueDatePicker
|
||||||
utc
|
utc
|
||||||
autoApply
|
autoApply
|
||||||
v-model="retireDate"
|
v-model="retireDate"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
class="col-6"
|
class="col-6"
|
||||||
|
>
|
||||||
|
<template #year="{ value }">
|
||||||
|
{{ value + 543 }}
|
||||||
|
</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
label="วันที่พ้นสภาพพนักงาน"
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:model-value="retireDate ? dateFormat(retireDate) : ''"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
size="xs"
|
||||||
|
name="mdi-calendar-blank-outline"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
v-if="retireDate && !readonly"
|
||||||
|
name="mdi-close"
|
||||||
|
class="cursor-pointer"
|
||||||
|
size="xs"
|
||||||
|
@click="retireDate = undefined"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</VueDatePicker>
|
||||||
|
<q-select
|
||||||
|
v-if="userType === 'MESSENGER'"
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
label="พื้นที่ ที่รับผิดชอบในการส่งเอกสาร"
|
||||||
|
class="col-12"
|
||||||
|
bg-color="white"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
v-model="responsibleArea"
|
||||||
|
:options="userStore.userOption.responsibleAreaOpts"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="userType === 'DELEGATE'"
|
||||||
|
class="row col-12"
|
||||||
|
style="row-gap: 16px"
|
||||||
>
|
>
|
||||||
<template #year="{ value }">
|
<q-input
|
||||||
{{ value + 543 }}
|
:dense="dense"
|
||||||
</template>
|
:outlined="outlined"
|
||||||
<template #trigger>
|
:readonly="readonly"
|
||||||
<q-input
|
label="เงื่อนไขส่วนลดบริการต่างๆ ของตัวแทน"
|
||||||
label="วันที่พ้นสภาพพนักงาน"
|
class="col-12"
|
||||||
:dense="dense"
|
v-model="discountCondition"
|
||||||
:outlined="outlined"
|
type="textarea"
|
||||||
:readonly="readonly"
|
/>
|
||||||
:model-value="retireDate ? dateFormat(retireDate) : ''"
|
</div>
|
||||||
>
|
<div
|
||||||
<template v-slot:prepend>
|
v-if="userType === 'AGENCY'"
|
||||||
<q-icon
|
class="row col-12 q-col-gutter-md"
|
||||||
size="xs"
|
style="margin-left: 0px; padding-left: 0px"
|
||||||
name="mdi-calendar-blank-outline"
|
|
||||||
class="cursor-pointer"
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template v-slot:append>
|
|
||||||
<q-icon
|
|
||||||
v-if="retireDate && !readonly"
|
|
||||||
name="mdi-close"
|
|
||||||
class="cursor-pointer"
|
|
||||||
size="xs"
|
|
||||||
@click="retireDate = undefined"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</template>
|
|
||||||
</VueDatePicker>
|
|
||||||
|
|
||||||
<VueDatePicker
|
|
||||||
utc
|
|
||||||
autoApply
|
|
||||||
v-model="birthDate"
|
|
||||||
:locale="'th'"
|
|
||||||
:enableTimePicker="false"
|
|
||||||
:disabled="readonly"
|
|
||||||
class="col-3"
|
|
||||||
>
|
>
|
||||||
<template #year="{ value }">
|
<q-select
|
||||||
{{ value + 543 }}
|
:dense="dense"
|
||||||
</template>
|
:outlined="outlined"
|
||||||
<template #trigger>
|
:readonly="readonly"
|
||||||
<q-input
|
:hide-dropdown-icon="readonly"
|
||||||
label="วันเดือนปีเกิด"
|
emit-value
|
||||||
:dense="dense"
|
map-options
|
||||||
:outlined="outlined"
|
options-dense
|
||||||
:readonly="readonly"
|
label="สัญชาติต้นทาง"
|
||||||
:model-value="birthDate ? dateFormat(birthDate) : ''"
|
class="col-3"
|
||||||
>
|
bg-color="white"
|
||||||
<template v-slot:prepend>
|
option-label="label"
|
||||||
<q-icon
|
option-value="label"
|
||||||
size="xs"
|
v-model="sourceNationality"
|
||||||
name="mdi-calendar-blank-outline"
|
:options="userStore.userOption.nationalityOpts"
|
||||||
class="cursor-pointer"
|
/>
|
||||||
color="positive"
|
<q-select
|
||||||
/>
|
:dense="dense"
|
||||||
</template>
|
:outlined="outlined"
|
||||||
<template v-slot:append>
|
:readonly="readonly"
|
||||||
<q-icon
|
:hide-dropdown-icon="readonly"
|
||||||
v-if="birthDate && !readonly"
|
emit-value
|
||||||
name="mdi-close"
|
map-options
|
||||||
class="cursor-pointer"
|
options-dense
|
||||||
size="xs"
|
label="นำเข้าสัญชาติ"
|
||||||
@click="birthDate = undefined"
|
class="col-3"
|
||||||
/>
|
option-label="label"
|
||||||
</template>
|
option-value="label"
|
||||||
</q-input>
|
v-model="importNationality"
|
||||||
</template>
|
:options="userStore.userOption.nationalityOpts"
|
||||||
</VueDatePicker>
|
/>
|
||||||
<q-input
|
<q-select
|
||||||
:dense="dense"
|
:dense="dense"
|
||||||
:outlined="outlined"
|
:outlined="outlined"
|
||||||
readonly
|
:readonly="readonly"
|
||||||
label="อายุ"
|
:hide-dropdown-icon="readonly"
|
||||||
class="col-3"
|
emit-value
|
||||||
:model-value="birthDate ? userStore.calculateAge(birthDate) : ''"
|
map-options
|
||||||
/>
|
options-dense
|
||||||
<q-select
|
label="สถานที่อบรม"
|
||||||
v-if="userType === 'MESSENGER'"
|
class="col-6"
|
||||||
:dense="dense"
|
option-label="label"
|
||||||
:outlined="outlined"
|
option-value="label"
|
||||||
:readonly="readonly"
|
v-model="trainingPlace"
|
||||||
:hide-dropdown-icon="readonly"
|
:options="userStore.userOption.trainingPlaceOpts"
|
||||||
emit-value
|
/>
|
||||||
map-options
|
<q-input
|
||||||
options-dense
|
:dense="dense"
|
||||||
label="พื้นที่ ที่รับผิดชอบในการส่งเอกสาร"
|
:outlined="outlined"
|
||||||
class="col-12"
|
:readonly="readonly"
|
||||||
bg-color="white"
|
label="ด่าน"
|
||||||
option-label="label"
|
class="col-6"
|
||||||
option-value="value"
|
v-model="checkPoint"
|
||||||
v-model="responsibleArea"
|
/>
|
||||||
:options="userStore.userOption.responsibleAreaOpts"
|
<q-input
|
||||||
/>
|
:dense="dense"
|
||||||
</div>
|
:outlined="outlined"
|
||||||
<div v-if="userType === 'DELEGATE'" class="row col-12" style="row-gap: 16px">
|
:readonly="readonly"
|
||||||
<q-input
|
label="ด่าน ENG"
|
||||||
:dense="dense"
|
class="col-6"
|
||||||
:outlined="outlined"
|
v-model="checkPointEN"
|
||||||
:readonly="readonly"
|
/>
|
||||||
label="เงื่อนไขส่วนลดบริการต่างๆ ของตัวแทน"
|
<q-file
|
||||||
class="col-12"
|
:dense="dense"
|
||||||
v-model="discountCondition"
|
:outlined="outlined"
|
||||||
type="textarea"
|
:readonly="readonly"
|
||||||
/>
|
label="แบบเอกสารประจำตัว"
|
||||||
</div>
|
class="col-12"
|
||||||
<div
|
v-model="idenDoc"
|
||||||
v-if="userType === 'AGENCY'"
|
type="textarea"
|
||||||
class="row col-12 q-col-gutter-md"
|
/>
|
||||||
style="margin-left: 0px; padding-left: 0px"
|
</div>
|
||||||
>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
label="สัญชาติต้นทาง"
|
|
||||||
class="col-3"
|
|
||||||
bg-color="white"
|
|
||||||
option-label="label"
|
|
||||||
option-value="label"
|
|
||||||
v-model="sourceNationality"
|
|
||||||
:options="userStore.userOption.nationalityOpts"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
label="นำเข้าสัญชาติ"
|
|
||||||
class="col-3"
|
|
||||||
option-label="label"
|
|
||||||
option-value="label"
|
|
||||||
v-model="importNationality"
|
|
||||||
:options="userStore.userOption.nationalityOpts"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
label="สถานที่อบรม"
|
|
||||||
class="col-6"
|
|
||||||
option-label="label"
|
|
||||||
option-value="label"
|
|
||||||
v-model="trainingPlace"
|
|
||||||
:options="userStore.userOption.trainingPlaceOpts"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
label="ด่าน"
|
|
||||||
class="col-6"
|
|
||||||
v-model="checkPoint"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
label="ด่าน ENG"
|
|
||||||
class="col-6"
|
|
||||||
v-model="checkPointEN"
|
|
||||||
/>
|
|
||||||
<q-file
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
label="แบบเอกสารประจำตัว"
|
|
||||||
class="col-12"
|
|
||||||
v-model="idenDoc"
|
|
||||||
type="textarea"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
132
src/components/02_personnel-management/FormInformation.vue
Normal file
132
src/components/02_personnel-management/FormInformation.vue
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import useUserStore from 'src/stores/user';
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
const hqId = defineModel<string | null | undefined>('hqId');
|
||||||
|
const brId = defineModel<string | null | undefined>('brId');
|
||||||
|
const userType = defineModel<string>('userType');
|
||||||
|
const userRole = defineModel<string>('userRole');
|
||||||
|
const userName = defineModel<string | null | undefined>('userName');
|
||||||
|
const userCode = defineModel<string>('userCode');
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
dense?: boolean;
|
||||||
|
outlined?: boolean;
|
||||||
|
readonly?: boolean;
|
||||||
|
separator?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
async function selectHq(id: string) {
|
||||||
|
if (!id) return;
|
||||||
|
brId.value = '';
|
||||||
|
userStore.userOption.brOpts = [];
|
||||||
|
await userStore.fetchBrOption(id);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="col-3 app-text-muted">• ข้อมูลพื้นฐาน</div>
|
||||||
|
<div class="col-9 row q-col-gutter-md">
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-6"
|
||||||
|
bg-color="white"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
label="รหัสสำนักงานใหญ่"
|
||||||
|
v-model="hqId"
|
||||||
|
:options="userStore.userOption.hqOpts"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณาเลือกสำนักงานใหญ่']"
|
||||||
|
@update:model-value="(val: string) => selectHq(val)"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-6"
|
||||||
|
label="รหัสสาขา"
|
||||||
|
bg-color="white"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
v-model="brId"
|
||||||
|
:options="userStore.userOption.brOpts"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
bg-color="white"
|
||||||
|
option-value="value"
|
||||||
|
option-label="label"
|
||||||
|
label="ประเภทผู้ใช้งาน"
|
||||||
|
v-model="userType"
|
||||||
|
:options="userStore.userOption.userTypeOpts"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณาเลือกประเภทผู้ใช้งาน']"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
bg-color="white"
|
||||||
|
label="สิทธิ์ผู้ใช้งาน"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
v-model="userRole"
|
||||||
|
:options="userStore.userOption.roleOpts"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณาเลือกสิทธิ์ผู้ใช้งาน']"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
bg-color="white"
|
||||||
|
label="ชื่อผู้ใช้งาน (Username)"
|
||||||
|
v-model="userName"
|
||||||
|
:rules="[(val: string) => val.length > 2 || 'กรุณากรอกชื่อผู้ใช้งาน']"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
readonly
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
bg-color="white"
|
||||||
|
label="รหัสพนักงาน"
|
||||||
|
v-model="userCode"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<q-separator
|
||||||
|
v-if="separator"
|
||||||
|
class="col-12 q-mb-md"
|
||||||
|
style="padding-block: 0.5px; margin-top: 32px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
const firstName = defineModel<string>('firstName');
|
|
||||||
const lastName = defineModel<string>('lastName');
|
|
||||||
const firstNameEN = defineModel<string>('firstNameEN');
|
|
||||||
const lastNameEN = defineModel<string>('lastNameEN');
|
|
||||||
|
|
||||||
defineProps<{
|
|
||||||
dense?: boolean;
|
|
||||||
outlined?: boolean;
|
|
||||||
readonly?: boolean;
|
|
||||||
}>();
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
label="ชื่อ ภาษาไทย"
|
|
||||||
v-model="firstName"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณากรอกชื่อ ภาษาไทย']"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
label="นามสกุล ภาษาไทย"
|
|
||||||
v-model="lastName"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณากรอกนามสกุล ภาษาไทย']"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
label="ชื่อ ภาษาอังกฤษ"
|
|
||||||
v-model="firstNameEN"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณากรอกชื่อ ภาษาอังกฤษ']"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
label="นามสกุล ภาษาอังกฤษ"
|
|
||||||
v-model="lastNameEN"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณากรอกนามสกุล ภาษาอังกฤษ']"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
152
src/components/02_personnel-management/FormPerson.vue
Normal file
152
src/components/02_personnel-management/FormPerson.vue
Normal file
|
|
@ -0,0 +1,152 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import useUserStore from 'src/stores/user';
|
||||||
|
import { dateFormat } from 'src/utils/datetime';
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
const firstName = defineModel<string>('firstName');
|
||||||
|
const lastName = defineModel<string>('lastName');
|
||||||
|
const firstNameEN = defineModel<string>('firstNameEN');
|
||||||
|
const lastNameEN = defineModel<string>('lastNameEN');
|
||||||
|
const telephoneNo = defineModel<string>('telephoneNo');
|
||||||
|
const email = defineModel<string>('email');
|
||||||
|
const gender = defineModel<string>('gender');
|
||||||
|
const birthDate = defineModel<Date | null>('birthDate');
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
dense?: boolean;
|
||||||
|
outlined?: boolean;
|
||||||
|
readonly?: boolean;
|
||||||
|
separator?: boolean;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="col-3 app-text-muted">• ข้อมูลบุคลากร</div>
|
||||||
|
<div class="col-9 row q-col-gutter-md">
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
label="ชื่อ ภาษาไทย"
|
||||||
|
v-model="firstName"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณากรอกชื่อ ภาษาไทย']"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
label="นามสกุล ภาษาไทย"
|
||||||
|
v-model="lastName"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณากรอกนามสกุล ภาษาไทย']"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
label="ชื่อ ภาษาอังกฤษ"
|
||||||
|
v-model="firstNameEN"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณากรอกชื่อ ภาษาอังกฤษ']"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-3"
|
||||||
|
label="นามสกุล ภาษาอังกฤษ"
|
||||||
|
v-model="lastNameEN"
|
||||||
|
:rules="[(val: string) => !!val || 'กรุณากรอกนามสกุล ภาษาอังกฤษ']"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
class="col-6"
|
||||||
|
label="เบอร์โทร"
|
||||||
|
v-model="telephoneNo"
|
||||||
|
mask="##########"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
label="อีเมล"
|
||||||
|
class="col-6"
|
||||||
|
v-model="email"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
label="เพศ"
|
||||||
|
class="col-3"
|
||||||
|
bg-color="white"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
v-model="gender"
|
||||||
|
:options="userStore.userOption.genderOpts"
|
||||||
|
/>
|
||||||
|
<VueDatePicker
|
||||||
|
utc
|
||||||
|
autoApply
|
||||||
|
v-model="birthDate"
|
||||||
|
:locale="'th'"
|
||||||
|
:enableTimePicker="false"
|
||||||
|
:disabled="readonly"
|
||||||
|
class="col-3"
|
||||||
|
>
|
||||||
|
<template #year="{ value }">
|
||||||
|
{{ value + 543 }}
|
||||||
|
</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
label="วันเดือนปีเกิด"
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
:readonly="readonly"
|
||||||
|
:model-value="birthDate ? dateFormat(birthDate) : ''"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
size="xs"
|
||||||
|
name="mdi-calendar-blank-outline"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="positive"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
v-if="birthDate && !readonly"
|
||||||
|
name="mdi-close"
|
||||||
|
class="cursor-pointer"
|
||||||
|
size="xs"
|
||||||
|
@click="birthDate = undefined"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</VueDatePicker>
|
||||||
|
<q-input
|
||||||
|
:dense="dense"
|
||||||
|
:outlined="outlined"
|
||||||
|
readonly
|
||||||
|
label="อายุ"
|
||||||
|
class="col-3"
|
||||||
|
:model-value="birthDate ? userStore.calculateAge(birthDate) : ''"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<q-separator
|
||||||
|
v-if="separator"
|
||||||
|
class="col-12 q-mb-md"
|
||||||
|
style="padding-block: 0.5px; margin-top: 32px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import useUserStore from 'src/stores/user';
|
|
||||||
|
|
||||||
const userStore = useUserStore();
|
|
||||||
|
|
||||||
const hqId = defineModel<string | null | undefined>('hqId');
|
|
||||||
const brId = defineModel<string | null | undefined>('brId');
|
|
||||||
const userType = defineModel<string>('userType');
|
|
||||||
const userRole = defineModel<string>('userRole');
|
|
||||||
const userName = defineModel<string | null | undefined>('userName');
|
|
||||||
const userCode = defineModel<string>('userCode');
|
|
||||||
|
|
||||||
defineProps<{
|
|
||||||
dense?: boolean;
|
|
||||||
outlined?: boolean;
|
|
||||||
readonly?: boolean;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
async function selectHq(id: string) {
|
|
||||||
if (!id) return;
|
|
||||||
brId.value = '';
|
|
||||||
userStore.userOption.brOpts = [];
|
|
||||||
await userStore.fetchBrOption(id);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-6"
|
|
||||||
bg-color="white"
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
label="รหัสสำนักงานใหญ่"
|
|
||||||
v-model="hqId"
|
|
||||||
:options="userStore.userOption.hqOpts"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณาเลือกสำนักงานใหญ่']"
|
|
||||||
@update:model-value="(val: string) => selectHq(val)"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-6"
|
|
||||||
label="รหัสสาขา"
|
|
||||||
bg-color="white"
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
v-model="brId"
|
|
||||||
:options="userStore.userOption.brOpts"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
bg-color="white"
|
|
||||||
option-value="value"
|
|
||||||
option-label="label"
|
|
||||||
label="ประเภทผู้ใช้งาน"
|
|
||||||
v-model="userType"
|
|
||||||
:options="userStore.userOption.userTypeOpts"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณาเลือกประเภทผู้ใช้งาน']"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
:hide-dropdown-icon="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
bg-color="white"
|
|
||||||
label="สิทธิ์ผู้ใช้งาน"
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
v-model="userRole"
|
|
||||||
:options="userStore.userOption.roleOpts"
|
|
||||||
:rules="[(val: string) => !!val || 'กรุณาเลือกสิทธิ์ผู้ใช้งาน']"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
v-if="userName"
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
:readonly="readonly"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
options-dense
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-3"
|
|
||||||
bg-color="white"
|
|
||||||
label="ชื่อผู้ใช้งาน (Username)"
|
|
||||||
v-model="userName"
|
|
||||||
:rules="[(val: string) => val.length > 2 || 'กรุณากรอกชื่อผู้ใช้งาน']"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
:dense="dense"
|
|
||||||
:outlined="outlined"
|
|
||||||
readonly
|
|
||||||
hide-bottom-space
|
|
||||||
:class="userName ? 'col-3' : 'col-6'"
|
|
||||||
bg-color="white"
|
|
||||||
label="รหัสพนักงาน"
|
|
||||||
v-model="userCode"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
@ -1,24 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
|
||||||
import AppBox from 'components/app/AppBox.vue';
|
import AppBox from 'components/app/AppBox.vue';
|
||||||
|
import FormAddress from './02_personnel-management/FormAddress.vue';
|
||||||
import { Province, District, SubDistrict } from 'stores/address';
|
|
||||||
import useAddressStore from 'stores/address';
|
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
title: string;
|
title: string;
|
||||||
addressTitle?: string;
|
addressTitle?: string;
|
||||||
addressENTitle?: string;
|
addressTitleEN?: string;
|
||||||
|
addressSeparator?: boolean;
|
||||||
submit?: (...args: unknown[]) => void;
|
submit?: (...args: unknown[]) => void;
|
||||||
close?: (...args: unknown[]) => void;
|
close?: (...args: unknown[]) => void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
fetchDistrict,
|
|
||||||
fetchSubDistrict,
|
|
||||||
});
|
|
||||||
|
|
||||||
const adrressStore = useAddressStore();
|
|
||||||
const modal = defineModel('modal', { default: false });
|
const modal = defineModel('modal', { default: false });
|
||||||
const address = defineModel('address', { default: '' });
|
const address = defineModel('address', { default: '' });
|
||||||
const addressEN = defineModel('addressEN', { default: '' });
|
const addressEN = defineModel('addressEN', { default: '' });
|
||||||
|
|
@ -26,78 +18,22 @@ const provinceId = defineModel<string | null | undefined>('provinceId');
|
||||||
const districtId = defineModel<string | null | undefined>('districtId');
|
const districtId = defineModel<string | null | undefined>('districtId');
|
||||||
const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
|
const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
|
||||||
const zipCode = defineModel<string>('zipCode', { default: '' });
|
const zipCode = defineModel<string>('zipCode', { default: '' });
|
||||||
|
|
||||||
const addrOptions = ref<{
|
|
||||||
provinceOps?: Province[];
|
|
||||||
districtOps?: District[];
|
|
||||||
subDistrictOps?: SubDistrict[];
|
|
||||||
}>({});
|
|
||||||
|
|
||||||
async function fetchProvince() {
|
|
||||||
const result = await adrressStore.fetchProvince();
|
|
||||||
if (result) {
|
|
||||||
addrOptions.value.provinceOps = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchDistrict(id: string | undefined) {
|
|
||||||
if (id) {
|
|
||||||
const result = await adrressStore.fetchDistrictByProvinceId(id);
|
|
||||||
if (result) {
|
|
||||||
addrOptions.value.districtOps = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchSubDistrict(id: string | undefined) {
|
|
||||||
if (id) {
|
|
||||||
const result = await adrressStore.fetchSubDistrictByProvinceId(id);
|
|
||||||
if (result) {
|
|
||||||
addrOptions.value.subDistrictOps = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function selectProvince(id: string) {
|
|
||||||
if (!id) return;
|
|
||||||
districtId.value = undefined;
|
|
||||||
subDistrictId.value = undefined;
|
|
||||||
addrOptions.value.districtOps = [];
|
|
||||||
addrOptions.value.subDistrictOps = [];
|
|
||||||
zipCode.value = '';
|
|
||||||
await fetchDistrict(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function selectDistrict(id: string) {
|
|
||||||
if (!id) return;
|
|
||||||
subDistrictId.value = undefined;
|
|
||||||
zipCode.value = '';
|
|
||||||
await fetchSubDistrict(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function selectSubDistrict(id: string) {
|
|
||||||
if (!id) return;
|
|
||||||
zipCode.value =
|
|
||||||
addrOptions.value.subDistrictOps
|
|
||||||
?.filter((x) => x.id === id)
|
|
||||||
.map((x) => x.zipCode)[0] ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
await fetchProvince();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog full-width v-model="modal" @hide="close">
|
<q-dialog full-width v-model="modal" @hide="close">
|
||||||
<AppBox style="padding: 0; border-radius: var(--radius-2); max-width: 80%">
|
<AppBox
|
||||||
|
style="
|
||||||
|
padding: 0;
|
||||||
|
border-radius: var(--radius-2);
|
||||||
|
max-width: 80%;
|
||||||
|
max-height: 100%;
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-form greedy @submit.prevent @validation-success="submit">
|
<q-form greedy @submit.prevent @validation-success="submit">
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<q-card-section class="form-header">
|
<div class="form-header q-py-sm q-pr-lg">
|
||||||
<div class="row items-center justity-between">
|
<div class="row items-center">
|
||||||
<div
|
<div class="col text-subtitle1 text-weight-bold text-center">
|
||||||
class="col text-subtitle1 text-weight-bold"
|
|
||||||
style="color: hsl(var(--info-bg))"
|
|
||||||
>
|
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -112,222 +48,89 @@ onMounted(async () => {
|
||||||
@click="close"
|
@click="close"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
|
||||||
|
|
||||||
<!-- form-top -->
|
|
||||||
<div class="form-body-top" :class="{ dark: $q.dark.isActive }">
|
|
||||||
<q-card-section class="column col-12">
|
|
||||||
<div class="row q-col-gutter-x-md" style="row-gap: 16px">
|
|
||||||
<slot name="top"></slot>
|
|
||||||
</div>
|
|
||||||
</q-card-section>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- form-mid -->
|
<!-- body -->
|
||||||
<div class="row" style="overflow-y: auto; max-height: 50vh">
|
<div
|
||||||
|
class="row form-body q-pa-lg"
|
||||||
|
:class="{ dark: $q.dark.isActive }"
|
||||||
|
:style="$q.screen.gt.sm ? '' : 'overflow-y: auto; max-height: 75vh'"
|
||||||
|
>
|
||||||
<!-- prepend -->
|
<!-- prepend -->
|
||||||
<q-card-section
|
<div
|
||||||
class="column col-2"
|
class="column"
|
||||||
|
:class="$q.screen.gt.sm ? 'col-2 q-pr-lg' : 'col-12'"
|
||||||
v-if="$slots.prepend && !$slots.append"
|
v-if="$slots.prepend && !$slots.append"
|
||||||
>
|
>
|
||||||
<slot name="prepend"></slot>
|
<slot name="prepend"></slot>
|
||||||
</q-card-section>
|
</div>
|
||||||
|
|
||||||
<!-- center -->
|
<!-- center -->
|
||||||
<q-card-section
|
<AppBox
|
||||||
class="column"
|
bordered
|
||||||
:class="`${$slots.prepend ? 'col-10' : $slots.append ? 'col-6' : 'col-12'}`"
|
class="column full-height"
|
||||||
|
:class="`${$slots.prepend ? ($q.screen.gt.sm ? 'col-10' : 'col-12') : $slots.append ? 'col-6' : 'col-12'}`"
|
||||||
|
style="padding-right: 0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="row inline col-12 q-col-gutter-x-md"
|
class="row col-12 q-col-gutter-y-md q-pr-md"
|
||||||
style="row-gap: 16px"
|
:style="$q.screen.gt.sm ? 'overflow-y: auto; height: 60vh' : ''"
|
||||||
>
|
>
|
||||||
<slot name="midTop"></slot>
|
<slot name="information"></slot>
|
||||||
<div class="col-12">
|
<slot name="person"></slot>
|
||||||
{{ $t(addressTitle || 'address') }}
|
<slot name="address">
|
||||||
</div>
|
<FormAddress
|
||||||
<q-input
|
dense
|
||||||
hide-bottom-space
|
outlined
|
||||||
dense
|
:separator="addressSeparator"
|
||||||
outlined
|
v-model:address="address"
|
||||||
id="Addr"
|
v-model:addressEN="addressEN"
|
||||||
:label="$t('address')"
|
v-model:provinceId="provinceId"
|
||||||
class="col-12"
|
v-model:districtId="districtId"
|
||||||
v-model="address"
|
v-model:subDistrictId="subDistrictId"
|
||||||
lazy-rules
|
v-model:zipCode="zipCode"
|
||||||
:rules="[
|
:addressTitle="addressTitle || ''"
|
||||||
(val) =>
|
:addressTitleEN="addressTitleEN || ''"
|
||||||
(val && val.length > 0) ||
|
v-if="!$slots.address"
|
||||||
$t('formDialogInputAddressValidate'),
|
/>
|
||||||
]"
|
</slot>
|
||||||
/>
|
<slot name="qr-code"></slot>
|
||||||
<q-select
|
<slot name="location"></slot>
|
||||||
hide-bottom-space
|
<slot name="by-type"></slot>
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
id="selectProvince"
|
|
||||||
v-model="provinceId"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:label="$t('province')"
|
|
||||||
class="col-3"
|
|
||||||
:options="addrOptions.provinceOps"
|
|
||||||
@update:model-value="(v: string) => selectProvince(v)"
|
|
||||||
lazy-rules
|
|
||||||
:rules="[
|
|
||||||
(val) =>
|
|
||||||
(val && val.length > 0) ||
|
|
||||||
$t('formDialogInputProvinceValidate'),
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
id="selectDistrict"
|
|
||||||
v-model="districtId"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:label="$t('district')"
|
|
||||||
class="col-3"
|
|
||||||
:options="addrOptions.districtOps"
|
|
||||||
@update:model-value="(v: string) => selectDistrict(v)"
|
|
||||||
lazy-rules
|
|
||||||
:rules="[
|
|
||||||
(val) =>
|
|
||||||
(val && val.length > 0) ||
|
|
||||||
$t('formDialogInputDistrictValidate'),
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
id="SelectSubDistrict"
|
|
||||||
v-model="subDistrictId"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:label="$t('subDistrict')"
|
|
||||||
class="col-3"
|
|
||||||
:options="addrOptions.subDistrictOps"
|
|
||||||
@update:model-value="(v: string) => selectSubDistrict(v)"
|
|
||||||
lazy-rules
|
|
||||||
:rules="[
|
|
||||||
(val) =>
|
|
||||||
(val && val.length > 0) ||
|
|
||||||
$t('formDialogInputSubDistrictValidate'),
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
dense
|
|
||||||
readonly
|
|
||||||
outlined
|
|
||||||
id="zip"
|
|
||||||
:label="$t('zipCode')"
|
|
||||||
class="col-3"
|
|
||||||
v-model="zipCode"
|
|
||||||
/>
|
|
||||||
<span class="col-12">{{ $t(addressTitle || 'address') }} EN</span>
|
|
||||||
<q-input
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
id="addressEN"
|
|
||||||
:label="$t('address')"
|
|
||||||
class="col-12"
|
|
||||||
v-model="addressEN"
|
|
||||||
lazy-rules
|
|
||||||
:rules="[
|
|
||||||
(val) =>
|
|
||||||
(val && val.length > 0) ||
|
|
||||||
$t('formDialogInputAddressValidate'),
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
id="selectProvinceEN"
|
|
||||||
v-model="provinceId"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nameEN"
|
|
||||||
:label="$t('province')"
|
|
||||||
class="col-3"
|
|
||||||
:options="addrOptions.provinceOps"
|
|
||||||
@update:model-value="(v: string) => selectProvince(v)"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
id="selectDistrictEN"
|
|
||||||
v-model="districtId"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nameEN"
|
|
||||||
:label="$t('district')"
|
|
||||||
class="col-3"
|
|
||||||
:options="addrOptions.districtOps"
|
|
||||||
@update:model-value="(v: string) => selectDistrict(v)"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
id="SelectSubDistrictEN"
|
|
||||||
v-model="subDistrictId"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nameEN"
|
|
||||||
:label="$t('subDistrict')"
|
|
||||||
class="col-3"
|
|
||||||
:options="addrOptions.subDistrictOps"
|
|
||||||
@update:model-value="(v: string) => selectSubDistrict(v)"
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
dense
|
|
||||||
readonly
|
|
||||||
outlined
|
|
||||||
zip="zipEN"
|
|
||||||
:label="$t('zipCode')"
|
|
||||||
class="col-3"
|
|
||||||
v-model="zipCode"
|
|
||||||
/>
|
|
||||||
<div class="col-12" v-if="$slots.midBottom">
|
|
||||||
<q-separator size="1px" />
|
|
||||||
</div>
|
|
||||||
<slot name="midBottom"></slot>
|
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</AppBox>
|
||||||
|
|
||||||
<!-- append -->
|
<!-- append -->
|
||||||
<q-card-section
|
<q-item-section
|
||||||
class="column col-6"
|
class="column col-6"
|
||||||
v-if="$slots.append && !$slots.prepend"
|
v-if="$slots.append && !$slots.prepend"
|
||||||
>
|
>
|
||||||
<slot name="append"></slot>
|
<slot name="append"></slot>
|
||||||
</q-card-section>
|
</q-item-section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
<q-card-section class="form-footer">
|
<div class="form-footer q-py-sm q-pr-lg text-right q-gutter-x-lg">
|
||||||
<div class="text-right">
|
<q-btn
|
||||||
<q-btn
|
dense
|
||||||
dense
|
outline
|
||||||
unelevated
|
unelevated
|
||||||
id="submitBtn"
|
id="cancelBtn"
|
||||||
type="submit"
|
class="q-px-md app-text-negative"
|
||||||
color="primary"
|
:label="$t('cancel')"
|
||||||
class="q-px-sm"
|
@click="close"
|
||||||
:label="$t('save')"
|
v-close-popup
|
||||||
/>
|
/>
|
||||||
</div>
|
<q-btn
|
||||||
</q-card-section>
|
dense
|
||||||
|
unelevated
|
||||||
|
id="submitBtn"
|
||||||
|
type="submit"
|
||||||
|
color="primary"
|
||||||
|
class="q-px-md"
|
||||||
|
:label="$t('save')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
</AppBox>
|
</AppBox>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
@ -348,7 +151,7 @@ onMounted(async () => {
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px solid var(--border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-body-top {
|
.form-body {
|
||||||
--_body-bg: var(--sand-0);
|
--_body-bg: var(--sand-0);
|
||||||
background-color: var(--_body-bg);
|
background-color: var(--_body-bg);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ import SelectorList from 'components/SelectorList.vue';
|
||||||
import AddButton from 'components/AddButton.vue';
|
import AddButton from 'components/AddButton.vue';
|
||||||
import TooltipComponent from 'components/TooltipComponent.vue';
|
import TooltipComponent from 'components/TooltipComponent.vue';
|
||||||
import FormDialog from 'src/components/FormDialog.vue';
|
import FormDialog from 'src/components/FormDialog.vue';
|
||||||
import FormTop from 'src/components/02_personnel-management/FormTop.vue';
|
import FormInformation from 'src/components/02_personnel-management/FormInformation.vue';
|
||||||
import FormName from 'src/components/02_personnel-management/FormName.vue';
|
import FormPerson from 'src/components/02_personnel-management/FormPerson.vue';
|
||||||
import FormByType from 'src/components/02_personnel-management/FormByType.vue';
|
import FormByType from 'src/components/02_personnel-management/FormByType.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -62,11 +62,11 @@ const isEdit = ref(false);
|
||||||
const modal = ref(false);
|
const modal = ref(false);
|
||||||
const status = ref(false);
|
const status = ref(false);
|
||||||
const userId = ref('');
|
const userId = ref('');
|
||||||
const code = ref('');
|
|
||||||
const selectorLabel = ref('');
|
const selectorLabel = ref('');
|
||||||
const hqId = ref('');
|
const hqId = ref('');
|
||||||
const brId = ref('');
|
const brId = ref('');
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
|
const code = ref('');
|
||||||
const formDialogRef = ref();
|
const formDialogRef = ref();
|
||||||
const userStats = ref<BranchUserStats[]>();
|
const userStats = ref<BranchUserStats[]>();
|
||||||
const typeStats = ref<UserTypeStats>();
|
const typeStats = ref<UserTypeStats>();
|
||||||
|
|
@ -416,34 +416,20 @@ watch(
|
||||||
<!-- form -->
|
<!-- form -->
|
||||||
<FormDialog
|
<FormDialog
|
||||||
ref="formDialogRef"
|
ref="formDialogRef"
|
||||||
|
v-model:formData="formData"
|
||||||
v-model:modal="modal"
|
v-model:modal="modal"
|
||||||
v-model:address="formData.address"
|
v-model:hqId="hqId"
|
||||||
v-model:addressEN="formData.addressEN"
|
v-model:brId="brId"
|
||||||
v-model:provinceId="formData.provinceId"
|
v-model:username="username"
|
||||||
v-model:districtId="formData.districtId"
|
v-model:code="code"
|
||||||
v-model:subDistrictId="formData.subDistrictId"
|
|
||||||
v-model:zipCode="formData.zipCode"
|
|
||||||
title="เพิ่มบุคลากร"
|
title="เพิ่มบุคลากร"
|
||||||
addressTitle="ที่อยู่พนักงาน"
|
addressTitle="ที่อยู่พนักงาน"
|
||||||
addressENTitle="ที่อยู่พนักงาน ENG"
|
addressENTitle="ที่อยู่พนักงาน ENG"
|
||||||
:submit="() => onSubmit()"
|
:submit="() => onSubmit()"
|
||||||
:close="() => onClose()"
|
:close="() => onClose()"
|
||||||
>
|
>
|
||||||
<template #top>
|
|
||||||
<FormTop
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
v-model:hqId="hqId"
|
|
||||||
v-model:brId="brId"
|
|
||||||
v-model:userType="formData.userType"
|
|
||||||
v-model:userRole="formData.userRole"
|
|
||||||
v-model:userName="username"
|
|
||||||
v-model:userCode="code"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<div class="q-pl-md text-center">
|
<div class="text-center">
|
||||||
<div class="upload-img-preview">
|
<div class="upload-img-preview">
|
||||||
<q-img
|
<q-img
|
||||||
v-if="urlProfile"
|
v-if="urlProfile"
|
||||||
|
|
@ -493,29 +479,44 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #midTop>
|
<template #information>
|
||||||
<FormName
|
<FormInformation
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
separator
|
||||||
|
:addressSeparator="formData.userType"
|
||||||
|
v-model:hqId="hqId"
|
||||||
|
v-model:brId="brId"
|
||||||
|
v-model:userType="formData.userType"
|
||||||
|
v-model:userRole="formData.userRole"
|
||||||
|
v-model:userName="username"
|
||||||
|
v-model:userCode="code"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #person>
|
||||||
|
<FormPerson
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
separator
|
||||||
v-model:firstName="formData.firstName"
|
v-model:firstName="formData.firstName"
|
||||||
v-model:lastName="formData.lastName"
|
v-model:lastName="formData.lastName"
|
||||||
v-model:firstNameEN="formData.firstNameEN"
|
v-model:firstNameEN="formData.firstNameEN"
|
||||||
v-model:lastNameEN="formData.lastNameEN"
|
v-model:lastNameEN="formData.lastNameEN"
|
||||||
|
v-model:telephoneNo="formData.telephoneNo"
|
||||||
|
v-model:email="formData.email"
|
||||||
|
v-model:gender="formData.gender"
|
||||||
|
v-model:birthDate="formData.birthDate"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #by-type>
|
||||||
<template #midBottom v-if="formData.userType">
|
|
||||||
<FormByType
|
<FormByType
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
separator
|
||||||
v-model:userType="formData.userType"
|
v-model:userType="formData.userType"
|
||||||
v-model:telephoneNo="formData.telephoneNo"
|
|
||||||
v-model:gender="formData.gender"
|
|
||||||
v-model:email="formData.email"
|
|
||||||
v-model:registrationNo="formData.registrationNo"
|
v-model:registrationNo="formData.registrationNo"
|
||||||
v-model:startDate="formData.startDate"
|
v-model:startDate="formData.startDate"
|
||||||
v-model:retireDate="formData.retireDate"
|
v-model:retireDate="formData.retireDate"
|
||||||
v-model:birthDate="formData.birthDate"
|
|
||||||
v-model:responsibleArea="formData.responsibleArea"
|
v-model:responsibleArea="formData.responsibleArea"
|
||||||
v-model:discountCondition="formData.discountCondition"
|
v-model:discountCondition="formData.discountCondition"
|
||||||
v-model:sourceNationality="formData.sourceNationality"
|
v-model:sourceNationality="formData.sourceNationality"
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ import { dialog } from 'src/stores/utils';
|
||||||
|
|
||||||
import PersonCard from 'components/home/PersonCard.vue';
|
import PersonCard from 'components/home/PersonCard.vue';
|
||||||
import AppBox from 'components/app/AppBox.vue';
|
import AppBox from 'components/app/AppBox.vue';
|
||||||
import FormTop from 'src/components/02_personnel-management/FormTop.vue';
|
import FormTop from 'src/components/02_personnel-management/FormInfomation.vue';
|
||||||
import FormName from 'src/components/02_personnel-management/FormName.vue';
|
import FormName from 'src/components/02_personnel-management/FormPerson.vue';
|
||||||
import FormByType from 'src/components/02_personnel-management/FormByType.vue';
|
import FormByType from 'src/components/02_personnel-management/FormByType.vue';
|
||||||
import useAddressStore, {
|
import useAddressStore, {
|
||||||
District,
|
District,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue