diff --git a/src/pages/02_personnel-management/MainPage.vue b/src/pages/02_personnel-management/MainPage.vue index 893f9366..705db843 100644 --- a/src/pages/02_personnel-management/MainPage.vue +++ b/src/pages/02_personnel-management/MainPage.vue @@ -266,7 +266,30 @@ async function openDialog( agencyFileList.value = result; } } - } else hqId.value = userStore.userOption.hqOpts[0].value; + } if(userStore.userOption.hqOpts.length !== 0) { + + hqId.value = userStore.userOption.hqOpts[0].value; + } + if(userStore.userOption.hqOpts.length === 0) { + console.log('no hq'); + + dialog({ + color: 'warning', + icon: 'mdi-alert', + title: t('warning'), + actionText: t('agree'), + persistent: true, + message: t('headquartersNotEstablished'), + action: async () => { + + }, + }); + + + return + + } + if (action === 'FORM') { modal.value = true; @@ -407,10 +430,10 @@ async function onDelete(id: string) { dialog({ color: 'negative', icon: 'mdi-trash-can-outline', - title: 'ยืนยันการลบข้อมูล', - actionText: 'ตกลง', + title: t('deleteConfirmTitle'), + actionText: t('agree'), persistent: true, - message: 'คุณต้องการลบข้อมูล ใช่หรือไม่', + message: t('deleteConfirmMessage'), action: async () => { await userStore.deleteById(id);