refactor: add props showBtnSave

This commit is contained in:
Net 2024-08-01 11:57:20 +07:00
parent feb7fa2575
commit c2e869a74c
2 changed files with 21 additions and 11 deletions

View file

@ -31,16 +31,22 @@ const customerBranch = defineModel<{
const employeeId = defineModel<string>('employeeId'); const employeeId = defineModel<string>('employeeId');
const nrcNo = defineModel<string>('nrcNo'); const nrcNo = defineModel<string>('nrcNo');
const props = defineProps<{ const props = withDefaults(
dense?: boolean; defineProps<{
outlined?: boolean; dense?: boolean;
readonly?: boolean; outlined?: boolean;
separator?: boolean; readonly?: boolean;
typeCustomer?: string; separator?: boolean;
employee?: boolean; typeCustomer?: string;
employeeOwnerOption?: CustomerBranch[]; employee?: boolean;
prefixId: string; employeeOwnerOption?: CustomerBranch[];
}>(); prefixId: string;
showBtnSave: boolean;
}>(),
{
showBtnSave: false,
},
);
defineEmits<{ defineEmits<{
(e: 'filterOwnerBranch', val: string, update: void): void; (e: 'filterOwnerBranch', val: string, update: void): void;
@ -440,7 +446,7 @@ onMounted(() => {
</div> </div>
<div class="col-12 row justify-end" style="min-height: 50px"> <div class="col-12 row justify-end" style="min-height: 50px">
<q-btn <q-btn
v-if="!readonly" v-if="!readonly && showBtnSave"
dense dense
unelevated unelevated
id="save-basic-info" id="save-basic-info"

View file

@ -608,6 +608,7 @@ const employeeHistoryDialog = ref(false);
const employeeHistory = ref<EmployeeHistory[]>(); const employeeHistory = ref<EmployeeHistory[]>();
async function triggerCreate(type: CustomerType) { async function triggerCreate(type: CustomerType) {
countStartsOne.value = 1;
customerType.value = type; customerType.value = type;
await fetchListOfOptionBranch(); await fetchListOfOptionBranch();
openDialogInputForm(); openDialogInputForm();
@ -3159,6 +3160,7 @@ watch(isMainPage, () => {
v-model:customer-name-en="formData.customerNameEN" v-model:customer-name-en="formData.customerNameEN"
v-model:person-name="formData.personName" v-model:person-name="formData.personName"
v-model:tax-no="formData.taxNo" v-model:tax-no="formData.taxNo"
:show-btn-save="true"
@save=" @save="
async () => { async () => {
await onSubmitBasicInformation(); await onSubmitBasicInformation();
@ -3309,6 +3311,7 @@ watch(isMainPage, () => {
<FormDialog <FormDialog
employee employee
disabledRule disabledRule
:hiddenBtnSave="false"
addressSeparator addressSeparator
v-model:modal="dialogEmployee" v-model:modal="dialogEmployee"
:noAddress="formDataEmployeeTab !== 'personalInfo'" :noAddress="formDataEmployeeTab !== 'personalInfo'"
@ -3661,6 +3664,7 @@ watch(isMainPage, () => {
dense dense
outlined outlined
separator separator
:show-btn-save="true"
:readonly="!infoDrawerEdit" :readonly="!infoDrawerEdit"
:type-customer="customerType" :type-customer="customerType"
v-model:options-branch="branchOption" v-model:options-branch="branchOption"