Merge branch 'dev-chiangmai' of https://github.com/Frappet/bma-ehr-frontend into dev-chiangmai
# Conflicts: # src/api/05_placement/api.placement.ts # src/modules/05_placement/components/pass/TableDetail.vue
This commit is contained in:
commit
593576a7e6
10 changed files with 964 additions and 774 deletions
|
|
@ -1,13 +1,16 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { defineAsyncComponent } from "@vue/runtime-core";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter ,useRoute} from "vue-router";
|
||||
import cardTop from "@/modules/05_placement/components/pass/StatCard.vue";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
let roleAdmin = ref<boolean>(false);
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const examId = route.params.examId;
|
||||
const year = ref<string>("2566");
|
||||
const round = ref<string>("1");
|
||||
const title = ref<string>("การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ");
|
||||
|
|
@ -15,14 +18,38 @@ const AddTablePosition = defineAsyncComponent(
|
|||
() => import("@/modules/05_placement/components/pass/Table.vue")
|
||||
);
|
||||
const stat = ref<any>({
|
||||
total: 5,
|
||||
unContain: 1,
|
||||
prepareContain: 3,
|
||||
contain: 1,
|
||||
total: 0,
|
||||
unContain: 0,
|
||||
prepareContain: 0,
|
||||
contain: 0,
|
||||
disclaim: 0,
|
||||
});
|
||||
|
||||
const getStat = async () => {
|
||||
const examIdString = Array.isArray(examId) ? examId[0] : examId;
|
||||
|
||||
try {
|
||||
const res = await http.get(config.API.getStatCard(examIdString));
|
||||
const statCard = res.data.result;
|
||||
|
||||
// อัปเดตค่าในตัวแปร stat
|
||||
stat.value = {
|
||||
total: statCard.total,
|
||||
unContain: statCard.unContain,
|
||||
prepareContain: statCard.prepareContain,
|
||||
contain: statCard.contain,
|
||||
disclaim: statCard.disclaim,
|
||||
};
|
||||
|
||||
console.log("🚀 ~ file: Table.vue:96 ~ getStatCard ~ data:", statCard);
|
||||
} catch (error) {
|
||||
console.error("Error retrieving data:", error);
|
||||
// จัดการข้อผิดพลาดที่เกิดขึ้นในการรับข้อมูล
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getStat()
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -12,6 +12,9 @@ const mixin = useCounterMixin(); //เรียกฟังก์ชันกล
|
|||
const modal = ref<boolean>();
|
||||
const { success, showLoader, hideLoader, date2Thai, modalConfirm } = mixin;
|
||||
const save = ref<boolean>(true);
|
||||
|
||||
const fullName = ref<any>()
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
close: {
|
||||
|
|
@ -27,12 +30,55 @@ const props = defineProps({
|
|||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
|
||||
// const getDetailbyId = (props.getdetail) => {
|
||||
// showLoader();
|
||||
|
||||
// // ดึงข้อมูล personalId จาก API ก่อน
|
||||
// try {
|
||||
// const response = await http.get(config.API.personalId(id));
|
||||
// const personalId = response.data.personalId;
|
||||
|
||||
// // เมื่อได้รับ personalId แล้วให้ดึงข้อมูลอื่นๆ จาก API
|
||||
// const organizationResponse = await http.get(config.API.organizationName(personalId));
|
||||
// const data = organizationResponse.data.result;
|
||||
|
||||
// // อัปเดตข้อมูลบนหน้า UI จากข้อมูลที่ได้รับ
|
||||
// uid.value = data.personalId;
|
||||
// idCard.value = data.idCard;
|
||||
// fullName.value = "tee";
|
||||
// dateOfBirth.value = new Date(data.dateOfBirth).toLocaleDateString();
|
||||
// gender.value = data.gender;
|
||||
// address.value = data.address;
|
||||
// education.value = data.education;
|
||||
// pointA.value = data.pointA;
|
||||
// pointB.value = data.pointB;
|
||||
// pointC.value = data.pointC;
|
||||
// pointTotalA.value = data.pointTotalA;
|
||||
// pointTotalB.value = data.pointTotalB;
|
||||
// pointTotalC.value = data.pointTotalC;
|
||||
// point.value = data.point;
|
||||
// pointTotal.value = data.pointTotal;
|
||||
// examNumber.value = data.examNumber;
|
||||
// examRound.value = data.examRound;
|
||||
// pass.value = data.pass;
|
||||
// isProperty.value = data.isProperty;
|
||||
// } catch (error) {
|
||||
// messageError($q, error);
|
||||
// } finally {
|
||||
// hideLoader();
|
||||
// }
|
||||
|
||||
// };
|
||||
|
||||
const rows = ref<any[]>([
|
||||
// university: props.getdetail.university || "-",
|
||||
// degree: props.getdetail.degree || "-",
|
||||
// major: props.getdetail.major || "-",
|
||||
// graduation: "2022-01-01",
|
||||
]);
|
||||
]);
|
||||
//--------------------(แปลงวันที่เป็นไทย)------------------------------------//
|
||||
// const graduationDate = new Date(graduationExample);
|
||||
// rows.value[0].graduation = date2Thai(graduationDate, false, false);
|
||||
|
||||
//--------------------------------------------------------------------//
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "university",
|
||||
|
|
@ -77,54 +123,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const myForm = ref<any>([]);
|
||||
const personalForm = ref<any>([]);
|
||||
// const checkValidate = ref<boolean>(false);
|
||||
const selection = ref<any>([]);
|
||||
|
||||
// const checkboxItems: CheckboxItem[] = [
|
||||
// { id: 1, label: "ไม่เป็นผู้ดำรงตำแหน่งทางการเมือง" },
|
||||
// {
|
||||
// id: 2,
|
||||
// label:
|
||||
// "ไม่เป็นคนไร้ความสามารถ คนเสมือนไร้ความสามารถ คนวิกลจริตหรือจิตฟั่นเฟือน ไม่สมประกอบหรือเป็นโรคตามที่กำหนดในกฎ ก.พ.",
|
||||
// },
|
||||
// {
|
||||
// id: 3,
|
||||
// label:
|
||||
// "ไม่เป็นผู้อยู่ในระหว่างถูกสั่งพักราชการหรือถูกสั่งให้ออกจากราชการไว้ก่อนตามพระราชบัญญัตินี้ หรือตามกฎหมายอื่น",
|
||||
// },
|
||||
// { id: 4, label: "ไม่เป็นผู้บกพร่องในศีลธรรมอันดีจนเป็นที่รังเกียจของสังคม" },
|
||||
// {
|
||||
// id: 5,
|
||||
// label:
|
||||
// "ไม่เป็นกรรมการหรือผู้ดำรงตำแหน่งที่รับผิดชอบในการบริหารพรรคการเมือง หรือเจ้าหน้าที่ในพรรคการเมือง",
|
||||
// },
|
||||
// { id: 6, label: "ไม่เป็นบุคคลล้มละลาย" },
|
||||
// {
|
||||
// id: 7,
|
||||
// label:
|
||||
// "ไม่เป็นผู้เคยต้องรับโทษจำคุกโดยคำพิพากษาถึงที่สุดให้จำคุกเพราะกระทำความผิดทางอาญา เว้นแต่เป็นโทษสำหรับความผิดที่ใด้กระทำโดยประมาทหรือความผิดลหุโทษ",
|
||||
// },
|
||||
// {
|
||||
// id: 8,
|
||||
// label:
|
||||
// "ไม่เป็นผู้เคยถูกลงโทษให้ออก ปลดออก หรือไล่ออกจากรัฐวิสาหกิจ หรือ หน่วยงานอื่นของรัฐ",
|
||||
// },
|
||||
// {
|
||||
// id: 9,
|
||||
// label:
|
||||
// "เป็นผู้เคยถูลงโทษให้ออก หรือปลดออก เพราะกระทำผิตวินัยตามพระราชบัญญัตินี้ หรือตามกฎหมายอื่น",
|
||||
// },
|
||||
// {
|
||||
// id: 10,
|
||||
// label:
|
||||
// "เป็นผู้เคยถูกลงโทษไล่ออก เพราะกระทำผิดวินัยตามพระราชบัญญัตินี้ หรือตามกฎหมายอื่น",
|
||||
// },
|
||||
// {
|
||||
// id: 11,
|
||||
// label:
|
||||
// "เป็นผู้เคยกระทำการทุจริตในการสอบเข้ารับราชการ หรือเข้าปฏิบัติงานใน หน่วยงานของรัฐ",
|
||||
// },
|
||||
// ];
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
function isRequired(val: any): boolean | string {
|
||||
|
|
@ -304,6 +305,7 @@ const putpersonalForm = async () => {
|
|||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
hide-bottom
|
||||
>
|
||||
</q-table>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue