โหลดไฟล์
This commit is contained in:
parent
91502f6d8b
commit
3f0b3924d4
3 changed files with 62 additions and 10 deletions
|
|
@ -23,7 +23,14 @@ import HistoryTable from "@/components/TableHistory.vue";
|
|||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateText, showLoader, hideLoader, messageError,onSearchDataTable } = mixin;
|
||||
const {
|
||||
success,
|
||||
dateText,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
onSearchDataTable,
|
||||
} = mixin;
|
||||
|
||||
const router = useRouter();
|
||||
const name = ref<string>("");
|
||||
|
|
@ -359,14 +366,12 @@ async function clickClose() {
|
|||
async function clickCloseScore() {
|
||||
modalScore.value = false;
|
||||
files_score.value = null;
|
||||
await fetchData();
|
||||
}
|
||||
|
||||
/** ปิด dialog เลือกไฟล์ผู้สมัครสอบแข่งขัน */
|
||||
async function clickCloseCandidate() {
|
||||
modalCandidate.value = false;
|
||||
files_candidate.value = null
|
||||
await fetchData();
|
||||
files_candidate.value = null;
|
||||
}
|
||||
|
||||
/** บันทึกข้อมูล เลือกไฟล์ผู้สมัครสอบแข่งขัน */
|
||||
|
|
@ -379,7 +384,7 @@ async function checkSaveCandidate() {
|
|||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ");
|
||||
modalCandidate.value = false;
|
||||
files_candidate.value = null
|
||||
files_candidate.value = null;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
|
|
@ -444,6 +449,9 @@ function onSearch() {
|
|||
);
|
||||
}
|
||||
|
||||
function onTemplate(name: string) {
|
||||
window.open(`/File/${name}.xlsx`, "_blank");
|
||||
}
|
||||
/** ดึงข้อมูล เมื่อโหลดหน้า component */
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
|
|
@ -772,7 +780,31 @@ onMounted(async () => {
|
|||
<q-dialog v-model="modalScore" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleScore" :close="clickCloseScore" />
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold"
|
||||
>{{ textTittleScore }}
|
||||
<q-btn
|
||||
icon="mdi-download"
|
||||
unelevated
|
||||
round
|
||||
color="blue"
|
||||
flat
|
||||
dense
|
||||
@click="onTemplate('สรรหาสอบแข่งขัน_จำนวนที่บันทึกผลสอบ')"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์ต้นแบบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="clickCloseScore"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
|
|
@ -812,10 +844,30 @@ onMounted(async () => {
|
|||
<q-dialog v-model="modalCandidate" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader
|
||||
:tittle="textTittleCandidate"
|
||||
:close="clickCloseCandidate"
|
||||
/>
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold"
|
||||
>{{ textTittleCandidate }}
|
||||
<q-btn
|
||||
icon="mdi-download"
|
||||
unelevated
|
||||
round
|
||||
color="blue"
|
||||
flat
|
||||
dense
|
||||
@click="onTemplate('สรรหาสอบแข่งขัน_จำนวนผู้สอบทั้งหมด')"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์ต้นแบบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="clickCloseCandidate"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue