จัดโค้ดบรรจุ รายชื่อผู้สอบผ่าน

This commit is contained in:
setthawutttty 2023-11-13 13:32:26 +07:00
parent eb80e5e267
commit 9f9879202e
9 changed files with 527 additions and 411 deletions

View file

@ -1,13 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, reactive } from "vue"; import { onMounted, ref, reactive } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { usePlacementDataStore } from "@/modules/05_placement/store";
import type { QTableProps } from "quasar";
import type { import type {
DataOption, DataOption,
DataOption1, DataOption1,
} from "@/modules/05_placement/interface/index/Main"; } from "@/modules/05_placement/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
import { usePlacementDataStore } from "@/modules/05_placement/store";
import router from "@/router"; import router from "@/router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -17,7 +18,59 @@ const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
// const searchYear = ref();
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
const dataPlacement = ref<any>([]);
const yearOptionsFn = ref<any>([]);
/**ข้อมูลตาราง (จำลอง)*/
const rows = ref<QTableProps["rows"]>([]);
/** ค้นหาในตาราง */
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
/**ครั้งที่สอบ */
const examTime = ref<number | string>("");
const examTimeOP = reactive<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
const addedExamTimeValues: Set<number> = new Set();
/** ประเภทการสอบ */
const examType = ref<string | null>("");
const examTypeOP = ref<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
const addedExamTypeValues: Set<string> = new Set();
/** บัญชีหมดอายุ */
const expiredAccount = ref<boolean>(false);
const examTimeOP2 = ref<any[]>([]);
const examTypeOP2 = ref<any[]>([]);
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "accountStartDate",
descending: true,
page: 1,
rowsPerPage: 10,
});
/** ส่วนเเสดงผล ตาราง */
const visibleColumns = ref([
"id",
"examRound",
"examOrder",
"examOrder",
"fiscalYear",
"numberOfCandidates",
"examTypeName",
"accountStartDate",
"accountExpirationDate",
]);
/**หัวตาราง */
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "id", name: "id",
@ -96,28 +149,12 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
// ()
const rows = ref<QTableProps["rows"]>([]);
const searchYear = ref();
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
const dataPlacement = ref<any>([]); /**
const visibleColumns = ref([ * งช get อมลตามป
"id", * @param val .. โดยทงหมดเป เลข 0
"examRound", */
"examOrder", async function fetchPlacementData(val: number) {
"examOrder",
"fiscalYear",
"numberOfCandidates",
"examTypeName",
"accountStartDate",
"accountExpirationDate",
]);
onMounted(async () => {
await fetchYearOptions();
});
const fetchPlacementData = async (val: number) => {
showLoader(); showLoader();
rows.value = []; rows.value = [];
await http await http
@ -155,9 +192,10 @@ const fetchPlacementData = async (val: number) => {
expiredAccount.value = false; expiredAccount.value = false;
hideLoader(); hideLoader();
}); });
}; }
const fetchYearOptions = async () => { /** ฟังชั่น get ปี ค.ส. */
async function fetchYearOptions() {
await http await http
.get(config.API.yearOptions()) .get(config.API.yearOptions())
.then((res) => { .then((res) => {
@ -174,32 +212,27 @@ const fetchYearOptions = async () => {
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}); });
}; }
const filterYear = () => {
/** Null
* เม != null เอาคาสงไปฟงช get data
*/
function filterYear() {
if (searchYear.value !== null) { if (searchYear.value !== null) {
fetchPlacementData(searchYear.value); fetchPlacementData(searchYear.value);
} }
}; }
// /**
const redirectToPage = (examId?: number) => { * รายการสอบแขงข หนาตอไป
* @param examId id ระบ รอบการสอบ
*/
function redirectToPage(examId?: number) {
router.push(`/placement/personal-list/${examId}`); router.push(`/placement/personal-list/${examId}`);
}; }
//-------------------||-----------------// /** ฟิลเตอร์หาครั้งที่สอบ ตาม ปี */
const filterKeyword = ref<string>(""); async function examTimeFilter() {
const filterRef = ref<any>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
//-------------------||------------------------------//
const examTime = ref<number | string>("");
const examTimeOP = reactive<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
const addedExamTimeValues: Set<number> = new Set();
const examTimeFilter = async () => {
for (const data of dataPlacement.value) { for (const data of dataPlacement.value) {
const examOrder = data.examOrder; const examOrder = data.examOrder;
if (examOrder !== null && !addedExamTimeValues.has(examOrder)) { if (examOrder !== null && !addedExamTimeValues.has(examOrder)) {
@ -212,13 +245,9 @@ const examTimeFilter = async () => {
if (b.id === "all") return 1; if (b.id === "all") return 1;
return Number(a.id) - Number(b.id); return Number(a.id) - Number(b.id);
}); // id }); // id
}; }
// function examTypeFilter() {
const examType = ref<string | null>("");
const examTypeOP = ref<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
const addedExamTypeValues: Set<string> = new Set();
const examTypeFilter = () => {
dataPlacement.value.forEach((item: any) => { dataPlacement.value.forEach((item: any) => {
const examTypeName = item.examTypeName; const examTypeName = item.examTypeName;
const examTypeValue = item.examTypeValue; const examTypeValue = item.examTypeValue;
@ -230,9 +259,10 @@ const examTypeFilter = () => {
addedExamTypeValues.add(examTypeName); addedExamTypeValues.add(examTypeName);
} }
}); });
}; }
//--------------||--------------------------------------//
const searchFilterTable = async () => { /** ฟิลเตอร์ */
async function searchFilterTable() {
rows.value = []; rows.value = [];
if (examType.value !== undefined && examType.value !== null) { if (examType.value !== undefined && examType.value !== null) {
await DataStore.DataUpdateMain( await DataStore.DataUpdateMain(
@ -257,31 +287,29 @@ const searchFilterTable = async () => {
}); });
rows.value = dataArr; rows.value = dataArr;
} }
}; }
//----------------||-----------------------------// /** บัญชีหมดอายุ */
const expiredAccount = ref<boolean>(false); async function expiredAccountFilter() {
const expiredAccountFilter = async () => {
const updatedRows = dataPlacement.value.map((data: any) => { const updatedRows = dataPlacement.value.map((data: any) => {
let isExpired = data.isExpired == expiredAccount; let isExpired = data.isExpired == expiredAccount;
return { ...data, isExpired }; return { ...data, isExpired };
}); });
await DataStore.DataMain(updatedRows); await DataStore.DataMain(updatedRows);
}; }
const paging = ref<boolean>(true); function paginationLabel(start: number, end: number, total: number){
const pagination = ref({
sortBy: "accountStartDate",
descending: true,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total; if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total;
}; };
// filter dropdown
const examTimeOP2 = ref<any[]>([]); /** filter ใน dropdown ครั้งที่ */
/**
* งช กรอกขอมลเพ นหา
* @param val าทกรอก
* @param update afterFn ของ quasar
*/
function filterFnexamTime(val: string, update: any) { function filterFnexamTime(val: string, update: any) {
if (val === "") { if (val === "") {
update(() => { update(() => {
@ -295,7 +323,12 @@ function filterFnexamTime(val: string, update: any) {
}); });
} }
} }
const examTypeOP2 = ref<any[]>([]);
/**
* งช กรอกขอมลเพ นหา
* @param val าทกรอก
* @param update afterFn ของ quasar
*/
function filterFnExamtype(val: string, update: any) { function filterFnExamtype(val: string, update: any) {
if (val === "") { if (val === "") {
update(() => { update(() => {
@ -309,7 +342,12 @@ function filterFnExamtype(val: string, update: any) {
}); });
} }
} }
const yearOptionsFn = ref<any>([]);
/**
* งช กรอกขอมลเพ นหา
* @param val าทกรอก
* @param update afterFn ของ quasar
*/
function filterFnYear(val: string, update: any) { function filterFnYear(val: string, update: any) {
if (val === "") { if (val === "") {
update(() => { update(() => {
@ -323,6 +361,11 @@ function filterFnYear(val: string, update: any) {
}); });
} }
} }
/** เรียกใช้ฟังชั่น เมื่อเริ่มหน้านี้ */
onMounted(async () => {
await fetchYearOptions();
});
</script> </script>
<template> <template>
@ -357,7 +400,9 @@ function filterFnYear(val: string, update: any) {
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
standout standout
@ -378,6 +423,7 @@ function filterFnYear(val: string, update: any) {
/> />
</template> </template>
</q-input> </q-input>
<q-select <q-select
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
v-model="visibleColumns" v-model="visibleColumns"
@ -393,6 +439,7 @@ function filterFnYear(val: string, update: any) {
options-cover options-cover
/> />
</div> </div>
<div class="col-12"> <div class="col-12">
<q-card bordered class="col-12 filter-card q-pa-sm"> <q-card bordered class="col-12 filter-card q-pa-sm">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
@ -424,6 +471,7 @@ function filterFnYear(val: string, update: any) {
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<q-select <q-select
class="col-xs-12 col-sm-3 col-md-3" class="col-xs-12 col-sm-3 col-md-3"
v-model="examType" v-model="examType"
@ -452,6 +500,7 @@ function filterFnYear(val: string, update: any) {
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<q-toggle <q-toggle
class="col-xs-12 col-sm-5 col-md-5 toggle-expired-account" class="col-xs-12 col-sm-5 col-md-5 toggle-expired-account"
v-model="expiredAccount" v-model="expiredAccount"

View file

@ -3,19 +3,21 @@ import { onMounted, ref } from "vue";
import { defineAsyncComponent } from "@vue/runtime-core"; import { defineAsyncComponent } from "@vue/runtime-core";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import cardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue"; import cardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue";
import keycloak from "@/plugins/keycloak"; import keycloak from "@/plugins/keycloak";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { usePlacementDataStore } from "@/modules/05_placement/store"; import { usePlacementDataStore } from "@/modules/05_placement/store";
const DataStore = usePlacementDataStore(); const DataStore = usePlacementDataStore();
let roleAdmin = ref<boolean>(false);
const $q = useQuasar; const $q = useQuasar;
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin; const { messageError, showLoader, hideLoader } = mixin;
let roleAdmin = ref<boolean>(false);
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const examId = route.params.examId; const examId = route.params.examId;
@ -33,8 +35,9 @@ const stat = ref<any>({
contain: 0, contain: 0,
disclaim: 0, disclaim: 0,
}); });
// Stat
const getStat = async () => { /** เรียกข้อมูล Stat */
async function getStat() {
const examIdString = Array.isArray(examId) ? examId[0] : examId; const examIdString = Array.isArray(examId) ? examId[0] : examId;
await http await http
.get(config.API.getStatCard(examIdString)) .get(config.API.getStatCard(examIdString))
@ -52,8 +55,27 @@ const getStat = async () => {
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}); });
}; }
/** get รายละเอียด ของการสอบ */
async function fetchPlacementData() {
showLoader();
await http
.get(config.API.MainDetail(0))
.then(async (res) => {
DataStore.DataMainOrig = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** get stat
* เเละหา อรอบ รอบ
*/
onMounted(async () => { onMounted(async () => {
if (DataStore.DataMainOrig.length == 0) { if (DataStore.DataMainOrig.length == 0) {
await fetchPlacementData(); await fetchPlacementData();
@ -73,21 +95,6 @@ onMounted(async () => {
round.value = examData.value == null ? null : examData.value.examOrder; round.value = examData.value == null ? null : examData.value.examOrder;
year.value = examData.value == null ? null : examData.value.fiscalYear; year.value = examData.value == null ? null : examData.value.fiscalYear;
}); });
const fetchPlacementData = async () => {
showLoader();
await http
.get(config.API.MainDetail(0))
.then(async (res) => {
DataStore.DataMainOrig = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
</script> </script>
<template> <template>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 row"> <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 row">

View file

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
/** รับค่ามาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
editvisible: Boolean, editvisible: Boolean,
modalEdit: Boolean, modalEdit: Boolean,
@ -20,23 +21,29 @@ const props = defineProps({
default: () => console.log("not function"), default: () => console.log("not function"),
}, },
}); });
const emit = defineEmits([ const emit = defineEmits([
"update:editvisible", "update:editvisible",
"update:next", "update:next",
"update:previous", "update:previous",
]); ]);
const updateEdit = (value: Boolean) => { /**
* งช update
* @param value true/false
*/
function updateEdit(value: Boolean){
emit("update:editvisible", value); emit("update:editvisible", value);
}; };
// const cancel = async () => {
// props.cancel(); /** update edit */
// }; async function edit(){
const edit = async () => {
updateEdit(!props.editvisible); updateEdit(!props.editvisible);
props.edit(); props.edit();
}; };
const checkSave = () => {
/** save */
function checkSave(){
props.validate(); props.validate();
props.save(); props.save();
@ -51,9 +58,9 @@ const checkSave = () => {
:disabled="editvisible" :disabled="editvisible"
:color="editvisible ? 'grey-7' : 'primary'" :color="editvisible ? 'grey-7' : 'primary'"
@click="edit" @click="edit"
><!-- icon="mdi-pencil-outline" >
<q-tooltip>แกไขขอม</q-tooltip> -->
</q-btn> </q-btn>
<div v-else> <div v-else>
<q-btn <q-btn
unelevated unelevated
@ -62,8 +69,7 @@ const checkSave = () => {
:color="!editvisible ? 'grey-7' : 'public'" :color="!editvisible ? 'grey-7' : 'public'"
@click="checkSave" @click="checkSave"
> >
</q-btn><!-- icon="mdi-content-save-outline"> </q-btn>
<q-tooltip>นท</q-tooltip> -->
</div> </div>
</q-card-actions> </q-card-actions>
</template> </template>

View file

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
/** รับค่ามาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
title: String, title: String,
close: { close: {
@ -6,6 +8,8 @@ const props = defineProps({
default: () => console.log("not function"), default: () => console.log("not function"),
}, },
}); });
/** ปิด dialog*/
const close = async () => { const close = async () => {
props.close(); props.close();
}; };

View file

@ -1,9 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { useQuasar, QForm } from "quasar"; import { useQuasar, QForm } from "quasar";
import { onMounted, reactive, ref, watch } from "vue"; import { onMounted, reactive, ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue"; import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -28,8 +29,26 @@ const selectedFile = ref<string>("");
const dataRespone = ref<any>(); const dataRespone = ref<any>();
const search = ref<string>(""); const search = ref<string>("");
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
const personal = ref<any>();
const expanded = ref<string[]>([]);
const editDataStatus = ref<boolean>(false);
const placementPosition = ref<any>([]);
const treeData = ref<Array<any>>([]);
// Set form field //
const posNoOptions = ref<Object[]>([{ label: "", value: "" }]);
//
const positionOptions = ref<Object[]>([{ label: "", value: "" }]);
// /
const positionPathSideOptions = ref<Object[]>([{ label: "", value: "" }]);
//
const positionTypeOptions = ref<Object[]>([{ label: "", value: "" }]);
//
const positionLineOptions = ref<Object[]>([{ label: "", value: "" }]);
//
const positionLevelOptions = ref<Object[]>([{ label: "", value: "" }]);
/** กำหนดตัวแปร เเบบ ออปเจ็ค */
let dataForm = reactive({ let dataForm = reactive({
personalId: "", personalId: "",
containDate: new Date(), containDate: new Date(),
@ -41,12 +60,8 @@ let dataForm = reactive({
positionTypeId: "", positionTypeId: "",
}); });
onMounted(async () => { /** ฟังชั่น get file*/
await fetchPublishFile(); async function fetchPublishFile(){
await loadTreeData();
await fetchplacementPosition();
});
const fetchPublishFile = async () => {
await http await http
.get(config.API.getPublishFileHistory) .get(config.API.getPublishFileHistory)
.then((res) => { .then((res) => {
@ -61,8 +76,7 @@ const fetchPublishFile = async () => {
}); });
}; };
// json /** โหลดข้อมูลโครงสร้างจาก json */
const treeData = ref<Array<any>>([]);
const loadTreeData = async () => { const loadTreeData = async () => {
expanded.value = []; expanded.value = [];
await http await http
@ -83,6 +97,11 @@ const loadTreeData = async () => {
}); });
}; };
/**
* งกนกรองขอมลท personId เป null
* @param obj อมลทจะถกกรอง
* @returns {boolean} ผลลพธของการกรองขอม
*/
function filterByPersonIdNull(obj: any) { function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) { if (obj.name === null && obj.isCondition != true) {
return true; return true;
@ -94,9 +113,8 @@ function filterByPersonIdNull(obj: any) {
return false; return false;
} }
// position /**get data ตำแหน่งงาน */
const placementPosition = ref<any>([]); async function fetchplacementPosition() {
const fetchplacementPosition = async () => {
await http await http
.get(config.API.placementPosition()) .get(config.API.placementPosition())
.then((res: any) => { .then((res: any) => {
@ -105,8 +123,9 @@ const fetchplacementPosition = async () => {
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}); });
}; }
/** รับค่ามาจาก หน้าหลัก*/
const props = defineProps({ const props = defineProps({
personalId: String, personalId: String,
modal: Boolean, modal: Boolean,
@ -116,8 +135,14 @@ const props = defineProps({
}, },
personal: Object, personal: Object,
}); });
// filter
const myFilterMethod = (node: any, filter: string) => { /**
* งกนกรองขอมลหนวยงาน
* @param node อมลทจะถกกรอง
* @param filter อความทใชในการกรองขอม
* @returns {boolean} ผลลพธของการกรองขอม
*/
function myFilterMethod(node: any, filter: string) {
const filt = filter; const filt = filter;
return ( return (
// ((node.name && node.name == null) || !node.name) && // ((node.name && node.name == null) || !node.name) &&
@ -139,18 +164,20 @@ const myFilterMethod = (node: any, filter: string) => {
node.executivePositionSide.indexOf(filt) > -1) || node.executivePositionSide.indexOf(filt) > -1) ||
(node.positionLevel && node.positionLevel.indexOf(filt) > -1) (node.positionLevel && node.positionLevel.indexOf(filt) > -1)
); );
}; }
const validateData = async () => { /** validate */
async function validateData() {
checkValidate.value = true; checkValidate.value = true;
await myFormPosition.value.validate().then((result: boolean) => { await myFormPosition.value.validate().then((result: boolean) => {
if (result == false) { if (result == false) {
checkValidate.value = false; checkValidate.value = false;
} }
}); });
}; }
//
const saveAppoint = async () => { /** ยืนยันการเลือกหน่วยงาน */
async function saveAppoint() {
myFormPosition.value.validate().then(async (result: boolean) => { myFormPosition.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
const dataAppoint = await { const dataAppoint = await {
@ -183,11 +210,10 @@ const saveAppoint = async () => {
}); });
} }
}); });
}; }
const editDataStatus = ref<boolean>(false); /** ปิด dialog */
function closeModal() {
const closeModal = () => {
if (editDataStatus.value == true) { if (editDataStatus.value == true) {
dialogConfirm( dialogConfirm(
$q, $q,
@ -198,9 +224,9 @@ const closeModal = () => {
} else { } else {
closeAndClear(); closeAndClear();
} }
}; }
// clean /** clean ข้อมูล */
const closeAndClear = async () => { async function closeAndClear() {
await props.close(); await props.close();
editDataStatus.value = false; editDataStatus.value = false;
selected.value = ""; selected.value = "";
@ -212,51 +238,13 @@ const closeAndClear = async () => {
dataForm.positionLineId = ""; dataForm.positionLineId = "";
dataForm.positionPathSideId = ""; dataForm.positionPathSideId = "";
dataForm.positionTypeId = ""; dataForm.positionTypeId = "";
}; }
//
const posNoOptions = ref<Object[]>([ /**
{ * เลอกหนวยงาน
label: "", * @param data อมลตำเเหนงงาน
value: "", */
}, async function selectedPosition(data: any) {
]);
//
const positionOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
// /
const positionPathSideOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionTypeOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionLineOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionLevelOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const selectedPosition = async (data: any) => {
if (data.name == null && selected.value != data.keyId) { if (data.name == null && selected.value != data.keyId) {
editDataStatus.value = true; editDataStatus.value = true;
selected.value = data.keyId; selected.value = data.keyId;
@ -338,43 +326,21 @@ const selectedPosition = async (data: any) => {
dataForm.positionPathSideId = ""; dataForm.positionPathSideId = "";
dataForm.positionTypeId = ""; dataForm.positionTypeId = "";
} }
}; }
const checkPosition = (val: string) => { /**
* เชคตำแหน งาน
* @param val id ตำแหน
*/
function checkPosition(val: string) {
const num = placementPosition.value.findIndex((e: string) => e === val); const num = placementPosition.value.findIndex((e: string) => e === val);
return num; return num;
}; }
const personal = ref<any>();
const expanded = ref<string[]>([]); /**
// props * หาหนวยงานทเลอก
watch(props, () => { * @param element
expanded.value = []; */
const dataPersonal = props.personal;
fetchplacementPosition();
if (dataPersonal) {
dataPersonal.map((data: any) => {
personal.value = data;
});
}
if (
personal.value &&
personal.value.draft === false &&
personal.value.positionNumber !== null
) {
let findData: any = null;
dataRespone.value.map((x: any) => {
findData = findByPerson(x);
// expandedTree
if (findData != null) {
selectedPosition(findData);
for (let i = 3; i <= findData.keyId.length; i += 2) {
expanded.value.push(findData.keyId.slice(0, i));
}
}
});
}
});
//
function findByPerson(element: any): any { function findByPerson(element: any): any {
if ( if (
element.positionNumId && element.positionNumId &&
@ -395,17 +361,19 @@ function findByPerson(element: any): any {
} }
return null; return null;
} }
//
const clearPosition = () => { /** ยืนยันการคืนตำแหน่ง */
function clearPosition() {
dialogConfirm( dialogConfirm(
$q, $q,
async () => postClearPosition(), async () => postClearPosition(),
"ยืนยันการคืนตำแหน่ง", "ยืนยันการคืนตำแหน่ง",
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?" "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
); );
}; }
//
const postClearPosition = async () => { /** คืนตำแหน่ง */
async function postClearPosition() {
showLoader(); showLoader();
await http await http
.post(config.API.clearPosition(personal.value.personalId), {}) .post(config.API.clearPosition(personal.value.personalId), {})
@ -419,7 +387,42 @@ const postClearPosition = async () => {
hideLoader(); hideLoader();
await closeAndClear(); await closeAndClear();
}); });
}; }
/** เมื่อ props เปลี่ยนแปลงจะโหลดหน่วยงาน */
watch(props, () => {
expanded.value = [];
const dataPersonal = props.personal;
fetchplacementPosition();
if (dataPersonal) {
dataPersonal.map((data: any) => {
personal.value = data;
});
}
if (
personal.value &&
personal.value.draft === false &&
personal.value.positionNumber !== null
) {
let findData: any = null;
dataRespone.value.map((x: any) => {
findData = findByPerson(x);
// expandedTree
if (findData != null) {
selectedPosition(findData);
for (let i = 3; i <= findData.keyId.length; i += 2) {
expanded.value.push(findData.keyId.slice(0, i));
}
}
});
}
});
onMounted(async () => {
await fetchPublishFile();
await loadTreeData();
await fetchplacementPosition();
});
</script> </script>
<template> <template>

View file

@ -1,9 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
const sizeCard = (val: number) => { /** รับค่ามาจาก หน้าหลัก*/
if (val === 5) {
return "width:15%;";
}
};
const props = defineProps({ const props = defineProps({
color: { color: {
type: String, type: String,
@ -18,6 +14,16 @@ const props = defineProps({
default: 0, default: 0,
}, },
}); });
/**
* ปรบขนาด การดตาม าทไดบมา
* @param val วเลข
*/
function sizeCard(val: number) {
if (val === 5) {
return "width:15%;";
}
}
</script> </script>
<template> <template>
<div <div

View file

@ -3,6 +3,7 @@ import { ref, onMounted, watch, reactive, computed } from "vue";
import { useQuasar, QForm } from "quasar"; import { useQuasar, QForm } from "quasar";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import Table from "@/modules/05_placement/components/PersonalList/TableView.vue"; import Table from "@/modules/05_placement/components/PersonalList/TableView.vue";
import DialogCard from "@/modules/05_placement/components/PersonalList/TableDetail.vue"; import DialogCard from "@/modules/05_placement/components/PersonalList/TableDetail.vue";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue"; import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
@ -17,12 +18,14 @@ import router from "@/router";
let roleAdmin = ref<boolean>(false); let roleAdmin = ref<boolean>(false);
/** รับค่ามาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
statCard: { statCard: {
type: Function, type: Function,
default: () => console.log("getStat"), default: () => console.log("getStat"),
}, },
}); });
const edit = ref<boolean>(true); const edit = ref<boolean>(true);
const modal = ref<boolean>(false); //modal + const modal = ref<boolean>(false); //modal +
const editRow = ref<boolean>(false); // const editRow = ref<boolean>(false); //
@ -42,7 +45,32 @@ const myForm = ref<any>();
const files = ref<any>(null); const files = ref<any>(null);
const mixin = useCounterMixin(); // const mixin = useCounterMixin(); //
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const appointModal = ref<boolean>(false);
const getNumFile = ref(0);
const dataRes = ref<any>([]);
const personal = ref<any>([]);
const displayAdd = ref<boolean>(true);
const containStatus = ref<boolean>(false);
const modaladdlist = ref<boolean>(false);
const selected = ref<any>([]);
const personal_selected = ref<any>([]);
const filterlistAdd = ref<string>("");
const paging = ref<boolean>(true);
//
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
const pagination = ref({
page: 1,
rowsPerPage: 10,
});
const dataInfo = reactive({
reason: "",
reliefDoc: "",
});
const { const {
messageError, messageError,
showLoader, showLoader,
@ -57,6 +85,7 @@ const examId = route.params.examId;
const examIdString = Array.isArray(examId) ? examId[0] : examId; const examIdString = Array.isArray(examId) ? examId[0] : examId;
const personalId = ref<string>(""); const personalId = ref<string>("");
/** แสดงข้อมูลตารางหลัก */
const visibleColumns = ref<any[]>([ const visibleColumns = ref<any[]>([
"position", "position",
"fullName", "fullName",
@ -70,6 +99,10 @@ const visibleColumns = ref<any[]>([
"draft", "draft",
"positionCandidate", "positionCandidate",
]); ]);
/**
* ตาราง งรายชอไปหนวยงาน
*/
const visibleColumnslist = ref<any>([ const visibleColumnslist = ref<any>([
"fullName", "fullName",
"examNumber", "examNumber",
@ -81,6 +114,7 @@ const visibleColumnslist = ref<any>([
"positionCandidate", "positionCandidate",
]); ]);
/**หัวตาราง */
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "position", name: "position",
@ -172,8 +206,12 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
]); ]);
//
const convertBmaOfficer = (val: string) => { /**
* แปลงสถานะพนกงาน
* @param val type
*/
function convertBmaOfficer(val: string) {
switch (val) { switch (val) {
case "OFFICER": case "OFFICER":
return "ขรก.กทม. สามัญ"; return "ขรก.กทม. สามัญ";
@ -184,9 +222,13 @@ const convertBmaOfficer = (val: string) => {
default: default:
return "บุคคลภายนอก"; return "บุคคลภายนอก";
} }
}; }
//
const convertContainStatus = (val: string) => { /**
* แปลงสถานะบรรจ
* @param val type
*/
function convertContainStatus(val: string) {
switch (val) { switch (val) {
case "UN-CONTAIN": case "UN-CONTAIN":
return "ยังไม่บรรจุ"; return "ยังไม่บรรจุ";
@ -199,9 +241,13 @@ const convertContainStatus = (val: string) => {
default: default:
return "-"; return "-";
} }
}; }
//
const convertDraft = (val: boolean) => { /**
* แปลงสถานะการสงรายช
* @param val true/false
*/
function convertDraft(val: boolean) {
switch (val) { switch (val) {
case false: case false:
return "รอส่งตัว"; return "รอส่งตัว";
@ -210,9 +256,10 @@ const convertDraft = (val: boolean) => {
default: default:
return "-"; return "-";
} }
}; }
//
const getTable = async () => { /**เรียกข้อมูลรายชื่อผู้สอบผ่าย */
async function getTable() {
showLoader(); showLoader();
await http await http
.get(config.API.personalList(examIdString)) .get(config.API.personalList(examIdString))
@ -273,11 +320,10 @@ const getTable = async () => {
.finally(async () => { .finally(async () => {
hideLoader(); hideLoader();
}); });
}; }
const appointModal = ref<boolean>(false); /**ยืนยันการผ่อนผัน */
// async function saveDeferment() {
const saveDeferment = async () => {
myForm.value.validate().then(async (result: boolean) => { myForm.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
dialogConfirm( dialogConfirm(
@ -288,9 +334,9 @@ const saveDeferment = async () => {
); );
} }
}); });
}; }
// post /**post ผ่อนผัน */
const postDeferment = async () => { async function postDeferment() {
const formData = new FormData(); const formData = new FormData();
formData.append("personalId", personalId.value); formData.append("personalId", personalId.value);
formData.append("note", userNote.value); formData.append("note", userNote.value);
@ -311,9 +357,10 @@ const postDeferment = async () => {
modalDefermentDisclaim.value = false; modalDefermentDisclaim.value = false;
hideLoader(); hideLoader();
}); });
}; }
//
const saveDisclaim = async () => { /**ยืนยันการสละสิทธิ์ */
async function saveDisclaim() {
myForm.value.validate().then(async (result: boolean) => { myForm.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
dialogConfirm( dialogConfirm(
@ -324,9 +371,10 @@ const saveDisclaim = async () => {
); );
} }
}); });
}; }
// post
const postDisclaimf = async () => { /**post การสละสิทธิ์ */
async function postDisclaimf() {
const dataPost = { const dataPost = {
note: userNote.value, note: userNote.value,
personId: personalId.value, personId: personalId.value,
@ -347,33 +395,40 @@ const postDisclaimf = async () => {
modalDefermentDisclaim.value = false; modalDefermentDisclaim.value = false;
hideLoader(); hideLoader();
}); });
}; }
const clickEditRow = () => { /** เปิด dialog */
function clickEditRow() {
editRow.value = true; editRow.value = true;
}; }
const getClass = (val: boolean) => { /** เปลี่ยน class true/false */
function getClass(val: boolean) {
return { return {
"full-width inputgreen cursor-pointer ": val, "full-width inputgreen cursor-pointer ": val,
"full-width cursor-pointer": !val, "full-width cursor-pointer": !val,
}; };
}; }
//
const selectData = (pid: string, draft: string) => { /**
if (roleAdmin.value && draft === 'ส่งตัวแล้ว') { * เรยกดรายละเอยดขอม
* @param pid id personal
* @param draft status
*/
function selectData(pid: string, draft: string) {
if (roleAdmin.value && draft === "ส่งตัวแล้ว") {
personalId.value = pid; personalId.value = pid;
modal.value = true; modal.value = true;
} else { } else {
router.push("/placement/personal-detail/" + pid); router.push("/placement/personal-detail/" + pid);
} }
}; }
const getNumFile = ref(0);
const dataInfo = reactive({ /**
reason: "", * แกไขขอม
reliefDoc: "", * @param props rows data
}); * @param action type
// */
const editDetail = ( const editDetail = (
props: PartialTableName, props: PartialTableName,
action: "disclaim" | "deferment" | "defermentInfo" | "disclaimInfo" action: "disclaim" | "deferment" | "defermentInfo" | "disclaimInfo"
@ -421,36 +476,42 @@ const editDetail = (
} }
}; };
const dataRes = ref<any>([]); /**
const personal = ref<any>([]); * เป dialog
const openAppointModal = (pid: string) => { * @param pid id personal
*/
function openAppointModal(pid: string) {
appointModal.value = true; appointModal.value = true;
personalId.value = pid; personalId.value = pid;
personal.value = dataRes.value.filter( personal.value = dataRes.value.filter(
(e: any) => e.personalId == personalId.value (e: any) => e.personalId == personalId.value
); );
}; }
const clickCloseModalTree = async () => { /** close dialog */
async function clickCloseModalTree() {
await getTable(); await getTable();
appointModal.value = false; appointModal.value = false;
props.statCard(); props.statCard();
}; }
const validateData = async () => { /** validate */
async function validateData() {
checkValidate.value = true; checkValidate.value = true;
await myForm.value.validate().then((result: boolean) => { await myForm.value.validate().then((result: boolean) => {
if (result == false) { if (result == false) {
checkValidate.value = false; checkValidate.value = false;
} }
}); });
}; }
const clickCloseSendModal = () => { /** ปิด dialog */
function clickCloseSendModal() {
modaladdlist.value = false; modaladdlist.value = false;
}; }
const clickClose = async () => { /** validate */
async function clickClose() {
userNote.value = ""; userNote.value = "";
if (editRow.value == true) { if (editRow.value == true) {
dialogConfirm( dialogConfirm(
@ -469,45 +530,10 @@ const clickClose = async () => {
modalwaitInfo.value = false; modalwaitInfo.value = false;
modal.value = false; modal.value = false;
} }
}; }
const displayAdd = ref<boolean>(true);
onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
if (roleAdmin.value === false) {
displayAdd.value = false;
visibleColumns.value = [
"position",
"fullName",
"examNumber",
"idCard",
"positionNumber",
"organizationName",
"reportingDate",
"bmaOfficer",
"statusName",
"positionCandidate",
];
}
}
await getTable();
});
const containStatus = ref<boolean>(false); /** ยืนยันส่งราชชื่อไปหน่วยงาน */
watch(containStatus, () => { function savelist() {
if (containStatus.value) {
rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
} else {
rows.value = rowsAll.value.filter((x: any) => x.statusId != "CONTAIN");
}
});
const modaladdlist = ref<boolean>(false);
const selected = ref<any>([]);
const personal_selected = ref<any>([]);
const filterlistAdd = ref<string>("");
const paging = ref<boolean>(true);
//
const savelist = () => {
selected.value.map((e: any) => { selected.value.map((e: any) => {
personal_selected.value.push(e.personalId); personal_selected.value.push(e.personalId);
}); });
@ -533,26 +559,50 @@ const savelist = () => {
"ต้องการยืนยันการส่งรายชื่อไปยังหน่วยงานหรือไม่?" "ต้องการยืนยันการส่งรายชื่อไปยังหน่วยงานหรือไม่?"
); );
} }
}; }
// popup
const handleModalAddListUpdate = (val: boolean) => { /**
* เป popup งรายชอไปยงหนวยงาน
* @param val true/false
*/
function handleModalAddListUpdate(val: boolean) {
modaladdlist.value = val; modaladdlist.value = val;
(selected.value = []), (personal_selected.value = []); (selected.value = []), (personal_selected.value = []);
}; }
//
const checkSelected = computed(() => { function paginationLabel(start: number, end: number, total: number) {
if (selected.value.length === 0) {
return true;
}
});
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total; if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total;
}; }
const pagination = ref({ watch(containStatus, () => {
page: 1, if (containStatus.value) {
rowsPerPage: 10, rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
} else {
rows.value = rowsAll.value.filter((x: any) => x.statusId != "CONTAIN");
}
});
onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
if (roleAdmin.value === false) {
displayAdd.value = false;
visibleColumns.value = [
"position",
"fullName",
"examNumber",
"idCard",
"positionNumber",
"organizationName",
"reportingDate",
"bmaOfficer",
"statusName",
"positionCandidate",
];
}
}
await getTable();
}); });
</script> </script>
<template> <template>
@ -642,12 +692,14 @@ const pagination = ref({
</div> </div>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<div class="col-4"> <div class="col-4">
<div class="text-weight-medium">-</div> <div class="text-weight-medium">-</div>
</div> </div>
</div> </div>
</template> </template>
<template v-else-if="col.name === 'positionCandidate'"> <template v-else-if="col.name === 'positionCandidate'">
<div <div
class="text-weight-medium" class="text-weight-medium"
@ -659,6 +711,7 @@ const pagination = ref({
{{ props.row.positionCandidate }} {{ props.row.positionCandidate }}
</div> </div>
</template> </template>
<template <template
v-else-if="col.name === 'reportingDate' && col.value !== '-'" v-else-if="col.name === 'reportingDate' && col.value !== '-'"
> >
@ -666,16 +719,19 @@ const pagination = ref({
{{ props.row.reportingDate }} {{ props.row.reportingDate }}
</div> </div>
</template> </template>
<template v-else-if="col.name === 'bmaOfficer'"> <template v-else-if="col.name === 'bmaOfficer'">
<div class="text-weight-medium"> <div class="text-weight-medium">
{{ props.row.bmaOfficer !== null ? props.row.bmaOfficer : "-" }} {{ props.row.bmaOfficer !== null ? props.row.bmaOfficer : "-" }}
</div> </div>
</template> </template>
<template v-else-if="col.name === 'draft'"> <template v-else-if="col.name === 'draft'">
<div class="text-weight-medium"> <div class="text-weight-medium">
{{ props.row.draft }} {{ props.row.draft }}
</div> </div>
</template> </template>
<template v-else-if="col.name === 'statusName'"> <template v-else-if="col.name === 'statusName'">
<div class="text-weight-medium"> <div class="text-weight-medium">
{{ props.row.statusName }} {{ props.row.statusName }}
@ -738,6 +794,7 @@ const pagination = ref({
</q-item-section> </q-item-section>
<q-item-section>ขอผอนผ</q-item-section> <q-item-section>ขอผอนผ</q-item-section>
</q-item> </q-item>
<q-item <q-item
v-else-if=" v-else-if="
props.row.deferment === true && props.row.deferment === true &&
@ -760,6 +817,7 @@ const pagination = ref({
</q-item-section> </q-item-section>
<q-item-section>อมลการผอนผ</q-item-section> <q-item-section>อมลการผอนผ</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item <q-item
v-if=" v-if="
@ -783,6 +841,7 @@ const pagination = ref({
</q-item-section> </q-item-section>
<q-item-section>สละสทธ</q-item-section> <q-item-section>สละสทธ</q-item-section>
</q-item> </q-item>
<q-item <q-item
v-else-if="props.row.statusId === 'DISCLAIM'" v-else-if="props.row.statusId === 'DISCLAIM'"
clickable clickable

View file

@ -1,15 +1,23 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const $q = useQuasar();
const mixin = useCounterMixin(); // const mixin = useCounterMixin(); //
const { showLoader, hideLoader, date2Thai, messageError } = mixin; const { showLoader, hideLoader, date2Thai, messageError } = mixin;
const $q = useQuasar();
const rows = ref<any[]>([]);
const myForm = ref<any>([]);
const selection = ref<any>([]);
const personalForm = ref<any>([]);
/** รับค่ามาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
Modal: Boolean, Modal: Boolean,
close: { close: {
@ -26,13 +34,7 @@ const props = defineProps({
}, },
}); });
const rows = ref<any[]>([]); /**หัวตาราง */
//--------------------()------------------------------------//
// const graduationDate = new Date(graduationExample);
// rows.value[0].graduation = date2Thai(graduationDate, false, false);
//--------------------------------------------------------------------//
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "university", name: "university",
@ -75,17 +77,9 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
]); ]);
const myForm = ref<any>([]);
const personalForm = ref<any>([]); /** get ข้อมูลการศึกษา */
const selection = ref<any>([]); async function fetchData(){
// props.Modal
watch(props, () => {
if (props.Modal === true) {
fetchData();
}
});
//
const fetchData = async () => {
showLoader(); showLoader();
await http await http
.get(config.API.getDatapersonal(props.personalId)) .get(config.API.getDatapersonal(props.personalId))
@ -108,7 +102,11 @@ const fetchData = async () => {
}); });
}; };
const formBmaofficer = (val: string) => { /**
* convert text
* @param val type
*/
function formBmaofficer(val: string){
switch (val) { switch (val) {
case "OFFICER": case "OFFICER":
return "ขรก.กทม. สามัญ"; return "ขรก.กทม. สามัญ";
@ -120,12 +118,20 @@ const formBmaofficer = (val: string) => {
return ""; return "";
} }
}; };
// POPUP
const close = async () => { /** ปิด POPUP ข้อมูล */
async function close(){
props.close(); props.close();
selection.value = []; selection.value = [];
rows.value = []; rows.value = [];
}; };
/** เมื่อ props.Modal จะเรียกข้อมูลการศึกษา */
watch(props, () => {
if (props.Modal === true) {
fetchData();
}
});
</script> </script>
<template> <template>
<q-dialog v-model="props.Modal" persistent> <q-dialog v-model="props.Modal" persistent>
@ -137,6 +143,7 @@ const close = async () => {
@click="close" @click="close"
/> />
</div> </div>
<q-separator /> <q-separator />
<div class="contanier-box-main"> <div class="contanier-box-main">
@ -152,11 +159,13 @@ const close = async () => {
{{ formBmaofficer(personalForm.bmaOfficer) }} {{ formBmaofficer(personalForm.bmaOfficer) }}
</span> </span>
</div> </div>
<div class="row q-pa-xs"> <div class="row q-pa-xs">
<div class="col-3 header-sub-text"> <div class="col-3 header-sub-text">
<div class="q-pb-md">เลขประจำตวประชาชน</div> <div class="q-pb-md">เลขประจำตวประชาชน</div>
<div>/เดอน/เก</div> <div>/เดอน/เก</div>
</div> </div>
<div class="col-4 sub-text"> <div class="col-4 sub-text">
<div class="q-pb-md"> <div class="q-pb-md">
{{ personalForm.idCard }} {{ personalForm.idCard }}
@ -165,6 +174,7 @@ const close = async () => {
{{ date2Thai(personalForm.dateOfBirth) }} {{ date2Thai(personalForm.dateOfBirth) }}
</div> </div>
</div> </div>
<div class="col-2 header-sub-text"> <div class="col-2 header-sub-text">
<div class="q-pb-md">-นามสก</div> <div class="q-pb-md">-นามสก</div>
<div>เพศ</div> <div>เพศ</div>
@ -177,9 +187,11 @@ const close = async () => {
{{ personalForm.gender }} {{ personalForm.gender }}
</div> </div>
</div> </div>
</div> </div>
</q-card> </q-card>
</div> </div>
<div class="contanier-box-mini"> <div class="contanier-box-mini">
<q-card bordered class="card-panding"> <q-card bordered class="card-panding">
<div class="row items-center q-pa-xs header-text">ลำเนา</div> <div class="row items-center q-pa-xs header-text">ลำเนา</div>
@ -191,6 +203,7 @@ const close = async () => {
</div> </div>
</q-card> </q-card>
</div> </div>
<div class="contanier-box-mini"> <div class="contanier-box-mini">
<q-card bordered class="card-panding"> <q-card bordered class="card-panding">
<div class="row items-center q-pa-xs header-text">การศกษา</div> <div class="row items-center q-pa-xs header-text">การศกษา</div>
@ -209,58 +222,11 @@ const close = async () => {
</q-table> </q-table>
</q-card> </q-card>
</div> </div>
<div class="contanier-box-mini"> <div class="contanier-box-mini">
<q-card bordered class="card-panding"> <q-card bordered class="card-panding">
<div class="row items-center q-pa-xs header-text">การสอบ</div> <div class="row items-center q-pa-xs header-text">การสอบ</div>
<div class="row q-pa-xs"> <div class="row q-pa-xs">
<!-- <div class="col-6">
<q-card class="card-exam q-pa-sm">
<div class="row">
<div class="col-4 q-pa-xs header-sub-text-exam">
<div>ประเภท</div>
<div>ภาค </div>
<div>ภาค </div>
<div>ภาค </div>
<div>รวมทงหมด</div>
</div>
<div class="col-4 q-pa-xs text-right">
<div class="header-sub-text-exam-2">คะแนนทได</div>
<div class="sub-text-exam">
{{ personalForm.pointTotalA }}
</div>
<div class="sub-text-exam">
{{ personalForm.pointTotalB }}
</div>
<div class="sub-text-exam">
{{ personalForm.pointTotalC }}
</div>
<div class="sub-text-exam">
{{ personalForm.pointTotal }}
</div>
</div>
<div
class="col-4 q-pa-xs header-sub-text-exam-2 text-right"
>
<div class="header-sub-text-exam-2 text-right">
ผลการสอบ
</div>
<div class="sub-text-exam">
{{ personalForm.pointA }}
</div>
<div class="sub-text-exam">
{{ personalForm.pointB }}
</div>
<div class="sub-text-exam">
{{ personalForm.pointC }}
</div>
<div class="sub-text-exam">
{{ personalForm.point }}
</div>
</div>
</div>
</q-card>
</div>
<div class="col-1"></div> -->
<div class="col-6 q-pt-sm q-pl-lg"> <div class="col-6 q-pt-sm q-pl-lg">
<div class="row"> <div class="row">
<div class="col-7 header-sub-text"> <div class="col-7 header-sub-text">

View file

@ -1,11 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, useAttrs } from "vue"; import { ref, useAttrs } from "vue";
import { QTooltip, useQuasar } from "quasar"; import { QTooltip, useQuasar } from "quasar";
const $q = useQuasar(); const $q = useQuasar();
const attrs = ref<any>(useAttrs()); const attrs = ref<any>(useAttrs());
const paging = ref<boolean>(true); const paging = ref<boolean>(true);
const table = ref<any>(null); const table = ref<any>(null);
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
const props = defineProps({ const props = defineProps({
inputfilter: String, inputfilter: String,
inputvisible: Array, inputvisible: Array,
@ -95,18 +97,15 @@ const props = defineProps({
containStatus: Boolean, containStatus: Boolean,
roleAdmin: Boolean, roleAdmin: Boolean,
}); });
const pagination = ref({ const pagination = ref({
sortBy: "examNumber", sortBy: "examNumber",
descending: false, descending: false,
page: 1, page: 1,
rowsPerPage: 10, rowsPerPage: 10,
}); });
const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
const refresh = () => props.refresh();
/** ส่งค่า*/
const emit = defineEmits([ const emit = defineEmits([
"update:inputfilter", "update:inputfilter",
"update:inputvisible", "update:inputvisible",
@ -117,25 +116,42 @@ const emit = defineEmits([
"update-modaladdlist", "update-modaladdlist",
]); ]);
const updateInput = (value: any) => { function paginationLabel(start: string, end: string, total: string) {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
}
/**
* update าทนหา
* @param value string
*/
function updateInput(value: any) {
emit("update:inputfilter", value); emit("update:inputfilter", value);
}; }
const updateVisible = (value: any) => {
/** update ข้อมูลที่ เเสดง */
function updateVisible(value: any) {
emit("update:inputvisible", value); emit("update:inputvisible", value);
}; }
const updateContain = (value: any) => { /**
* แสดงสถานะบรรจแล
* @param value true/false
*/
function updateContain(value: any) {
emit("update:containfilter", value); emit("update:containfilter", value);
}; }
const resetFilter = () => { /** reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา */
// reset X function resetFilter() {
emit("update:inputfilter", ""); emit("update:inputfilter", "");
filterRef.value.focus(); filterRef.value.focus();
}; }
const updateModaladdlist = () => {
/** ส่งรายชื่อไปยังหน่วยงาน */
function updateModaladdlist() {
emit("update-modaladdlist", true); emit("update-modaladdlist", true);
}; }
</script> </script>
<template> <template>