diff --git a/src/api/recruiting/api.period-exam.ts b/src/api/recruiting/api.period-exam.ts index 0df5e58ed..bf777e193 100644 --- a/src/api/recruiting/api.period-exam.ts +++ b/src/api/recruiting/api.period-exam.ts @@ -96,4 +96,8 @@ export default { applicationFormPDF: (candidateId: string) => `${env.API_URI}/placement/candidate/pdf/${candidateId}`, + + downloadCandidateExam: (id: string) => + `${periodExam}download/candidate-exam/${id}`, + downloadPassExam: (id: string) => `${periodExam}download/pass-exam/${id}`, }; diff --git a/src/modules/03_recruiting/components/TableCandidate.vue b/src/modules/03_recruiting/components/TableCandidate.vue index 883d9257c..7a832784f 100644 --- a/src/modules/03_recruiting/components/TableCandidate.vue +++ b/src/modules/03_recruiting/components/TableCandidate.vue @@ -365,7 +365,7 @@ async function downloadFileDashboard() { async function clickPassExam() { showLoader(); await http - .get(config.API.exportExamPassExamList(examId.value)) + .get(config.API.downloadPassExam(examId.value)) .then(async (res) => { const data = res.data.result; data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; @@ -382,7 +382,7 @@ async function clickPassExam() { async function clickCandidateList() { showLoader(); await http - .get(config.API.exportExamCandidateList(examId.value)) + .get(config.API.downloadCandidateExam(examId.value)) .then(async (res) => { const data = res.data.result; data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; diff --git a/src/modules/09_leave/components/07_LeaveHistory/DialogForm.vue b/src/modules/09_leave/components/07_LeaveHistory/DialogForm.vue index 93be3fbb0..d235c8c65 100644 --- a/src/modules/09_leave/components/07_LeaveHistory/DialogForm.vue +++ b/src/modules/09_leave/components/07_LeaveHistory/DialogForm.vue @@ -10,6 +10,7 @@ import { useCounterMixin } from "@/stores/mixin"; import { useLeaveHistoryDataStore } from "@/modules/09_leave/stores/LeaveHistoryStore"; import { calculateFiscalYear } from "@/utils/function"; import { usePagination } from "@/composables/usePagination"; +import { checkPermission } from "@/utils/permissions"; import type { QTableColumn } from "quasar"; import type { DataOption } from "@/modules/09_leave/interface/index/Main"; @@ -104,20 +105,24 @@ async function onSubmit() { leaveTypeId: formData.leaveTypeId, leaveYear: formData.leaveYear, leaveDays: formData.leaveDays ? Number(formData.leaveDays) : 0, - leaveDaysUsed: formData.leaveDaysUsed - ? Number(formData.leaveDaysUsed) + leaveDaysUsed: + checkPermission(route)?.attrOwnership === "OWNER" + ? formData.leaveDaysUsed + ? Number(formData.leaveDaysUsed) + : 0 + : undefined, + leaveCount: + checkPermission(route)?.attrOwnership === "OWNER" + ? formData.leaveCount + ? Number(formData.leaveCount) + : 0 + : undefined, + beginningLeaveDays: formData.beginningLeaveDays + ? Number(formData.beginningLeaveDays) + : 0, + beginningLeaveCount: formData.beginningLeaveCount + ? Number(formData.beginningLeaveCount) : 0, - leaveCount: formData.leaveCount ? Number(formData.leaveCount) : 0, - beginningLeaveDays: !isStatusEdit.value - ? formData.leaveDaysUsed - ? Number(formData.leaveDaysUsed) - : 0 - : undefined, - beginningLeaveCount: !isStatusEdit.value - ? formData.leaveCount - ? Number(formData.leaveCount) - : 0 - : undefined, }) .then(async () => { @@ -470,30 +475,8 @@ watch(modal, async (val) => { :rules="[(val: string) => !val || /^\d+(\.\d*)?$/.test(val) || 'กรุณากรอกเฉพาะตัวเลข']" /> -
- -
-
- -
- + + +
+ +
+
+ +