แก้ฟิลเตอร์
This commit is contained in:
parent
8a609fa120
commit
6ea0bc8fb6
9 changed files with 134 additions and 54 deletions
|
|
@ -20,7 +20,7 @@ import type { ResSalaryOrg } from "@/modules/13_salary/interface/response/Salary
|
|||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const store = useSalaryListSDataStore();
|
||||
const { messageError, showLoader, hideLoader } = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader,onSearchDataTable } = useCounterMixin();
|
||||
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
|
|
@ -146,6 +146,7 @@ const itemsCard = computed(() => {
|
|||
|
||||
/** ข้อมูล Table*/
|
||||
const rows = ref<ResSalaryOrg[]>([]);
|
||||
const rowsData = ref<ResSalaryOrg[]>([]);
|
||||
const filter = ref<string>("");
|
||||
const columnsAPR = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -450,6 +451,7 @@ async function fetchDataDashboard() {
|
|||
console.log(res.data.result.salaryOrg);
|
||||
|
||||
rows.value = res.data.result.salaryOrg;
|
||||
rowsData.value = res.data.result.salaryOrg;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -459,6 +461,14 @@ async function fetchDataDashboard() {
|
|||
});
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
filter.value,
|
||||
rowsData.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
/** HookLifecycle*/
|
||||
onMounted(() => {
|
||||
fetchDataDashboard();
|
||||
|
|
@ -535,6 +545,7 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
outlined
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -567,7 +578,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
const $q = useQuasar();
|
||||
const store = useSalaryEmployeeListSDataStore();
|
||||
const { messageError, showLoader, hideLoader } = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader, onSearchDataTable } =
|
||||
useCounterMixin();
|
||||
|
||||
const props = defineProps({
|
||||
year: Number,
|
||||
|
|
@ -131,6 +132,7 @@ const itemsCard = computed(() => {
|
|||
});
|
||||
|
||||
const rows = ref<any[]>([]);
|
||||
const rowsData = ref<any[]>([]);
|
||||
const columnsAPR = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "org",
|
||||
|
|
@ -410,6 +412,7 @@ function fetchDataDashboard() {
|
|||
itemsCardSpeciel.value[2].total = quota.totalBackup;
|
||||
|
||||
rows.value = res.data.result.salaryOrg;
|
||||
rowsData.value = res.data.result.salaryOrg;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -418,6 +421,15 @@ function fetchDataDashboard() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
filter.value,
|
||||
rowsData.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataDashboard();
|
||||
});
|
||||
|
|
@ -479,6 +491,7 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
outlined
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -495,7 +508,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import type { DataDiscipline } from "@/modules/13_salary/interface/response/Main
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError,onSearchDataTable } = useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -30,6 +30,7 @@ const employeeClass = defineModel<string>("employeeClass", { required: true });
|
|||
*/
|
||||
const keyword = ref<string>("");
|
||||
const rows = ref<DataDiscipline[]>([]);
|
||||
const rowsData = ref<DataDiscipline[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
|
|
@ -106,6 +107,7 @@ function fetchListDiscipline() {
|
|||
.get(config.API.disciplineListCard(profileId.value, employeeClass.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsData.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -115,6 +117,14 @@ function fetchListDiscipline() {
|
|||
});
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
rowsData.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchListDiscipline();
|
||||
});
|
||||
|
|
@ -124,15 +134,16 @@ onMounted(() => {
|
|||
<q-card-section class="q-pt-none">
|
||||
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
||||
<q-space />
|
||||
<q-input dense outlined v-model="keyword" label="ค้นหา" class="q-mr-sm">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="keyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-else
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="keyword = ''"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -147,7 +158,6 @@ onMounted(() => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -158,7 +168,6 @@ onMounted(() => {
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="keyword"
|
||||
:paging="true"
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import type { DataLeave } from "@/modules/13_salary/interface/response/Main";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, onSearchDataTable } =
|
||||
useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -30,6 +31,7 @@ const employeeClass = defineModel<string>("employeeClass", { required: true });
|
|||
*/
|
||||
const keyword = ref<string>("");
|
||||
const rows = ref<DataLeave[]>([]);
|
||||
const rowsData = ref<DataLeave[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -108,6 +110,7 @@ function fetchListSalary() {
|
|||
.get(config.API.leaveListCard(profileId.value, employeeClass.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsData.value = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -145,6 +148,14 @@ function convertStatus(val: string) {
|
|||
}
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
rowsData.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchListSalary();
|
||||
});
|
||||
|
|
@ -154,15 +165,9 @@ onMounted(() => {
|
|||
<q-card-section class="q-pt-none">
|
||||
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
||||
<q-space />
|
||||
<q-input dense outlined v-model="keyword" label="ค้นหา" class="q-mr-sm">
|
||||
<q-input dense outlined v-model="keyword" label="ค้นหา" class="q-mr-sm" @keydown.enter="onSearch">
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="keyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-else
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="keyword = ''"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -177,7 +182,6 @@ onMounted(() => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -188,7 +192,6 @@ onMounted(() => {
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="keyword"
|
||||
:paging="true"
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import type { DataPosSalary } from "@/modules/13_salary/interface/response/Main"
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, onSearchDataTable } =
|
||||
useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -30,6 +31,7 @@ const employeeClass = defineModel<string>("employeeClass", { required: true });
|
|||
*/
|
||||
const keyword = ref<string>("");
|
||||
const rows = ref<DataPosSalary[]>([]);
|
||||
const rowsData = ref<DataPosSalary[]>([]);
|
||||
const baseColumns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
|
|
@ -154,6 +156,7 @@ function fetchListSalary() {
|
|||
.get(config.API.salaryListCard(profileId.value, employeeClass.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsData.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -163,6 +166,14 @@ function fetchListSalary() {
|
|||
});
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
rowsData.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchListSalary();
|
||||
});
|
||||
|
|
@ -172,15 +183,16 @@ onMounted(() => {
|
|||
<q-card-section class="q-pt-none">
|
||||
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
||||
<q-space />
|
||||
<q-input dense outlined v-model="keyword" label="ค้นหา" class="q-mr-sm">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="keyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-else
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="keyword = ''"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -195,7 +207,6 @@ onMounted(() => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -206,7 +217,6 @@ onMounted(() => {
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="keyword"
|
||||
:paging="true"
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue