feat: filter สถานะ

This commit is contained in:
Net 2024-06-14 13:03:20 +07:00
parent 728bcf94d8
commit d049782e36
2 changed files with 39 additions and 8 deletions

View file

@ -249,6 +249,8 @@ const currentCustomerName = ref<string>('');
const currentCustomerUrlImage = ref<string | null>(null);
const genderselector = ref<string>('');
const currentStatus = ref<Status | 'All'>('All');
const inputFile = (() => {
const element = document.createElement('input');
element.type = 'file';
@ -680,6 +682,12 @@ async function fetchListCustomer() {
includeBranch: true,
page: currentPageCustomer.value,
pageSize: pageSizeCustomer.value,
status:
currentStatus.value === 'All'
? undefined
: currentStatus.value === 'ACTIVE'
? 'ACTIVE'
: 'INACTIVE',
});
if (resultList) {
@ -1133,6 +1141,12 @@ watch(
watch(genderselector, async (gender) => {
await fetchListEmployee({ gender: gender });
});
watch(currentStatus, async () => {
if (selectorLabel.value === 'EMPLOYER') {
await fetchListCustomer();
}
});
</script>
<template>
@ -1329,21 +1343,21 @@ watch(genderselector, async (gender) => {
<q-item
clickable
class="flex items-center"
@click="console.log('test')"
@click="currentStatus = 'All'"
>
{{ $t('all') }}
</q-item>
<q-item
clickable
class="flex items-center"
@click="console.log('test')"
@click="currentStatus = 'ACTIVE'"
>
{{ $t('statusACTIVE') }}
</q-item>
<q-item
clickable
class="flex items-center"
@click="console.log('test')"
@click="currentStatus = 'INACTIVE'"
>
{{ $t('statusINACTIVE') }}
</q-item>