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 () => { { -