fix: แก้ เส้น API

This commit is contained in:
setthawutttty 2025-09-05 09:52:19 +07:00
parent fc90c639ef
commit 3af65f9889
2 changed files with 11 additions and 13 deletions

View file

@ -47,5 +47,6 @@ export default {
exportCandidateListNew: (id: string) => `${recruit_report}candidate-new/${id}`,
examReport: (id: string,no:string) => `${recruit}report/exam/${id}/${no}`,
};

View file

@ -8,6 +8,8 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import genReport from "@/plugins/genreport";
const $q = useQuasar();
const router = useRouter();
@ -99,15 +101,10 @@ async function fetchData() {
async function downloadScore() {
showLoader();
await http
.get(config.API.downloadScoreReport(importId.value, examId.value), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `ผลคะแนน_${examId.value}.pdf`;
// start download
a.click();
.get(config.API.examReport(importId.value, examId.value))
.then(async (res) => {
const data = res.data.result;
await genReport(data, `ผลคะแนน_${examId.value}.pdf`,'pdf');
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
@ -316,12 +313,12 @@ onMounted(async () => {
{{ typeTest == "bangkok" ? "กทม." : "ก.พ." }}
</div>
<div class="col-xs-3 col-sm-2 q-pr-xs"></div>
<div class="col-12">
<div class="col-12">
<q-separator />
</div>
<div class="col-xs-4 col-sm-5 text-weight-medium text-grey-7">
</div>
<div
class="col-xs-4 col-sm-5 text-weight-medium text-grey-7"
></div>
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
คะแนนเต
</div>