Merge branch 'develop' into nice

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-01-06 09:05:25 +07:00
commit 5e29bac774
6 changed files with 73 additions and 71 deletions

View file

@ -134,7 +134,7 @@ const fetchDistrict = async (id: string, position: string) => {
await http
.get(config.API.listDistrict(id))
.then((res) => {
const data = res.data.result;
const data = res.data.result.districts;
let option: DataOption[] = [];
data.map((r: DataOption) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
@ -158,7 +158,7 @@ const fetchSubDistrict = async (id: string, position: string) => {
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
const data = res.data.result;
const data = res.data.result.subDistricts;
let option: DataOption[] = [];
data.map((r: DataOption) => {
option.push({

View file

@ -142,7 +142,7 @@ async function fetchDistrict(id: string) {
await http
.get(config.API.listDistrict(id))
.then((res) => {
const data = res.data.result;
const data = res.data.result.districts;
let option: DataOption[] = [];
data.map((r: DataOption) => {
option.push({ id: r.id.toString(), name: r.name.toString() });

View file

@ -11,6 +11,7 @@ import { useQuasar } from "quasar";
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
import Table from "@/modules/03_recruiting/components/Table.vue";
import genReportXLSX from "@/plugins/genreportxlsx";
const $q = useQuasar();
const router = useRouter();
@ -34,6 +35,8 @@ const visibleColumns = ref<String[]>([
"dateOfBirth",
"gender",
"position_name",
"position_type",
"position_level",
"university",
"degree",
"major",
@ -120,6 +123,34 @@ const columns = ref<QTableProps["columns"]>([
sensitivity: "base",
}),
},
{
name: "position_type",
align: "left",
label: "ประเภทที่สมัคร",
sortable: true,
field: "position_type",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, {
numeric: true,
sensitivity: "base",
}),
},
{
name: "position_level",
align: "left",
label: "ระดับที่สมัคร",
sortable: true,
field: "position_level",
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",
@ -250,15 +281,10 @@ function clickDetail(examID: string) {
async function downloadExam() {
showLoader();
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();
.get(config.API.exportExam(importId.value))
.then(async (res) => {
const dataList = res.data.result;
await genReportXLSX(dataList, "ส่งออกข้อมูลผู้มีสิทธิ์สอบ");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
@ -272,15 +298,10 @@ async function downloadExam() {
async function downloadPassExam() {
showLoader();
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();
.get(config.API.exportPassExam(importId.value))
.then(async (res) => {
const dataList = res.data.result;
await genReportXLSX(dataList, "ส่งออกข้อมูลผู้สอบผ่านภาค ก.");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
@ -294,15 +315,10 @@ async function downloadPassExam() {
async function downloadPassResultExam() {
showLoader();
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();
.get(config.API.exportPassResultExam(importId.value))
.then(async (res) => {
const dataList = res.data.result;
await genReportXLSX(dataList, "ส่งออกข้อมูลผู้สอบแข่งขันได้");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));

View file

@ -11,6 +11,7 @@ import { useCounterMixin } from "@/stores/mixin";
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
import Table from "@/modules/03_recruiting/components/Table.vue";
import genReportXLSX from "@/plugins/genreportxlsx";
const $q = useQuasar();
const router = useRouter();
@ -220,15 +221,10 @@ function clickDetail(examID: string) {
async function downloadExam() {
showLoader();
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();
.get(config.API.exportDisableExam(importId.value))
.then(async (res) => {
const dataList = res.data.result;
await genReportXLSX(dataList, "ส่งออกข้อมูลผู้มีสิทธิ์สอบ");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
@ -242,15 +238,10 @@ async function downloadExam() {
async function downloadPassExam() {
showLoader();
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();
.get(config.API.exportDisablePassExam(importId.value))
.then(async (res) => {
const dataList = res.data.result;
await genReportXLSX(dataList, "ส่งออกข้อมูลผู้สอบผ่านภาค");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
@ -264,15 +255,10 @@ async function downloadPassExam() {
async function downloadPassResultExam() {
showLoader();
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();
.get(config.API.exportDisablePassResultExam(importId.value))
.then(async (res) => {
const dataList = res.data.result;
await genReportXLSX(dataList, "ส่งออกข้อมูลผู้คัดเลือกคนพิการได้");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));