jws-frontend/src/components/03_customer-management/BasicInformation.vue

139 lines
3.2 KiB
Vue
Raw Normal View History

2024-04-22 17:00:30 +07:00
<script setup lang="ts">
2024-06-11 04:58:59 +00:00
import { ref } from 'vue';
const customerName = defineModel<string>('customerName');
const customerNameEn = defineModel<string>('customerNameEn');
const taxNo = defineModel<string | null | undefined>('taxNo');
const employerID = defineModel<string>('employerID');
2024-04-22 17:00:30 +07:00
// employee
const customerBranchId = defineModel<string>('customerBranchId');
const employeeID = defineModel<string>('employeeID');
const nrcNo = defineModel<string>('nrcNo');
2024-06-11 04:58:59 +00:00
const branchOption = ref([
{
label: 'uuu',
value: 'ad87961c-c44f-47ca-8c1e-0ef30c2b16ba',
},
]);
2024-04-22 17:00:30 +07:00
defineProps<{
dense?: boolean;
outlined?: boolean;
readonly?: boolean;
separator?: boolean;
typeCustomer?: string;
employee?: boolean;
2024-04-22 17:00:30 +07:00
}>();
</script>
<template>
<div class="col-3 app-text-muted">
{{ $t(`formDialogTitleInformation`) }}
</div>
<div v-if="!employee" class="col-9 row q-col-gutter-md">
<q-input
2024-06-11 11:23:23 +07:00
v-if="typeCustomer === 'PERS'"
:dense="dense"
:outlined="!readonly"
:readonly="true"
:borderless="readonly"
hide-bottom-space
class="col-6"
:label="$t('formDialogEmployerID')"
v-model="employerID"
/>
<q-input
2024-06-11 11:23:23 +07:00
v-if="typeCustomer === 'PERS'"
:dense="dense"
:outlined="!readonly"
:readonly="readonly"
:borderless="readonly"
hide-bottom-space
class="col-6"
:label="$t('taxNo')"
v-model="taxNo"
/>
2024-04-22 17:00:30 +07:00
<q-input
:dense="dense"
:outlined="!readonly"
:readonly="readonly"
:borderless="readonly"
hide-bottom-space
class="col-6"
:label="$t('corporationThaiName')"
v-model="customerName"
2024-04-22 17:00:30 +07:00
/>
<q-input
:dense="dense"
:outlined="!readonly"
:readonly="readonly"
:borderless="readonly"
hide-bottom-space
class="col-6"
:label="$t('corporationEnglishName')"
v-model="customerNameEn"
2024-04-22 17:00:30 +07:00
/>
</div>
<div v-if="employee" class="col-9 row q-col-gutter-md">
<q-select
2024-06-11 04:58:59 +00:00
id="select-employer-branch"
:dense="dense"
:outlined="!readonly"
:readonly="readonly"
:borderless="readonly"
hide-bottom-space
class="col-3"
2024-06-11 04:58:59 +00:00
:label="$t('formDialogEmployerBranchCode')"
v-model="customerBranchId"
2024-06-11 04:58:59 +00:00
option-label="label"
option-value="value"
emit-value
map-options
:options="branchOption"
:rules="[
(val: string) =>
!!val || $t('selectValidate') + $t('formDialogEmployerBranchCode'),
]"
/>
<q-input
2024-06-11 04:58:59 +00:00
for="input-employeeID"
:dense="dense"
:outlined="!readonly"
:readonly="true"
:borderless="readonly"
hide-bottom-space
class="col-3"
:label="$t('formDialogEmployeeID')"
v-model="employeeID"
/>
<q-input
2024-06-11 04:58:59 +00:00
for="input-nrcNo"
:dense="dense"
:outlined="!readonly"
:readonly="readonly"
:borderless="readonly"
hide-bottom-space
class="col-6"
:label="$t('formDialogEmployeeNRCNo')"
v-model="nrcNo"
2024-06-11 04:58:59 +00:00
:rules="[
(val: string) =>
!!val || $t('inputValidate') + $t('formDialogEmployeeNRCNo'),
]"
/>
</div>
2024-04-22 17:00:30 +07:00
<q-separator
v-if="separator"
class="col-12 q-mt-xl q-mb-md"
style="padding-block: 0.5px"
/>
</template>
<style scoped></style>