This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-01-14 16:51:26 +07:00
parent fceabfa99c
commit 15fe87e0fc
2 changed files with 7 additions and 19 deletions

View file

@ -29,6 +29,7 @@ const { messageError, success, dialogConfirm, showLoader, hideLoader } = mixin;
const route = useRoute(); const route = useRoute();
const assignId = ref<string>("baa3d9f6-9d21-4c58-85f2-114abf8de25c"); const assignId = ref<string>("baa3d9f6-9d21-4c58-85f2-114abf8de25c");
const isData = defineModel<boolean>("isData", { required: true });
const status = ref<boolean>(true); const status = ref<boolean>(true);
const answer1 = ref<string>(""); const answer1 = ref<string>("");
@ -39,11 +40,13 @@ const classBordered = ref<string>("");
/** ดึง ข้อมูลแบบสำรวจ */ /** ดึง ข้อมูลแบบสำรวจ */
async function getSurveyData() { async function getSurveyData() {
isData.value = true;
showLoader(); showLoader();
await http await http
.get(config.API.summaryDetail()) .get(config.API.summaryDetail())
.then(async (res: any) => { .then(async (res: any) => {
const data = await res.data.result.data; const data = await res.data.result.data;
isData.value = true;
assignId.value = res.data.result.assignId; assignId.value = res.data.result.assignId;
store.assignId = res.data.result.assignId; store.assignId = res.data.result.assignId;
if (data !== null) { if (data !== null) {
@ -55,7 +58,8 @@ async function getSurveyData() {
hideLoader(); hideLoader();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); // messageError($q, e);
isData.value = false;
hideLoader(); hideLoader();
}); });
} }

View file

@ -13,23 +13,7 @@ import ResultPage from "@/modules/15_probationReport/components/02_ResultPage.vu
const store = useProbationReport(); const store = useProbationReport();
const router = useRouter(); const router = useRouter();
const isData = ref<boolean>(false); const isData = ref<boolean>(true);
async function fetchCheckData() {
isData.value = false;
await http
.get(config.API.summaryDetail())
.then(() => {
isData.value = true;
})
.catch((e) => {
console.log("error", e);
});
}
onMounted(() => {
fetchCheckData();
});
</script> </script>
<template> <template>
<div class="col-12 row justify-center"> <div class="col-12 row justify-center">
@ -75,7 +59,7 @@ onMounted(() => {
<q-tab-panels v-model="store.tabMain" animated> <q-tab-panels v-model="store.tabMain" animated>
<q-tab-panel name="SURVEY" class="q-pa-none"> <q-tab-panel name="SURVEY" class="q-pa-none">
<SurveyPage /> <SurveyPage v-model:is-data="isData" />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="RESULT"> <q-tab-panel name="RESULT">
<ResultPage /> <ResultPage />