diff --git a/src/modules/12_evaluatePersonal/components/Meeting/EditPage.vue b/src/modules/12_evaluatePersonal/components/Meeting/EditPage.vue index 2175677a7..64b9a118b 100644 --- a/src/modules/12_evaluatePersonal/components/Meeting/EditPage.vue +++ b/src/modules/12_evaluatePersonal/components/Meeting/EditPage.vue @@ -11,7 +11,9 @@ import config from "@/app.config"; import type { formData } from "@/modules/09_leave/interface/request/workTime"; const route = useRoute(); -const personalId = ref(route.params.id.toString()); +const personalId = ref(route.params.id as string); +console.log(personalId.value); + const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -21,6 +23,7 @@ const { dialogConfirm, success, date2Thai, + dateToISO, } = mixin; /**เมื่อเริ่มโหลดหน้า @@ -53,7 +56,6 @@ const fetchData = async () => { .get(config.API.meetingById(personalId.value)) .then((res) => { const dataApi = res.data.result; - personalId.value = dataApi.id; data.title = dataApi.Tittle; data.rounded = dataApi.Round; data.consider = dataApi.Result; @@ -78,16 +80,18 @@ const fetchData = async () => { */ function onSubmit(formData: FormData) { dialogConfirm($q, () => putData(formData)); + console.log(personalId.value); } function putData(formData: FormData) { + console.log(personalId.value); showLoader(); http .put(config.API.meetingById(personalId.value), { Round: formData.rounded ?? "", Tittle: formData.title, - DateStart: formData.dateMeetingStart, - DateEnd: formData.dateMeetingEnd, + DateStart: dateToISO(formData.dateMeetingStart), + DateEnd: dateToISO(formData.dateMeetingEnd), Result: formData.consider, Duration: formData.period, }) @@ -98,7 +102,8 @@ function putData(formData: FormData) { messageError($q, e); }) .finally(async () => { - router.push(`/discipline/meeting`); + hideLoader(); + router.push(`/evaluate/meeting`); }); } diff --git a/src/modules/12_evaluatePersonal/interface/index/meeting.ts b/src/modules/12_evaluatePersonal/interface/index/meeting.ts index 50f66db71..3211e7bab 100644 --- a/src/modules/12_evaluatePersonal/interface/index/meeting.ts +++ b/src/modules/12_evaluatePersonal/interface/index/meeting.ts @@ -16,8 +16,8 @@ interface MainList { interface FormData { rounded: string; dateMeeting: string; - dateMeetingStart: Date | null; - dateMeetingEnd: Date | null; + dateMeetingStart: Date; + dateMeetingEnd: Date; consider: string; period: string; title: string; diff --git a/src/modules/12_evaluatePersonal/views/MainPage.vue b/src/modules/12_evaluatePersonal/views/MainPage.vue index 51e8d9bac..d18bcb57c 100644 --- a/src/modules/12_evaluatePersonal/views/MainPage.vue +++ b/src/modules/12_evaluatePersonal/views/MainPage.vue @@ -56,6 +56,10 @@ watch( } ); +function filterFn() { + getList(); + console.log("enter", filter.value); +} function getList() { showLoader(); http @@ -68,7 +72,9 @@ function getList() { ) .then((res) => { maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value); - const data = res.data.result; + const data = res.data.result.data; + console.log(data); + store.fetchData(data); }) .catch((e) => { @@ -92,6 +98,41 @@ onMounted(async () => { รายการคำขอประเมิน +
+ + + + + + +