clone code
This commit is contained in:
parent
c9597d1e38
commit
d57bcd1719
362 changed files with 104804 additions and 0 deletions
421
src/modules/03_recruiting/views/01_compete/Detail.vue
Normal file
421
src/modules/03_recruiting/views/01_compete/Detail.vue
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายชื่อผู้สมัครสอบรอบ {{ name }} ครั้งที่ {{ round }}/{{ year }}
|
||||
<q-space />
|
||||
<q-btn class="bg-teal-1" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadExam()">
|
||||
<q-item-section class="text-blue">ส่งออกข้อมูลผู้มีสิทธิ์สอบ</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassExam()">
|
||||
<q-item-section class="text-primary"
|
||||
>ส่งออกข้อมูลผู้สอบผ่านภาค ก.</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassResultExam()">
|
||||
<q-item-section class="text-amber-9"
|
||||
>ส่งออกข้อมูลผู้สอบแข่งขันได้</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pt-sm q-pa-md">
|
||||
<div class="col-12">
|
||||
<Table
|
||||
:count="count"
|
||||
:pass="pass"
|
||||
:notpass="notpass"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:nornmalData="false"
|
||||
:conclude="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.examID)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
<div class="row col-12 items-center">
|
||||
<img
|
||||
:src="props.row.avatar"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.fullname }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.citizenId }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c1'">
|
||||
<q-checkbox disable v-model="props.row.c1" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c2'">
|
||||
<q-checkbox disable v-model="props.row.c2" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c3'">
|
||||
<q-checkbox disable v-model="props.row.c3" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c4'">
|
||||
<q-checkbox disable v-model="props.row.c4" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c5'">
|
||||
<q-checkbox disable v-model="props.row.c5" />
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const year = ref<string>("");
|
||||
const round = ref<string>("");
|
||||
const name = ref<string>("");
|
||||
const count = ref<number>(0);
|
||||
const pass = ref<number>(0);
|
||||
const notpass = ref<number>(0);
|
||||
const rows = ref<any>([]);
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"examID",
|
||||
"profileID",
|
||||
"fullName",
|
||||
"dateOfBirth",
|
||||
"gender",
|
||||
"position_name",
|
||||
"university",
|
||||
"degree",
|
||||
"major",
|
||||
"certificateIssueDate",
|
||||
"certificateNo",
|
||||
"examAttribute",
|
||||
"examScore",
|
||||
"examResult",
|
||||
"applyDate",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "examID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวสอบ",
|
||||
sortable: true,
|
||||
field: "examID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "profileID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "profileID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "personName",
|
||||
headerStyle: "font-size: 14px; min-width: 250px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปีเกิด",
|
||||
sortable: true,
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "gender",
|
||||
align: "left",
|
||||
label: "เพศ",
|
||||
sortable: true,
|
||||
field: "gender",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position_name",
|
||||
align: "left",
|
||||
label: "ตำแหน่งที่สมัคร",
|
||||
sortable: true,
|
||||
field: "position_name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "university",
|
||||
align: "left",
|
||||
label: "สถานศึกษา",
|
||||
sortable: true,
|
||||
field: "university",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "degree",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษา",
|
||||
sortable: true,
|
||||
field: "degree",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "major",
|
||||
align: "left",
|
||||
label: "สาขาวิชาเอก",
|
||||
sortable: true,
|
||||
field: "major",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateNo",
|
||||
align: "left",
|
||||
label: "เลขที่ใบประกอบวิชาชีพ",
|
||||
sortable: true,
|
||||
field: "certificateNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateIssueDate",
|
||||
align: "left",
|
||||
label: "วันที่ได้รับใบประกอบวิชาชีพฯ",
|
||||
sortable: true,
|
||||
field: "certificateIssueDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examAttribute",
|
||||
align: "left",
|
||||
label: "สถานะการคัดกรองคุณสมบัติ",
|
||||
sortable: true,
|
||||
field: "examAttribute",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examScore",
|
||||
align: "right",
|
||||
label: "คะแนนรวม",
|
||||
sortable: true,
|
||||
field: "examScore",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examResult",
|
||||
align: "left",
|
||||
label: "ผลการสอบ",
|
||||
sortable: true,
|
||||
field: "examResult",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "applyDate",
|
||||
align: "left",
|
||||
label: "วันที่สมัครสอบ",
|
||||
sortable: true,
|
||||
field: "applyDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const clickDetail = (examID: string) => {
|
||||
router.push(`/compete/import/${importId.value}/${examID}`);
|
||||
};
|
||||
|
||||
const downloadExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อผู้มีสิทธิ์สอบ.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportPassExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อสอบผ่านภาค_ก.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassResultExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportPassResultExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อสอบแข่งขันได้.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.getExamResultById(importId.value), {
|
||||
examAttribute: "",
|
||||
examResult: "",
|
||||
})
|
||||
.then((res) => {
|
||||
var header = res.data.result.header;
|
||||
count.value = header.count;
|
||||
pass.value = header.pass;
|
||||
notpass.value = header.notpass;
|
||||
const data = res.data.result.data;
|
||||
let result: RecruitDetailResponse[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: RecruitDetailResponse) => {
|
||||
r.personName = `${r.prefix}${r.fullName}`;
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
rows.value = result;
|
||||
name.value = result[0].exam_name as string;
|
||||
round.value = result[0].exam_order as string;
|
||||
year.value = result[0].score_year as string;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
340
src/modules/03_recruiting/views/01_compete/DetailEx.vue
Normal file
340
src/modules/03_recruiting/views/01_compete/DetailEx.vue
Normal file
|
|
@ -0,0 +1,340 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดของผู้สมัครสอบ {{ examID }} : {{ prefix }}{{ fullname }}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-md col-12">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card bordered flat class="col-12 q-pa-md">
|
||||
<div class="col-12 q-col-gutter-sm row items-center">
|
||||
<div class="col-12 text-weight-bold">ข้อมูลทั่วไป</div>
|
||||
<div class="col-6 text-grey-7" v-if="profile_id !== null">
|
||||
เลขประจำตัวประชาชน
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="profile_id !== null">
|
||||
{{ profile_id }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="prefix !== null">คำนำหน้านาม</div>
|
||||
<div class="col-6 text-black" v-if="prefix !== null">
|
||||
{{ prefix }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="fullname !== null">ชื่อ-นามสกุล</div>
|
||||
<div class="col-6 text-black" v-if="fullname !== null">
|
||||
{{ fullname }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="birthdate !== null">
|
||||
วัน/เดือน/ปี เกิด
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="birthdate !== null">
|
||||
{{ birthdate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="gender !== null">เพศ</div>
|
||||
<div class="col-6 text-black" v-if="gender !== null">
|
||||
{{ gender }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="position_name !== null">
|
||||
ตำแหน่งที่สมัคร
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="position_name !== null">
|
||||
{{ position_name }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="university !== null">สถานศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="university !== null">
|
||||
{{ university }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="degree !== null">วุฒิการศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="degree !== null">
|
||||
{{ degree }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">สาขาวิชาเอก</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ major }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">
|
||||
จำนวนครั้งที่สมัครสอบ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ examCount }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="cert_issuedate !== null">
|
||||
ใบอนุญาตประกอบวิชาชีพ วัน เดือน ปีที่ได้รับ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="cert_issuedate !== null">
|
||||
{{ cert_issuedate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="examAttribute !== null">
|
||||
สถานะการคัดกรองคุณสมบัติ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="examAttribute !== null">
|
||||
{{ examAttribute }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="col-xs-12 col-sm-12 col-md-6 q-px-md q-py-sm full-height"
|
||||
>
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<div class="col-12 text-weight-bold row items-center">
|
||||
ผลการสอบ
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
v-if="examResultinscore === 'ผ่าน'"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadScore()">
|
||||
<q-item-section class="text-primary"
|
||||
>ดาวน์โหลดผลคะแนน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadCertificate()">
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดเอกสารรับรอง</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
@click="downloadScore()"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดผลคะแนน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row items-center q-gutter-y-sm col-12">
|
||||
<div class="col-xs-4 col-sm-5 text-weight-medium text-grey-7">ประเภท</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">คะแนนเต็ม</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
|
||||
คะแนนที่ได้
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 text-primary text-weight-bold"></div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ก</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreAFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreA }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ข</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreBFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreB }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ค</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreCFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreC }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">รวมทั้งหมด</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSumFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSum }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||
<span
|
||||
:class="examResultinscore != 'ผ่าน' ? 'text-red' : 'text-positive'"
|
||||
>{{ examResultinscore }}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">ลำดับที่สอบได้</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ number }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">วันหมดอายุบัญชีสอบแข่งขัน</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ score_expired }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { loaderPage } = dataStore;
|
||||
const profile_id = ref<string>("");
|
||||
const birthdate = ref<string>("");
|
||||
const gender = ref<string>("");
|
||||
const university = ref<string>("");
|
||||
const position_name = ref<string>("");
|
||||
const degree = ref<string>("");
|
||||
const major = ref<string>("");
|
||||
const cert_issuedate = ref<string>("");
|
||||
const examAttribute = ref<string>("");
|
||||
const examResultinscore = ref<string>("");
|
||||
const scoreAFull = ref<string>("");
|
||||
const scoreA = ref<string>("");
|
||||
const scoreBFull = ref<string>("");
|
||||
const scoreB = ref<string>("");
|
||||
const scoreCFull = ref<string>("");
|
||||
const scoreC = ref<string>("");
|
||||
const scoreSumFull = ref<string>("");
|
||||
const scoreSum = ref<string>("");
|
||||
const examCount = ref<string>("");
|
||||
const number = ref<string>("");
|
||||
const score_expired = ref<string>("");
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const examID = ref<string>("62150001");
|
||||
const prefix = ref<string>("นาย");
|
||||
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const examId = ref<string>(route.params.examId as string); // เลขประจำตัวสอบ
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getExamDetail(importId.value, examId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
|
||||
profile_id.value = data.profileID;
|
||||
examID.value = data.examID;
|
||||
prefix.value = data.prefix;
|
||||
fullname.value = data.fullName;
|
||||
birthdate.value = data.dateOfBirth;
|
||||
gender.value = data.gender;
|
||||
degree.value = data.degree;
|
||||
major.value = data.major;
|
||||
university.value = data.university;
|
||||
position_name.value = data.positionName;
|
||||
cert_issuedate.value = data.certificateIssueDate;
|
||||
examAttribute.value = data.examAttribute;
|
||||
number.value = data.number;
|
||||
examCount.value = data.examCount;
|
||||
score_expired.value = data.scoreExpire;
|
||||
if (data.scoreResult != null) {
|
||||
scoreAFull.value = data.scoreResult.scoreAFull;
|
||||
scoreA.value = data.scoreResult.scoreA;
|
||||
scoreBFull.value = data.scoreResult.scoreBFull;
|
||||
scoreB.value = data.scoreResult.scoreB;
|
||||
scoreCFull.value = data.scoreResult.scoreCFull;
|
||||
scoreC.value = data.scoreResult.scoreC;
|
||||
scoreSumFull.value = data.scoreResult.scoreSumFull;
|
||||
scoreSum.value = data.scoreResult.scoreSum;
|
||||
examResultinscore.value = data.scoreResult.examResult;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadScore = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadScoreReport(importId.value, examId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `ผลคะแนน_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadCertificate = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadExamReport(importId.value, examId.value, 2), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `เอกสารรับรอง_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
213
src/modules/03_recruiting/views/01_compete/ImportData.vue
Normal file
213
src/modules/03_recruiting/views/01_compete/ImportData.vue
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
<!-- page:main page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการนำเข้าข้อมูลผู้สมัครสอบแข่งขัน
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:nornmalData="false"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'" @click="clickEdit(props.row.year)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'name'"
|
||||
class="table_ellipsis2"
|
||||
@click="clickEdit(props.row.year)"
|
||||
>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'file'">
|
||||
<q-btn
|
||||
size="13px"
|
||||
flat
|
||||
class="bg-blue-1 q-ml-xs"
|
||||
color="blue"
|
||||
v-if="col.value == null || file == false"
|
||||
>
|
||||
<q-icon
|
||||
name="mdi-file-excel-outline"
|
||||
size="20px"
|
||||
class="q-mr-sm"
|
||||
/>
|
||||
นำเข้าไฟล์
|
||||
<q-tooltip>นำเข้าไฟล์ excel</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
<q-chip
|
||||
removable
|
||||
color="grey-2"
|
||||
text-color="grey-9"
|
||||
:label="col.value"
|
||||
size="14px"
|
||||
square
|
||||
icon-remove="mdi-close"
|
||||
v-model="file"
|
||||
@remove="remove"
|
||||
>
|
||||
<q-tooltip>{{ col.value }}</q-tooltip>
|
||||
</q-chip>
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
dense
|
||||
color="positive"
|
||||
icon="mdi-content-save-settings-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกคะแนนสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else @click="clickEdit(props.row.year)">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const file = ref<boolean>(true);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"year",
|
||||
"name",
|
||||
"startDate",
|
||||
"endDate",
|
||||
"file",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อระยะเวลาการสอบแข่งขัน",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "doc",
|
||||
align: "left",
|
||||
label: "เอกสารประกอบ",
|
||||
sortable: true,
|
||||
field: "doc",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "startDate",
|
||||
align: "left",
|
||||
label: "วันที่เริ่มต้น",
|
||||
sortable: true,
|
||||
field: "startDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "endDate",
|
||||
align: "left",
|
||||
label: "วันที่สิ้นสุด",
|
||||
sortable: true,
|
||||
field: "endDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "file",
|
||||
align: "left",
|
||||
label: "เอกสารข้อมูลผู้สอบ",
|
||||
sortable: true,
|
||||
field: "file",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
const rows = ref<any>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = () => {};
|
||||
|
||||
const clickEdit = (id: string) => {
|
||||
router.push(`/compete/import/${id}`);
|
||||
};
|
||||
|
||||
const remove = () => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบเอกสารข้อมูล",
|
||||
message: "ต้องการลบเอกสารนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(() => {
|
||||
file.value = false;
|
||||
})
|
||||
.onCancel(() => {
|
||||
file.value = true;
|
||||
})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
767
src/modules/03_recruiting/views/01_compete/Period.vue
Normal file
767
src/modules/03_recruiting/views/01_compete/Period.vue
Normal file
|
|
@ -0,0 +1,767 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการข้อมูลผู้สมัครสอบแข่งขัน
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.id)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'name'" class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'year'" class="table_ellipsis2">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
v-if="col.value == null"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<!-- นำเข้าไฟล์ผลการสอบ -->
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickPassExam(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'examCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
color="green"
|
||||
round
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
v-if="col.value == null || col.value == '0'"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickCandidateList(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="clickEditPeriod(props.row.id)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
icon="mdi-history"
|
||||
@click="clickHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>แสดงประวัติการทำงาน</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<HistoryTable
|
||||
:rows="rowsHistory"
|
||||
:columns="columnsHistory"
|
||||
:visible-columns="visibleColumnsHistory"
|
||||
v-model:modal="modalHistory"
|
||||
v-model:inputvisible="visibleColumnsHistory"
|
||||
v-model:tittle="tittleHistory"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'isActive'" class="">
|
||||
<q-icon
|
||||
v-if="col.value == false"
|
||||
name="mdi-close"
|
||||
color="red"
|
||||
class="text-h5"
|
||||
/>
|
||||
<q-icon v-else name="mdi-check" color="positive" class="text-h5" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'" class="">
|
||||
{{ textDate(col.value) }}
|
||||
</div>
|
||||
|
||||
<div v-else class="">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</HistoryTable>
|
||||
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="textTittle" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อการสอบแข่งขัน"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="order"
|
||||
label="ครั้งที่"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="year"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files"
|
||||
dense
|
||||
label="เลือกไฟล์รายชื่อผู้สมัครสอบแข่งขัน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalScore" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleScore" :close="clickCloseScore" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_score"
|
||||
dense
|
||||
label="เลือกไฟล์ผลการสอบแข่งขัน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveScore"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalCandidate" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleCandidate" :close="clickCloseCandidate" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_candidate"
|
||||
dense
|
||||
label="เลือกไฟล์ผู้สมัครสอบแข่งขัน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveCandidate"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type {
|
||||
ResponseRecruitPeriod,
|
||||
ResponseHistoryObject,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import HistoryTable from "@/components/TableHistory.vue";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const name = ref<string>("");
|
||||
const year = ref<number>(new Date().getFullYear() + 543);
|
||||
const order = ref<number>(1);
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateToISO, dateText } = mixin;
|
||||
const files = ref<any>(null);
|
||||
const files_score = ref<any>(null);
|
||||
const files_candidate = ref<any>(null);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const modalScore = ref<boolean>(false);
|
||||
const modalCandidate = ref<boolean>(false);
|
||||
const selected_row_id = ref<string>("");
|
||||
const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history
|
||||
const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); //
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const modalError = ref<boolean>(false); // modal สำหรับแจ้งเตือนerror
|
||||
const modalErrorTittle = ref<string>(""); // tittle modal error
|
||||
const modalErrorDetail = ref<string>(""); // detail modal error
|
||||
const statusCode = ref<number>();
|
||||
const filter = ref<string>(""); //search data table
|
||||
const textTittle = ref<string>("");
|
||||
const { messageError } = mixin;
|
||||
const textTittleScore = ref<string>("");
|
||||
const textTittleCandidate = ref<string>("");
|
||||
const rows = ref<any>([]);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"name",
|
||||
"order",
|
||||
"year",
|
||||
"examCount",
|
||||
"scoreCount",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "รอบการสอบแข่งขัน",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "order",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "order",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "examCount",
|
||||
label: "จำนวนผู้สอบทั้งหมด",
|
||||
align: "right",
|
||||
field: "examCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "scoreCount",
|
||||
label: "จำนวนที่บันทึกผลสอบ",
|
||||
align: "right",
|
||||
field: "scoreCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const columnsHistory = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "description",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
sortable: true,
|
||||
field: "description",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "center",
|
||||
label: "วันที่ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "createdFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "createdFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const visibleColumnsHistory = ref<String[]>([
|
||||
"description",
|
||||
"createdAt",
|
||||
"createdFullName",
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลง date เป็นภาษาไทย
|
||||
* @param value วันที่ type datetime ที่จะแปลงเป็นไทย
|
||||
*/
|
||||
const textDate = (value: Date) => {
|
||||
return dateText(value);
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getCandidates)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let result: ResponseRecruitPeriod[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: ResponseRecruitPeriod) => {
|
||||
if (r.score != null) {
|
||||
r.scoreCount = r.score.scoreCount;
|
||||
r.scoreImportDate = r.score.importDate;
|
||||
}
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickPassExam = (id: string) => {
|
||||
window.open(config.API.exportPassExamList(id));
|
||||
};
|
||||
|
||||
const clickCandidateList = (id: string) => {
|
||||
window.open(config.API.exportCandidateList(id));
|
||||
};
|
||||
|
||||
const clickDetail = (id: string) => {
|
||||
router.push(`/compete/import/${id}`);
|
||||
};
|
||||
|
||||
const clickEdit = async (id: string) => {
|
||||
modalScore.value = true;
|
||||
textTittleScore.value = "นำเข้าผลการสอบแข่งขัน";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickUpload = async (id: string) => {
|
||||
modalCandidate.value = true;
|
||||
textTittleCandidate.value = "นำเข้าผู้สมัครสอบแข่งขัน";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickEditPeriod = (id: string) => {
|
||||
router.push(`/compete/period/${id}`);
|
||||
};
|
||||
|
||||
const clickHistory = async (id: string) => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getImportHistory(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
if (data.length > 0) {
|
||||
data.map((i: ResponseHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
createdAt: i.createdAt,
|
||||
createdFullName: i.createdFullName,
|
||||
createdUserId: i.createdUserId,
|
||||
id: i.id,
|
||||
isActive: i.isActive,
|
||||
lastUpdateFullName: i.lastUpdateFullName,
|
||||
lastUpdateUserId: i.lastUpdateUserId,
|
||||
lastUpdatedAt: i.lastUpdatedAt,
|
||||
description: i.description,
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
modalError.value = true;
|
||||
modalErrorTittle.value = "ไม่พบประวัติการเผยแพร่";
|
||||
modalErrorDetail.value = e.response.data.message;
|
||||
statusCode.value = e.response.data.status;
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.deleteCandidates(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลการสอบสำเร็จ");
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "competePeriodAdd" });
|
||||
};
|
||||
|
||||
const clickClose = async () => {
|
||||
modalAdd.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseScore = async () => {
|
||||
modalScore.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseCandidate = async () => {
|
||||
modalCandidate.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const checkSaveCandidate = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_candidate.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.uploadCandidates(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ");
|
||||
modalCandidate.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSaveScore = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_score.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveScores(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผลการสอบสำเร็จ");
|
||||
modalScore.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files.value[0]);
|
||||
fd.append("year", year.value.toString());
|
||||
fd.append("order", order.value.toString());
|
||||
fd.append("name", name.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveCandidates, fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบแข่งขันสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
987
src/modules/03_recruiting/views/01_compete/PeriodAdd.vue
Normal file
987
src/modules/03_recruiting/views/01_compete/PeriodAdd.vue
Normal file
|
|
@ -0,0 +1,987 @@
|
|||
<!-- page:จัดการรอบการสอบแข่งขัน สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="clickBack"
|
||||
/>
|
||||
{{ edit ? "แก้ไขข้อมูลการสอบแข่งขัน" : "เพิ่มข้อมูลการสอบแข่งขัน" }}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-form ref="myForm">
|
||||
<q-card-section class="q-pa-md">
|
||||
<div class="col-xs-12 col-sm-8"></div>
|
||||
<div class="col-12 row items-center q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อรอบการสอบแข่งขัน/ชื่อประกาศ"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกชื่อรอบการสอบแข่งขัน/ชื่อประกาศ'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="round"
|
||||
type="number"
|
||||
label="รอบการสอบ(ครั้ง)"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearly"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="updateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
:model-value="yearly + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="fee"
|
||||
type="number"
|
||||
label="ค่าธรรมเนียม"
|
||||
dense
|
||||
lazy-rules
|
||||
input-class="text-right"
|
||||
:rules="[(val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateExam"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateExam)"
|
||||
:label="`${'วันที่สอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnouncement"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
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
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateAnnouncement)"
|
||||
:label="`${'วันที่ประกาศ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
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
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateRegister)"
|
||||
:label="`${'วันที่สมัคร'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="datePayment"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
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
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(datePayment)"
|
||||
:label="`${'วันที่ชำระเงิน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnounce"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateAnnounce)"
|
||||
:label="`${'วันประกาศผลสอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" />
|
||||
</div>
|
||||
|
||||
<div class="row col-12 items-top q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">รูปภาพประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
accept=".jpg,.png,.pdf,.csv,.doc"
|
||||
bordered
|
||||
label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadImg"
|
||||
@removed="fileRemoveImg"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div class="row no-wrap items-center q-pa-sm q-gutter-xs text-white">
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileImgs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item v-for="file in fileImgs" :key="file.id" class="q-my-xs">
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteImgData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">เอกสารประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
accept=".jpg,.png,.pdf,.csv,.doc"
|
||||
bordered
|
||||
label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadDoc"
|
||||
@removed="fileRemoveDoc"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div class="row no-wrap items-center q-pa-sm q-gutter-xs text-white">
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileDocs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item v-for="file in fileDocs" :key="file.id" class="q-my-xs">
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteDocData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" class="q-my-lg" />
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm q-pt-md">รายละเอียด</div>
|
||||
<q-editor
|
||||
v-model="editor"
|
||||
:dense="$q.screen.lt.md"
|
||||
toolbar-text-color="blue-grey-10"
|
||||
toolbar-bg="blue-grey-2"
|
||||
toolbar-toggle-color="blue-grey-8"
|
||||
class="editor"
|
||||
:toolbar="[
|
||||
['left', 'center', 'right', 'justify'],
|
||||
['bold', 'italic', 'strike', 'underline', 'subscript', 'superscript'],
|
||||
['token', 'hr', 'link', 'custom_btn'],
|
||||
['print', 'fullscreen'],
|
||||
[
|
||||
{
|
||||
label: $q.lang.editor.formatting,
|
||||
icon: $q.iconSet.editor.formatting,
|
||||
list: 'no-icons',
|
||||
options: ['p', 'h1', 'h2', 'h3'],
|
||||
},
|
||||
{
|
||||
label: $q.lang.editor.defaultFont,
|
||||
icon: $q.iconSet.editor.font,
|
||||
fixedIcon: true,
|
||||
list: 'no-icons',
|
||||
options: [
|
||||
'default_font',
|
||||
'arial',
|
||||
'arial_black',
|
||||
'comic_sans',
|
||||
'courier_new',
|
||||
'impact',
|
||||
'lucida_grande',
|
||||
'times_new_roman',
|
||||
'verdana',
|
||||
],
|
||||
},
|
||||
'removeFormat',
|
||||
],
|
||||
['undo', 'redo'],
|
||||
['viewsource'],
|
||||
]"
|
||||
:fonts="{
|
||||
arial: 'Arial',
|
||||
arial_black: 'Arial Black',
|
||||
comic_sans: 'Comic Sans MS',
|
||||
courier_new: 'Courier New',
|
||||
impact: 'Impact',
|
||||
lucida_grande: 'Lucida Grande',
|
||||
times_new_roman: 'Times New Roman',
|
||||
verdana: 'Verdana',
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-mt-md">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>{{ edit ? "แก้ไขข้อมูล" : "บันทึกข้อมูล" }}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, notifyError } = mixin;
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const name = ref<string>("");
|
||||
const note = ref<string>("");
|
||||
const editor = ref<string>("");
|
||||
const announcementExam = ref<boolean>(true);
|
||||
const fee = ref<number>(0);
|
||||
const round = ref<number>(1);
|
||||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const dateRegister = ref<[Date, Date]>([new Date(), new Date()]); //วันที่สมัคร
|
||||
const datePayment = ref<[Date, Date]>([new Date(), new Date()]); //วันที่จ่ายเงิน
|
||||
const dateAnnouncement = ref<[Date, Date]>([new Date(), new Date()]); //วันที่ประกาศ
|
||||
const dateExam = ref<Date>(new Date()); //วันที่สอบ
|
||||
const dateAnnounce = ref<Date>(new Date()); //วันที่ประกาศผล
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption[]>([]);
|
||||
const { messageError } = mixin;
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileDocs = ref<UploadType[]>([]);
|
||||
const fileImgDataUpload = ref<File[]>([]);
|
||||
const fileImgs = ref<UploadType[]>([]);
|
||||
const id = ref<string>("");
|
||||
const pay = ref<string>("");
|
||||
const edit = ref<boolean>(false);
|
||||
const columnsPayment = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "accountNumber",
|
||||
align: "left",
|
||||
label: "เลขบัญชี",
|
||||
sortable: true,
|
||||
field: "accountNumber",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "bankName",
|
||||
align: "left",
|
||||
label: "ธนาคาร",
|
||||
sortable: true,
|
||||
field: "bankName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "accountName",
|
||||
align: "left",
|
||||
label: "ชื่อบัญชี",
|
||||
sortable: true,
|
||||
field: "accountName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const visibleColumnsPosition = ref<String[]>(["position", "type"]);
|
||||
const columnsPosition = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
align: "left",
|
||||
label: "ประเภทแบบฟอร์ม",
|
||||
sortable: true,
|
||||
field: "type",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
watch(organizationShortName, (count: DataOption, prevCount: DataOption) => {
|
||||
organizationNameOptions.value = [];
|
||||
});
|
||||
|
||||
watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
||||
positionPathOptions.value = [];
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
if (route.params.id != undefined) {
|
||||
edit.value = true;
|
||||
id.value = route.params.id.toString();
|
||||
await fetchData();
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
const clickBack = () => {
|
||||
router.push({ name: "competePeriod" });
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getPeriodById(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result.periods;
|
||||
const images = res.data.result.images;
|
||||
const files = res.data.result.files;
|
||||
|
||||
id.value = data.id;
|
||||
name.value = data.name;
|
||||
round.value = data.order;
|
||||
yearly.value = data.year;
|
||||
fee.value = data.fee;
|
||||
dateAnnouncement.value = [
|
||||
new Date(data.announcementStartDate),
|
||||
new Date(data.announcementEndDate),
|
||||
];
|
||||
dateExam.value = new Date(data.examDate);
|
||||
dateRegister.value = [
|
||||
new Date(data.registerStartDate),
|
||||
new Date(data.registerEndDate),
|
||||
];
|
||||
datePayment.value = [
|
||||
new Date(data.paymentStartDate),
|
||||
new Date(data.paymentEndDate),
|
||||
];
|
||||
editor.value = data.detail;
|
||||
note.value = data.note;
|
||||
dateAnnounce.value = new Date(data.announcementDate);
|
||||
|
||||
fileDocs.value = files;
|
||||
fileImgs.value = images;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileDocDataUpload.value.findIndex((x: any) => x.__key == file.__key);
|
||||
if (index > -1) {
|
||||
fileDocDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const uploadDocData = async () => {
|
||||
const formData = new FormData();
|
||||
if (fileDocDataUpload.value.length > 0) {
|
||||
fileDocDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodRecruitDoc(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
clickBack();
|
||||
});
|
||||
} else {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
clickBack();
|
||||
}
|
||||
};
|
||||
|
||||
const uploadImgData = async () => {
|
||||
if (fileImgDataUpload.value.length > 0) {
|
||||
const formData = new FormData();
|
||||
fileImgDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodRecruitImg(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fileUploadImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileImgDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileImgDataUpload.value.findIndex((x: any) => x.__key == file.__key);
|
||||
if (index > -1) {
|
||||
fileImgDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const downloadData = async (path: string) => {
|
||||
window.open(path);
|
||||
};
|
||||
|
||||
const updateYear = async (e: number) => {
|
||||
yearly.value = e;
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (success) => {
|
||||
if (success) {
|
||||
if (edit.value) {
|
||||
await editData(id.value);
|
||||
} else {
|
||||
await addData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const sendData = () => {
|
||||
const valueData: RequestPeriodCompete = {
|
||||
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
|
||||
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
|
||||
examDate: dateToISO(dateExam.value),
|
||||
detail: editor.value,
|
||||
fee: fee.value,
|
||||
id: "",
|
||||
name: name.value,
|
||||
note: note.value,
|
||||
paymentEndDate: dateToISO(datePayment.value[1]),
|
||||
paymentStartDate: dateToISO(datePayment.value[0]),
|
||||
registerEndDate: dateToISO(dateRegister.value[1]),
|
||||
registerStartDate: dateToISO(dateRegister.value[0]),
|
||||
order: round.value,
|
||||
year: yearly.value,
|
||||
announcementDate: dateToISO(dateAnnounce.value),
|
||||
};
|
||||
return valueData;
|
||||
};
|
||||
|
||||
const deleteDocData = async (docId: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodDeleteDoc(docId))
|
||||
.then(async () => {
|
||||
await fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const deleteImgData = async (docId: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodDeleteImg(docId))
|
||||
.then(async () => {
|
||||
await fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.savePeriod, sendData())
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data.id;
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const editData = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.editPeriod(id), sendData())
|
||||
.then(async () => {
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
24
src/modules/03_recruiting/views/01_compete/PeriodStat.vue
Normal file
24
src/modules/03_recruiting/views/01_compete/PeriodStat.vue
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
ข้อมูลสถิติการสมัครสอบแข่งขัน
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-px-md q-py-sm">
|
||||
<iframe
|
||||
:src="panelUrl"
|
||||
style="height: 80vh; width: 100%; border: none; overflow: hidden"
|
||||
></iframe>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import config from "@/app.config";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
|
||||
const panelUrl = ref<string>("");
|
||||
|
||||
onBeforeMount(async () => {
|
||||
panelUrl.value = config.compettitivePanel;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
424
src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
Normal file
424
src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายชื่อผู้สมัครสอบรอบ {{ name }} ครั้งที่ {{ round }}/{{ year }}
|
||||
<q-space />
|
||||
<q-btn class="bg-teal-1" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadExam()">
|
||||
<q-item-section class="text-blue"
|
||||
>ส่งออกข้อมูลผู้มีสิทธิ์สอบ</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassExam()">
|
||||
<q-item-section class="text-primary"
|
||||
>ส่งออกข้อมูลผู้สอบผ่านภาค ก.</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassResultExam()">
|
||||
<q-item-section class="text-amber-9"
|
||||
>ส่งออกข้อมูลผู้คัดเลือกผู้พิการได้</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pt-sm q-pa-md">
|
||||
<div class="col-12">
|
||||
<Table
|
||||
:count="count"
|
||||
:pass="pass"
|
||||
:notpass="notpass"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:nornmalData="false"
|
||||
:conclude="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.examID)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
<div class="row col-12 items-center">
|
||||
<img
|
||||
:src="props.row.avatar"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.fullname }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.citizenId }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c1'">
|
||||
<q-checkbox disable v-model="props.row.c1" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c2'">
|
||||
<q-checkbox disable v-model="props.row.c2" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c3'">
|
||||
<q-checkbox disable v-model="props.row.c3" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c4'">
|
||||
<q-checkbox disable v-model="props.row.c4" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c5'">
|
||||
<q-checkbox disable v-model="props.row.c5" />
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const year = ref<string>("2566");
|
||||
const round = ref<string>("1");
|
||||
const name = ref<string>("");
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const count = ref<number>(0);
|
||||
const pass = ref<number>(0);
|
||||
const notpass = ref<number>(0);
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"examID",
|
||||
"profileID",
|
||||
"fullName",
|
||||
"dateOfBirth",
|
||||
"gender",
|
||||
"position_name",
|
||||
"university",
|
||||
"degree",
|
||||
"major",
|
||||
"certificateIssueDate",
|
||||
"certificateNo",
|
||||
"examAttribute",
|
||||
"examScore",
|
||||
"examResult",
|
||||
"applyDate",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "examID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวสอบ",
|
||||
sortable: true,
|
||||
field: "examID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "profileID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "profileID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "personName",
|
||||
headerStyle: "font-size: 14px; min-width: 250px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปีเกิด",
|
||||
sortable: true,
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "gender",
|
||||
align: "left",
|
||||
label: "เพศ",
|
||||
sortable: true,
|
||||
field: "gender",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position_name",
|
||||
align: "left",
|
||||
label: "ตำแหน่งที่สมัคร",
|
||||
sortable: true,
|
||||
field: "position_name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "university",
|
||||
align: "left",
|
||||
label: "สถานศึกษา",
|
||||
sortable: true,
|
||||
field: "university",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "degree",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษา",
|
||||
sortable: true,
|
||||
field: "degree",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "major",
|
||||
align: "left",
|
||||
label: "สาขาวิชาเอก",
|
||||
sortable: true,
|
||||
field: "major",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateNo",
|
||||
align: "left",
|
||||
label: "เลขที่ใบประกอบวิชาชีพ",
|
||||
sortable: true,
|
||||
field: "certificateNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateIssueDate",
|
||||
align: "left",
|
||||
label: "วันที่ได้รับใบประกอบวิชาชีพฯ",
|
||||
sortable: true,
|
||||
field: "certificateIssueDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examAttribute",
|
||||
align: "left",
|
||||
label: "สถานะการคัดกรองคุณสมบัติ",
|
||||
sortable: true,
|
||||
field: "examAttribute",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examScore",
|
||||
align: "right",
|
||||
label: "คะแนนรวม",
|
||||
sortable: true,
|
||||
field: "examScore",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examResult",
|
||||
align: "left",
|
||||
label: "ผลการสอบ",
|
||||
sortable: true,
|
||||
field: "examResult",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "applyDate",
|
||||
align: "left",
|
||||
label: "วันที่สมัครสอบ",
|
||||
sortable: true,
|
||||
field: "applyDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const rows = ref<any>([]);
|
||||
const clickDetail = (examID: string) => {
|
||||
router.push(`/disable/import/${importId.value}/${examID}`);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const downloadExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportDisableExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อผู้มีสิทธิ์สอบ.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportDisablePassExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อสอบผ่านภาค_ก.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassResultExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportDisablePassResultExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อคัดเลือกผู้พิการได้.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.getDisableExamResultById(importId.value), {
|
||||
examAttribute: "",
|
||||
examResult: "",
|
||||
})
|
||||
.then((res) => {
|
||||
var _data = res.data.result;
|
||||
var header = res.data.result.header;
|
||||
count.value = header.count;
|
||||
pass.value = header.pass;
|
||||
notpass.value = header.notpass;
|
||||
|
||||
const data = res.data.result.data;
|
||||
let result: RecruitDetailResponse[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: RecruitDetailResponse) => {
|
||||
r.personName = `${r.prefix}${r.fullName}`;
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = result;
|
||||
if (result.length > 0) name.value = result[0].exam_name as string;
|
||||
round.value = _data.round;
|
||||
year.value = _data.year;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
353
src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue
Normal file
353
src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดของผู้สมัครสอบ {{ examID }} : {{ prefix }}{{ fullname }}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-md col-12">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card bordered flat class="col-12 q-pa-md">
|
||||
<div class="col-12 q-col-gutter-sm row items-center">
|
||||
<div class="col-12 text-weight-bold">ข้อมูลทั่วไป</div>
|
||||
<div class="col-6 text-grey-7" v-if="profile_id !== null">
|
||||
เลขประจำตัวประชาชน
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="profile_id !== null">
|
||||
{{ profile_id }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="prefix !== null">คำนำหน้านาม</div>
|
||||
<div class="col-6 text-black" v-if="prefix !== null">
|
||||
{{ prefix }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="fullname !== null">ชื่อ-นามสกุล</div>
|
||||
<div class="col-6 text-black" v-if="fullname !== null">
|
||||
{{ fullname }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="birthdate !== null">
|
||||
วัน/เดือน/ปี เกิด
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="birthdate !== null">
|
||||
{{ birthdate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="gender !== null">เพศ</div>
|
||||
<div class="col-6 text-black" v-if="gender !== null">
|
||||
{{ gender }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="position_name !== null">
|
||||
ตำแหน่งที่สมัคร
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="position_name !== null">
|
||||
{{ position_name }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="university !== null">สถานศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="university !== null">
|
||||
{{ university }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="degree !== null">วุฒิการศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="degree !== null">
|
||||
{{ degree }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">สาขาวิชาเอก</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ major }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">
|
||||
จำนวนครั้งที่สมัครสอบ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ examCount }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="cert_issuedate !== null">
|
||||
ใบอนุญาตประกอบวิชาชีพ วัน เดือน ปีที่ได้รับ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="cert_issuedate !== null">
|
||||
{{ cert_issuedate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="examAttribute !== null">
|
||||
สถานะการคัดกรองคุณสมบัติ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="examAttribute !== null">
|
||||
{{ examAttribute }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="col-xs-12 col-sm-12 col-md-6 q-px-md q-py-sm full-height"
|
||||
>
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<div class="col-12 text-weight-bold row items-center">
|
||||
ผลการสอบ
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
v-if="examResultinscore === 'ผ่าน'"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadScore()">
|
||||
<q-item-section class="text-primary"
|
||||
>ดาวน์โหลดผลคะแนน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadCertificate()">
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดเอกสารรับรอง</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
@click="downloadScore()"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดผลคะแนน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row items-center q-gutter-y-sm col-12">
|
||||
<div class="col-xs-4 col-sm-5 text-weight-medium text-grey-7">ประเภท</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">คะแนนเต็ม</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
|
||||
คะแนนที่ได้
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 text-primary text-weight-bold"></div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ก</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreAFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreA }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ข</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreBFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreB }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ค</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreCFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreC }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">รวมทั้งหมด</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSumFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSum }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||
<span
|
||||
:class="examResultinscore != 'ผ่าน' ? 'text-red' : 'text-positive'"
|
||||
>{{ examResultinscore }}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">ลำดับที่สอบได้</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ number }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">
|
||||
วันหมดอายุบัญชีคัดเลือกผู้พิการ
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ score_expired }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const { loaderPage } = dataStore;
|
||||
const date = ref<any>();
|
||||
const profile_id = ref<string>("");
|
||||
const birthdate = ref<string>("");
|
||||
const gender = ref<string>("");
|
||||
const university = ref<string>("");
|
||||
const position_name = ref<string>("");
|
||||
const degree = ref<string>("");
|
||||
const major = ref<string>("");
|
||||
const cert_issuedate = ref<string>("");
|
||||
const examAttribute = ref<string>("");
|
||||
const checkbox = false;
|
||||
const remarkText = ref<string>("");
|
||||
const examResultinscore = ref<string>("");
|
||||
const scoreAFull = ref<string>("");
|
||||
const scoreA = ref<string>("");
|
||||
const scoreBFull = ref<string>("");
|
||||
const scoreB = ref<string>("");
|
||||
const scoreCFull = ref<string>("");
|
||||
const scoreC = ref<string>("");
|
||||
const scoreSumFull = ref<string>("");
|
||||
const scoreSum = ref<string>("");
|
||||
const examCount = ref<string>("");
|
||||
const number = ref<string>("");
|
||||
const score_expired = ref<string>("");
|
||||
const attachments = ref<any>([
|
||||
{ fileName: "เอกสารประกอบ 1" },
|
||||
{ fileName: "เอกสารประกอบ 2" },
|
||||
]);
|
||||
const examID = ref<string>("62150001");
|
||||
const prefix = ref<string>("นาย");
|
||||
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const examId = ref<string>(route.params.examId as string); // เลขประจำตัวสอบ
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisableExamDetail(importId.value, examId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result.data;
|
||||
if (res.data.result != null) {
|
||||
examCount.value = res.data.result.examCount;
|
||||
profile_id.value = data.profileID;
|
||||
examID.value = data.examID;
|
||||
prefix.value = data.prefix;
|
||||
fullname.value = data.fullName;
|
||||
birthdate.value = data.dateOfBirth;
|
||||
gender.value = data.gender;
|
||||
degree.value = data.degree;
|
||||
major.value = data.major;
|
||||
university.value = data.university;
|
||||
position_name.value = data.positionName;
|
||||
cert_issuedate.value = data.certificateIssueDate;
|
||||
examAttribute.value = data.examAttribute;
|
||||
number.value = data.number;
|
||||
console.log(data);
|
||||
examCount.value = data.examCount;
|
||||
score_expired.value = data.scoreExpire;
|
||||
if (data.scoreResult != null) {
|
||||
scoreAFull.value = data.scoreResult.scoreAFull;
|
||||
scoreA.value = data.scoreResult.scoreA;
|
||||
scoreBFull.value = data.scoreResult.scoreBFull;
|
||||
scoreB.value = data.scoreResult.scoreB;
|
||||
scoreCFull.value = data.scoreResult.scoreCFull;
|
||||
scoreC.value = data.scoreResult.scoreC;
|
||||
scoreSumFull.value = data.scoreResult.scoreSumFull;
|
||||
scoreSum.value = data.scoreResult.scoreSum;
|
||||
examResultinscore.value = data.scoreResult.examResult;
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadScore = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadDisableScoreReport(importId.value, examId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `ผลคะแนน_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadCertificate = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadDisableExamReport(importId.value, examId.value, 2), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `เอกสารรับรอง_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
762
src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
Normal file
762
src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
Normal file
|
|
@ -0,0 +1,762 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการรอบคัดเลือกคนพิการ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.id)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'name'" class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'year'" class="table_ellipsis2">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
v-if="col.value == null"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<!-- นำเข้าไฟล์ผลการสอบ -->
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickPassExam(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'examCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
color="green"
|
||||
round
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
v-if="col.value == null || col.value == '0'"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickCandidateList(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="clickEditPeriod(props.row.id)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
icon="mdi-history"
|
||||
@click="clickHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>แสดงประวัติการทำงาน</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<HistoryTable
|
||||
:rows="rowsHistory"
|
||||
:columns="columnsHistory"
|
||||
:visible-columns="visibleColumnsHistory"
|
||||
v-model:modal="modalHistory"
|
||||
v-model:inputvisible="visibleColumnsHistory"
|
||||
v-model:tittle="tittleHistory"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'isActive'" class="">
|
||||
<q-icon
|
||||
v-if="col.value == false"
|
||||
name="mdi-close"
|
||||
color="red"
|
||||
class="text-h5"
|
||||
/>
|
||||
<q-icon v-else name="mdi-check" color="positive" class="text-h5" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'" class="">
|
||||
{{ textDate(col.value) }}
|
||||
</div>
|
||||
|
||||
<div v-else class="">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</HistoryTable>
|
||||
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="textTittle" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อการคัดเลือกผู้พิการ"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="round"
|
||||
label="ครั้งที่"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="year"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files"
|
||||
dense
|
||||
label="เลือกไฟล์รายชื่อผู้สมัครคัดเลือกผู้พิการ"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalScore" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleScore" :close="clickCloseScore" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_score"
|
||||
dense
|
||||
label="เลือกไฟล์ผลการคัดเลือกผู้พิการ"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveScore"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalCandidate" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader
|
||||
:tittle="textTittleCandidate"
|
||||
:close="clickCloseCandidate"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_candidate"
|
||||
dense
|
||||
label="เลือกไฟล์ผู้สมัครคัดเลือกผู้พิการ"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveCandidate"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type {
|
||||
ResponseRecruitPeriod,
|
||||
ResponseHistoryObject,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import HistoryTable from "@/components/TableHistory.vue";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const name = ref<string>("");
|
||||
const year = ref<number>(new Date().getFullYear() + 543);
|
||||
const round = ref<number>(1);
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateText, messageError } = mixin;
|
||||
const files = ref<any>(null);
|
||||
const files_score = ref<any>(null);
|
||||
const files_candidate = ref<any>(null);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const modalScore = ref<boolean>(false);
|
||||
const modalCandidate = ref<boolean>(false);
|
||||
const selected_row_id = ref<string>("");
|
||||
const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history
|
||||
const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); //
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const rows = ref<any>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const textTittle = ref<string>("");
|
||||
const textTittleScore = ref<string>("");
|
||||
const textTittleCandidate = ref<string>("");
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"name",
|
||||
"round",
|
||||
"year",
|
||||
"examCount",
|
||||
"scoreCount",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "รอบการคัดเลือกผู้พิการ",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "round",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "round",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "examCount",
|
||||
label: "จำนวนผู้สอบทั้งหมด",
|
||||
align: "right",
|
||||
field: "examCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "scoreCount",
|
||||
label: "จำนวนที่บันทึกผลสอบ",
|
||||
align: "right",
|
||||
field: "scoreCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const columnsHistory = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "description",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
sortable: true,
|
||||
field: "description",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "center",
|
||||
label: "วันที่ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "createdFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "createdFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const visibleColumnsHistory = ref<String[]>([
|
||||
"description",
|
||||
"createdAt",
|
||||
"createdFullName",
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const clickPassExam = (id: string) => {
|
||||
window.open(config.API.exportDisablePassExamList(id));
|
||||
};
|
||||
|
||||
const clickCandidateList = (id: string) => {
|
||||
window.open(config.API.exportDisableCandidateList(id));
|
||||
};
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลง date เป็นภาษาไทย
|
||||
* @param value วันที่ type datetime ที่จะแปลงเป็นไทย
|
||||
*/
|
||||
const textDate = (value: Date) => {
|
||||
return dateText(value);
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisableCandidates)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let result: ResponseRecruitPeriod[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: ResponseRecruitPeriod) => {
|
||||
if (r.score != null) {
|
||||
r.scoreCount = r.score.scoreCount;
|
||||
r.scoreImportDate = r.score.importDate;
|
||||
}
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickDetail = (id: string) => {
|
||||
router.push(`/disable/import/${id}`);
|
||||
};
|
||||
|
||||
const clickEdit = async (id: string) => {
|
||||
modalScore.value = true;
|
||||
textTittleScore.value = "นำเข้าผลการคัดเลือกผู้พิการ";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickUpload = async (id: string) => {
|
||||
modalCandidate.value = true;
|
||||
textTittleCandidate.value = "นำเข้าผู้สมัครคัดเลือกผู้พิการ";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickEditPeriod = (id: string) => {
|
||||
router.push(`/disable/period/${id}`);
|
||||
};
|
||||
|
||||
const clickHistory = async (id: string) => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisableImportHistory(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
if (data.length > 0) {
|
||||
data.map((i: ResponseHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
createdAt: i.createdAt,
|
||||
createdFullName: i.createdFullName,
|
||||
createdUserId: i.createdUserId,
|
||||
id: i.id,
|
||||
isActive: i.isActive,
|
||||
lastUpdateFullName: i.lastUpdateFullName,
|
||||
lastUpdateUserId: i.lastUpdateUserId,
|
||||
lastUpdatedAt: i.lastUpdatedAt,
|
||||
description: i.description,
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.deleteDisableCandidates(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลการสอบสำเร็จ");
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "disablePeriodAdd" });
|
||||
};
|
||||
|
||||
const clickClose = async () => {
|
||||
modalAdd.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseScore = async () => {
|
||||
modalScore.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseCandidate = async () => {
|
||||
modalCandidate.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const checkSaveCandidate = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_candidate.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.uploadDisableCandidates(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ");
|
||||
modalCandidate.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSaveScore = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_score.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveDisableScores(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผลการสอบสำเร็จ");
|
||||
modalScore.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files.value[0]);
|
||||
fd.append("year", year.value.toString());
|
||||
fd.append("round", round.value.toString());
|
||||
fd.append("name", name.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveDisableCandidates, fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครคัดเลือกผู้พิการสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
962
src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue
Normal file
962
src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue
Normal file
|
|
@ -0,0 +1,962 @@
|
|||
<!-- page:จัดการรอบการคัดเลือกผู้พิการ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="clickBack"
|
||||
/>
|
||||
{{
|
||||
edit ? "แก้ไขข้อมูลการคัดเลือกผู้พิการ" : "เพิ่มข้อมูลการคัดเลือกผู้พิการ"
|
||||
}}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-form ref="myForm">
|
||||
<q-card-section class="q-pa-md">
|
||||
<div class="col-xs-12 col-sm-8"></div>
|
||||
<div class="col-12 row items-center q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อรอบการคัดเลือกผู้พิการ/ชื่อประกาศ"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณากรอกชื่อรอบการคัดเลือกผู้พิการ/ชื่อประกาศ'}`,
|
||||
]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="round"
|
||||
type="number"
|
||||
label="รอบการสอบ(ครั้ง)"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearly"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="updateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
:model-value="yearly + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="fee"
|
||||
type="number"
|
||||
label="ค่าธรรมเนียม"
|
||||
dense
|
||||
lazy-rules
|
||||
input-class="text-right"
|
||||
:rules="[
|
||||
(val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`,
|
||||
]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateExam"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateExam)"
|
||||
:label="`${'วันที่สอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnouncement"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
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
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateAnnouncement)"
|
||||
:label="`${'วันที่ประกาศ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
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
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateRegister)"
|
||||
:label="`${'วันที่สมัคร'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="datePayment"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
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
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(datePayment)"
|
||||
:label="`${'วันที่ชำระเงิน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnounce"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateAnnounce)"
|
||||
:label="`${'วันประกาศผลสอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" class="q-mb-md" />
|
||||
</div>
|
||||
|
||||
<div class="row col-12 items-top q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">รูปภาพประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
accept=".jpg,.png,.pdf,.csv,.doc"
|
||||
bordered
|
||||
label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadImg"
|
||||
@removed="fileRemoveImg"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div
|
||||
class="row no-wrap items-center q-pa-sm q-gutter-xs text-white"
|
||||
>
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner
|
||||
v-if="scope.isUploading"
|
||||
class="q-uploader__spinner"
|
||||
/>
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileImgs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item
|
||||
v-for="file in fileImgs"
|
||||
:key="file.id"
|
||||
class="q-my-xs"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteDocData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">เอกสารประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
bordered
|
||||
label="[ไฟล์ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadDoc"
|
||||
@removed="fileRemoveDoc"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div
|
||||
class="row no-wrap items-center q-pa-sm q-gutter-xs text-white"
|
||||
>
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner
|
||||
v-if="scope.isUploading"
|
||||
class="q-uploader__spinner"
|
||||
/>
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileDocs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item
|
||||
v-for="file in fileDocs"
|
||||
:key="file.id"
|
||||
class="q-my-xs"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteDocData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" class="q-mt-md" />
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm q-pt-md">
|
||||
รายละเอียด
|
||||
</div>
|
||||
<q-editor
|
||||
v-model="editor"
|
||||
:dense="$q.screen.lt.md"
|
||||
toolbar-text-color="blue-grey-10"
|
||||
toolbar-bg="blue-grey-2"
|
||||
toolbar-toggle-color="blue-grey-8"
|
||||
class="editor"
|
||||
:toolbar="[
|
||||
['left', 'center', 'right', 'justify'],
|
||||
[
|
||||
'bold',
|
||||
'italic',
|
||||
'strike',
|
||||
'underline',
|
||||
'subscript',
|
||||
'superscript',
|
||||
],
|
||||
['token', 'hr', 'link', 'custom_btn'],
|
||||
['print', 'fullscreen'],
|
||||
[
|
||||
{
|
||||
label: $q.lang.editor.formatting,
|
||||
icon: $q.iconSet.editor.formatting,
|
||||
list: 'no-icons',
|
||||
options: ['p', 'h1', 'h2', 'h3'],
|
||||
},
|
||||
{
|
||||
label: $q.lang.editor.defaultFont,
|
||||
icon: $q.iconSet.editor.font,
|
||||
fixedIcon: true,
|
||||
list: 'no-icons',
|
||||
options: [
|
||||
'default_font',
|
||||
'arial',
|
||||
'arial_black',
|
||||
'comic_sans',
|
||||
'courier_new',
|
||||
'impact',
|
||||
'lucida_grande',
|
||||
'times_new_roman',
|
||||
'verdana',
|
||||
],
|
||||
},
|
||||
'removeFormat',
|
||||
],
|
||||
['undo', 'redo'],
|
||||
['viewsource'],
|
||||
]"
|
||||
:fonts="{
|
||||
arial: 'Arial',
|
||||
arial_black: 'Arial Black',
|
||||
comic_sans: 'Comic Sans MS',
|
||||
courier_new: 'Courier New',
|
||||
impact: 'Impact',
|
||||
lucida_grande: 'Lucida Grande',
|
||||
times_new_roman: 'Times New Roman',
|
||||
verdana: 'Verdana',
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-mt-md">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>{{ edit ? "แก้ไขข้อมูล" : "บันทึกข้อมูล" }}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RequestPeriodDisable } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, notifyError, messageError } = mixin;
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const name = ref<string>("");
|
||||
const note = ref<string>("");
|
||||
const editor = ref<string>("");
|
||||
const announcementExam = ref<boolean>(true);
|
||||
const fee = ref<number>(0);
|
||||
const round = ref<number>(1);
|
||||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const dateRegister = ref<[Date, Date]>([new Date(), new Date()]); //วันที่สมัคร
|
||||
const datePayment = ref<[Date, Date]>([new Date(), new Date()]); //วันที่จ่ายเงิน
|
||||
const dateAnnouncement = ref<[Date, Date]>([new Date(), new Date()]); //วันที่ประกาศ
|
||||
const dateExam = ref<Date>(new Date()); //วันที่สอบ
|
||||
const dateAnnounce = ref<Date>(new Date()); //วันที่ประกาศผล
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption[]>([]);
|
||||
const examTypeOptions = [
|
||||
{ name: "ทั่วไป", id: "normol" },
|
||||
{ name: "แพทย์", id: "docter" },
|
||||
];
|
||||
const category = ref<string>("");
|
||||
const categoryOptions = [
|
||||
{ name: "สำนักอนามัย", id: "hygiene" },
|
||||
{ name: "สำนักการแพทย์", id: "physician" },
|
||||
{ name: "สำนักผังเมือง", id: "city" },
|
||||
{ name: "สำนักวัฒนธรรม กีฬา และการท่องเที่ยว", id: "culture" },
|
||||
];
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileDocs = ref<UploadType[]>([]);
|
||||
const fileImgDataUpload = ref<File[]>([]);
|
||||
const fileImgs = ref<UploadType[]>([]);
|
||||
const id = ref<string>("");
|
||||
const edit = ref<boolean>(false);
|
||||
|
||||
watch(organizationShortName, (count: DataOption, prevCount: DataOption) => {
|
||||
organizationNameOptions.value = [];
|
||||
});
|
||||
|
||||
watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
||||
positionPathOptions.value = [];
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
if (route.params.id != undefined) {
|
||||
edit.value = true;
|
||||
id.value = route.params.id.toString();
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
const clickBack = () => {
|
||||
router.push({ name: "disablePeriod" });
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisablePeriodById(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data.id;
|
||||
name.value = data.name;
|
||||
round.value = data.round;
|
||||
yearly.value = data.year;
|
||||
fee.value = data.fee;
|
||||
dateAnnouncement.value = [
|
||||
new Date(data.announcementStartDate),
|
||||
new Date(data.announcementEndDate),
|
||||
];
|
||||
dateExam.value = new Date(data.examDate);
|
||||
dateRegister.value = [
|
||||
new Date(data.registerStartDate),
|
||||
new Date(data.registerEndDate),
|
||||
];
|
||||
datePayment.value = [
|
||||
new Date(data.paymentStartDate),
|
||||
new Date(data.paymentEndDate),
|
||||
];
|
||||
editor.value = data.detail;
|
||||
note.value = data.note;
|
||||
dateAnnounce.value = new Date(data.announcementDate);
|
||||
fileDocs.value = data.documents;
|
||||
fileImgs.value = data.images;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const updateYear = async (e: number) => {
|
||||
yearly.value = e;
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (success) => {
|
||||
if (success) {
|
||||
if (edit.value) {
|
||||
await editData(id.value);
|
||||
} else {
|
||||
await addData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const sendData = () => {
|
||||
const valueData: RequestPeriodDisable = {
|
||||
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
|
||||
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
|
||||
examDate: dateToISO(dateExam.value),
|
||||
detail: editor.value,
|
||||
fee: fee.value,
|
||||
id: "",
|
||||
name: name.value,
|
||||
note: note.value,
|
||||
paymentEndDate: dateToISO(datePayment.value[1]),
|
||||
paymentStartDate: dateToISO(datePayment.value[0]),
|
||||
registerEndDate: dateToISO(dateRegister.value[1]),
|
||||
registerStartDate: dateToISO(dateRegister.value[0]),
|
||||
round: round.value,
|
||||
year: yearly.value,
|
||||
announcementDate: dateToISO(dateAnnounce.value),
|
||||
};
|
||||
return valueData;
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveDisablePeriod, sendData())
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data;
|
||||
success($q, "บันทึกรอบการสอบผู้พิการสำเร็จ");
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
clickBack();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const editData = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.editDisablePeriod(id), sendData())
|
||||
.then(async () => {
|
||||
success($q, "แก้ไขรอบการสอบผู้พิการสำเร็จ");
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
clickBack();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fileUploadImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileImgDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileImgDataUpload.value.findIndex(
|
||||
(x: any) => x.__key == file.__key
|
||||
);
|
||||
if (index > -1) {
|
||||
fileImgDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const uploadImgData = async () => {
|
||||
if (fileImgDataUpload.value.length > 0) {
|
||||
const formData = new FormData();
|
||||
fileImgDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamImg(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const deleteDocData = async (docId: string) => {
|
||||
const params = {
|
||||
documentId: docId,
|
||||
};
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodExamDoc(id.value.toString()), {
|
||||
params,
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadData = async (path: string) => {
|
||||
window.open(path);
|
||||
};
|
||||
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileDocDataUpload.value.findIndex(
|
||||
(x: any) => x.__key == file.__key
|
||||
);
|
||||
if (index > -1) {
|
||||
fileDocDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const uploadDocData = async () => {
|
||||
const formData = new FormData();
|
||||
if (fileDocDataUpload.value.length > 0) {
|
||||
fileDocDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamDoc(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
} else {
|
||||
clickBack();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
345
src/modules/03_recruiting/views/02_qualify/ExamForm.vue
Normal file
345
src/modules/03_recruiting/views/02_qualify/ExamForm.vue
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
<!-- step กรอกข้อมูล -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
ตรวจสอบคุณสมบัติผู้สมัครสอบรอบคัดเลือก
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
icon="mdi-content-save-outline"
|
||||
@click="clickSave"
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
class="q-mr-sm bg-blue-1"
|
||||
outline
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
round
|
||||
icon="check"
|
||||
class="bg-teal-1"
|
||||
@click="modalCheck"
|
||||
v-if="status == 'checkRegister'"
|
||||
>
|
||||
<q-tooltip>ตรวจสอบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card class="q-pa-md">
|
||||
<div>
|
||||
<Profile
|
||||
:status="status"
|
||||
v-model:formInformation="formInformation"
|
||||
v-model:formAddress="formAddress"
|
||||
v-model:formFamily="formFamily"
|
||||
v-model:formOccupation="formOccupation"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-dialog :model-value="modal" persistent>
|
||||
<q-card style="min-width: 700px">
|
||||
<q-form ref="myForm">
|
||||
<div class="row items-center q-pa-sm">
|
||||
<div class="row">
|
||||
<div class="text-bold">ตรวจสอบคุณสมบัติ</div>
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
size="12px"
|
||||
@click="close"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<!-- header บน table มี ค้นหา แสดงคอลัมน์ (status nornmalData true) -->
|
||||
<div class="col-12 row q-pa-md">
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
label="ผ่านการตรวจสอบคุณสมบัติ"
|
||||
class="col-12"
|
||||
@update:modelValue="reason = ''"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="2"
|
||||
label="ไม่ผ่านการตรวจสอบคุณสมบัติ(ผู้สมัครแก้ข้อมูลสมัคร)"
|
||||
class="col-12"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="3"
|
||||
label="ไม่ผ่านการตรวจสอบคุณสมบัติ"
|
||||
class="col-12"
|
||||
/>
|
||||
<q-input
|
||||
class="col-12 q-px-sm q-pt-sm"
|
||||
outlined
|
||||
stack-label
|
||||
v-model="reason"
|
||||
label="หมายเหตุ"
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
v-if="approve == '2' || approve == '3'"
|
||||
type="textarea"
|
||||
></q-input>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกตรวจสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import Profile from "@/modules/03_recruiting/components/Profile.vue";
|
||||
import {
|
||||
defaultInformation,
|
||||
defaultOccupation,
|
||||
defaultAddress,
|
||||
defaultFamily,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { success, dateToISO, messageError } = mixin;
|
||||
const route = useRoute();
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const modal = ref<boolean>(false);
|
||||
const approve = ref<string>("1");
|
||||
const reason = ref<string>("");
|
||||
const formInformation = ref<any>({});
|
||||
const formAddress = ref<any>({});
|
||||
const formFamily = ref<any>({});
|
||||
const formOccupation = ref<any>({});
|
||||
const status = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchStatus();
|
||||
});
|
||||
|
||||
const fetchStatus = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateId(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
status.value = data.status;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const confirm = async (status: boolean, reason: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateCheckRegister(candidateId.value), {
|
||||
status: status,
|
||||
reason: reason,
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "ตรวจสอบข้อมูลสำเร็จ");
|
||||
router.push(`/qualify/manage/${examId.value}`);
|
||||
});
|
||||
};
|
||||
|
||||
const reject = async (reason: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateRejectRegister(candidateId.value), {
|
||||
reason: reason,
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "ตรวจสอบข้อมูลสำเร็จ");
|
||||
router.push(`/qualify/manage/${examId.value}`);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = () => {
|
||||
if (approve.value == "1") {
|
||||
confirm(true, "");
|
||||
} else if (approve.value == "2") {
|
||||
confirm(false, reason.value);
|
||||
} else {
|
||||
reject(reason.value);
|
||||
}
|
||||
};
|
||||
|
||||
const modalCheck = () => {
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
modal.value = false;
|
||||
};
|
||||
|
||||
const clickSave = async () => {
|
||||
await formInformation.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formAddress.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formFamily.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formOccupation.value
|
||||
.validate()
|
||||
.then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
const type = ref<string | null>("");
|
||||
if (defaultOccupation.value.status == "official")
|
||||
type.value = defaultOccupation.value.official;
|
||||
if (defaultOccupation.value.status == "personnel")
|
||||
type.value = defaultOccupation.value.personnel;
|
||||
if (defaultOccupation.value.status == "officialsOther")
|
||||
type.value = defaultOccupation.value.officialsOther;
|
||||
if (defaultOccupation.value.status == "employee")
|
||||
type.value = defaultOccupation.value.employee;
|
||||
if (defaultOccupation.value.status == "other")
|
||||
type.value = defaultOccupation.value.other;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.candidateId(candidateId.value), {
|
||||
prefixId: defaultInformation.value.prefixId,
|
||||
lastName: defaultInformation.value.lastname,
|
||||
citizenProvinceId: defaultInformation.value.provinceId,
|
||||
citizenDistrictId: defaultInformation.value.districtId,
|
||||
dateOfBirth:
|
||||
defaultInformation.value.birthDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.birthDate),
|
||||
citizenDate:
|
||||
defaultInformation.value.cardIdDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.cardIdDate),
|
||||
citizenId: defaultInformation.value.cardid,
|
||||
firstName: defaultInformation.value.firstname,
|
||||
relationshipId: defaultInformation.value.relationshipId,
|
||||
nationality: defaultInformation.value.nationality,
|
||||
email: defaultInformation.value.email,
|
||||
mobilePhone: defaultInformation.value.phone,
|
||||
telephone: defaultInformation.value.tel,
|
||||
knowledge: defaultInformation.value.knowledge,
|
||||
occupationType: defaultOccupation.value.status,
|
||||
occupationCompany: defaultOccupation.value.company,
|
||||
occupationDepartment:
|
||||
defaultOccupation.value.department,
|
||||
occupationEmail: defaultOccupation.value.email,
|
||||
occupationTelephone: defaultOccupation.value.tel,
|
||||
occupationPosition: type.value,
|
||||
registAddress: defaultAddress.value.address,
|
||||
currentAddress: defaultAddress.value.addressC,
|
||||
registProvinceId: defaultAddress.value.provinceId,
|
||||
currentProvinceId: defaultAddress.value.provinceIdC,
|
||||
registDistrictId: defaultAddress.value.districtId,
|
||||
currentDistrictId: defaultAddress.value.districtIdC,
|
||||
registSubDistrictId: defaultAddress.value.subdistrictId,
|
||||
currentSubDistrictId:
|
||||
defaultAddress.value.subdistrictIdC,
|
||||
registZipCode: defaultAddress.value.code,
|
||||
currentZipCode: defaultAddress.value.codeC,
|
||||
registSame:
|
||||
defaultAddress.value.same == "1"
|
||||
? true
|
||||
: defaultAddress.value.same == "0"
|
||||
? false
|
||||
: null,
|
||||
marryPrefixId: defaultFamily.value.prefixIdC,
|
||||
marryFirstName: defaultFamily.value.firstnameC,
|
||||
marryLastName: defaultFamily.value.lastnameC,
|
||||
marryOccupation: defaultFamily.value.occupationC,
|
||||
marryNationality: defaultFamily.value.nationalityC,
|
||||
fatherPrefixId: defaultFamily.value.prefixIdM,
|
||||
fatherFirstName: defaultFamily.value.firstnameM,
|
||||
fatherLastName: defaultFamily.value.lastnameM,
|
||||
fatherOccupation: defaultFamily.value.occupationM,
|
||||
fatherNationality: defaultFamily.value.nationalityM,
|
||||
motherPrefixId: defaultFamily.value.prefixIdF,
|
||||
motherFirstName: defaultFamily.value.firstnameF,
|
||||
motherLastName: defaultFamily.value.lastnameF,
|
||||
motherOccupation: defaultFamily.value.occupationF,
|
||||
motherNationality: defaultFamily.value.nationalityF,
|
||||
marry:
|
||||
defaultFamily.value.same == "1"
|
||||
? true
|
||||
: defaultFamily.value.same == "0"
|
||||
? false
|
||||
: null,
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, "บันทึกข้อมูลส่วนตัวสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
245
src/modules/03_recruiting/views/02_qualify/Manage.vue
Normal file
245
src/modules/03_recruiting/views/02_qualify/Manage.vue
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการรายชื่อคัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm">
|
||||
<data-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="viewDetail(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'yearly'">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.name == 'dateRegister' ||
|
||||
col.name == 'datePayment' ||
|
||||
col.name == 'dateAnnouncement'
|
||||
"
|
||||
>
|
||||
{{ dateThaiRange(col.value) }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</data-table>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import type { RequestPeriodExam } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type { ResponsePeriodExam } from "@/modules/03_recruiting/interface/response/Period";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, messageError } = mixin;
|
||||
const rows = ref<ResponsePeriodExam[]>([]);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"yearly",
|
||||
"name",
|
||||
"document",
|
||||
"dateAnnouncement",
|
||||
"dateRegister",
|
||||
"datePayment",
|
||||
"fee",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "yearly",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "yearly",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อรอบการคัดเลือก",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fee",
|
||||
align: "left",
|
||||
label: "ค่าธรรมเนียม",
|
||||
sortable: true,
|
||||
field: "fee",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateAnnouncement",
|
||||
align: "left",
|
||||
label: "วันที่สมัคร",
|
||||
sortable: true,
|
||||
field: "dateAnnouncement",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateRegister",
|
||||
align: "left",
|
||||
label: "วันที่ชำระเงิน",
|
||||
sortable: true,
|
||||
field: "dateRegister",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "datePayment",
|
||||
align: "left",
|
||||
label: "วันที่ประกาศ",
|
||||
sortable: true,
|
||||
field: "datePayment",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamType("exam"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((r: RequestPeriodExam) => {
|
||||
rows.value.push({
|
||||
id: r.id,
|
||||
name: r.name,
|
||||
checkDocument: r.checkDocument,
|
||||
checkDisability: r.checkDisability,
|
||||
round: r.round,
|
||||
yearly: r.year,
|
||||
fee: r.fee,
|
||||
announcementExam: r.announcementExam,
|
||||
dateAnnounce: new Date(r.announcementDate),
|
||||
dateAnnouncement: [
|
||||
new Date(r.announcementStartDate),
|
||||
new Date(r.announcementEndDate),
|
||||
],
|
||||
dateRegister: [
|
||||
new Date(r.registerStartDate),
|
||||
new Date(r.registerEndDate),
|
||||
],
|
||||
dateExam: new Date(r.examDate),
|
||||
datePayment: [
|
||||
new Date(r.paymentStartDate),
|
||||
new Date(r.paymentEndDate),
|
||||
],
|
||||
organizationName: {
|
||||
id: r.organizationId,
|
||||
name: r.organizationName,
|
||||
},
|
||||
organizationShortName: {
|
||||
id: r.organizationCodeId,
|
||||
name: r.organizationCodeName,
|
||||
},
|
||||
positionExam: [],
|
||||
pay: r.bankExam.length > 0 ? "payment2" : "payment1",
|
||||
bankExam: [],
|
||||
editor: r.detail,
|
||||
note: r.note,
|
||||
category: r.category,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const viewDetail = (row: any) => {
|
||||
router.push(`/qualify/manage/${row.id}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
386
src/modules/03_recruiting/views/02_qualify/Payment.vue
Normal file
386
src/modules/03_recruiting/views/02_qualify/Payment.vue
Normal file
|
|
@ -0,0 +1,386 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
ตรวจสอบการชำระเงิน
|
||||
</div>
|
||||
<q-list bordered class="col-12 rounded-borders" v-if="bank.length > 0">
|
||||
<q-item class="q-pa-md">
|
||||
<q-item-section avatar>
|
||||
<q-icon name="mdi-cash" color="positive" size="30px" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<div class="row">
|
||||
<q-item-label class="text-weight-medium text-subtitle1 q-pl-sm"
|
||||
>ชำระเงินค่าสมัครสอบผ่านสำนัก/หน่วยงาน</q-item-label
|
||||
>
|
||||
<q-space />
|
||||
<q-btn color="primary" icon="check" @click="modalCheck"
|
||||
>ตรวจสอบข้อมูล
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-slide-transition :duration="100" class="">
|
||||
<div class="q-pa-md bg-grey-1">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<q-card
|
||||
bordered
|
||||
class="items-start q-pa-md row q-mb-sm"
|
||||
style="height: 300px"
|
||||
>
|
||||
<div class="row col-12">
|
||||
<div class="col-12" v-for="item in bank" :key="item.id">
|
||||
<div class="row q-pl-md col-12">
|
||||
<div class="q-pb-xs col-4">
|
||||
<span class="text-weight-medium">ธนาคาร :</span>
|
||||
<span class="text-blue q-pl-xs">{{ item.bankName }}</span>
|
||||
</div>
|
||||
<div class="q-pb-xs col-4">
|
||||
<span class="text-weight-medium">ชื่อบัญชี :</span>
|
||||
<span class="text-blue q-pl-xs">{{
|
||||
item.accountName
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="q-pb-xs col-4">
|
||||
<span class="text-weight-medium">เลขบัญชี :</span>
|
||||
<span class="text-blue q-pl-xs">
|
||||
{{ item.accountNumber }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator class="q-my-md" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<q-card bordered class="q-pa-md">
|
||||
<div class="q-pb-sm">
|
||||
<span class="text-weight-medium">รหัสใบสั่งซื้อ :</span>
|
||||
<span class="text-blue q-pl-sm">12837495985900</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-weight-medium">ยอดสุทธิ (บาท) :</span>
|
||||
<span class="text-blue q-pl-sm text-bold">{{
|
||||
fee
|
||||
}}</span>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<label class="col-12 row">
|
||||
<q-img
|
||||
src="@/assets/ex_slip.jpeg"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
v-if="img == ''"
|
||||
>
|
||||
</q-img>
|
||||
<q-img
|
||||
:src="img"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
@click="openImg"
|
||||
v-else
|
||||
>
|
||||
</q-img>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-slide-transition>
|
||||
</q-list>
|
||||
<q-list bordered class="col-12 rounded-borders" v-else>
|
||||
<q-item class="q-pa-md">
|
||||
<q-avatar size="32px">
|
||||
<q-img src="@/assets/krungthai.png" class="col-12" />
|
||||
</q-avatar>
|
||||
<q-item-section>
|
||||
<div class="row">
|
||||
<q-item-label class="text-weight-medium text-subtitle1 q-pl-sm">
|
||||
ชำระเงินค่าสมัครสอบผ่านธนาคารกรุงไทย</q-item-label
|
||||
>
|
||||
<q-space />
|
||||
<q-btn color="primary" icon="check" @click="modalCheck"
|
||||
>ตรวจสอบข้อมูล
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-slide-transition :duration="100">
|
||||
<div class="q-pa-md bg-grey-1">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<q-card bordered class="q-pa-md">
|
||||
<div class="q-pb-sm">
|
||||
<span class="text-weight-medium">รหัสใบสั่งซื้อ :</span>
|
||||
<span class="text-blue q-pl-sm">12837495985900</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-weight-medium">ยอดสุทธิ (บาท) :</span>
|
||||
<span class="text-blue q-pl-sm text-bold">{{ fee }}</span>
|
||||
</div>
|
||||
</q-card>
|
||||
<div class="q-pt-md q-pb-xs text-bold">ธนาคารกรุงไทย</div>
|
||||
<div class="q-pb-md">สอดบัตร ATM กดรหัสและเลือกรายการ</div>
|
||||
<ul class="q-gutter-y-sm">
|
||||
<li>ขั้นที่ 1 บริการอื่นๆ</li>
|
||||
<li>ขั้นที่ 2 ชำระค่าบริการ</li>
|
||||
<li>ขั้นที่ 3 ระบุรหัสบริษัท</li>
|
||||
<li>
|
||||
ขั้นที่ 4 เลือกบัญชีผู้ชำระเงิน คือ
|
||||
บัญชีของตัวท่านว่าเป็นบัญชีออมทรัพย์ หรือ กระแสรายวัน
|
||||
</li>
|
||||
<li>
|
||||
ขั้นที่ 5 ใส่รหัสบริษัทฯ คือ
|
||||
<span class="text-blue text-bold">2111</span> และ ใส่ Ref No.1
|
||||
ขั้นด้วยเครื่องหมายจุด ( . ) แล้วตามด้วย Ref No.2 (ดูใน
|
||||
"ใบแจ้งการชำระเงิน")
|
||||
</li>
|
||||
<li>
|
||||
ยกตัวอย่างเช่น ถ้า Ref No.1 คือ 012345 และ Ref No.2 คือ
|
||||
308833ต้องใส่ เป็น 012345.308833
|
||||
</li>
|
||||
<li>ขั้นที่ 6 ใส่จำนวนเงินที่ชำระรวมหน่วยสตางค์</li>
|
||||
<li>ขั้นที่ 7 ตรวจสอบรายการ</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<label for="file-upload" class="col-12 row">
|
||||
<q-img
|
||||
src="@/assets/ex_slip.jpeg"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
v-if="img == ''"
|
||||
>
|
||||
</q-img>
|
||||
<q-img
|
||||
:src="img"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
v-else
|
||||
@click="openImg"
|
||||
>
|
||||
</q-img>
|
||||
</label>
|
||||
<q-file
|
||||
id="file-upload"
|
||||
v-model="filePayment"
|
||||
dense
|
||||
label="อัปโหลดหลักฐานชำระเงิน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
class="q-pl-sm"
|
||||
v-if="status == 'payment' || status == 'rejectPayment'"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-slide-transition>
|
||||
</q-list>
|
||||
|
||||
<q-dialog :model-value="modal" persistent>
|
||||
<q-card style="min-width: 700px">
|
||||
<q-form ref="myForm">
|
||||
<div class="row items-center q-pa-sm">
|
||||
<div class="row">
|
||||
<div class="text-bold">ตรวจสอบการชำระเงิน</div>
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
size="12px"
|
||||
@click="close"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="q-pa-sm">
|
||||
<div class="col-12 row q-pa-md">
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
label="ผ่านการตรวจสอบคุณสมบัติ"
|
||||
dense
|
||||
class="col-12"
|
||||
@update:modelValue="reason = ''"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="2"
|
||||
label="ไม่ผ่านการตรวจสอบคุณสมบัติ(ผู้สมัครแก้ข้อมูลสมัคร)"
|
||||
dense
|
||||
class="col-12"
|
||||
/>
|
||||
<q-input
|
||||
class="col-12"
|
||||
outlined
|
||||
v-model="reason"
|
||||
dense
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
v-if="approve == '2'"
|
||||
type="textarea"
|
||||
></q-input>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกตรวจสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const filePayment = ref<File[]>([]);
|
||||
const bank = ref<any>([]);
|
||||
const fee = ref<number>();
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { success, messageError } = mixin;
|
||||
const route = useRoute();
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const modal = ref<boolean>(false);
|
||||
const approve = ref<string>("1");
|
||||
const reason = ref<string>("");
|
||||
const img = ref<string>("");
|
||||
const props = defineProps({
|
||||
fetchStep: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchPaymentExam();
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidatePayment(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
img.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchPaymentExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamPayment(examId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
bank.value = data.bankExam;
|
||||
fee.value = data.fee;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const confirm = async (status: boolean, reason: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateCheckPayment(candidateId.value), {
|
||||
status: status,
|
||||
reason: reason,
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "ตรวจสอบข้อมูลชำระเงินสำเร็จ");
|
||||
router.push(`/qualify/manage/${examId.value}`);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = () => {
|
||||
if (approve.value == "1") {
|
||||
confirm(true, "");
|
||||
} else {
|
||||
confirm(false, reason.value);
|
||||
}
|
||||
};
|
||||
|
||||
const openImg = () => {
|
||||
window.open(img.value);
|
||||
};
|
||||
|
||||
const modalCheck = () => {
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
modal.value = false;
|
||||
};
|
||||
</script>
|
||||
368
src/modules/03_recruiting/views/02_qualify/Period.vue
Normal file
368
src/modules/03_recruiting/views/02_qualify/Period.vue
Normal file
|
|
@ -0,0 +1,368 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการรอบคัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="examData"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'" class="table_ellipsis2">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'yearly'" class="table_ellipsis2">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.name == 'dateRegister' ||
|
||||
col.name == 'datePayment' ||
|
||||
col.name == 'dateAnnouncement'
|
||||
"
|
||||
class="table_ellipsis2"
|
||||
>
|
||||
{{ dateThaiRange(col.value) }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'announcementExam'"
|
||||
class="table_ellipsis2"
|
||||
>
|
||||
{{ col.value ? "ข่าวการสอบ" : "ข่าวทั่วไป" }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'category'" class="table_ellipsis2">
|
||||
{{ typeCategoryExam(col.value) }}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type {
|
||||
RequestPeriodExam,
|
||||
RequestPosition,
|
||||
RequestPayment,
|
||||
} from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
ResponsePeriodExam,
|
||||
ResponsePosition,
|
||||
ResponsePayment,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const { date2Thai, success, typeCategoryExam, messageError } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const examData = ref<ResponsePeriodExam[]>([]);
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"announcementExam",
|
||||
"yearly",
|
||||
"category",
|
||||
"name",
|
||||
"document",
|
||||
"dateAnnouncement",
|
||||
"dateRegister",
|
||||
"datePayment",
|
||||
"fee",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "center",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "announcementExam",
|
||||
align: "left",
|
||||
label: "ประเภทการประกาศ",
|
||||
sortable: true,
|
||||
field: "announcementExam",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "yearly",
|
||||
align: "center",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "yearly",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "category",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "category",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "รายการประกาศ",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fee",
|
||||
align: "right",
|
||||
label: "ค่าธรรมเนียม",
|
||||
sortable: true,
|
||||
field: "fee",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateAnnouncement",
|
||||
align: "left",
|
||||
label: "วันที่สมัคร",
|
||||
sortable: true,
|
||||
field: "dateAnnouncement",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateRegister",
|
||||
align: "left",
|
||||
label: "วันที่ชำระเงิน",
|
||||
sortable: true,
|
||||
field: "dateRegister",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "datePayment",
|
||||
align: "left",
|
||||
label: "วันที่ประกาศ",
|
||||
sortable: true,
|
||||
field: "datePayment",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamType("all"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let result: ResponsePeriodExam[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: RequestPeriodExam) => {
|
||||
const positionData: ResponsePosition[] = [];
|
||||
r.positionExam.map((r: RequestPosition) => {
|
||||
positionData.push({
|
||||
id: r.id,
|
||||
position: {
|
||||
id: r.positionId,
|
||||
name: r.positionName,
|
||||
},
|
||||
type: {
|
||||
id: r.typeId,
|
||||
name: r.typeName,
|
||||
},
|
||||
});
|
||||
});
|
||||
const bankData: ResponsePayment[] = [];
|
||||
r.bankExam.map((r: RequestPayment) => {
|
||||
bankData.push({
|
||||
id: r.id,
|
||||
accountNumber: r.accountNumber,
|
||||
bankName: r.bankName,
|
||||
accountName: r.accountName,
|
||||
});
|
||||
});
|
||||
result.push({
|
||||
id: r.id,
|
||||
dateAnnounce: new Date(r.announcementDate),
|
||||
announcementExam: r.announcementExam,
|
||||
name: r.name,
|
||||
checkDocument: r.checkDocument,
|
||||
checkDisability: r.checkDisability,
|
||||
round: r.round,
|
||||
yearly: r.year,
|
||||
fee: r.fee,
|
||||
dateAnnouncement: [
|
||||
new Date(r.announcementStartDate),
|
||||
new Date(r.announcementEndDate),
|
||||
],
|
||||
dateExam: new Date(r.examDate),
|
||||
dateRegister: [
|
||||
new Date(r.registerStartDate),
|
||||
new Date(r.registerEndDate),
|
||||
],
|
||||
datePayment: [
|
||||
new Date(r.paymentStartDate),
|
||||
new Date(r.paymentEndDate),
|
||||
],
|
||||
organizationName: {
|
||||
id: r.organizationId,
|
||||
name: r.organizationName,
|
||||
},
|
||||
organizationShortName: {
|
||||
id: r.organizationCodeId,
|
||||
name: r.organizationCodeName,
|
||||
},
|
||||
positionExam: positionData,
|
||||
pay: r.bankExam.length > 0 ? "payment2" : "payment1",
|
||||
bankExam: bankData,
|
||||
editor: r.detail,
|
||||
note: r.note,
|
||||
category: r.category,
|
||||
});
|
||||
});
|
||||
}
|
||||
examData.value = result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickEdit = (col: ResponsePeriodExam) => {
|
||||
router.push(`/qualify/period/${col.id}`);
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
await deleteData(id);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "qualifyPeriodAdd" });
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodExamId(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
1539
src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue
Normal file
1539
src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue
Normal file
File diff suppressed because it is too large
Load diff
24
src/modules/03_recruiting/views/02_qualify/PeriodStat.vue
Normal file
24
src/modules/03_recruiting/views/02_qualify/PeriodStat.vue
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
สถิติสมัครคัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-px-md q-py-sm">
|
||||
<iframe
|
||||
:src="panelUrl"
|
||||
style="height: 80vh; width: 100%; border: none; overflow: hidden"
|
||||
></iframe>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import config from "@/app.config";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
|
||||
const panelUrl = ref<string>("");
|
||||
|
||||
onBeforeMount(async () => {
|
||||
panelUrl.value = config.qualifyExamPanel;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
สถิติสมัครคัดเลือกคนพิการ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-px-md q-py-sm">
|
||||
<iframe
|
||||
:src="panelUrl"
|
||||
style="height: 80vh; width: 100%; border: none; overflow: hidden"
|
||||
></iframe>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import config from "@/app.config";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
|
||||
const panelUrl = ref<string>("");
|
||||
|
||||
onBeforeMount(async () => {
|
||||
panelUrl.value = config.qualifyDisableExamPanel;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
661
src/modules/03_recruiting/views/02_qualify/manageDetail.vue
Normal file
661
src/modules/03_recruiting/views/02_qualify/manageDetail.vue
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
{{ name }}
|
||||
{{ `ครั้งที่${round}/${yearly == null ? "" : yearly + 543}` }}
|
||||
<q-space />
|
||||
<q-btn
|
||||
@click="visible = !visible"
|
||||
dense
|
||||
round
|
||||
size="13px"
|
||||
:style="
|
||||
visible == false
|
||||
? 'transform: rotate(90deg);transition-duration: 0.8s;'
|
||||
: 'transform: rotate(0);transition-duration: 0.8s;'
|
||||
"
|
||||
icon="mdi-pin"
|
||||
flat
|
||||
></q-btn>
|
||||
</div>
|
||||
<q-slide-transition>
|
||||
<q-card class="row col-12 q-mb-sm" v-show="visible">
|
||||
<div class="col-12 row">
|
||||
<div class="q-py-md row col-12 no-wrap">
|
||||
<!-- การ์ดแสดงจำนวนข้อมูล -->
|
||||
<div class="col-12 row">
|
||||
<div class="text-grey-7 row text-weight-medium col-12 q-pl-md">
|
||||
สรุปจำนวนผู้สมัครคัดเลือก
|
||||
<datepicker
|
||||
class="q-pl-sm"
|
||||
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
|
||||
size="md"
|
||||
icon="mdi-download"
|
||||
round
|
||||
flat
|
||||
color="primary"
|
||||
@click="downloadFileDashboard"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดสรุปข้อมูลสมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickCandidateList()"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickPassExam()"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row col-12 q-col-gutter-md fit q-pa-md">
|
||||
<div
|
||||
style="width: 25%"
|
||||
v-for="(num, index) in dataNum"
|
||||
:key="index"
|
||||
>
|
||||
<q-card bordered flat class="row fit cardNum items-center">
|
||||
<div class="col-12 row items-center q-pa-sm">
|
||||
<div
|
||||
:class="
|
||||
'col-12 text-h5 text-weight-bold text-' + `${num.color}`
|
||||
"
|
||||
>
|
||||
{{
|
||||
num.count != null
|
||||
? num.count.toLocaleString("en-US")
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="col-12 text-dark ellipsis">
|
||||
{{ num.name }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-slide-transition>
|
||||
<q-card flat bordered class="col-12 q-pt-sm">
|
||||
<TableCandidate
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
v-model:inputvisibleFilter="status"
|
||||
v-model:optionsFilter="optionsStatus"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
:statusPayment="statusPayment"
|
||||
:setSeat="setSeat"
|
||||
:fetchData="fetchDataCom"
|
||||
:history="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="viewDetail(props.row.id, props.row.status)"
|
||||
>
|
||||
<div v-if="col.name == 'no'" class="table_ellipsis">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
<div class="row col-12 items-center">
|
||||
<img
|
||||
v-if="props.row.avatar == ''"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="props.row.avatar"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.fullname }}
|
||||
</div>
|
||||
<!-- <div class="text-weight-light">
|
||||
{{ props.row.citizenId }}
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'career'">
|
||||
<div class="col-4">
|
||||
{{ props.row.career }}
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.position }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'edu'">
|
||||
<div class="col-4">
|
||||
{{ props.row.edu }}
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.university }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'status'"
|
||||
:class="
|
||||
props.row.status == 'checkRegister' ||
|
||||
props.row.status == 'checkPayment' ||
|
||||
props.row.status == 'checkSeat' ||
|
||||
props.row.status == 'checkPoint'
|
||||
? 'text-blue'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ statusCandidate(props.row.status) }}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-file-chart-outline"
|
||||
v-if="props.row.status == 'done'"
|
||||
@click="clickPointRow(props.row)"
|
||||
>
|
||||
<q-tooltip>ผลสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</TableCandidate>
|
||||
</q-card>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 550px">
|
||||
<q-card-section class="row items-center q-py-sm">
|
||||
<div class="text-bold">บัตรประจำตัวผู้สอบ</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
v-close-popup
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-section class="row items-center">
|
||||
<div class="col text-dark">
|
||||
<ExamFinished :status="status" :candidateId="candidateId" />
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import TableCandidate from "@/modules/03_recruiting/components/TableCandidate.vue";
|
||||
import ExamFinished from "@/modules/03_recruiting/components/ExamFinished.vue";
|
||||
import type { DataNumObject } from "@/modules/01_metadata/interface/request/Calendar";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { genColor15, dateToISO, date2Thai, messageError } = mixin;
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
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);
|
||||
const round = ref<number | null>(null);
|
||||
const yearly = ref<number | null>(null);
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const visible = ref(true); //เปิดปิด card สรุปข้อมูล
|
||||
const dataNum = ref<DataNumObject[]>([]); //จำนวนสรุปจำนวนข้อมูลหลัก
|
||||
const rows = ref<any>([]);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"number",
|
||||
"examIdenNumber",
|
||||
"seatNumber",
|
||||
"resultB",
|
||||
"resultC",
|
||||
"pass",
|
||||
"citizenId",
|
||||
"fullname",
|
||||
"career",
|
||||
"office",
|
||||
"edu",
|
||||
"status",
|
||||
]);
|
||||
const optionsStatus = ref<any>([
|
||||
{
|
||||
id: "all",
|
||||
name: "ทั้งหมด",
|
||||
},
|
||||
{
|
||||
id: "checkRegister",
|
||||
name: "ตรวจสอบข้อมูลสมัครสอบ",
|
||||
},
|
||||
{
|
||||
id: "payment",
|
||||
name: "รอชำระค่าสมัครสอบ",
|
||||
},
|
||||
{
|
||||
id: "checkPayment",
|
||||
name: "ตรวจสอบหลักฐานชำระเงิน",
|
||||
},
|
||||
{
|
||||
id: "rejectPayment",
|
||||
name: "หลักฐานชำระเงินไม่ถูกต้อง",
|
||||
},
|
||||
{
|
||||
id: "checkSeat",
|
||||
name: "จัดที่นั่งสอบ",
|
||||
},
|
||||
{
|
||||
id: "checkPoint",
|
||||
name: "สรุปคะแนนสอบ",
|
||||
},
|
||||
{
|
||||
id: "done",
|
||||
name: "คัดเลือกสำเร็จ",
|
||||
},
|
||||
{
|
||||
id: "waiver",
|
||||
name: "สละสิทธิ์สอบ",
|
||||
},
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
sortable: true,
|
||||
field: "citizenId",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "number",
|
||||
align: "left",
|
||||
label: "ลำดับที่สอบได้",
|
||||
sortable: true,
|
||||
field: "number",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "examIdenNumber",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวสอบ",
|
||||
sortable: true,
|
||||
field: "examIdenNumber",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "seatNumber",
|
||||
align: "left",
|
||||
label: "เลขที่นั่งสอบ",
|
||||
sortable: true,
|
||||
field: "seatNumber",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "resultB",
|
||||
align: "left",
|
||||
label: "ผลสอบภาค ข",
|
||||
sortable: true,
|
||||
field: "resultB",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "resultC",
|
||||
align: "left",
|
||||
label: "ผลสอบภาค ค",
|
||||
sortable: true,
|
||||
field: "resultC",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "pass",
|
||||
align: "left",
|
||||
label: "ผลสอบ",
|
||||
sortable: true,
|
||||
field: "pass",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: false,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
watch(status, (count: String, prevCount: String) => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchDataCom();
|
||||
});
|
||||
|
||||
const clickPassExam = () => {
|
||||
window.open(config.API.exportExamPassExamList(examId.value));
|
||||
};
|
||||
|
||||
const clickCandidateList = () => {
|
||||
window.open(config.API.exportExamCandidateList(examId.value));
|
||||
};
|
||||
|
||||
const fetchDataCom = async () => {
|
||||
await fetchDataSummary();
|
||||
await fetchPeriodExam();
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateOfPeriodExam(status.value, examId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((r: any) => {
|
||||
rows.value.push({
|
||||
id: r.id,
|
||||
fullname: `${r.firstName} ${r.lastName}`,
|
||||
avatar: r.profileImg != null ? r.profileImg.detail : "",
|
||||
citizenId: r.citizenId,
|
||||
number: r.number,
|
||||
examIdenNumber: r.examIdenNumber,
|
||||
seatNumber: r.seatNumber,
|
||||
resultC: r.resultC,
|
||||
resultB: r.resultB,
|
||||
pass: r.pass,
|
||||
email: r.email,
|
||||
status: r.status,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchPeriodExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamStatus(examId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
name.value = data.name;
|
||||
round.value = data.round;
|
||||
yearly.value = data.year;
|
||||
statusPayment.value = data.status;
|
||||
setSeat.value = data.setSeat;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* สรุปจำนวน
|
||||
*/
|
||||
const fetchDataSummary = async () => {
|
||||
dataNum.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.countDashbordPeriodExam(examId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
data.map((e: DataNumObject) => {
|
||||
dataNum.value.push({
|
||||
id: e.id,
|
||||
count: e.count,
|
||||
name: e.name,
|
||||
color: genColor15(e.id),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
dataNum.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFileDashboard = async () => {
|
||||
loaderPage(true);
|
||||
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(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
/**
|
||||
* สรุปคะแนนสอบ
|
||||
*/
|
||||
const clickPointRow = async (row: any) => {
|
||||
candidateId.value = row.id;
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const viewDetail = (id: string, status: string) => {
|
||||
if (status == "checkPayment") {
|
||||
router.push(`${route.fullPath}/payment/${id}`);
|
||||
} else {
|
||||
router.push(`${route.fullPath}/profile/${id}`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า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":
|
||||
return "ยังไม่สมัครสอบ";
|
||||
case "checkRegister":
|
||||
return "ตรวจสอบข้อมูลสมัครสอบ";
|
||||
case "payment":
|
||||
return "รอชำระค่าสมัครสอบ";
|
||||
case "rejectRegister":
|
||||
return "คุณสมบัติสมัครสอบไม่ผ่าน";
|
||||
case "checkPayment":
|
||||
return "ตรวจสอบหลักฐานชำระเงิน";
|
||||
case "rejectPayment":
|
||||
return "หลักฐานชำระเงินไม่ถูกต้อง";
|
||||
case "checkSeat":
|
||||
return "จัดที่นั่งสอบ";
|
||||
case "checkPoint":
|
||||
return "สรุปคะแนนสอบ";
|
||||
case "done":
|
||||
return "คัดเลือกสำเร็จ";
|
||||
case "waiver":
|
||||
return "สละสิทธิ์สอบ";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
1188
src/modules/03_recruiting/views/03_editor/index.vue
Normal file
1188
src/modules/03_recruiting/views/03_editor/index.vue
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue