feat: add button

This commit is contained in:
Methapon2001 2024-08-09 17:58:35 +07:00
parent d1afb438ea
commit 99fd73e4c5

View file

@ -562,60 +562,43 @@ watch(
</script>
<template>
<ButtonAddComponent style="z-index: 999">
<div v-if="$route.name === 'CustomerManagement'">
<q-fab-action
v-if="currentTab === 'employer'"
id="add-customer-legal-entity"
style="color: white; background-color: hsla(var(--violet-11-hsl))"
@click="createCustomerForm('CORP')"
padding="xs"
icon="mdi-office-building-outline"
:label="$t('add') + ' ' + $t('customerLegalEntity')"
external-label
label-position="left"
/>
<q-fab-action
v-if="currentTab === 'employer'"
id="add-customer-natural-person"
:label="$t('add') + ' ' + $t('customerNaturalPerson')"
external-label
label-position="left"
@click="createCustomerForm('PERS')"
style="color: white; background-color: hsla(var(--teal-10-hsl))"
padding="xs"
icon="mdi-account-plus-outline"
/>
<q-fab-action
v-if="currentTab === 'employee'"
:label="$t('add') + ' ' + $t('EMPLOYEE')"
external-label
id="add-employee"
label-position="left"
@click="createEmployeeForm()"
color="primary"
padding="xs"
icon="mdi-account-plus-outline"
/>
</div>
<div v-else>
<q-fab-action
id="add-branch"
:style="{
color: 'white',
'background-color':
currentCustomer?.customerType === 'CORP'
? 'hsla(var(--violet-11-hsl))'
: 'hsla(var(--pink-6-hsl))',
}"
@click="console.log('add-branch')"
padding="xs"
icon="mdi-office-building-outline"
:label="$t('formDialogTitleCreateSubBranch')"
external-label
label-position="left"
/>
</div>
<ButtonAddComponent
style="z-index: 999"
v-if="$route.name === 'CustomerManagement'"
>
<q-fab-action
v-if="currentTab === 'employer'"
id="add-customer-legal-entity"
style="color: white; background-color: hsla(var(--violet-11-hsl))"
@click="createCustomerForm('CORP')"
padding="xs"
icon="mdi-office-building-outline"
:label="$t('add') + ' ' + $t('customerLegalEntity')"
external-label
label-position="left"
/>
<q-fab-action
v-if="currentTab === 'employer'"
id="add-customer-natural-person"
:label="$t('add') + ' ' + $t('customerNaturalPerson')"
external-label
label-position="left"
@click="createCustomerForm('PERS')"
style="color: white; background-color: hsla(var(--teal-10-hsl))"
padding="xs"
icon="mdi-account-plus-outline"
/>
<q-fab-action
v-if="currentTab === 'employee'"
:label="$t('add') + ' ' + $t('EMPLOYEE')"
external-label
id="add-employee"
label-position="left"
@click="createEmployeeForm()"
color="primary"
padding="xs"
icon="mdi-account-plus-outline"
/>
</ButtonAddComponent>
<div class="column full-height no-wrap">