fix: แก้สรรหา

This commit is contained in:
setthawutttty 2025-09-10 12:04:53 +07:00
parent 40e2b34617
commit 22d1fbed58
5 changed files with 17 additions and 18 deletions

View file

@ -39,5 +39,5 @@ export default {
`${disableExam}placement/${examId}`, `${disableExam}placement/${examId}`,
repoetUploadDisableExam:(id:string)=>`${disableExam}result/${id}`, repoetUploadDisableExam:(id:string)=>`${disableExam}result/${id}`,
repoetDownloadDisableExam:(id:string)=>`${disableExam}report/exam/${id}` repoetDownloadDisableExam:(id:string,examId:string)=>`${disableExam}report/exam/${id}/${examId}`
}; };

View file

@ -104,7 +104,7 @@ async function downloadScore() {
.get(config.API.examReport(importId.value, examId.value)) .get(config.API.examReport(importId.value, examId.value))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
await genReport(data, `ผลคะแนน_${examId.value}.pdf`,'pdf'); await genReport(data, `ผลคะแนน_${examId.value}`, "pdf");
}) })
.catch(async (e) => { .catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text())); messageError($q, JSON.parse(await e.response.data.text()));
@ -332,10 +332,10 @@ onMounted(async () => {
ภาคความรความสามารถทใชเฉพาะตำแหน (ภาค ) ภาคความรความสามารถทใชเฉพาะตำแหน (ภาค )
</div> </div>
<div class="col-xs-3 col-sm-2 q-pr-xs"> <div class="col-xs-3 col-sm-2 q-pr-xs">
{{ scoreAFull ? scoreAFull:'-' }} {{ scoreAFull ? scoreAFull : "-" }}
</div> </div>
<div class="col-xs-3 col-sm-2 q-pr-xs"> <div class="col-xs-3 col-sm-2 q-pr-xs">
{{ scoreA ? scoreA:'-' }} {{ scoreA ? scoreA : "-" }}
</div> </div>
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div> <div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>

View file

@ -231,6 +231,7 @@ async function clickPassExam(id: string) {
.get(config.API.exportPassExamList(id)) .get(config.API.exportPassExamList(id))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
data.reportName = `CandidateList`;
await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf"); await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf");
}) })
.catch(async (e) => { .catch(async (e) => {

View file

@ -8,6 +8,8 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import genReport from "@/plugins/genreport";
const $q = useQuasar(); const $q = useQuasar();
const router = useRouter(); const router = useRouter();
@ -96,15 +98,10 @@ async function fetchData() {
async function downloadScore() { async function downloadScore() {
showLoader(); showLoader();
await http await http
.get(config.API.downloadDisableScoreReport(importId.value, examId.value), { .get(config.API.repoetDownloadDisableExam(importId.value, examId.value))
responseType: "blob", .then(async (res) => {
}) const data = res.data.result;
.then((res) => { await genReport(data, `ผลคะแนน_${examId.value}`, "pdf");
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `ผลคะแนน_${examId.value}.pdf`;
// start download
a.click();
}) })
.catch(async (e) => { .catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text())); messageError($q, JSON.parse(await e.response.data.text()));

View file

@ -60,6 +60,7 @@ const textTittleScore = ref<string>("");
const textTittleCandidate = ref<string>(""); const textTittleCandidate = ref<string>("");
const textTittleResult = ref<string>(""); const textTittleResult = ref<string>("");
const initialPagination = ref<Pagination>({ const initialPagination = ref<Pagination>({
page: 1,
rowsPerPage: 0, rowsPerPage: 0,
sortBy: "year", sortBy: "year",
}); });
@ -186,9 +187,10 @@ const visibleColumnsHistory = ref<String[]>([
async function clickPassExam(id: string) { async function clickPassExam(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.repoetDownloadDisableExam(id)) .get(config.API.exportDisablePassExamList(id))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
data.reportName = `CandidateList`;
await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf"); await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf");
}) })
.catch(async (e) => { .catch(async (e) => {
@ -668,7 +670,8 @@ onMounted(async () => {
round round
@click.stop.prevent="clickResult(props.row.id)" @click.stop.prevent="clickResult(props.row.id)"
v-if=" v-if="
(props.row.score == null || props.row.score.resultCount == 0) && (props.row.score == null ||
props.row.score.resultCount == 0) &&
checkPermission($route)?.attrIsUpdate checkPermission($route)?.attrIsUpdate
" "
> >
@ -702,9 +705,7 @@ onMounted(async () => {
@click.stop.prevent="clickPassExam(props.row.id)" @click.stop.prevent="clickPassExam(props.row.id)"
icon="mdi-clipboard-arrow-down" icon="mdi-clipboard-arrow-down"
> >
<q-tooltip <q-tooltip>ดาวนโหลดรายชอผสอบแขงขนได</q-tooltip>
>ดาวนโหลดรายชอผสอบแขงขนได</q-tooltip
>
</q-btn> </q-btn>
</div> </div>
</div> </div>