@@ -137,7 +151,8 @@ function remove() {
-
diff --git a/src/modules/03_recruiting/views/01_compete/Period.vue b/src/modules/03_recruiting/views/01_compete/Period.vue
index f09ab5570..1bc6c7ec3 100644
--- a/src/modules/03_recruiting/views/01_compete/Period.vue
+++ b/src/modules/03_recruiting/views/01_compete/Period.vue
@@ -23,7 +23,7 @@ import HistoryTable from "@/components/TableHistory.vue";
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
-const { success, dateText, showLoader, hideLoader, messageError } = mixin;
+const { success, dateText, showLoader, hideLoader, messageError,onSearchDataTable } = mixin;
const router = useRouter();
const name = ref("");
@@ -50,6 +50,7 @@ const textTittle = ref("");
const textTittleScore = ref("");
const textTittleCandidate = ref("");
const rows = ref([]);
+const rowsData = ref([]);
const initialPagination = ref({
rowsPerPage: 0,
});
@@ -182,6 +183,7 @@ async function fetchData() {
}
rows.value = result;
+ rowsData.value = result;
})
.catch((e) => {
messageError($q, e);
@@ -432,6 +434,14 @@ async function checkSave() {
});
}
+function onSearch() {
+ rows.value = onSearchDataTable(
+ filter.value,
+ rowsData.value,
+ columns.value ? columns.value : []
+ );
+}
+
/** ดึงข้อมูล เมื่อโหลดหน้า component */
onMounted(async () => {
hideLoader();
@@ -449,7 +459,8 @@ onMounted(async () => {
style="max-height: 80vh"
:rows="rows"
:columns="columns"
- :filter="filter"
+ v-model:filter="filter"
+ :onSearch="onSearch"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
diff --git a/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue b/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
index 59473d064..7def96c89 100644
--- a/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
+++ b/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
@@ -17,7 +17,8 @@ const $q = useQuasar();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
-const { messageError, success, showLoader, hideLoader } = mixin;
+const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
+ mixin;
const year = ref("2566");
const round = ref("1");
@@ -208,6 +209,7 @@ const columns = ref([
},
]);
const rows = ref([]);
+const rowsData = ref([]);
/**
* ไปหน้ารายละเอียด จัดการรอบคัดเลือกคนพิการ
@@ -293,6 +295,7 @@ async function fetchData() {
}
rows.value = result;
+ rowsData.value = result;
if (result.length > 0) name.value = result[0].exam_name as string;
round.value = _data.round;
year.value = _data.year;
@@ -335,6 +338,14 @@ async function candidateToPlacement() {
.onDismiss(() => {});
}
+function onSearch() {
+ rows.value = onSearchDataTable(
+ filter.value,
+ rowsData.value,
+ columns.value ? columns.value : []
+ );
+}
+
onMounted(async () => {
hideLoader();
await fetchData();
@@ -397,7 +408,8 @@ onMounted(async () => {
:notpass="notpass"
:rows="rows"
:columns="columns"
- :filter="filter"
+ v-model:filter="filter"
+ :onSearch="onSearch"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
diff --git a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
index b12dc148d..4c6650a87 100644
--- a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
+++ b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
@@ -24,8 +24,15 @@ import HistoryTable from "@/components/TableHistory.vue";
const $q = useQuasar(); // show dialog
const router = useRouter();
const mixin = useCounterMixin();
-const { success, dateText, messageError, showLoader, hideLoader, date2Thai } =
- mixin;
+const {
+ success,
+ dateText,
+ messageError,
+ showLoader,
+ hideLoader,
+ date2Thai,
+ onSearchDataTable,
+} = mixin;
const name = ref("");
const year = ref(new Date().getFullYear() + 543);
@@ -41,6 +48,7 @@ const rowsHistory = ref([]); //select data history
const tittleHistory = ref("ประวัติการนำเข้าข้อมูล"); //
const modalHistory = ref(false); //modal ประวัติการแก้ไขข้อมูล
const rows = ref([]);
+const rowsData = ref([]);
const filter = ref(""); //search data table
const filterHistory = ref(""); //search data table
const textTittle = ref("");
@@ -218,6 +226,7 @@ async function fetchData() {
}
rows.value = result;
+ rowsData.value = result;
})
.catch((e) => {
messageError($q, e);
@@ -405,6 +414,14 @@ async function checkSave() {
});
}
+function onSearch() {
+ rows.value = onSearchDataTable(
+ filter.value,
+ rowsData.value,
+ columns.value ? columns.value : []
+ );
+}
+
onMounted(async () => {
hideLoader();
await fetchData();
@@ -420,7 +437,8 @@ onMounted(async () => {
style="max-height: 80vh"
:rows="rows"
:columns="columns"
- :filter="filter"
+ v-model:filter="filter"
+ :onSearch="onSearch"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
diff --git a/src/modules/03_recruiting/views/02_qualify/Manage.vue b/src/modules/03_recruiting/views/02_qualify/Manage.vue
index 7cf1b9d20..b00833943 100644
--- a/src/modules/03_recruiting/views/02_qualify/Manage.vue
+++ b/src/modules/03_recruiting/views/02_qualify/Manage.vue
@@ -17,9 +17,11 @@ import type { ResponsePeriodExam } from "@/modules/03_recruiting/interface/respo
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
-const { date2Thai, messageError, showLoader, hideLoader } = mixin;
+const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } =
+ mixin;
const rows = ref([]);
+const rowsData = ref([]);
const initialPagination = ref({
rowsPerPage: 0,
});
@@ -123,50 +125,52 @@ async function fetchData() {
.then((res) => {
const data = res.data.result;
rows.value = [];
- data.map((r: RequestPeriodExam) => {
- rows.value.push({
- id: r.id,
- name: r.name,
- checkDocument: r.checkDocument,
- checkDisability: r.checkDisability,
- round: r.round,
- yearly: r.year,
- fee: r.fee,
- announcementExam: r.announcementExam,
- dateAnnounce:
- r.announcementDate !== null ? new Date(r.announcementDate) : null,
- dateAnnouncement:
- r.announcementStartDate !== null && r.announcementEndDate !== null
- ? [
- new Date(r.announcementStartDate),
- new Date(r.announcementEndDate),
- ]
- : null,
- dateRegister:
- r.registerStartDate !== null && r.registerEndDate !== null
- ? [new Date(r.registerStartDate), new Date(r.registerEndDate)]
- : null,
- dateExam: r.examDate !== null ? new Date(r.examDate) : null,
- datePayment:
- r.paymentStartDate !== null && r.paymentEndDate !== null
- ? [new Date(r.paymentStartDate), new Date(r.paymentEndDate)]
- : null,
- organizationName: {
- id: r.organizationId,
- name: r.organizationName,
- },
- organizationShortName: {
- id: r.organizationCodeId,
- name: r.organizationCodeName,
- },
- positionExam: [],
- pay: r.bankExam.length > 0 ? "payment2" : "payment1",
- bankExam: [],
- editor: r.detail,
- note: r.note,
- category: r.category,
- });
- });
+ rowsData.value = [];
+ const list = data.map((r: RequestPeriodExam) => ({
+ id: r.id,
+ name: r.name,
+ checkDocument: r.checkDocument,
+ checkDisability: r.checkDisability,
+ round: r.round,
+ yearly: r.year,
+ fee: r.fee,
+ announcementExam: r.announcementExam,
+ dateAnnounce:
+ r.announcementDate !== null ? new Date(r.announcementDate) : null,
+ dateAnnouncement:
+ r.announcementStartDate !== null && r.announcementEndDate !== null
+ ? [
+ new Date(r.announcementStartDate),
+ new Date(r.announcementEndDate),
+ ]
+ : null,
+ dateRegister:
+ r.registerStartDate !== null && r.registerEndDate !== null
+ ? [new Date(r.registerStartDate), new Date(r.registerEndDate)]
+ : null,
+ dateExam: r.examDate !== null ? new Date(r.examDate) : null,
+ datePayment:
+ r.paymentStartDate !== null && r.paymentEndDate !== null
+ ? [new Date(r.paymentStartDate), new Date(r.paymentEndDate)]
+ : null,
+ organizationName: {
+ id: r.organizationId,
+ name: r.organizationName,
+ },
+ organizationShortName: {
+ id: r.organizationCodeId,
+ name: r.organizationCodeName,
+ },
+ positionExam: [],
+ pay: r.bankExam.length > 0 ? "payment2" : "payment1",
+ bankExam: [],
+ editor: r.detail,
+ note: r.note,
+ category: r.category,
+ }));
+
+ rows.value = list;
+ rowsData.value = list;
})
.catch((e) => {
messageError($q, e);
@@ -195,6 +199,14 @@ function dateThaiRange(val: [Date, Date]) {
}
}
+function onSearch() {
+ rows.value = onSearchDataTable(
+ filter.value,
+ rowsData.value,
+ columns.value ? columns.value : []
+ );
+}
+
onMounted(async () => {
hideLoader();
await fetchData();
@@ -208,7 +220,8 @@ onMounted(async () => {
(""); //search data table
const initialPagination = ref({
rowsPerPage: 0,
});
const examData = ref([]);
+const examDataData = ref([]);
const visibleColumns = ref([
"no",
"announcementExam",
@@ -215,6 +217,7 @@ async function fetchData() {
});
}
examData.value = result;
+ examDataData.value = result;
})
.catch((e) => {
messageError($q, e);
@@ -283,6 +286,14 @@ function openDetail(col: ResponsePeriodExam) {
router.push(`/qualify/period-detail/${col.id}`);
}
+function onSearch() {
+ examData.value = onSearchDataTable(
+ filter.value,
+ examDataData.value,
+ columns.value ? columns.value : []
+ );
+}
+
onMounted(async () => {
hideLoader();
await fetchData();
@@ -298,7 +309,8 @@ onMounted(async () => {
style="max-height: 80vh"
:rows="examData"
:columns="columns"
- :filter="filter"
+ v-model:filter="filter"
+ :onSearch="onSearch"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
diff --git a/src/modules/03_recruiting/views/03_editor/index.vue b/src/modules/03_recruiting/views/03_editor/index.vue
index bfe9a11b6..d39c696a8 100644
--- a/src/modules/03_recruiting/views/03_editor/index.vue
+++ b/src/modules/03_recruiting/views/03_editor/index.vue
@@ -33,6 +33,7 @@ const {
hideLoader,
dialogConfirm,
dialogRemove,
+ onSearchDataTable,
} = mixin;
const previous = ref(false);
@@ -66,7 +67,9 @@ const districtOptions = ref([]);
const subdistrictOptionsMain = ref([]);
const subdistrictOptions = ref([]);
const cmsGoverment = ref([]);
+const cmsGovermentData = ref([]);
const cmsAgency = ref([]);
+const cmsAgencyData = ref([]);
const web = ref({
by: "",
thai: "",
@@ -435,6 +438,7 @@ async function fetchData() {
address.value.districtId = data.districtId;
address.value.subdistrictId = data.subDistrictId;
cmsGoverment.value = [];
+ cmsGovermentData.value = [];
if (data.cmsGovernments.length > 0) {
let setData: CmsTable[] = [];
data.cmsGovernments.map((r: CmsTable) => {
@@ -447,9 +451,11 @@ async function fetchData() {
});
});
cmsGoverment.value = setData;
+ cmsGovermentData.value = setData;
}
cmsAgency.value = [];
+ cmsAgencyData.value = [];
if (data.cmsAgencys.length > 0) {
let setData: CmsTable[] = [];
data.cmsAgencys.map((r: CmsTable) => {
@@ -462,6 +468,7 @@ async function fetchData() {
});
});
cmsAgency.value = setData;
+ cmsAgencyData.value = setData;
}
})
.catch((e: any) => {
@@ -770,6 +777,22 @@ function filterSelector(val: string, update: Function, refData: string) {
}
}
+function onSearch(type: string) {
+ if (type == "ส่วนราชการ") {
+ cmsGoverment.value = onSearchDataTable(
+ filter.value,
+ cmsGovermentData.value,
+ columns.value ? columns.value : []
+ );
+ } else if (type == "หน่วยงาน") {
+ cmsAgency.value = onSearchDataTable(
+ filterAgency.value,
+ cmsAgencyData.value,
+ columns.value ? columns.value : []
+ );
+ }
+}
+
onMounted(async () => {
await fetchData();
await fetchProvince();
@@ -1176,7 +1199,8 @@ onMounted(async () => {
{