From b9ea12a451767676c37d5ea33ccf019c4922d875 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Mon, 18 Mar 2024 16:14:11 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4:=20API=20=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=AD=E0=B8=9A=E0=B8=A3=E0=B8=A1=E0=B8=94=E0=B8=B9=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/registry/api.registry.ts | 9 ++ .../detail/Achievement/02_Train.vue | 150 ++++++++---------- 2 files changed, 77 insertions(+), 82 deletions(-) diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 659f9cf76..da9223ed6 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -27,4 +27,13 @@ export default { `${registryNew}training/${trainingId}`, profileNewTrainingHisByTrainingId: (trainingId: string) => `${registryNew}training/history/${trainingId}`, + +// ประวัติการศึกษา +profileNewEducation: `${registryNew}educations`, +profileNewEducationByProfileId: (profileId: string) => + `${registryNew}educations/${profileId}`, +profileNewEducationByEducationId: (educationId: string) => + `${registryNew}educations/${educationId}`, +profileNewEducationHisByEducationId: (educationsId: string) => + `${registryNew}educations/history/${educationsId}`, }; diff --git a/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue b/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue index 0437dbe27..1d36bb25e 100644 --- a/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue +++ b/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue @@ -167,83 +167,19 @@ const pagination = ref({ page: formFilter.page, rowsPerPage: formFilter.pageSize, }); +const historyFormFilter = reactive({ + page: 1, + pageSize: 10, + keyword: "", +}); -const row = [ - { - name: "ชื่อโครงการ", - topic: "ชื่อหัวข้อ", - yearly: "2567", - place: "สถานที่", - duration: "3 ปี", - department: "แผนกสาขา", - numberOrder: "1244", - dateOrder: new Date(), - startDate: new Date(), - endDate: new Date(), - }, - { - name: "ชื่อโครงการ", - topic: "ชื่อหัวข้อ", - yearly: "2567", - place: "สถานที่", - duration: "2567", - department: "แผนกสาขา", - numberOrder: "1244", - dateOrder: new Date(), - startDate: new Date(), - endDate: new Date(), - }, - { - name: "ชื่อโครงการ", - topic: "ชื่อหัวข้อ", - yearly: "2567", - place: "สถานที่", - duration: "2567", - department: "แผนกสาขา", - numberOrder: "1244", - dateOrder: new Date(), - startDate: new Date(), - endDate: new Date(), - }, - { - name: "ชื่อโครงการ", - topic: "ชื่อหัวข้อ", - yearly: "2567", - place: "สถานที่", - duration: "2567", - department: "แผนกสาขา", - numberOrder: "1244", - dateOrder: new Date(), - startDate: new Date(), - endDate: new Date(), - }, - { - name: "ชื่อโครงการ", - topic: "ชื่อหัวข้อ", - yearly: "2567", - place: "สถานที่", - duration: "2567", - department: "แผนกสาขา", - numberOrder: "1244", - dateOrder: new Date(), - startDate: new Date(), - endDate: new Date(), - }, - { - name: "ชื่อโครงการ", - topic: "ชื่อหัวข้อ", - yearly: "2567", - place: "สถานที่", - duration: "2567", - department: "แผนกสาขา", - numberOrder: "1244", - dateOrder: new Date(), - startDate: new Date(), - endDate: new Date(), - }, -]; +const historyPagination = ref({ + page: historyFormFilter.page, + rowsPerPage: historyFormFilter.pageSize, +}); const rows = ref([]); +const historyRows = ref([]); const visibleColumns = ref([ "name", // ชื่อโครงงาน @@ -258,6 +194,19 @@ const visibleColumns = ref([ "endDate", // วันสิ้นสุด ]); +const historyVisibleColumns = ref([ + "name", // ชื่อโครงงาน + "topic", // หัวข้อ + "yearly", // ปีที่อบรม + "place", // สถานที่ + "duration", // รวมระยะวเลา + "department", // หน่วยงานที่รับผิดชอบ + "numberOrder", // เลขที่คำสั่ง + "dateOrder", // คำสั่งลงวันที่ + "startDate", // วันเริ่มต้น + "endDate", // วันสิ้นสุด +]); + function validateForm() { onSubmit(); } @@ -444,6 +393,22 @@ async function fetchData(id: string) { }); } +async function fetchHistoryData(id: string) { + showLoader(); + await http + .get(config.API.profileNewTrainingHisByTrainingId(id)) + .then(async (res) => { + historyRows.value = res.data.result; + console.log(historyRows.value); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + onMounted(async () => { await fetchData(id.value); }); @@ -539,6 +504,7 @@ onMounted(async () => { bordered :paging="true" dense + :filter="formFilter.keyword" :rows-per-page-options="[20, 50, 100]" v-model:pagination="pagination" class="custom-header-table" @@ -600,7 +566,9 @@ onMounted(async () => { round size="14px" icon="mdi-history" - @click="() => (historyDialog = true)" + @click=" + () => (fetchHistoryData(props.row.id), (historyDialog = true)) + " > ประวัติแก้ไขประวัติการศึกษา @@ -1087,7 +1055,7 @@ onMounted(async () => { dense outlined bg-color="white" - v-model="formFilter.keyword" + v-model="historyFormFilter.keyword" label="ค้นหา" class="q-mr-sm" > @@ -1097,7 +1065,7 @@ onMounted(async () => { { -