feat: customer branch dialog UI + function submit + define emit

This commit is contained in:
oat_dev 2024-06-10 12:00:16 +07:00
parent e7c7d10e13
commit aba1d61e01
2 changed files with 166 additions and 6 deletions

View file

@ -10,10 +10,10 @@ const userCustomer = useCustomerStore();
const { fetchListById } = userCustomer;
const inputSearch = ref<string>('');
const branch = ref<CustomerBranch[]>();
const currentCustomerName = ref<string>('');
const currentCustomerUrlImage = ref<string>('');
const branch = defineModel<CustomerBranch[]>('branch');
const currentCustomerName = defineModel<string>('currentCustomerName');
const currentCustomerUrlImage = defineModel<string>('currentCustomerUrlImage');
const prop = withDefaults(
defineProps<{
@ -25,6 +25,12 @@ const prop = withDefaults(
},
);
defineEmits<{
(e: 'back'): void;
(e: 'viewDetail'): void;
(e: 'dialog'): void;
}>();
onMounted(async () => {
const result = await fetchListById(prop.customerId);
if (result) {
@ -84,7 +90,7 @@ onMounted(async () => {
unelevated
:label="'+ ' + $t('formDialogTitleCreateSubBranch')"
padding="4px 16px"
@click="console.log('add')"
@click="$emit('dialog')"
style="background-color: var(--cyan-6); color: white"
/>
<q-separator vertical inset class="q-mx-lg" />