2024-11-08 13:11:42 +07:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import SelectInput from '../shared/SelectInput.vue';
|
|
|
|
|
import useOptionStore from 'src/stores/options';
|
|
|
|
|
|
|
|
|
|
const optionStore = useOptionStore();
|
|
|
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
|
dense?: boolean;
|
|
|
|
|
outlined?: boolean;
|
|
|
|
|
readonly?: boolean;
|
|
|
|
|
onDrawer?: boolean;
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const group = defineModel('group', { default: '' });
|
|
|
|
|
const name = defineModel('name', { default: '' });
|
|
|
|
|
const nameEn = defineModel('nameEn', { default: '' });
|
2024-11-26 17:02:31 +07:00
|
|
|
|
|
|
|
|
type Options = { label: string; value: string };
|
2024-11-08 13:11:42 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="row col-12">
|
|
|
|
|
<div class="col-12 q-pb-sm row items-center">
|
|
|
|
|
<q-icon
|
|
|
|
|
flat
|
|
|
|
|
size="xs"
|
|
|
|
|
class="q-pa-sm rounded q-mr-sm"
|
|
|
|
|
color="info"
|
|
|
|
|
name="mdi-office-building-outline"
|
|
|
|
|
style="background-color: var(--surface-3)"
|
|
|
|
|
/>
|
|
|
|
|
<span class="text-body1 text-weight-bold">
|
|
|
|
|
{{ $t(`form.field.basicInformation`) }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12 row q-col-gutter-sm">
|
|
|
|
|
<SelectInput
|
2025-01-27 10:39:53 +07:00
|
|
|
:class="{ col: $q.screen.lt.md }"
|
2024-11-08 13:11:42 +07:00
|
|
|
:disable="!readonly && onDrawer"
|
|
|
|
|
:readonly="readonly"
|
|
|
|
|
for="input-agencies-code"
|
|
|
|
|
:label="$t('agencies.group')"
|
|
|
|
|
option-label="value"
|
2024-11-26 17:02:31 +07:00
|
|
|
:option="
|
|
|
|
|
optionStore.globalOption?.agenciesType.sort(
|
|
|
|
|
(lhs: Options, rhs: Options) => lhs.value.localeCompare(rhs.value),
|
|
|
|
|
)
|
|
|
|
|
"
|
2025-02-10 09:43:46 +07:00
|
|
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
2024-11-08 13:11:42 +07:00
|
|
|
v-model="group"
|
2024-11-25 15:20:21 +07:00
|
|
|
>
|
2024-11-25 15:30:46 +07:00
|
|
|
<template v-slot:option="{ scope, opt }">
|
|
|
|
|
<q-item v-bind="scope.itemProps" clickable>
|
2024-11-25 15:20:21 +07:00
|
|
|
{{ opt.value }} ({{ opt.label }})
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</SelectInput>
|
|
|
|
|
|
2024-11-08 13:11:42 +07:00
|
|
|
<q-input
|
|
|
|
|
for="input-agencies-name"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="readonly"
|
|
|
|
|
hide-bottom-space
|
2025-01-27 10:39:53 +07:00
|
|
|
class="col-md col-12"
|
2024-11-08 13:11:42 +07:00
|
|
|
:label="$t('agencies.name')"
|
|
|
|
|
v-model="name"
|
|
|
|
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
|
|
|
|
/>
|
|
|
|
|
<q-input
|
|
|
|
|
for="input-agencies-name-en"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="readonly"
|
|
|
|
|
hide-bottom-space
|
2025-01-27 10:39:53 +07:00
|
|
|
class="col-md col-12"
|
2024-11-08 13:11:42 +07:00
|
|
|
:label="'Agencies Name'"
|
|
|
|
|
v-model="nameEn"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<style scoped></style>
|