refactor: เพิ่ม พื้นฐานให้กับ สาขาที่ลงทะเบียน

This commit is contained in:
Net 2024-07-10 11:02:26 +07:00
parent 99e26e4ad2
commit fc0abea637
3 changed files with 33 additions and 5 deletions

View file

@ -23,7 +23,7 @@ const customerBranch = defineModel<{
const employeeId = defineModel<string>('employeeId'); const employeeId = defineModel<string>('employeeId');
const nrcNo = defineModel<string>('nrcNo'); const nrcNo = defineModel<string>('nrcNo');
defineProps<{ const props = defineProps<{
dense?: boolean; dense?: boolean;
outlined?: boolean; outlined?: boolean;
readonly?: boolean; readonly?: boolean;
@ -39,14 +39,24 @@ defineEmits<{
(e: 'filterOwnerBranch', val: string, update: void): void; (e: 'filterOwnerBranch', val: string, update: void): void;
}>(); }>();
onMounted(async () => {}); onMounted(async () => {
if(!!props.optionsBranch) {
registeredBranchId.value = props.optionsBranch[0].id ;
}
});
</script> </script>
<template> <template>
<div class="col-3 app-text-muted"> <div class="col-3 app-text-muted">
{{ $t(`formDialogTitleInformation`) }} {{ $t(`formDialogTitleInformation`) }}
</div> </div>
<div v-if="!employee" class="col-9 row q-col-gutter-md"> <div v-if="!employee" class="col-9 row q-col-gutter-md">
<q-select <q-select
id="input-source-nationality" id="input-source-nationality"
:dense="dense" :dense="dense"

View file

@ -10,9 +10,9 @@ const name = defineModel<string>('name');
const code = defineModel<string>('code'); const code = defineModel<string>('code');
const registeredBranchId = defineModel<string>('registeredBranchId'); const registeredBranchId = defineModel<string>('registeredBranchId');
const codeOption = ref([]); const codeOption = ref<{ id: string; name: string }[]>([]);
defineProps<{ const props = defineProps<{
dense?: boolean; dense?: boolean;
outlined?: boolean; outlined?: boolean;
readonly?: boolean; readonly?: boolean;
@ -31,6 +31,15 @@ onMounted(async () => {
if (locale.value === 'th-th') { if (locale.value === 'th-th') {
codeOption.value = option.tha.typeProduct; codeOption.value = option.tha.typeProduct;
} }
if(!!props.optionsBranch) {
registeredBranchId.value = props.optionsBranch[0].id ;
}
}); });
</script> </script>

View file

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import useOptionStore from 'src/stores/options'; import useOptionStore from 'src/stores/options';
import { onMounted } from 'vue';
const optionStore = useOptionStore(); const optionStore = useOptionStore();
@ -13,7 +14,7 @@ const serviceName = defineModel<string>('serviceNameTh');
const serviceDescription = defineModel<string>('serviceDescription'); const serviceDescription = defineModel<string>('serviceDescription');
const registeredBranchId = defineModel<string | null>('registeredBranchId'); const registeredBranchId = defineModel<string | null>('registeredBranchId');
defineProps<{ const props = defineProps<{
dense?: boolean; dense?: boolean;
outlined?: boolean; outlined?: boolean;
readonly?: boolean; readonly?: boolean;
@ -22,6 +23,14 @@ defineProps<{
service?: boolean; service?: boolean;
optionsBranch?: { id: string; name: string }[]; optionsBranch?: { id: string; name: string }[];
}>(); }>();
onMounted(async () => {
if(!!props.optionsBranch) {
registeredBranchId.value = props.optionsBranch[0].id ;
}
});
</script> </script>
<template> <template>