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 666b6f44a..58d905d23 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue @@ -53,7 +53,10 @@ const columns = ref([ align: "left", label: "ตั้งแต่", sortable: true, - field: "startDate", + field: (v) => + v.isDate + ? date2Thai(v.startDate) + : new Date(v.startDate).getFullYear() + 543, headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -64,7 +67,8 @@ const columns = ref([ align: "left", label: "ถึง", sortable: true, - field: "endDate", + field: (v) => + v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543, headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -76,6 +80,7 @@ const columns = ref([ label: "วันที่สำเร็จการศึกษา", sortable: true, field: "finishDate", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -89,6 +94,7 @@ const columns = ref([ field: "isEducation", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (v) => (v === true ? "ใช่" : "ไม่ใช่"), sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, @@ -334,7 +340,6 @@ async function fetchData(id: string) { .get(config.API.profileNewEducationByProfileId(id)) .then(async (res) => { rows.value = res.data.result; - console.log(rows.value); }) .catch((err) => { messageError($q, err); @@ -350,7 +355,6 @@ async function fetchHistoryData(id: string) { .get(config.API.profileNewEducationHisByEducationId(id)) .then(async (res) => { historyRows.value = res.data.result; - console.log(historyRows.value); }) .catch((err) => { messageError($q, err); @@ -361,7 +365,6 @@ async function fetchHistoryData(id: string) { } async function addData() { - console.log(educationData.durationYear); await http .post(config.API.profileNewEducation, { profileId: id.value, @@ -451,7 +454,6 @@ watch( () => isDate.value, () => { if (isDate.value === "false") { - console.log(educationData.startDate); educationData.startYear = +educationData.startDate .toString() .slice(11, 15); @@ -613,19 +615,7 @@ onMounted(async () => {