diff --git a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue index 9f52fe786..87ed0f29e 100644 --- a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue +++ b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue @@ -258,6 +258,7 @@ function close() { modal.value = false; member.value = ""; selected.value = []; + rowsDirector.value = []; } function updatePagination(newPagination: any) { @@ -324,13 +325,13 @@ async function getPerson() { ); totalList.value = Math.ceil(dataTotal / pagination.value.rowsPerPage); total.value = dataTotal; - hideLoader(); }) .catch((e) => { messageError($q, e); - hideLoader(); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } function onDelete(id: string) { diff --git a/src/modules/05_placement/components/probation/MainAppoint.vue b/src/modules/05_placement/components/probation/MainAppoint.vue index fb50de670..ae08e5f3d 100644 --- a/src/modules/05_placement/components/probation/MainAppoint.vue +++ b/src/modules/05_placement/components/probation/MainAppoint.vue @@ -1,5 +1,5 @@ @@ -688,7 +660,7 @@ onMounted(async () => { @@ -697,7 +669,6 @@ onMounted(async () => { standout dense v-model="formProbation.keyword" - ref="filterRef2" outlined placeholder="ค้นหา" @keydown.enter.prevent="filterKeyword2Fn(formProbation.page)" @@ -708,7 +679,6 @@ onMounted(async () => { v-if="filterKeyword2 !== ''" name="clear" class="cursor-pointer" - @click="resetFilter2" /> @@ -723,7 +693,6 @@ onMounted(async () => { :paging="true" dense class="custom-header-table" - v-bind="attrs" :pagination-label="paginationLabel2" v-model:pagination="pagination2" @update:pagination="updatePagination" @@ -750,7 +719,7 @@ onMounted(async () => { outline color="primary" label="เพิ่ม" - @click="clickAdd(props.row)" + @click="addPersonalData(props.row)" > diff --git a/src/modules/05_placement/components/probation/MainSurvey.vue b/src/modules/05_placement/components/probation/MainSurvey.vue index 900148b20..d87412ebf 100644 --- a/src/modules/05_placement/components/probation/MainSurvey.vue +++ b/src/modules/05_placement/components/probation/MainSurvey.vue @@ -5,8 +5,8 @@ import { useQuasar, type QTableProps } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; -import { checkPermission } from "@/utils/permissions"; +import type { Pagination } from "@/modules/05_placement/interface/index/Main"; import type { MainData } from "@/modules/05_placement/interface/index/Survey"; const $q = useQuasar(); @@ -19,22 +19,6 @@ const rows = ref([]); const filterKeyword = ref(""); const total = ref(0); const totalList = ref(1); -const pagination = ref({ - sortBy: "createdAt", - descending: true, - page: 10, - rowsPerPage: 10, -}); - -const visibleColumns = ref([ - "no", - "fullname", - "position", - "answer1", - "answer2", - "answer3", - "createdAt", -]); /** หัวตาราง */ const columns = ref([ { @@ -104,35 +88,50 @@ const columns = ref([ }, }, ]); +const visibleColumns = ref([ + "no", + "fullname", + "position", + "answer1", + "answer2", + "answer3", + "createdAt", +]); +const pagination = ref({ + sortBy: "createdAt", + descending: true, + page: 10, + rowsPerPage: 10, +}); async function getData() { showLoader(); - let query = { - year: year.value, - keyword: filterKeyword.value, - page: pagination.value.page, - pageSize: pagination.value.rowsPerPage, - }; await http - .get(config.API.probationSurvey, { params: query }) + .get(config.API.probationSurvey, { + params: { + year: year.value, + keyword: filterKeyword.value, + page: pagination.value.page, + pageSize: pagination.value.rowsPerPage, + }, + }) .then(async (res) => { const data = await res.data.result.data; totalList.value = Math.ceil( res.data.result.total / pagination.value.rowsPerPage ); total.value = res.data.result.total; - rows.value = data; - hideLoader(); }) .catch((e) => { messageError($q, e); - hideLoader(); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } -function updatePagination(newPagination: any) { +function updatePagination(newPagination: Pagination) { pagination.value.page = 1; pagination.value.rowsPerPage = newPagination.rowsPerPage; } @@ -153,8 +152,9 @@ onMounted(async () => { await getData(); }); +