fix: แก้ ปุ่มกด เพิ่ม สาาขา

This commit is contained in:
Net 2024-06-14 16:05:42 +07:00
parent 2a911b84b6
commit d073361a93

View file

@ -229,10 +229,13 @@ function triggerCreate(
clearData(); clearData();
formTypeBranch.value = type; formTypeBranch.value = type;
currentHq.value = {
id: id ?? '', if (type === 'headOffice') {
code: code ?? '', currentHq.value = {
}; id: id ?? '',
code: code ?? '',
};
}
formType.value = 'create'; formType.value = 'create';
openDialog(); openDialog();
@ -477,7 +480,15 @@ watch(locale, () => {
icon="pixelarticons:plus" icon="pixelarticons:plus"
height="26" height="26"
class="color-icon-plus cursor-pointer" class="color-icon-plus cursor-pointer"
@click="triggerCreate('headOffice')" @click="
() => {
if (!currentHq.id) {
triggerCreate('headOffice');
} else {
triggerCreate('subBranch');
}
}
"
/> />
</button> </button>
</div> </div>