diff --git a/src/modules/05_leave/components/FormLeave/Form.vue b/src/modules/05_leave/components/FormLeave/Form.vue index 381ffd3..a737632 100644 --- a/src/modules/05_leave/components/FormLeave/Form.vue +++ b/src/modules/05_leave/components/FormLeave/Form.vue @@ -141,7 +141,6 @@ watch( /**Hook */ onMounted(() => { - dataStore.typeLeave = ""; }); diff --git a/src/modules/05_leave/store.ts b/src/modules/05_leave/store.ts index 5047cc2..e56c9cd 100644 --- a/src/modules/05_leave/store.ts +++ b/src/modules/05_leave/store.ts @@ -316,6 +316,7 @@ export const useLeaveStore = defineStore("Leave", () => { const data = res.data.result; dateSendLeave.value = data.dateSendLeave; leaveTypeName.value = data.leaveTypeName; + typeLeave.value = data.leaveTypeName; fullName.value = data.fullName; positionName.value = data.positionName; positionLevelName.value = data.positionLevelName; diff --git a/src/modules/05_leave/views/AddPage.vue b/src/modules/05_leave/views/AddPage.vue index 0d9bfc4..af1a538 100644 --- a/src/modules/05_leave/views/AddPage.vue +++ b/src/modules/05_leave/views/AddPage.vue @@ -106,6 +106,8 @@ function filterOptionFn(val: string, update: Function) { } onMounted(async () => { + dataStore.typeLeave = ""; + if (dataStore.options.length == 0) { await fectOptionType(); } diff --git a/src/modules/05_leave/views/EditPage.vue b/src/modules/05_leave/views/EditPage.vue index 129a61c..e9f90a9 100644 --- a/src/modules/05_leave/views/EditPage.vue +++ b/src/modules/05_leave/views/EditPage.vue @@ -320,6 +320,8 @@ async function fectOptionType() { * เรียกใช้งาน fetchData เพื่อดึงข้อมูล */ onMounted(async () => { + dataStore.typeLeave = ""; + if (dataStore.options.length == 0) { fectOptionType(); }