ปรับ fe sprint2

This commit is contained in:
Kittapath 2023-06-19 15:50:50 +07:00
parent 8576f3c387
commit 0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions

View file

@ -274,7 +274,7 @@ const subdistrictCOptions = ref<DataOption[]>([]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const emit = defineEmits(["update:form"]);
watch(myform, async (count: any, prevCount: any) => {
@ -319,7 +319,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -381,7 +381,7 @@ const fetchDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -409,7 +409,7 @@ const fetchSubDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -213,15 +213,7 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const {
dateThaiRange,
modalDelete,
modalConfirm,
dateToISO,
success,
showLoader,
hideLoader,
} = mixin;
const { dateThaiRange, modalDelete, modalConfirm, dateToISO, success } = mixin;
const store = useExamDataStore();
const { examData, changeExamColumns } = store;
const id = ref<string>("");
@ -326,7 +318,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateCareer(candidateId.value))
.then((res) => {
@ -344,7 +336,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -423,7 +415,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
showLoader();
loaderPage(true);
await http
.delete(config.API.candidateAdminCareer(rawItem.value.id))
.then(() => {
@ -459,7 +451,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.candidateAdminCareer(candidateId.value), {
name: location.value,
@ -484,7 +476,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateAdminCareer(id.value), {
name: location.value,

View file

@ -168,7 +168,7 @@ const name = ref<string>("");
const files = ref<UploadType[]>([]);
const file = ref<File[]>([]);
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
onMounted(async () => {
await getData();
@ -180,7 +180,7 @@ const fileAdd = async (val: any) => {
};
const getData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateUpload(candidateId.value))
.then((res) => {
@ -191,7 +191,7 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -199,7 +199,7 @@ const deleteData = async (id: string) => {
const params = {
documentId: id,
};
showLoader();
loaderPage(true);
await http
.delete(config.API.candidateUpload(candidateId.value), {
params,
@ -211,7 +211,7 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
await getData();
});
};
@ -223,7 +223,7 @@ const uploadData = async () => {
});
const formData = new FormData();
formData.append("", newFile);
showLoader();
loaderPage(true);
await http
.put(config.API.candidateUpload(candidateId.value), formData)
.then((res) => {
@ -233,7 +233,7 @@ const uploadData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
name.value = "";
uploader.value.reset();
await getData();

View file

@ -240,7 +240,7 @@ const rows = ref<RequestItemsObject[]>([]);
const route = useRoute();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const candidateId = ref<string>(route.params.candidateId.toString());
const filter = ref<string>(""); //search data table
@ -324,7 +324,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateEducation(candidateId.value))
.then((res) => {
@ -343,12 +343,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetcheducationLevel = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.educationLevel)
.then((res) => {
@ -363,7 +363,7 @@ const fetcheducationLevel = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -444,7 +444,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
showLoader();
loaderPage(true);
await http
.delete(config.API.candidateAdminEducation(rawItem.value.id))
.then(() => {
@ -480,7 +480,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.candidateAdminEducation(candidateId.value), {
educationLevelId: educationLevelId.value,
@ -505,7 +505,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateAdminEducation(id.value), {
educationLevelId: educationLevelId.value,

View file

@ -113,7 +113,7 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const { messageError, date2Thai } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const fullName = ref<string>("");
@ -136,7 +136,7 @@ onMounted(async () => {
});
const fetchCard = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateCard(props.candidateId))
.then((res) => {
@ -178,7 +178,7 @@ const fetchCard = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -302,7 +302,7 @@ const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const edit = ref<boolean>(true);
const myform = ref<any>({});
const route = useRoute();
@ -323,7 +323,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateFamily(candidateId.value))
.then((res) => {
@ -350,7 +350,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -430,8 +430,7 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, calAge, modalError, success, showLoader, hideLoader } =
mixin;
const { date2Thai, calAge, modalError, success } = mixin;
const districtOptions = ref<DataOption[]>([]);
const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
@ -464,7 +463,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateInformation(candidateId.value))
.then((res) => {
@ -495,12 +494,12 @@ const fetchData = async () => {
keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.family_name;
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchImgData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateProfile(candidateId.value))
.then((res) => {
@ -511,7 +510,7 @@ const fetchImgData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
@ -543,7 +542,7 @@ const selectProvince = (val: string) => {
};
const fetchDistrict = async (id: string) => {
showLoader();
loaderPage(true);
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -558,7 +557,7 @@ const fetchDistrict = async (id: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -283,7 +283,7 @@ const candidateId = ref<string>(route.params.candidateId.toString());
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const emit = defineEmits(["update:form"]);
@ -300,7 +300,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateOccupation(candidateId.value))
.then((res) => {
@ -327,7 +327,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -21,11 +21,7 @@
<q-separator class="q-my-lg bg-gray" size="5px" />
<div class="q-px-sm">
<Family
:prefixOptions="prefixOptions"
:status="status"
v-model:form="formFamily"
/>
<Family :prefixOptions="prefixOptions" :status="status" v-model:form="formFamily" />
</div>
<q-separator class="q-my-lg bg-gray" size="5px" />
@ -60,9 +56,9 @@ import Occupation from "@/modules/03_recruiting/components/Occupation.vue";
import Education from "@/modules/03_recruiting/components/Education.vue";
import Career from "@/modules/03_recruiting/components/Career.vue";
import Document from "@/modules/03_recruiting/components/Document.vue";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useManageDataStore } from "@/modules/01_metadata/store";
const props = defineProps({
status: {
@ -88,9 +84,8 @@ const props = defineProps({
});
const $q = useQuasar();
const store = useManageDataStore();
const { getPrefix } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const prefixOptions = ref<DataOption[]>([]);
const relationshipOptions = ref<DataOption[]>([]);
const provinceOptions = ref<DataOption[]>([]);
@ -99,7 +94,7 @@ const formAddress = ref<any>({});
const formFamily = ref<any>({});
const formOccupation = ref<any>({});
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const emit = defineEmits([
"update:formInformation",
@ -125,26 +120,34 @@ watch(formOccupation, async (count: Object, prevCount: Object) => {
});
onMounted(() => {
hideLoader();
loaderPage(false);
fetchPrefix();
fetchRelationship();
fetchProvince();
});
const fetchPrefix = async () => {
const result = await getPrefix(true, false);
const data = result.data;
let option: DataOption[] = [];
if (data.length > 0) {
data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
loaderPage(true);
await http
.get(config.API.prefix)
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
prefixOptions.value = option;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
prefixOptions.value = option;
};
const fetchRelationship = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.relationship)
.then((res) => {
@ -159,12 +162,12 @@ const fetchRelationship = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchProvince = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.province)
.then((res) => {
@ -179,7 +182,7 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -106,9 +106,9 @@
:virtual-scroll-sticky-size-start="48"
dense
:pagination-label="paginationLabel"
:pagination="initialPagination"
:rows-per-page-options="[0]"
>
<!-- :pagination="initialPagination"
:rows-per-page-options="[0]" -->
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">

View file

@ -47,7 +47,7 @@
<q-list style="min-width: 100px">
<q-item clickable v-close-popup @click="downloadFile()">
<q-item-section class="text-blue"
>ดาวนโหลดอมสมคร(แบบย)</q-item-section
>ดาวนโหลดดการรายชสมคร</q-item-section
>
</q-item>
<q-item clickable v-close-popup @click="downloadFileDetail()">
@ -155,7 +155,7 @@ const table = ref<any>(null);
const files = ref<File[]>([]);
const filterRef = ref<any>(null);
const examId = ref<string>(route.params.examId.toString());
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const props = defineProps({
inputfilter: String,
inputvisible: Array,
@ -278,7 +278,7 @@ const uploadFile = async () => {
};
const uploadDataSeat = async () => {
showLoader();
loaderPage(true);
const formData = new FormData();
formData.append("", files.value[0]);
await http
@ -290,14 +290,14 @@ const uploadDataSeat = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
files.value = [];
props.fetchData();
});
};
const uploadDataPoint = async () => {
showLoader();
loaderPage(true);
const formData = new FormData();
formData.append("", files.value[0]);
await http
@ -310,14 +310,14 @@ const uploadDataPoint = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
files.value = [];
props.fetchData();
});
};
const downloadFile = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamDownload(examId.value), {
responseType: "blob",
@ -330,12 +330,12 @@ const downloadFile = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadFileDetail = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamDownloadDetail(examId.value), {
responseType: "blob",
@ -348,7 +348,7 @@ const downloadFileDetail = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -1,9 +1,9 @@
//ข้อมูล
interface RequestPeriodExam {
announcementDate: string;
announcementEndDate: string;
announcementStartDate: string;
examDate: string;
announcementDate: string | null;
announcementEndDate: string | null;
announcementStartDate: string | null;
examDate: string | null;
announcementExam: boolean;
bankExam: RequestPayment[];
checkDisability: boolean;
@ -18,51 +18,51 @@ interface RequestPeriodExam {
organizationCodeName: string;
organizationId: string;
organizationName: string;
paymentEndDate: string;
paymentEndDate: string | null;
paymentKrungThai: string;
paymentStartDate: string;
paymentStartDate: string | null;
positionExam: RequestPosition[];
registerEndDate: string;
registerStartDate: string;
registerEndDate: string | null;
registerStartDate: string | null;
round: number;
year: number;
category: string;
}
interface RequestPeriodCompete {
announcementEndDate: string;
announcementStartDate: string;
examDate: string;
announcementEndDate: string | null;
announcementStartDate: string | null;
examDate: string | null;
detail: string;
fee: number;
id: string;
name: string;
note: string;
paymentEndDate: string;
paymentStartDate: string;
registerEndDate: string;
registerStartDate: string;
paymentEndDate: string | null;
paymentStartDate: string | null;
registerEndDate: string | null;
registerStartDate: string | null;
order: number;
year: number;
announcementDate: string;
announcementDate: string | null;
}
interface RequestPeriodDisable {
announcementEndDate: string;
announcementStartDate: string;
examDate: string;
announcementEndDate: string | null;
announcementStartDate: string | null;
examDate: string | null;
detail: string;
fee: number;
id: string;
name: string;
note: string;
paymentEndDate: string;
paymentStartDate: string;
registerEndDate: string;
registerStartDate: string;
paymentEndDate: string | null;
paymentStartDate: string | null;
registerEndDate: string | null;
registerStartDate: string | null;
round: number;
year: number;
announcementDate: string;
announcementDate: string | null;
}
interface RequestPosition {
@ -71,6 +71,7 @@ interface RequestPosition {
positionName: string;
typeId: string;
typeName: string;
highDegree: Boolean;
}
interface RequestPayment {

View file

@ -21,11 +21,11 @@ interface ResponsePeriodExam {
round: number;
yearly: number;
fee: number;
dateAnnounce: Date;
dateAnnouncement: [Date, Date];
dateExam: Date;
dateRegister: [Date, Date];
datePayment: [Date, Date];
dateAnnounce: Date | null;
dateAnnouncement: [Date, Date] | null;
dateExam: Date | null;
dateRegister: [Date, Date] | null;
datePayment: [Date, Date] | null;
organizationName: {
id: string;
name: string;
@ -50,6 +50,7 @@ interface ResponsePosition {
id: string;
name: string;
};
highDegree: Boolean;
}
interface ResponsePayment {
id: string;

View file

@ -18,9 +18,7 @@
<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-section class="text-blue">งออกขอมลผทธสอบ</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="downloadPassExam()">
<q-item-section class="text-primary"
@ -48,7 +46,6 @@
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
v-model:pagination="pagination"
:nornmalData="false"
:conclude="true"
>
@ -102,23 +99,12 @@
</q-tr>
</template>
</Table>
<div class="row justify-center q-mt-md">
<q-pagination
v-model="pagination.page"
color="grey-8"
:max="pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</div>
</div>
</q-card>
</template>
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { ref, onMounted, computed } from "vue";
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";
@ -134,7 +120,7 @@ const router = useRouter();
const route = useRoute();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const year = ref<string>("");
const round = ref<string>("");
const name = ref<string>("");
@ -326,18 +312,8 @@ const columns = ref<QTableProps["columns"]>([
},
]);
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const pagesNumber = computed(() => {
return Math.ceil(rows.value.length / pagination.value.rowsPerPage);
});
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
@ -346,7 +322,7 @@ const clickDetail = (examID: string) => {
};
const downloadExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.exportExam(importId.value), {
responseType: "blob",
@ -362,12 +338,12 @@ const downloadExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadPassExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.exportPassExam(importId.value), {
responseType: "blob",
@ -383,12 +359,12 @@ const downloadPassExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadPassResultExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.exportPassResultExam(importId.value), {
responseType: "blob",
@ -404,12 +380,12 @@ const downloadPassResultExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.getExamResultById(importId.value), {
examAttribute: "",
@ -437,7 +413,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -1,237 +1,304 @@
<!-- 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="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="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="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="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="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="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="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="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">
{{ 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="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="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-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">
{{ 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">
{{ 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">
{{ 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-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-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">
{{ 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>
<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";
@ -269,7 +336,7 @@ const examCount = ref<string>("");
const number = ref<string>("");
const score_expired = ref<string>("");
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const examID = ref<string>("62150001");
const prefix = ref<string>("นาย");
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
@ -277,91 +344,95 @@ 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();
await fetchData();
});
const fetchData = async () => {
showLoader();
await http
.get(config.API.getExamDetail(importId.value, examId.value))
.then((res) => {
let data = res.data.result;
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(() => {
hideLoader();
});
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 () => {
showLoader();
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(() => {
hideLoader();
});
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 () => {
showLoader();
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(() => {
hideLoader();
});
loaderPage(true);
let type = degree.value.includes("บัณฑิต") ? 2 : 1;
await http
.get(
config.API.downloadExamReport(importId.value, examId.value, type),
{
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>

View file

@ -316,10 +316,7 @@
<q-dialog v-model="modalCandidate" persistent>
<q-card style="width: 600px">
<q-form ref="myFormScore">
<DialogHeader
:tittle="textTittleCandidate"
:close="clickCloseCandidate"
/>
<DialogHeader :tittle="textTittleCandidate" :close="clickCloseCandidate" />
<q-separator />
<q-card-section>
<div class="col-12 row items-center q-col-gutter-sm">
@ -382,7 +379,7 @@ const name = ref<string>("");
const year = ref<number>(new Date().getFullYear() + 543);
const order = ref<number>(1);
const mixin = useCounterMixin();
const { success, dateToISO, dateText, showLoader, hideLoader } = mixin;
const { success, dateToISO, dateText } = mixin;
const files = ref<any>(null);
const files_score = ref<any>(null);
const files_candidate = ref<any>(null);
@ -554,7 +551,7 @@ const visibleColumnsHistory = ref<String[]>([
]);
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
@ -567,7 +564,7 @@ const textDate = (value: Date) => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.getCandidates)
.then((res) => {
@ -589,7 +586,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -623,7 +620,7 @@ const clickEditPeriod = (id: string) => {
const clickHistory = async (id: string) => {
modalHistory.value = true;
showLoader();
loaderPage(true);
await http
.get(config.API.getImportHistory(id))
.then((res) => {
@ -652,7 +649,7 @@ const clickHistory = async (id: string) => {
statusCode.value = e.response.data.status;
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
@ -667,7 +664,7 @@ const clickDelete = (id: string) => {
persistent: true,
})
.onOk(async () => {
showLoader();
loaderPage(true);
await http
.delete(config.API.deleteCandidates(id))
.then((res) => {
@ -678,7 +675,7 @@ const clickDelete = (id: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
})
.onCancel(() => {})
@ -707,7 +704,7 @@ const clickCloseCandidate = async () => {
const checkSaveCandidate = async () => {
const fd = new FormData();
fd.append("attachment", files_candidate.value[0]);
showLoader();
loaderPage(true);
await http
.post(config.API.uploadCandidates(selected_row_id.value), fd)
.then((res) => {
@ -720,14 +717,14 @@ const checkSaveCandidate = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const checkSaveScore = async () => {
const fd = new FormData();
fd.append("attachment", files_score.value[0]);
showLoader();
loaderPage(true);
await http
.post(config.API.saveScores(selected_row_id.value), fd)
.then((res) => {
@ -740,7 +737,7 @@ const checkSaveScore = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -750,7 +747,7 @@ const checkSave = async () => {
fd.append("year", year.value.toString());
fd.append("order", order.value.toString());
fd.append("name", name.value);
showLoader();
loaderPage(true);
await http
.post(config.API.saveCandidates, fd)
.then((res) => {
@ -762,7 +759,7 @@ const checkSave = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -112,8 +112,9 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="date2Thai(dateExam)"
:model-value="dateExam != null ? date2Thai(dateExam) : null"
:label="`${'วันที่สอบ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สอบ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -149,8 +150,13 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateAnnouncement)"
:model-value="
dateAnnouncement != null
? dateThaiRange(dateAnnouncement)
: null
"
:label="`${'วันที่ประกาศ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -186,8 +192,11 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateRegister)"
:model-value="
dateRegister != null ? dateThaiRange(dateRegister) : null
"
:label="`${'วันที่สมัคร'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]"
>
<template v-slot:prepend>
<q-icon
@ -223,8 +232,11 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(datePayment)"
:model-value="
datePayment != null ? dateThaiRange(datePayment) : null
"
:label="`${'วันที่ชำระเงิน'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]"
>
<template v-slot:prepend>
<q-icon
@ -260,8 +272,11 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="date2Thai(dateAnnounce)"
:model-value="
dateAnnounce != null ? date2Thai(dateAnnounce) : null
"
:label="`${'วันประกาศผลสอบ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -669,8 +684,7 @@ const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO, notifyError, showLoader, hideLoader } =
mixin;
const { date2Thai, success, dateToISO, notifyError } = mixin;
const myForm = ref<QForm | null>(null); //form data input
const name = ref<string>("");
const note = ref<string>("");
@ -679,11 +693,11 @@ 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 dateRegister = ref<[Date, Date] | null>(null); //
const datePayment = ref<[Date, Date] | null>(null); //
const dateAnnouncement = ref<[Date, Date] | null>(null); //
const dateExam = ref<Date | null>(null); //
const dateAnnounce = ref<Date | null>(null); //
const positionPathOptions = ref<DataOption[]>([]);
const organizationShortName = ref<DataOption>({ id: "", name: "" });
const organizationName = ref<DataOption>({ id: "", name: "" });
@ -766,7 +780,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => {
});
onMounted(async () => {
hideLoader();
loaderPage(false);
if (route.params.id != undefined) {
edit.value = true;
id.value = route.params.id.toString();
@ -781,7 +795,7 @@ const clickBack = () => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.getPeriodById(id.value))
.then((res) => {
@ -794,22 +808,27 @@ const fetchData = async () => {
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),
];
dateAnnouncement.value =
data.announcementStartDate != null && data.announcementEndDate != null
? [
new Date(data.announcementStartDate),
new Date(data.announcementEndDate),
]
: null;
dateExam.value = data.examDate != null ? new Date(data.examDate) : null;
dateRegister.value =
data.registerStartDate != null && data.registerEndDate != null
? [new Date(data.registerStartDate), new Date(data.registerEndDate)]
: null;
datePayment.value =
data.paymentStartDate != null && data.paymentEndDate != null
? [new Date(data.paymentStartDate), new Date(data.paymentEndDate)]
: null;
editor.value = data.detail;
note.value = data.note;
dateAnnounce.value = new Date(data.announcementDate);
dateAnnounce.value =
data.announcementDate != null ? new Date(data.announcementDate) : null;
fileDocs.value = files;
fileImgs.value = images;
@ -818,7 +837,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -845,7 +864,7 @@ const uploadDocData = async () => {
fileDocDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
showLoader();
loaderPage(true);
await http
.put(config.API.periodRecruitDoc(id.value), formData)
.then((res) => {})
@ -853,7 +872,7 @@ const uploadDocData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
success($q, "บันทึกข้อมูลสำเร็จ");
clickBack();
});
@ -869,7 +888,7 @@ const uploadImgData = async () => {
fileImgDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
showLoader();
loaderPage(true);
await http
.put(config.API.periodRecruitImg(id.value), formData)
.then((res) => {})
@ -877,7 +896,7 @@ const uploadImgData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
}
};
@ -923,27 +942,38 @@ const checkSave = async () => {
const sendData = () => {
const valueData: RequestPeriodCompete = {
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
examDate: dateToISO(dateExam.value),
announcementEndDate:
dateAnnouncement.value !== null
? dateToISO(dateAnnouncement.value[1])
: null,
announcementStartDate:
dateAnnouncement.value !== null
? dateToISO(dateAnnouncement.value[0])
: null,
examDate: dateExam.value !== null ? dateToISO(dateExam.value) : null,
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]),
paymentEndDate:
datePayment.value !== null ? dateToISO(datePayment.value[1]) : null,
paymentStartDate:
datePayment.value !== null ? dateToISO(datePayment.value[0]) : null,
registerEndDate:
dateRegister.value !== null ? dateToISO(dateRegister.value[1]) : null,
registerStartDate:
dateRegister.value !== null ? dateToISO(dateRegister.value[0]) : null,
order: round.value,
year: yearly.value,
announcementDate: dateToISO(dateAnnounce.value),
announcementDate:
dateAnnounce.value !== null ? dateToISO(dateAnnounce.value) : null,
};
return valueData;
};
const deleteDocData = async (docId: string) => {
showLoader();
loaderPage(true);
await http
.delete(config.API.periodDeleteDoc(docId))
.then(async () => {
@ -953,12 +983,12 @@ const deleteDocData = async (docId: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const deleteImgData = async (docId: string) => {
showLoader();
loaderPage(true);
await http
.delete(config.API.periodDeleteImg(docId))
.then(async () => {
@ -968,12 +998,12 @@ const deleteImgData = async (docId: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const addData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.savePeriod, sendData())
.then(async (res) => {
@ -986,12 +1016,12 @@ const addData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const editData = async (id: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.editPeriod(id), sendData())
.then(async () => {
@ -1002,7 +1032,7 @@ const editData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};

View file

@ -129,7 +129,7 @@ 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, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([
"examID",
@ -317,12 +317,12 @@ const clickDetail = (examID: string) => {
};
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
const downloadExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.exportDisableExam(importId.value), {
responseType: "blob",
@ -338,12 +338,12 @@ const downloadExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadPassExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.exportDisablePassExam(importId.value), {
responseType: "blob",
@ -359,12 +359,12 @@ const downloadPassExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadPassResultExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.exportDisablePassResultExam(importId.value), {
responseType: "blob",
@ -380,12 +380,12 @@ const downloadPassResultExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.getDisableExamResultById(importId.value), {
examAttribute: "",
@ -416,7 +416,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -26,16 +26,12 @@
{{ profile_id }}
</div>
<div class="col-6 text-grey-7" v-if="prefix !== null">
คำนำหนานาม
</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-grey-7" v-if="fullname !== null">ชื่อ-นามสกุล</div>
<div class="col-6 text-black" v-if="fullname !== null">
{{ fullname }}
</div>
@ -59,23 +55,17 @@
{{ position_name }}
</div>
<div class="col-6 text-grey-7" v-if="university !== null">
สถานศกษา
</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-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-grey-7" v-if="major !== null">สาขาวิชาเอก</div>
<div class="col-6 text-black" v-if="major !== null">
{{ major }}
</div>
@ -128,11 +118,7 @@
>ดาวนโหลดผลคะแนน</q-item-section
>
</q-item>
<q-item
clickable
v-close-popup
@click="downloadCertificate()"
>
<q-item clickable v-close-popup @click="downloadCertificate()">
<q-item-section class="text-blue"
>ดาวนโหลดเอกสารรบรอง</q-item-section
>
@ -152,18 +138,12 @@
</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-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-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">
@ -201,16 +181,10 @@
</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"
>
<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'
"
:class="examResultinscore != 'ผ่าน' ? 'text-red' : 'text-positive'"
>{{ examResultinscore }}</span
>
</div>
@ -248,7 +222,7 @@ const dataStore = useDataStore();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const { loaderPage } = dataStore;
const date = ref<any>();
const profile_id = ref<string>("");
@ -289,7 +263,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.getDisableExamDetail(importId.value, examId.value))
.then((res) => {
@ -329,12 +303,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadScore = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.downloadDisableScoreReport(importId.value, examId.value), {
responseType: "blob",
@ -350,19 +324,16 @@ const downloadScore = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadCertificate = async () => {
showLoader();
loaderPage(true);
await http
.get(
config.API.downloadDisableExamReport(importId.value, examId.value, 2),
{
responseType: "blob",
}
)
.get(config.API.downloadDisableExamReport(importId.value, examId.value, 2), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
@ -374,7 +345,7 @@ const downloadCertificate = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -382,7 +382,7 @@ const name = ref<string>("");
const year = ref<number>(new Date().getFullYear() + 543);
const round = ref<number>(1);
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const { success, dateText, messageError } = mixin;
const files = ref<any>(null);
const files_score = ref<any>(null);
const files_candidate = ref<any>(null);
@ -549,7 +549,7 @@ const visibleColumnsHistory = ref<String[]>([
]);
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
@ -570,7 +570,7 @@ const textDate = (value: Date) => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.getDisableCandidates)
.then((res) => {
@ -592,7 +592,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -618,7 +618,7 @@ const clickEditPeriod = (id: string) => {
const clickHistory = async (id: string) => {
modalHistory.value = true;
showLoader();
loaderPage(true);
await http
.get(config.API.getDisableImportHistory(id))
.then((res) => {
@ -644,7 +644,7 @@ const clickHistory = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
@ -659,7 +659,7 @@ const clickDelete = (id: string) => {
persistent: true,
})
.onOk(async () => {
showLoader();
loaderPage(true);
await http
.delete(config.API.deleteDisableCandidates(id))
.then((res) => {
@ -670,7 +670,7 @@ const clickDelete = (id: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
})
.onCancel(() => {})
@ -699,7 +699,7 @@ const clickCloseCandidate = async () => {
const checkSaveCandidate = async () => {
const fd = new FormData();
fd.append("attachment", files_candidate.value[0]);
showLoader();
loaderPage(true);
await http
.post(config.API.uploadDisableCandidates(selected_row_id.value), fd)
.then((res) => {
@ -712,14 +712,14 @@ const checkSaveCandidate = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const checkSaveScore = async () => {
const fd = new FormData();
fd.append("attachment", files_score.value[0]);
showLoader();
loaderPage(true);
await http
.post(config.API.saveDisableScores(selected_row_id.value), fd)
.then((res) => {
@ -732,7 +732,7 @@ const checkSaveScore = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -742,7 +742,7 @@ const checkSave = async () => {
fd.append("year", year.value.toString());
fd.append("round", round.value.toString());
fd.append("name", name.value);
showLoader();
loaderPage(true);
await http
.post(config.API.saveDisableCandidates, fd)
.then((res) => {
@ -754,7 +754,7 @@ const checkSave = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -115,8 +115,9 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="date2Thai(dateExam)"
:model-value="dateExam != null ? date2Thai(dateExam) : null"
:label="`${'วันที่สอบ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สอบ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -154,6 +155,7 @@
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateAnnouncement)"
:label="`${'วันที่ประกาศ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -191,6 +193,7 @@
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateRegister)"
:label="`${'วันที่สมัคร'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]"
>
<template v-slot:prepend>
<q-icon
@ -228,6 +231,7 @@
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(datePayment)"
:label="`${'วันที่ชำระเงิน'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]"
>
<template v-slot:prepend>
<q-icon
@ -263,8 +267,11 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="date2Thai(dateAnnounce)"
:model-value="
dateAnnounce != null ? date2Thai(dateAnnounce) : null
"
:label="`${'วันประกาศผลสอบ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -671,15 +678,7 @@ const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const {
date2Thai,
success,
dateToISO,
notifyError,
messageError,
showLoader,
hideLoader,
} = mixin;
const { date2Thai, success, dateToISO, notifyError, messageError } = mixin;
const myForm = ref<QForm | null>(null); //form data input
const name = ref<string>("");
const note = ref<string>("");
@ -688,11 +687,11 @@ 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 dateRegister = ref<[Date, Date] | null>(null); //
const datePayment = ref<[Date, Date] | null>(null); //
const dateAnnouncement = ref<[Date, Date] | null>(null); //
const dateExam = ref<Date | null>(null); //
const dateAnnounce = ref<Date | null>(null); //
const positionPathOptions = ref<DataOption[]>([]);
const organizationShortName = ref<DataOption>({ id: "", name: "" });
const organizationName = ref<DataOption>({ id: "", name: "" });
@ -727,7 +726,7 @@ onMounted(async () => {
if (route.params.id != undefined) {
edit.value = true;
id.value = route.params.id.toString();
hideLoader();
loaderPage(false);
await fetchData();
} else {
edit.value = false;
@ -739,7 +738,7 @@ const clickBack = () => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.getDisablePeriodById(id.value))
.then((res) => {
@ -749,22 +748,26 @@ const fetchData = async () => {
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),
];
dateAnnouncement.value =
data.announcementStartDate != null && data.announcementEndDate != null
? [
new Date(data.announcementStartDate),
new Date(data.announcementEndDate),
]
: null;
dateExam.value = data.examDate != null ? new Date(data.examDate) : null;
dateRegister.value =
data.registerStartDate != null && data.registerEndDate != null
? [new Date(data.registerStartDate), new Date(data.registerEndDate)]
: null;
datePayment.value =
data.paymentStartDate != null && data.paymentEndDate != null
? [new Date(data.paymentStartDate), new Date(data.paymentEndDate)]
: null;
editor.value = data.detail;
note.value = data.note;
dateAnnounce.value = new Date(data.announcementDate);
dateAnnounce.value =
data.announcementDate != null ? new Date(data.announcementDate) : null;
fileDocs.value = data.documents;
fileImgs.value = data.images;
})
@ -772,7 +775,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -796,27 +799,38 @@ const checkSave = async () => {
const sendData = () => {
const valueData: RequestPeriodDisable = {
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
examDate: dateToISO(dateExam.value),
announcementEndDate:
dateAnnouncement.value !== null
? dateToISO(dateAnnouncement.value[1])
: null,
announcementStartDate:
dateAnnouncement.value !== null
? dateToISO(dateAnnouncement.value[0])
: null,
examDate: dateExam.value !== null ? dateToISO(dateExam.value) : null,
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]),
paymentEndDate:
datePayment.value !== null ? dateToISO(datePayment.value[1]) : null,
paymentStartDate:
datePayment.value !== null ? dateToISO(datePayment.value[0]) : null,
registerEndDate:
dateRegister.value !== null ? dateToISO(dateRegister.value[1]) : null,
registerStartDate:
dateRegister.value !== null ? dateToISO(dateRegister.value[0]) : null,
round: round.value,
year: yearly.value,
announcementDate: dateToISO(dateAnnounce.value),
announcementDate:
dateAnnounce.value !== null ? dateToISO(dateAnnounce.value) : null,
};
return valueData;
};
const addData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.saveDisablePeriod, sendData())
.then(async (res) => {
@ -831,12 +845,12 @@ const addData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const editData = async (id: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.editDisablePeriod(id), sendData())
.then(async () => {
@ -849,7 +863,7 @@ const editData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
@ -876,7 +890,7 @@ const uploadImgData = async () => {
fileImgDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
showLoader();
loaderPage(true);
await http
.put(config.API.periodExamImg(id.value), formData)
.then((res) => {})
@ -884,7 +898,7 @@ const uploadImgData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
}
};
@ -893,7 +907,7 @@ const deleteDocData = async (docId: string) => {
const params = {
documentId: docId,
};
showLoader();
loaderPage(true);
await http
.delete(config.API.periodExamDoc(id.value.toString()), {
params,
@ -906,7 +920,7 @@ const deleteDocData = async (docId: string) => {
})
.finally(async () => {
await fetchData();
hideLoader();
loaderPage(false);
});
};
@ -937,7 +951,7 @@ const uploadDocData = async () => {
fileDocDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
showLoader();
loaderPage(true);
await http
.put(config.API.periodExamDoc(id.value), formData)
.then((res) => {})
@ -945,7 +959,7 @@ const uploadDocData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
} else {
clickBack();
@ -956,7 +970,7 @@ const uploadDocData = async () => {
* แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง
* @param val วงวนท
*/
const dateThaiRange = (val: [Date, Date]) => {
const dateThaiRange = (val: [Date, Date] | null) => {
if (val === null) {
return "";
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {

View file

@ -145,7 +145,7 @@ const { loaderPage } = dataStore;
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { success, dateToISO, messageError, showLoader, hideLoader } = mixin;
const { success, dateToISO, messageError } = mixin;
const route = useRoute();
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string>(route.params.candidateId.toString());
@ -163,7 +163,7 @@ onMounted(async () => {
});
const fetchStatus = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateId(candidateId.value))
.then((res) => {
@ -174,12 +174,12 @@ const fetchStatus = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const confirm = async (status: boolean, reason: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateCheckRegister(candidateId.value), {
status: status,
@ -190,14 +190,14 @@ const confirm = async (status: boolean, reason: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
success($q, "ตรวจสอบข้อมูลสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});
};
const reject = async (reason: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateRejectRegister(candidateId.value), {
reason: reason,
@ -207,7 +207,7 @@ const reject = async (reason: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
success($q, "ตรวจสอบข้อมูลสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});
@ -253,7 +253,7 @@ const clickSave = async () => {
type.value = defaultOccupation.value.employee;
if (defaultOccupation.value.status == "other")
type.value = defaultOccupation.value.other;
showLoader();
loaderPage(true);
await http
.post(config.API.candidateId(candidateId.value), {
prefixId: defaultInformation.value.prefixId,
@ -329,7 +329,7 @@ const clickSave = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
}
});

View file

@ -65,7 +65,7 @@ const dataStore = useDataStore();
const { loaderPage } = dataStore;
const router = useRouter();
const mixin = useCounterMixin();
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const { date2Thai, messageError } = mixin;
const rows = ref<ResponsePeriodExam[]>([]);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
@ -163,12 +163,12 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamType("exam"))
.then((res) => {
@ -184,20 +184,24 @@ const fetchData = async () => {
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),
],
dateAnnounce:
r.announcementDate !== null ? new Date(r.announcementDate) : null,
dateAnnouncement:
r.announcementStartDate !== null && r.announcementEndDate !== null
? [
new Date(r.announcementStartDate),
new Date(r.announcementEndDate),
]
: null,
dateRegister:
r.registerStartDate !== null && r.registerEndDate !== null
? [new Date(r.registerStartDate), new Date(r.registerEndDate)]
: null,
dateExam: r.examDate !== null ? new Date(r.examDate) : null,
datePayment:
r.paymentStartDate !== null && r.paymentEndDate !== null
? [new Date(r.paymentStartDate), new Date(r.paymentEndDate)]
: null,
organizationName: {
id: r.organizationId,
name: r.organizationName,
@ -219,7 +223,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -288,7 +288,7 @@ const fee = ref<number>();
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin(); //
const { success, messageError, showLoader, hideLoader } = mixin;
const { success, messageError } = mixin;
const route = useRoute();
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string>(route.params.candidateId.toString());
@ -308,13 +308,13 @@ const props = defineProps({
});
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchPaymentExam();
await fetchData();
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidatePayment(candidateId.value))
.then((res) => {
@ -325,12 +325,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchPaymentExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamPayment(examId.value))
.then((res) => {
@ -342,12 +342,12 @@ const fetchPaymentExam = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const confirm = async (status: boolean, reason: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateCheckPayment(candidateId.value), {
status: status,
@ -358,7 +358,7 @@ const confirm = async (status: boolean, reason: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
success($q, "ตรวจสอบข้อมูลชำระเงินสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});

View file

@ -102,14 +102,7 @@ const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const {
date2Thai,
success,
typeCategoryExam,
messageError,
showLoader,
hideLoader,
} = mixin;
const { date2Thai, success, typeCategoryExam, messageError } = mixin;
const filter = ref<string>(""); //search data table
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
@ -230,12 +223,12 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamType("all"))
.then((res) => {
@ -255,6 +248,7 @@ const fetchData = async () => {
id: r.typeId,
name: r.typeName,
},
highDegree: r.highDegree,
});
});
const bankData: ResponsePayment[] = [];
@ -268,7 +262,8 @@ const fetchData = async () => {
});
result.push({
id: r.id,
dateAnnounce: new Date(r.announcementDate),
dateAnnounce:
r.announcementDate !== null ? new Date(r.announcementDate) : null,
announcementExam: r.announcementExam,
name: r.name,
checkDocument: r.checkDocument,
@ -276,19 +271,22 @@ const fetchData = async () => {
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),
],
dateAnnouncement:
r.announcementStartDate !== null && r.announcementEndDate !== null
? [
new Date(r.announcementStartDate),
new Date(r.announcementEndDate),
]
: null,
dateExam: r.examDate !== null ? new Date(r.examDate) : null,
dateRegister:
r.registerStartDate !== null && r.registerEndDate !== null
? [new Date(r.registerStartDate), new Date(r.registerEndDate)]
: null,
datePayment:
r.paymentStartDate !== null && r.paymentEndDate !== null
? [new Date(r.paymentStartDate), new Date(r.paymentEndDate)]
: null,
organizationName: {
id: r.organizationId,
name: r.organizationName,
@ -312,7 +310,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -342,7 +340,7 @@ const clickAdd = () => {
};
const deleteData = async (id: string) => {
showLoader();
loaderPage(true);
await http
.delete(config.API.periodExamId(id))
.then((res) => {
@ -352,7 +350,7 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
await fetchData();
});
};

View file

@ -125,8 +125,10 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="date2Thai(dateExam)"
:model-value="dateExam != null ? date2Thai(dateExam) : null"
:label="`${'วันที่สอบ'}`"
clearable
@clear="clearDateExam"
>
<template v-slot:prepend>
<q-icon
@ -164,6 +166,7 @@
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateAnnouncement)"
:label="`${'วันที่ประกาศ'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]"
>
<template v-slot:prepend>
<q-icon
@ -183,6 +186,7 @@
v-model="dateRegister"
:locale="'th'"
autoApply
clearValue
borderless
range
:enableTimePicker="false"
@ -201,6 +205,8 @@
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateRegister)"
:label="`${'วันที่สมัคร'}`"
clearable
@clear="clearDateRegister"
>
<template v-slot:prepend>
<q-icon
@ -238,6 +244,8 @@
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(datePayment)"
:label="`${'วันที่ชำระเงิน'}`"
clearable
@clear="clearDatePayment"
>
<template v-slot:prepend>
<q-icon
@ -272,8 +280,12 @@
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="date2Thai(dateAnnounce)"
:model-value="
dateAnnounce != null ? date2Thai(dateAnnounce) : null
"
:label="`${'วันประกาศผลสอบ'}`"
clearable
@clear="clearDateAnnounce"
>
<template v-slot:prepend>
<q-icon
@ -417,6 +429,13 @@
</template>
</selector>
</q-td>
<q-td key="highDegree" :props="props">
<q-checkbox
v-model="props.row.highDegree"
label="ปริญญาขึ้นไป"
color="teal"
/>
</q-td>
<q-td key="type" :props="props">
<selector
class=""
@ -976,8 +995,7 @@ const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const { date2Thai, success, dateToISO, messageError } = mixin;
const myForm = ref<QForm | null>(null); //form data input
const name = ref<string>("");
const note = ref<string>("");
@ -991,11 +1009,11 @@ const yearly = ref<number>(new Date().getFullYear());
const nameRaw = ref<number | null>(null);
const roundRaw = ref<number | null>(null);
const yearlyRaw = ref<number | null>(null);
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 dateAnnounce = ref<Date>(new Date()); //
const dateExam = ref<Date>(new Date()); //
const dateRegister = ref<[Date, Date] | null>(null); //
const datePayment = ref<[Date, Date] | null>(null); //
const dateAnnouncement = ref<[Date, Date] | null>(null); //
const dateAnnounce = ref<Date | null>(null); //
const dateExam = ref<Date | null>(null); //
const myFormPayment = ref<any>();
const myFormPosition = ref<any>();
const positionPathOptions = ref<DataOption[]>([]);
@ -1007,6 +1025,10 @@ const examTypeOptions = [
{ name: "ทั่วไป", id: "normol" },
{ name: "แพทย์", id: "docter" },
];
const educateOptions = [
{ name: "ต่ำกว่าปริญญาตรี", id: "low" },
{ name: "ปริญญาขึ้นไป", id: "normol" },
];
const category = ref<string>("");
const categoryOptions = [
{ name: "สำนักอนามัย", id: "hygiene" },
@ -1065,7 +1087,11 @@ const columnsPayment = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumnsPosition = ref<String[]>(["position", "type"]);
const visibleColumnsPosition = ref<String[]>([
"position",
"type",
"highDegree",
]);
const columnsPosition = ref<QTableProps["columns"]>([
{
name: "position",
@ -1078,6 +1104,17 @@ const columnsPosition = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "highDegree",
align: "left",
label: "วุฒิการศึกษาปริญญาขึ้นไป",
sortable: true,
field: "highDegree",
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",
@ -1100,7 +1137,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => {
});
onMounted(async () => {
hideLoader();
loaderPage(false);
if (route.params.id != undefined) {
edit.value = true;
id.value = route.params.id.toString();
@ -1123,7 +1160,7 @@ const clickBack = () => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamId(id.value))
.then((res) => {
@ -1140,6 +1177,7 @@ const fetchData = async () => {
id: r.typeId,
name: r.typeName,
},
highDegree: r.highDegree,
});
});
const bankData: ResponsePayment[] = [];
@ -1162,20 +1200,24 @@ const fetchData = async () => {
roundRaw.value = data.round;
yearlyRaw.value = data.year;
fee.value = data.fee;
dateAnnounce.value = new Date(data.announcementDate);
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),
];
dateAnnounce.value =
data.announcementDate != null ? new Date(data.announcementDate) : null;
dateAnnouncement.value =
data.announcementStartDate != null && data.announcementEndDate != null
? [
new Date(data.announcementStartDate),
new Date(data.announcementEndDate),
]
: null;
dateExam.value = data.examDate != null ? new Date(data.examDate) : null;
dateRegister.value =
data.registerStartDate != null && data.registerEndDate != null
? [new Date(data.registerStartDate), new Date(data.registerEndDate)]
: null;
datePayment.value =
data.paymentStartDate != null && data.paymentEndDate != null
? [new Date(data.paymentStartDate), new Date(data.paymentEndDate)]
: null;
organizationShortName.value = {
id: data.organizationCodeId,
name: data.organizationCodeName,
@ -1197,7 +1239,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1205,7 +1247,7 @@ const fetchData = async () => {
* get รายการ รหสหนวยงาน
*/
const fetchOrganizationShortName = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.organizationShortName)
.then((res) => {
@ -1223,7 +1265,7 @@ const fetchOrganizationShortName = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1231,7 +1273,7 @@ const fetchOrganizationShortName = async () => {
* get รายการ หนวยงาน
*/
const fetchOrganizationOrganization = async (val: string) => {
showLoader();
loaderPage(true);
await http
.get(config.API.organization)
.then((res) => {
@ -1249,7 +1291,7 @@ const fetchOrganizationOrganization = async (val: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1257,7 +1299,7 @@ const fetchOrganizationOrganization = async (val: string) => {
* get รายการ ตำแหนงในสายงาน
*/
const fetchPositionPath = async (val: string) => {
showLoader();
loaderPage(true);
await http
.get(config.API.positionPath)
.then((res) => {
@ -1275,7 +1317,7 @@ const fetchPositionPath = async (val: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1321,13 +1363,21 @@ const sendData = () => {
positionName: r.position.name,
typeId: r.type.id,
typeName: r.type.name,
highDegree: r.highDegree ? true : false,
});
});
const valueData: RequestPeriodExam = {
announcementDate: dateToISO(dateAnnounce.value),
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
examDate: dateToISO(dateExam.value),
announcementDate:
dateAnnounce.value != null ? dateToISO(dateAnnounce.value) : null,
announcementEndDate:
dateAnnouncement.value != null
? dateToISO(dateAnnouncement.value[1])
: null,
announcementStartDate:
dateAnnouncement.value != null
? dateToISO(dateAnnouncement.value[0])
: null,
examDate: dateExam.value != null ? dateToISO(dateExam.value) : null,
bankExam: rowsPayment.value,
checkDisability: checkDisability.value,
announcementExam: announcementExam.value,
@ -1342,12 +1392,16 @@ const sendData = () => {
organizationCodeName: organizationShortName.value?.name,
organizationId: organizationName.value?.id,
organizationName: organizationName.value?.name,
paymentEndDate: dateToISO(datePayment.value[1]),
paymentEndDate:
datePayment.value != null ? dateToISO(datePayment.value[1]) : null,
paymentKrungThai: pay.value,
paymentStartDate: dateToISO(datePayment.value[0]),
paymentStartDate:
datePayment.value != null ? dateToISO(datePayment.value[0]) : null,
positionExam: positionData,
registerEndDate: dateToISO(dateRegister.value[1]),
registerStartDate: dateToISO(dateRegister.value[0]),
registerEndDate:
dateRegister.value != null ? dateToISO(dateRegister.value[1]) : null,
registerStartDate:
dateRegister.value != null ? dateToISO(dateRegister.value[0]) : null,
round: round.value,
year: yearly.value,
category: category.value,
@ -1356,7 +1410,7 @@ const sendData = () => {
};
const addData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.periodExam, sendData())
.then(async (res) => {
@ -1371,12 +1425,12 @@ const addData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
const editData = async (id: string) => {
showLoader();
loaderPage(true);
await http
.put(config.API.periodExamId(id), sendData())
.then(async (res) => {
@ -1389,7 +1443,7 @@ const editData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
@ -1416,13 +1470,13 @@ const uploadDocData = async () => {
fileDocDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
showLoader();
loaderPage(true);
await http
.put(config.API.periodExamDoc(id.value), formData)
.then((res) => {})
.catch((e) => {})
.finally(async () => {
hideLoader();
loaderPage(false);
});
} else {
clickBack();
@ -1452,13 +1506,13 @@ const uploadImgData = async () => {
fileImgDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
showLoader();
loaderPage(true);
await http
.put(config.API.periodExamImg(id.value), formData)
.then((res) => {})
.catch((e) => {})
.finally(async () => {
hideLoader();
loaderPage(false);
});
}
};
@ -1467,7 +1521,7 @@ const deleteDocData = async (docId: string) => {
const params = {
documentId: docId,
};
showLoader();
loaderPage(true);
await http
.delete(config.API.periodExamDoc(id.value.toString()), {
params,
@ -1510,6 +1564,7 @@ const clickAddPosition = () => {
id: "00000000-0000-0000-0000-000000000000",
position: { id: "", name: "" },
type: { id: "normol", name: "ทั่วไป" },
highDegree: false,
});
}
});
@ -1526,7 +1581,7 @@ const clickDeletePosition = (row: any) => {
* แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง
* @param val วงวนท
*/
const dateThaiRange = (val: [Date, Date]) => {
const dateThaiRange = (val: [Date, Date] | null) => {
if (val === null) {
return "";
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
@ -1535,6 +1590,22 @@ const dateThaiRange = (val: [Date, Date]) => {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
}
};
const clearDateExam = () => {
dateExam.value = null;
};
const clearDateRegister = () => {
dateRegister.value = null;
};
const clearDatePayment = () => {
datePayment.value = null;
};
const clearDateAnnounce = () => {
dateAnnounce.value = null;
};
</script>
<style></style>

View file

@ -11,7 +11,11 @@
@click="router.go(-1)"
/>
{{ name }}
{{ `ครั้งที่${round}/${yearly == null ? "" : yearly + 543}` }}
{{
`ครั้งที่${round == null ? "" : round}/${
yearly == null ? "" : yearly + 543
}`
}}
<q-space />
<q-btn
@click="visible = !visible"
@ -221,6 +225,9 @@
>
{{ statusCandidate(props.row.status) }}
</div>
<div v-else-if="col.name == 'registerDate'" class="table_ellipsis">
{{ col.value }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
</div>
@ -282,14 +289,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin(); //
const {
genColor15,
dateToISO,
date2Thai,
messageError,
showLoader,
hideLoader,
} = mixin;
const { genColor15, dateToISO, date2Thai, messageError } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const router = useRouter();
@ -314,6 +314,7 @@ const initialPagination = ref<Pagination>({
const visibleColumns = ref<String[]>([
"no",
"number",
"registerDate",
"examIdenNumber",
"seatNumber",
"resultB",
@ -451,6 +452,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px;",
style: "font-size: 14px; ",
},
{
name: "registerDate",
align: "left",
label: "วันเและเวลาที่สมัคร",
sortable: true,
field: "registerDate",
headerStyle: "font-size: 14px; min-width: 200px",
style: "font-size: 14px; ",
},
{
name: "status",
align: "left",
@ -472,7 +482,7 @@ watch(status, (count: String, prevCount: String) => {
});
onMounted(async () => {
hideLoader();
loaderPage(false);
await fetchDataCom();
});
@ -491,7 +501,7 @@ const fetchDataCom = async () => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateOfPeriodExam(status.value, examId.value))
.then((res) => {
@ -504,6 +514,7 @@ const fetchData = async () => {
avatar: r.profileImg != null ? r.profileImg.detail : "",
citizenId: r.citizenId,
number: r.number,
registerDate: r.registerDate,
examIdenNumber: r.examIdenNumber,
seatNumber: r.seatNumber,
resultC: r.resultC,
@ -518,12 +529,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchPeriodExam = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamStatus(examId.value))
.then((res) => {
@ -538,7 +549,7 @@ const fetchPeriodExam = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -547,7 +558,7 @@ const fetchPeriodExam = async () => {
*/
const fetchDataSummary = async () => {
dataNum.value = [];
showLoader();
loaderPage(true);
await http
.get(config.API.countDashbordPeriodExam(examId.value))
.then((res) => {
@ -565,12 +576,12 @@ const fetchDataSummary = async () => {
dataNum.value = [];
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadFileDashboard = async () => {
showLoader();
loaderPage(true);
await http
.put(
config.API.periodExamDownloadDashboard(examId.value),
@ -594,7 +605,7 @@ const downloadFileDashboard = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -578,7 +578,7 @@ const $q = useQuasar();
const mixin = useCounterMixin(); //
const store = useDataStore();
const { loaderPage } = store;
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const { date2Thai, messageError } = mixin;
const previous = ref<boolean>(false);
const next = ref<boolean>(false);
const addDialog = ref<boolean>(false);
@ -870,7 +870,7 @@ const saveEdit = async () => {
};
const saveDataAgency = async (data: DataLink[]) => {
showLoader();
loaderPage(true);
await http
.post(config.API.cmsAgency, data)
.then((res) => {})
@ -883,7 +883,7 @@ const saveDataAgency = async (data: DataLink[]) => {
};
const saveDataGoverment = async (data: DataLink[]) => {
showLoader();
loaderPage(true);
await http
.post(config.API.cmsGoverment, data)
@ -897,7 +897,7 @@ const saveDataGoverment = async (data: DataLink[]) => {
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.cms)
.then((res) => {
@ -952,12 +952,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const takeLogo = async () => {
showLoader();
loaderPage(true);
const formData = new FormData();
formData.append("FileData", imageFileLogo.value);
await http
@ -974,7 +974,7 @@ const takeLogo = async () => {
};
const takeBanner = async () => {
showLoader();
loaderPage(true);
const formData = new FormData();
formData.append("FileData", imageFile.value);
await http
@ -999,7 +999,7 @@ const sendDataDetail = async () => {
description: web.value.descripstion,
shortName: web.value.by,
};
showLoader();
loaderPage(true);
await http
.post(config.API.cmsDeatail, data)
.then((res) => {})
@ -1026,7 +1026,7 @@ const sendDataAbout = async () => {
zipCode: address.value.code,
telephone: address.value.tel,
};
showLoader();
loaderPage(true);
await http
.post(config.API.cmsAbout, data)
.then((res) => {})
@ -1042,7 +1042,7 @@ const sendDataAbout = async () => {
};
const fetchProvince = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.province)
.then((res) => {
@ -1057,13 +1057,13 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchDistrict = async (id: string | null) => {
if (id !== null) {
showLoader();
loaderPage(true);
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -1078,14 +1078,14 @@ const fetchDistrict = async (id: string | null) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
}
};
const fetchSubDistrict = async (id: string | null) => {
if (id !== null) {
showLoader();
loaderPage(true);
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -1104,7 +1104,7 @@ const fetchSubDistrict = async (id: string | null) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
}
};