feat(/qualify/manage): downloadApplicationForm
This commit is contained in:
parent
ed0d84b45c
commit
753ca8f078
2 changed files with 38 additions and 1 deletions
|
|
@ -93,4 +93,7 @@ export default {
|
||||||
periodExamToPlacement: (examId: string) => `${periodExam}placement/${examId}`,
|
periodExamToPlacement: (examId: string) => `${periodExam}placement/${examId}`,
|
||||||
|
|
||||||
checkShowExaminfo: `${candidate}check-showExamInfo`,
|
checkShowExaminfo: `${candidate}check-showExamInfo`,
|
||||||
|
|
||||||
|
applicationFormPDF: (candidateId: string) =>
|
||||||
|
`${env.API_URI}/placement/candidate/pdf/${candidateId}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import genReport from "@/plugins/genreport";
|
||||||
|
|
||||||
import Profile from "@/modules/03_recruiting/components/Profile.vue";
|
import Profile from "@/modules/03_recruiting/components/Profile.vue";
|
||||||
import {
|
import {
|
||||||
|
|
@ -44,6 +45,7 @@ const formContact = ref<any>({});
|
||||||
const status = ref<string>("");
|
const status = ref<string>("");
|
||||||
const rejectDetail = ref<string>("");
|
const rejectDetail = ref<string>("");
|
||||||
const positionLevelName = ref<string>("");
|
const positionLevelName = ref<string>("");
|
||||||
|
const isShowExamInfo = ref<boolean>(false);
|
||||||
|
|
||||||
/** ดึงข้อมูลสถานะ */
|
/** ดึงข้อมูลสถานะ */
|
||||||
async function fetchStatus() {
|
async function fetchStatus() {
|
||||||
|
|
@ -55,6 +57,7 @@ async function fetchStatus() {
|
||||||
status.value = data.status;
|
status.value = data.status;
|
||||||
rejectDetail.value = data.rejectDetail;
|
rejectDetail.value = data.rejectDetail;
|
||||||
positionLevelName.value = data?.positionExam?.positionLevelName;
|
positionLevelName.value = data?.positionExam?.positionLevelName;
|
||||||
|
isShowExamInfo.value = data.isShowExamInfo || false;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -284,6 +287,24 @@ async function clickSave() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function downloadApplicationForm() {
|
||||||
|
try {
|
||||||
|
showLoader();
|
||||||
|
const res = await http.get(
|
||||||
|
config.API.applicationFormPDF(candidateId.value)
|
||||||
|
);
|
||||||
|
|
||||||
|
const result = res.data.result;
|
||||||
|
const fileName = `${result.template}ของ ${result.data.fullName}`;
|
||||||
|
|
||||||
|
await genReport(result, fileName, "pdf");
|
||||||
|
} catch (err) {
|
||||||
|
messageError($q, err);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchStatus();
|
await fetchStatus();
|
||||||
});
|
});
|
||||||
|
|
@ -331,18 +352,31 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<q-tooltip>ตรวจสอบข้อมูล</q-tooltip>
|
<q-tooltip>ตรวจสอบข้อมูล</q-tooltip>
|
||||||
</q-btn> -->
|
</q-btn> -->
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="status == 'payment'"
|
||||||
color="red"
|
color="red"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
icon="refresh"
|
icon="refresh"
|
||||||
class="bg-red-1"
|
class="bg-red-1"
|
||||||
@click="modalReverse"
|
@click="modalReverse"
|
||||||
v-if="status == 'payment'"
|
|
||||||
>
|
>
|
||||||
<q-tooltip>ย้อนกลับให้เจ้าหน้าที่ตรวจสอบ</q-tooltip>
|
<q-tooltip>ย้อนกลับให้เจ้าหน้าที่ตรวจสอบ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<!-- || status == 'checkSeat' -->
|
<!-- || status == 'checkSeat' -->
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
icon="download"
|
||||||
|
class="bg-green-1"
|
||||||
|
v-if="isShowExamInfo"
|
||||||
|
@click="downloadApplicationForm"
|
||||||
|
>
|
||||||
|
<q-tooltip>ดาวน์โหลดใบสมัคร</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-card class="q-pa-md">
|
<q-card class="q-pa-md">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue