diff --git a/src/modules/07_insignia/components/2_Manage/listManage.vue b/src/modules/07_insignia/components/2_Manage/listManage.vue index d86a05ecb..ddc28e172 100644 --- a/src/modules/07_insignia/components/2_Manage/listManage.vue +++ b/src/modules/07_insignia/components/2_Manage/listManage.vue @@ -57,7 +57,11 @@ const fecthlistRound = async () => { if (optionRound.value.length !== 0) { DataStore.optionRound = optionRound.value; const lastValue = optionRound.value[0]; - round.value = lastValue.id.toString(); + if (DataStore.roundId) { + round.value = DataStore.roundId; + } else { + round.value = lastValue.id.toString(); + } DataStore.roundId = round.value; roundName.value = lastValue.name; await fecthStat(round.value); diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index ebd234f03..29d88e41c 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -85,14 +85,16 @@ export const useInsigniaDataStore = defineStore("insignia", () => { } } else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]; }; - const searchDataTable = async (type: string, employeeClass: string) => { - if (type !== 'all' && employeeClass !== 'all') { - rows.value = listinsignia.value.filter((e: any) => e.insigniaSend === type && e.employeeType === profileType(employeeClass)) - } else if (type !== 'all' && employeeClass === 'all') { + const searchDataTable = async (type: string, employeeClasstype: string) => { + typeinsignia.value = type + employeeClass.value = employeeClasstype + if (type !== 'all' && employeeClasstype !== 'all') { + rows.value = listinsignia.value.filter((e: any) => e.insigniaSend === type && e.employeeType === profileType(employeeClasstype)) + } else if (type !== 'all' && employeeClasstype === 'all') { rows.value = listinsignia.value.filter((e: any) => e.insigniaSend === type) - } else if (type === 'all' && employeeClass !== 'all') { - rows.value = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass)) - } else if (type === 'all' && employeeClass === 'all') { + } else if (type === 'all' && employeeClasstype !== 'all') { + rows.value = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClasstype)) + } else if (type === 'all' && employeeClasstype === 'all') { rows.value = listinsignia.value }