ปิด/เปิด ให้ดาวน์โหลดใบสมัครสรรหา

This commit is contained in:
Warunee Tamkoo 2025-11-26 17:39:18 +07:00
parent 5aa48d73d3
commit 55ab6e157f
2 changed files with 26 additions and 10 deletions

View file

@ -11,13 +11,11 @@ import config from "@/app.config";
import { useQuasar } from "quasar";
const route = useRoute();
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const { dateToISO, success, modalError, dialogMessage } = mixin;
const detailReport = ref<any>();
const attrs = ref<any>(useAttrs());
const table = ref<any>(null);
const files = ref<File[]>([]);
@ -104,6 +102,10 @@ const props = defineProps({
type: Boolean,
defualt: false,
},
isShowExaminfo: {
type: Boolean,
required: false,
},
save: {
type: Function,
default: () => console.log("not function"),
@ -395,23 +397,30 @@ async function clickCandidateList() {
}
async function onCheckShowExaminfo() {
console.log(props.isShowExaminfo);
dialogMessage(
$q,
"ยืนยันการเปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบนี้หรือไม่?",
"ยืนยันการเปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบ",
"mdi-email-check-outline",
`ยืนยันการ${props.isShowExaminfo ? "ปิด" : "เปิด"}`,
`${
props.isShowExaminfo ? "ปิดไม่" : "เปิด"
}ใหดาวนโหลดใบสมคร แสดงสถานทสอบ และเลขประจำตวสอบหรอไม?`,
props.isShowExaminfo ? "mdi-eye-off" : "mdi-eye-check",
"ยืนยัน",
"public",
props.isShowExaminfo ? "red" : "public",
async () => {
try {
showLoader();
await http.post(config.API.checkShowExaminfo, {
examId: examId.value,
status: !props.isShowExaminfo,
});
await props.fetchData();
success(
$q,
"เปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบสำเร็จ"
`${
props.isShowExaminfo ? "เปิด" : "ปิดไม่"
}ใหดาวนโหลดใบสมคร แสดงสถานทสอบ และเลขประจำตวสอบสำเร`
);
} catch (error) {
messageError($q, error);
@ -529,14 +538,15 @@ watch(
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
size="md"
icon="mdi-eye-check"
:icon="isShowExaminfo ? 'mdi-eye-off' : 'mdi-eye-check'"
round
flat
color="info"
:color="isShowExaminfo ? 'red' : 'info'"
@click="onCheckShowExaminfo"
>
<q-tooltip
>เปดใหดาวนโหลดใบสมคร แสดงสถานทสอบ และเลขประจำตวสอบ</q-tooltip
>{{ isShowExaminfo ? "ปิดไม่" : "เปิด" }}ใหดาวนโหลดใบสมคร
แสดงสถานทสอบ และเลขประจำตวสอบ</q-tooltip
>
</q-btn>
</div>