From 262dd67b42e9a95e72dfc21365e3b8422ed71dab Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 11 Nov 2024 10:05:02 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/resignEMP/ResignByid.vue | 2 +- .../components/resignEMP/ResignReject.vue | 2 +- .../components/resignEMP/Table.vue | 22 +++++++++---------- src/modules/06_retirement/store/resignMain.ts | 9 +++++++- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/modules/06_retirement/components/resignEMP/ResignByid.vue b/src/modules/06_retirement/components/resignEMP/ResignByid.vue index c5668d966..c057295b9 100644 --- a/src/modules/06_retirement/components/resignEMP/ResignByid.vue +++ b/src/modules/06_retirement/components/resignEMP/ResignByid.vue @@ -26,7 +26,7 @@ import WorkFlow from "@/components/Workflow/Main.vue"; const $q = useQuasar(); const route = useRoute(); const router = useRouter(); -const checkRoutePermisson = ref(route.name == "resignDetailbyid"); +const checkRoutePermisson = ref(route.name == "resignDetailbyidEMP"); const mixin = useCounterMixin(); const { messageError, diff --git a/src/modules/06_retirement/components/resignEMP/ResignReject.vue b/src/modules/06_retirement/components/resignEMP/ResignReject.vue index de0ab338f..7fdd04bae 100644 --- a/src/modules/06_retirement/components/resignEMP/ResignReject.vue +++ b/src/modules/06_retirement/components/resignEMP/ResignReject.vue @@ -26,7 +26,7 @@ import WorkFlow from "@/components/Workflow/Main.vue"; const $q = useQuasar(); const route = useRoute(); const router = useRouter(); -const checkRoutePermisson = ref(route.name == "resignDetailReject"); +const checkRoutePermisson = ref(route.name == "resignDetailRejectEMP"); const mixin = useCounterMixin(); const { messageError, diff --git a/src/modules/06_retirement/components/resignEMP/Table.vue b/src/modules/06_retirement/components/resignEMP/Table.vue index c2d56f311..4674c8959 100644 --- a/src/modules/06_retirement/components/resignEMP/Table.vue +++ b/src/modules/06_retirement/components/resignEMP/Table.vue @@ -130,7 +130,7 @@ const modal = ref(false); const filterKeyword2 = ref(""); const filterKeyword = ref(""); -const status = ref(""); +const statusEMP = ref(""); const optionStatus = ref([]); /**Setting pagination */ @@ -150,9 +150,9 @@ function closeModal() { /** */ async function openModalOrder() { const pathAPI = - stroeResign.mainTabs === "1" - ? `${config.API.listResign()}?type=APPROVE` - : `${config.API.listResign()}/cancel?type=APPROVE`; + stroeResign.mainTabsEMP === "1" + ? `${config.API.listResignEMP()}?type=APPROVE` + : `${config.API.listResignEMP()}/cancel?type=APPROVE`; showLoader(); await http .get(pathAPI) @@ -183,8 +183,8 @@ async function openModalOrder() { async function fecthlist() { const pathAPI = stroeResign.mainTabsEMP === "1" - ? `${config.API.listResignEMP()}?type=${status.value}` - : `${config.API.listResignEMP()}/cancel?type=${status.value}`; + ? `${config.API.listResignEMP()}?type=${statusEMP.value}` + : `${config.API.listResignEMP()}/cancel?type=${statusEMP.value}`; showLoader(); await http .get(pathAPI) @@ -207,8 +207,8 @@ async function fecthlist() { */ function filterOption(val: string, update: Function) { update(() => { - status.value = val ? "" : stroeResign.formQurey.status; - optionStatus.value = stroeResign.optionStatus.filter( + statusEMP.value = val ? "" : stroeResign.formQureyEMP.status; + optionStatus.value = stroeResign.optionStatusEMP.filter( (v: any) => v.name.indexOf(val) > -1 ); }); @@ -221,7 +221,7 @@ function onRedirectToDetail(type: string, id: string) { /**Hook */ onMounted(async () => { - status.value = stroeResign.formQurey.status; + statusEMP.value = stroeResign.formQureyEMP.status; optionStatus.value = stroeResign.optionStatusEMP; await fecthlist(); }); @@ -233,7 +233,7 @@ onMounted(async () => {
{ outlined use-input @update:model-value=" - (stroeResign.formQurey.status = status), fecthlist() + (stroeResign.formQureyEMP.status = statusEMP), fecthlist() " @filter="(inputValue:string,doneFn:Function) => filterOption(inputValue, doneFn) " > diff --git a/src/modules/06_retirement/store/resignMain.ts b/src/modules/06_retirement/store/resignMain.ts index 6d2dd3d44..fcb606866 100644 --- a/src/modules/06_retirement/store/resignMain.ts +++ b/src/modules/06_retirement/store/resignMain.ts @@ -58,6 +58,13 @@ export const useDataStore = defineStore("resign", () => { page: 1, rowsPerPage: 10, }); + + const formQureyEMP = reactive({ + status: "WAITTING", + page: 1, + rowsPerPage: 10, + }); + const optionStatus = computed(() => { return baseOptionStatus.value.filter( (option) => option.group === mainTabs.value @@ -76,5 +83,5 @@ export const useDataStore = defineStore("resign", () => { formQurey.status = "WAITTING"; }); - return { mainTabs, mainTabsEMP, formQurey, optionStatus, optionStatusEMP }; + return { mainTabs, mainTabsEMP, formQurey,formQureyEMP, optionStatus, optionStatusEMP }; });