diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue index b5696f409..a656d831a 100644 --- a/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue @@ -9,7 +9,7 @@ import config from "@/app.config"; import type { FormComment, FormCommentByRole, -} from "@/modules/14_KPI/interface/request/index"; +} from "@/modules/14_KPI/interface/request/Index"; import { useRoute } from "vue-router"; import { useQuasar } from "quasar"; @@ -82,7 +82,7 @@ function clickList(index: string, data: any) { reasonCommanderRef.value.reset(); reasonCommanderHighRef.value.reset(); } - count.value++; + showLoader(); setTimeout(() => { hideLoader(); @@ -116,12 +116,13 @@ function onSubmitAdd() { .then(async (res) => { success($q, "บันทึกข้อมูลสำเร็จ"); if (sendId.value) { - const id = res.data.result; + const id = await res.data.result; await closeAdd(); const data = listTarget.value.find((item: any) => item.id == id); + count.value = 0; clickList(id, data); } else { - sendId.value = res.data.result; + sendId.value = await res.data.result; getList(); } }) @@ -212,6 +213,7 @@ function onSubmitComment(role: string) { const data = listTarget.value.find( (item: any) => item.id == idCheck ); + count.value++; clickList(idCheck, data); } }, 200);