ปรับ fe sprint2

This commit is contained in:
Kittapath 2023-06-19 15:50:50 +07:00
parent 8576f3c387
commit 0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions

View file

@ -288,7 +288,7 @@ const fee = ref<number>();
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin(); //
const { success, messageError, showLoader, hideLoader } = mixin;
const { success, messageError } = mixin;
const route = useRoute();
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string>(route.params.candidateId.toString());
@ -308,13 +308,13 @@ const props = defineProps({
});
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchPaymentExam();
await fetchData();
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidatePayment(candidateId.value))
.then((res) => {
@ -325,12 +325,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchPaymentExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamPayment(examId.value))
.then((res) => {
@ -342,12 +342,12 @@ const fetchPaymentExam = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const confirm = async (status: boolean, reason: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateCheckPayment(candidateId.value), {
status: status,
@ -358,7 +358,7 @@ const confirm = async (status: boolean, reason: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
success($q, "ตรวจสอบข้อมูลชำระเงินสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});