From 2be49f69554faafbf0331905e35289e520dc5278 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Mon, 18 Mar 2024 15:44:46 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4:=20API=20=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A8=E0=B8=B6=E0=B8=81?= =?UTF-8?q?=E0=B8=A9=E0=B8=B2+Search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalInformation/05_Education.vue | 82 ++++++++++++++++--- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue index c1df295c3..50deb40c6 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue @@ -193,6 +193,7 @@ const columns = ref([ ]); const rows = ref([]); +const historyRows = ref([]); const editId = ref(""); const route = useRoute(); const id = ref(route.params.id.toString()); @@ -202,6 +203,7 @@ const educationOption = ref([ { label: "ใช่", value: true }, { label: "ไม่ใช่", value: false }, ]); + const historyDialog = ref(false); const educationData = reactive<{ educationLevel: string; @@ -252,6 +254,17 @@ const pagination = ref({ rowsPerPage: formFilter.pageSize, }); +const historyFormFilter = reactive({ + page: 1, + pageSize: 10, + keyword: "", +}); + +const historyPagination = ref({ + page: historyFormFilter.page, + rowsPerPage: historyFormFilter.pageSize, +}); + const visibleColumns = ref([ "educationLevel", "institute", @@ -269,6 +282,23 @@ const visibleColumns = ref([ "finishDate", "note", ]); +const historyVisibleColumns = ref([ + "educationLevel", + "institute", + "degree", + "field", + "gpa", + "country", + "duration", + "durationYear", + "other", + "fundName", + "isEducation", + "endDate", + "startDate", + "finishDate", + "note", +]); function validateForm() { onSubmit(); @@ -330,6 +360,21 @@ async function fetchData(id: string) { hideLoader(); }); } +async function fetchHistoryData(id: string) { + showLoader(); + await http + .get(config.API.profileNewEducationHisByEducationId(id)) + .then(async (res) => { + historyRows.value = res.data.result; + console.log(historyRows.value); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} async function addData() { console.log(educationData.durationYear); @@ -566,6 +611,7 @@ onMounted(async () => { flat bordered :paging="true" + :filter="formFilter.keyword" dense v-model:pagination="pagination" :rows-per-page-options="[20, 50, 100]" @@ -635,7 +681,9 @@ onMounted(async () => { round size="14px" icon="mdi-history" - @click="() => (historyDialog = true)" + @click=" + () => (fetchHistoryData(props.row.id), (historyDialog = true)) + " > ประวัติแก้ไขประวัติการศึกษา @@ -1184,7 +1232,7 @@ onMounted(async () => { dense outlined bg-color="white" - v-model="formFilter.keyword" + v-model="historyFormFilter.keyword" label="ค้นหา" class="q-mr-sm" > @@ -1194,7 +1242,7 @@ onMounted(async () => { { - + { -->
- +
@@ -421,7 +420,11 @@ onMounted(async () => { bordered class="row col-12 q-mt-xs" > - + From b9ea12a451767676c37d5ea33ccf019c4922d875 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Mon, 18 Mar 2024 16:14:11 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4:=20API=20=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=AD=E0=B8=9A=E0=B8=A3=E0=B8=A1=E0=B8=94=E0=B8=B9?= =?UTF-8?q?=E0=B8=87=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 () => { { -