สรรหาคัดเลือก - ลบวัน ย้ายปุ่ม icon เป็น list เปลี่ยน icon ถูกอีเมลเป็น icon อื่น
This commit is contained in:
parent
f4793732ed
commit
20b7fdf3cf
3 changed files with 185 additions and 235 deletions
|
|
@ -34,83 +34,9 @@
|
|||
<q-slide-transition>
|
||||
<q-card class="row col-12 q-mb-sm" v-show="visible">
|
||||
<div class="col-12 row">
|
||||
<div class="q-pa-md row col-12 no-wrap">
|
||||
<div class="q-py-md q-pl-md q-pr-sm row col-12 no-wrap">
|
||||
<!-- การ์ดแสดงจำนวนข้อมูล -->
|
||||
<div class="col-12 row">
|
||||
<div
|
||||
class="text-grey-7 q-pb-sm row text-weight-medium col-12 items-center"
|
||||
>
|
||||
<!-- สรุปจำนวนผู้สมัครคัดเลือก -->
|
||||
<datepicker
|
||||
v-model="dateFilter"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
label="วันที่"
|
||||
lazy-rules
|
||||
:model-value="dateThaiRange(dateFilter)"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<q-btn
|
||||
icon="mdi-download"
|
||||
round
|
||||
flat
|
||||
color="primary"
|
||||
@click="downloadFileDashboard"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดสรุปข้อมูลสมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
class="q-ml-sm"
|
||||
@click.stop.prevent="clickCandidateList()"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
class="q-ml-sm"
|
||||
@click.stop.prevent="clickPassExam()"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบคัดเลือกได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="row col-12 q-col-gutter-sm fit">
|
||||
<div
|
||||
|
|
@ -317,7 +243,6 @@ const status = ref<string>("all");
|
|||
const filter = ref<string>(""); //search data table
|
||||
const name = ref<string>("");
|
||||
const candidateId = ref<string>("");
|
||||
const dateFilter = ref<[Date, Date]>([new Date(), new Date()]); //วันที่เลือกค้นหา
|
||||
const statusPayment = ref<boolean>(false);
|
||||
const setSeat = ref<boolean>(false);
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -526,35 +451,6 @@ onMounted(async () => {
|
|||
await fetchDataCom();
|
||||
});
|
||||
|
||||
const clickPassExam = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.exportExamPassExamList(examId.value))
|
||||
.then((res) => {
|
||||
window.open(config.API.exportExamPassExamList(examId.value));
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const clickCandidateList = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.exportExamCandidateList(examId.value))
|
||||
.then((res) => {
|
||||
window.open(config.API.exportExamCandidateList(examId.value));
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const fetchDataCom = async () => {
|
||||
await fetchDataSummary();
|
||||
|
|
@ -644,47 +540,6 @@ const fetchDataSummary = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const downloadFileDashboard = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(
|
||||
config.API.periodExamDownloadDashboard(examId.value),
|
||||
{
|
||||
dateStart: dateToISO(dateFilter.value[0]),
|
||||
dateEnd: dateToISO(dateFilter.value[1]),
|
||||
responseType: "blob",
|
||||
},
|
||||
{
|
||||
responseType: "blob",
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
downloadFilePDF(
|
||||
data,
|
||||
`Candidate_Dashboard_${dateToISO(new Date())}.xlsx`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFilePDF = async (res: string, fileName: string) => {
|
||||
const link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(
|
||||
new Blob([res], {
|
||||
type: "application/vnd.ms-excel",
|
||||
})
|
||||
);
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* สรุปคะแนนสอบ
|
||||
*/
|
||||
|
|
@ -701,19 +556,6 @@ const viewDetail = (id: string, status: string) => {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
} else if (date2Thai(val[0]) === date2Thai(val[1])) {
|
||||
return `${date2Thai(val[0])}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0])} - ${date2Thai(val[1])} `;
|
||||
}
|
||||
};
|
||||
|
||||
const statusCandidate = (status: string) => {
|
||||
switch (status) {
|
||||
case "register":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue