ฟิลเตอร์ระบบ บรรจุ

This commit is contained in:
setthawutttty 2024-12-04 13:47:44 +07:00
parent 7ab17d378f
commit 992541eded
20 changed files with 674 additions and 488 deletions

View file

@ -17,7 +17,7 @@ import config from "@/app.config";
const DataStore = usePlacementDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai,onSearchDataTable } = mixin;
const searchYear = ref();
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
@ -26,6 +26,7 @@ const yearOptionsFn = ref<any>([]);
/**ข้อมูลตาราง (จำลอง)*/
const rows = ref<QTableProps["rows"]>([]);
const rowsData = ref<any[]>([]);
/** ค้นหาในตาราง */
const filterKeyword = ref<string>("");
@ -164,7 +165,8 @@ async function fetchPlacementData(val: number) {
const data = await res.data.result;
dataPlacement.value = data;
DataStore.DataMainOrig = dataPlacement.value;
rows.value = DataStore.DataMainOrig.map((e: any) => ({
const listData =
DataStore.DataMainOrig.map((e: any) => ({
id: e.id,
examRound: e.examRound,
examOrder: e.examOrder,
@ -176,6 +178,8 @@ async function fetchPlacementData(val: number) {
fiscalYear: e.fiscalYear,
numberOfCandidates: e.numberOfCandidates,
}));
rows.value = listData
rowsData.value = listData
filterKeyword.value = "";
examTime.value = "ทั้งหมด";
examType.value = "ทั้งหมด";
@ -374,6 +378,14 @@ function paginationLabel(start: number, end: number, total: number) {
else return start + "-" + end + " ใน " + total;
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* เรยกใชงช เมอเรมหนาน
*/
@ -428,6 +440,7 @@ onMounted(async () => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -540,7 +553,6 @@ onMounted(async () => {
ref="table"
:rows="rows"
:columns="columns"
:filter="filterKeyword"
row-key="id"
flat
bordered

View file

@ -27,6 +27,7 @@ const dataTransfer = ref<ResponseData[]>([]); //ช่อมูลรายก
const rows = ref<ResponseData[]>([]); //
const filterMain = ref<string>(""); //
const rowsOrder = ref<ResponseData[]>([]); //
const rowsOrderData = ref<ResponseData[]>([]); //
const filterOrder = ref<string>(""); //
const columns = ref<QTableProps["columns"]>([
{
@ -154,6 +155,7 @@ function openModalOrder() {
r.date
);
rowsOrder.value = row;
rowsOrderData.value = row;
modal.value = true;
}
@ -328,7 +330,8 @@ const filterAndApply = () => {
v-model:filter-order="filterOrder"
:fetch-data="fetchData"
:close-modal="closeModal"
:rows="rowsOrder"
v-model:rows="rowsOrder"
v-model:rowsData="rowsOrderData"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -31,6 +31,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = mixin;
const dataRecevice = ref<ResponseData[]>([]); //
@ -52,7 +53,9 @@ const type = ref<string | null>(null);
//Table
const rows = ref<ResponseRow[]>([]); //
const rowsData = ref<ResponseRow[]>([]); //
const rows2 = ref<ResponseRow[]>([]); //
const rows2Data = ref<ResponseRow[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -157,6 +160,7 @@ async function fecthlistRecevice() {
const data = await res.data.result;
dataRecevice.value = data;
rows.value = data;
rowsData.value = data;
filters.value = data;
})
.catch((e) => {
@ -227,7 +231,6 @@ function openModalTree(id: string, data: any) {
dataRows.value = data;
modalTree.value = true;
type.value = null;
dataRows.value = data;
posType.value = data.posTypeOldId;
posLevel.value = data.posLevelOldId;
position.value = data.positionOld;
@ -292,6 +295,7 @@ function openModalOrder() {
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -328,6 +332,15 @@ async function onSave(data: any) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -372,6 +385,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -403,7 +417,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -610,7 +623,8 @@ onMounted(() => {
v-model:modal="modal"
v-model:filter-keyword2="filterKeyword2"
:click-close="clickClose"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
:fecthlist-recevice="fecthlistRecevice"
:next-page="nextPage"
/>

View file

@ -34,6 +34,7 @@ const {
dialogRemove,
findOrgNameOld,
findPosMasterNoOld,
onSearchDataTable
} = mixin;
/**
@ -44,7 +45,9 @@ const modal = ref<boolean>(false); //แสดง popup ส่งไปออก
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const rows = ref<officerType[]>([]); //
const rowsData = ref<officerType[]>([]); //
const rows2 = ref<officerType[]>([]); //
const rows2Data = ref<officerType[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -192,6 +195,7 @@ async function getData() {
.then(async (res) => {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -246,6 +250,7 @@ function openModalOrder() {
item.dateEnd
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -265,6 +270,14 @@ function resetFilter() {
filterKeyword2.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -300,6 +313,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -326,7 +340,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -406,7 +419,8 @@ onMounted(() => {
v-model:filter-keyword2="filterKeyword2"
:get-data="getData"
:close-modal="closeModal"
:rows2="rows2"
v-model:rows2="rows2"
v-model:rows2Data="rows2Data"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -27,6 +27,7 @@ const {
success,
dialogRemove,
findPosMasterNoOld,
onSearchDataTable
} = useCounterMixin();
const modal = ref<boolean>(false); //
@ -35,7 +36,9 @@ const modal = ref<boolean>(false); // ส่งไปออกคำสั่
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const rows = ref<officerType[]>([]); //
const rowsData = ref<officerType[]>([]); //
const rows2 = ref<officerType[]>([]); //
const rows2Data = ref<officerType[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -157,6 +160,7 @@ async function getData() {
.then(async (res) => {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -206,6 +210,7 @@ function openModalOrder() {
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -225,6 +230,14 @@ function resetFilter() {
filterKeyword2.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -260,6 +273,7 @@ onMounted(async () => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -285,7 +299,6 @@ onMounted(async () => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -362,7 +375,8 @@ onMounted(async () => {
v-model:filter-keyword2="filterKeyword2"
:get-data="getData"
:close-modal="closeModal"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
</template>

View file

@ -30,6 +30,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = useCounterMixin();
const modal = ref<boolean>(false); // popup
@ -48,7 +49,9 @@ const type = ref<string>("");
//table
const rows = ref<PersonData[]>([]); //--
const rowsData = ref<PersonData[]>([]); //--
const rows2 = ref<PersonData[]>([]); //
const rows2Data = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //--
const filterKeyword2 = ref<string>(""); //
const columns = ref<QTableProps["columns"]>([
@ -167,8 +170,10 @@ async function fecthlistappointment() {
let response = res.data.result;
listRecevice.value = response;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData =
rows.value.filter(
(e: any) =>
e.root !== null &&
e.status !== "REPORT" &&
@ -180,6 +185,8 @@ async function fecthlistappointment() {
e.positionNumberOld &&
e.positionDate
);
rows2.value = listData
rows2Data.value = listData
})
.catch((e) => {
messageError($q, e);
@ -277,6 +284,14 @@ function clickClose() {
modal.value = false;
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/** ทำงานเมื่อมีการเรียกใช้ Components*/
onMounted(() => {
fecthlistappointment();
@ -313,6 +328,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -339,7 +355,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -553,7 +568,8 @@ onMounted(() => {
:options-type="optionsType"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
<DialogOrgSelect

View file

@ -29,6 +29,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = mixin;
const personalId = ref<string>("");
@ -47,7 +48,9 @@ const type = ref<string>("");
// Table
const rows = ref<PersonData[]>([]); //
const rowsData = ref<PersonData[]>([]); //
const rows2 = ref<PersonData[]>([]); //
const rows2Data = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -168,9 +171,11 @@ async function fecthlistappointment() {
let response = await res.data.result;
listRecevice.value = response;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData =
rows.value.filter(
(e: any) =>
e.root !== null &&
e.status !== "REPORT" &&
@ -182,6 +187,8 @@ async function fecthlistappointment() {
e.positionNumberOld &&
e.positionDate
);
rows2.value = listData
rows2Data.value = listData
})
.catch((e) => {
messageError($q, e);
@ -288,6 +295,14 @@ function onSave(data: any) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(() => {
fecthlistappointment();
});
@ -323,6 +338,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -349,7 +365,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -534,7 +549,8 @@ onMounted(() => {
:options-type="optionsType"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
<DialogOrgSelectEmployee

View file

@ -28,6 +28,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable,
} = useCounterMixin();
const modal = ref<boolean>(false);
@ -36,7 +37,9 @@ const modal = ref<boolean>(false);
* Table
*/
const rows = ref<listMain[]>([]); //
const rowsData = ref<listMain[]>([]); //
const rows2 = ref<listMain[]>([]); //
const rows2Data = ref<listMain[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -138,8 +141,9 @@ async function fecthlistOthet() {
.then((res) => {
let response = res.data.result;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData = rows.value.filter(
(e: listMain) =>
e.status !== "REPORT" &&
e.status !== "DONE" &&
@ -150,6 +154,8 @@ async function fecthlistOthet() {
e.positionDate &&
e.leaveDate !== null
);
rows2.value = listData;
rows2Data.value = listData;
})
.catch((e) => {
messageError($q, e);
@ -206,6 +212,14 @@ function nextPage(id: string) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(() => {
fecthlistOthet();
});
@ -237,6 +251,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -262,7 +277,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -338,7 +352,8 @@ onMounted(() => {
v-model:Modal="modal"
v-model:filter-keyword2="filterKeyword2"
:click-close="clickClose"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
:fecthlistOthet="fecthlistOthet"
/>
</template>