fixing
This commit is contained in:
parent
a43279b314
commit
21f1787dd0
3 changed files with 18 additions and 4 deletions
|
|
@ -45,6 +45,7 @@ async function getSurveyData() {
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
const data = await res.data.result.data;
|
const data = await res.data.result.data;
|
||||||
assignId.value = res.data.result.assignId;
|
assignId.value = res.data.result.assignId;
|
||||||
|
store.assignId = res.data.result.assignId;
|
||||||
if (data !== null) {
|
if (data !== null) {
|
||||||
answer1.value = data.answer1;
|
answer1.value = data.answer1;
|
||||||
answer2.value = data.answer2;
|
answer2.value = data.answer2;
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,13 @@ import { useRoute, useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { useProbationReport } from "@/modules/15_probationReport/store";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
const store = useProbationReport();
|
||||||
|
|
||||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const assignId = ref<string>("baa3d9f6-9d21-4c58-85f2-114abf8de25c");
|
|
||||||
const status = ref<boolean>(false);
|
const status = ref<boolean>(false);
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -52,7 +53,7 @@ const result_option = reactive([
|
||||||
async function getReportScore() {
|
async function getReportScore() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.summaryReportDetail(assignId.value))
|
.get(config.API.summaryReportDetail(store.assignId))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
develop_orientation_score.value = data.develop_orientation_score;
|
develop_orientation_score.value = data.develop_orientation_score;
|
||||||
|
|
@ -95,8 +96,19 @@ async function getReportScore() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ดึง ข้อมูลแบบสำรวจ */
|
||||||
|
async function getAssignId() {
|
||||||
|
await http.get(config.API.summaryDetail()).then(async (res: any) => {
|
||||||
|
store.assignId = res.data.result.assignId;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** get ค่า เมื่อโหลดหน้า */
|
/** get ค่า เมื่อโหลดหน้า */
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
if (!store.assignId) {
|
||||||
|
await getAssignId();
|
||||||
|
}
|
||||||
|
|
||||||
getReportScore();
|
getReportScore();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,6 @@ import type { DataOption } from "@/modules/10_registry/interface/index/Main";
|
||||||
|
|
||||||
export const useProbationReport = defineStore("ProbationReportStore", () => {
|
export const useProbationReport = defineStore("ProbationReportStore", () => {
|
||||||
const tabMain = ref<string>("SURVEY");
|
const tabMain = ref<string>("SURVEY");
|
||||||
return { tabMain };
|
const assignId = ref<string>("");
|
||||||
|
return { tabMain, assignId };
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue