ปรับ ประเมินบุคคล => ข้อมูลส่วนตัว
This commit is contained in:
parent
4d9be43479
commit
864c7c3637
6 changed files with 233 additions and 84 deletions
|
|
@ -4,16 +4,21 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
/** importComponents*/
|
||||
import PopupCheckFeatures from "@/modules/06_evaluate/components/PopupCheckFeatures.vue";
|
||||
|
||||
/** importStores*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
/** use*/
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const store = useEvaluateStore();
|
||||
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
/** props ID จาก Tab1.vue*/
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
type: String,
|
||||
|
|
@ -21,9 +26,10 @@ const props = defineProps({
|
|||
educations: Array,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:spec"]);
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const show = ref<boolean>(false);
|
||||
const emit = defineEmits(["update:spec"]);
|
||||
|
||||
const formData = reactive<any>({
|
||||
isEducationalQft: false, // คุณวุฒิการศึกษา
|
||||
|
|
@ -34,10 +40,16 @@ const formData = reactive<any>({
|
|||
isHaveProLicense: false, // มีใบอนุญาตประกอบวิชาชีพของสายงานต่างๆ
|
||||
isHaveMinPeriodOrHoldPos: false, // มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งหรือเคยดำรงตำแหน่งในสายงานที่จะคัดเลือกตามคุณวุฒิของบุคคลและระดับตำแหน่งที่จะคัดเลือก]
|
||||
});
|
||||
|
||||
/** function อัปเดทตรวจสอบคุณสมบัติ*/
|
||||
async function updateValue() {
|
||||
emit("update:spec", formData);
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetchData ตรวจสอบคุณสมบัติ
|
||||
* @param id ประเมิน
|
||||
*/
|
||||
async function fetchCheckSpec(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -60,18 +72,22 @@ async function fetchCheckSpec(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function openPopup
|
||||
* @param status
|
||||
*/
|
||||
function openModal(status: boolean) {
|
||||
modal.value = true;
|
||||
show.value = status;
|
||||
}
|
||||
|
||||
/** function closePopup*/
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
/**hook lifecycle*/
|
||||
onMounted(() => {
|
||||
console.log(store.step);
|
||||
|
||||
props.evaluateId && fetchCheckSpec(props.evaluateId);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,38 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import { VuePDF, usePDF } from "@tato30/vue-pdf";
|
||||
import { useQuasar } from "quasar";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { VuePDF, usePDF } from "@tato30/vue-pdf";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
/** importType*/
|
||||
import type { FormCommand } from "@/modules/06_evaluate/interface/evalute";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const store = useEvaluateStore();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { showLoader, hideLoader, date2Thai, messageError, success } = mixin;
|
||||
|
||||
const fullName = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
|
||||
);
|
||||
|
||||
/** props ID จาก Tab1.vue*/
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
/** emit */
|
||||
const emit = defineEmits(["update:form"]);
|
||||
|
||||
/** form ผู้เซ็นเอกสาร*/
|
||||
const formCommand = reactive<FormCommand>({
|
||||
commanderFullname: "",
|
||||
commanderPosition: "",
|
||||
|
|
@ -38,6 +40,7 @@ const formCommand = reactive<FormCommand>({
|
|||
commanderAbovePosition: "",
|
||||
});
|
||||
|
||||
/** formRef */
|
||||
const commanderFullnameRef = ref<object | null>(null);
|
||||
const commanderPositionRef = ref<object | null>(null);
|
||||
const commanderAboveFullnameRef = ref<object | null>(null);
|
||||
|
|
@ -49,7 +52,11 @@ const fileEvaluation4Ref = ref<object | null>(null);
|
|||
const fileEvaluation5Ref = ref<object | null>(null);
|
||||
const fileEvaluation6Ref = ref<object | null>(null);
|
||||
|
||||
const updateInput = (value: any) => {
|
||||
/**
|
||||
* function updateFormref
|
||||
* @param val value ผู้เซ็นเอกสาร
|
||||
*/
|
||||
function updateInput(val: any) {
|
||||
const ref = {
|
||||
commanderFullnameRef: commanderFullnameRef.value,
|
||||
commanderPositionRef: commanderPositionRef.value,
|
||||
|
|
@ -62,9 +69,10 @@ const updateInput = (value: any) => {
|
|||
fileEvaluation5Ref: fileEvaluation5Ref.value,
|
||||
fileEvaluation6Ref: fileEvaluation6Ref.value,
|
||||
};
|
||||
emit("update:form", value, ref);
|
||||
};
|
||||
emit("update:form", val, ref); // ส่งข้อมูลไปอัปเดท
|
||||
}
|
||||
|
||||
/** ตัวแปร file*/
|
||||
const fileEvaluation1 = ref<any>();
|
||||
const fileEvaluation2 = ref<any>();
|
||||
const fileEvaluation3 = ref<any>();
|
||||
|
|
@ -83,64 +91,77 @@ function onClickViewPDF(file: any) {
|
|||
modalView.value = true;
|
||||
}
|
||||
|
||||
/** ไปหน้าต่อไปของรายงาน */
|
||||
/** function ไปหน้าต่อไปของรายงาน */
|
||||
function nextPage() {
|
||||
if (page.value < numOfPages.value) {
|
||||
page.value++;
|
||||
}
|
||||
}
|
||||
|
||||
/** กลับหน้าก่อนหน้าของรายงาน */
|
||||
/** function กลับหน้าก่อนหน้าของรายงาน */
|
||||
function backPage() {
|
||||
if (page.value !== 1) {
|
||||
page.value--;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* funcion ดาวน์โหลดไฟล์
|
||||
* @param tp templatname
|
||||
* @param templateName
|
||||
* @param fileName ชือ่ไฟล์
|
||||
*/
|
||||
async function onClickDowloadFile(
|
||||
tp: string,
|
||||
templateName: string,
|
||||
fileName: string
|
||||
) {
|
||||
showLoader();
|
||||
let educations: any = [];
|
||||
if(profile.value!=null){
|
||||
profile.value.education.map((e: any) => {
|
||||
educations.push({
|
||||
educationLevel: e.educationLevel ?? "",
|
||||
finishYear: e.finishDate == null ? "":new Date(e.finishDate).getFullYear()+543,
|
||||
institute: e.institute ?? "",
|
||||
});
|
||||
});}
|
||||
let certificates: any = [];
|
||||
if(profile.value!=null){
|
||||
profile.value.certificate.map((e: any) => {
|
||||
certificates.push({
|
||||
certificateNo: e.certificateNo ?? "",
|
||||
certificateType: e.certificateType ?? "",
|
||||
issuer: e.issuer ?? "",
|
||||
});
|
||||
});}
|
||||
let salaries: any = [];
|
||||
if(profile.value!=null){
|
||||
profile.value.salaries.map((e: any) => {
|
||||
salaries.push({
|
||||
date: e.date == null ? "":date2Thai(new Date(e.date)),
|
||||
position: e.position ?? "",
|
||||
amount: e.amount ?? "",
|
||||
});
|
||||
});}
|
||||
let trainings: any = [];
|
||||
if(profile.value!=null){
|
||||
profile.value.training.map((e: any) => {
|
||||
trainings.push({
|
||||
yearly: e.yearly ?? "",
|
||||
startDate: e.startDate == null ? "":date2Thai(new Date(e.startDate)),
|
||||
endDate: e.endDate == null ? "":date2Thai(new Date(e.endDate)),
|
||||
name: e.name ?? "",
|
||||
topic: e.topic ?? "",
|
||||
});
|
||||
});}
|
||||
let educations: any = [];
|
||||
if (profile.value != null) {
|
||||
profile.value.education.map((e: any) => {
|
||||
educations.push({
|
||||
educationLevel: e.educationLevel ?? "",
|
||||
finishYear:
|
||||
e.finishDate == null
|
||||
? ""
|
||||
: new Date(e.finishDate).getFullYear() + 543,
|
||||
institute: e.institute ?? "",
|
||||
});
|
||||
});
|
||||
}
|
||||
let certificates: any = [];
|
||||
if (profile.value != null) {
|
||||
profile.value.certificate.map((e: any) => {
|
||||
certificates.push({
|
||||
certificateNo: e.certificateNo ?? "",
|
||||
certificateType: e.certificateType ?? "",
|
||||
issuer: e.issuer ?? "",
|
||||
});
|
||||
});
|
||||
}
|
||||
let salaries: any = [];
|
||||
if (profile.value != null) {
|
||||
profile.value.salaries.map((e: any) => {
|
||||
salaries.push({
|
||||
date: e.date == null ? "" : date2Thai(new Date(e.date)),
|
||||
position: e.position ?? "",
|
||||
amount: e.amount ?? "",
|
||||
});
|
||||
});
|
||||
}
|
||||
let trainings: any = [];
|
||||
if (profile.value != null) {
|
||||
profile.value.training.map((e: any) => {
|
||||
trainings.push({
|
||||
yearly: e.yearly ?? "",
|
||||
startDate: e.startDate == null ? "" : date2Thai(new Date(e.startDate)),
|
||||
endDate: e.endDate == null ? "" : date2Thai(new Date(e.endDate)),
|
||||
name: e.name ?? "",
|
||||
topic: e.topic ?? "",
|
||||
});
|
||||
});
|
||||
}
|
||||
const data = Object.assign(
|
||||
{ educations: educations },
|
||||
{ certificates: certificates },
|
||||
|
|
@ -151,9 +172,19 @@ async function onClickDowloadFile(
|
|||
{ positionLevel: profile.value == null ? "" : profile.value.positionLevel },
|
||||
{ posNo: profile.value == null ? "" : profile.value.posNo },
|
||||
{ oc: profile.value == null ? "" : profile.value.oc },
|
||||
{ birthDate: profile.value == null ? "" : date2Thai(profile.value.birthDate) },
|
||||
{
|
||||
birthDate:
|
||||
profile.value == null ? "" : date2Thai(profile.value.birthDate),
|
||||
},
|
||||
{ govAge: profile.value == null ? "" : profile.value.govAge },
|
||||
{ positionLevelNew: profile.value == null ? "" : (profile.value.type == "EXPERT"? "ชำนาญการ":"ชำนาญการพิเศษ")},
|
||||
{
|
||||
positionLevelNew:
|
||||
profile.value == null
|
||||
? ""
|
||||
: profile.value.type == "EXPERT"
|
||||
? "ชำนาญการ"
|
||||
: "ชำนาญการพิเศษ",
|
||||
},
|
||||
tp === "EV1_005" || tp === "EV1_007" ? { organizationName: "-" } : null,
|
||||
tp === "EV1_007" ? { positionName: "-" } : null,
|
||||
tp === "EV1_007" ? { positionLeaveName: "-" } : null
|
||||
|
|
@ -163,10 +194,16 @@ async function onClickDowloadFile(
|
|||
reportName: templateName,
|
||||
data: data,
|
||||
};
|
||||
|
||||
await genReport(body, fileName);
|
||||
await genReport(body, fileName); //สร้างไฟล์ต้นแบบ
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ลิงค์อัปโหลดไฟล์
|
||||
* @param volume เล่ม
|
||||
* @param id evaluate ID
|
||||
* @param type ประเภทไฟล์
|
||||
* @param file ไฟล์
|
||||
*/
|
||||
async function fetchPathUpload(
|
||||
volume: string,
|
||||
id: string | undefined,
|
||||
|
|
@ -175,13 +212,6 @@ async function fetchPathUpload(
|
|||
) {
|
||||
const body = {
|
||||
fileList: { fileName: type, metadata: {} },
|
||||
|
||||
// "1-แบบพิจารณาคุณสมบัติบุคคล",
|
||||
// "2-แบบแสดงรายละเอียดการเสนอผลงาน",
|
||||
// "3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล (เอกสารแบบ ก.)",
|
||||
// "4-แบบประเมินคุณลักษณะบุคคล",
|
||||
// "5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
|
||||
// "6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
};
|
||||
if (id && file) {
|
||||
showLoader();
|
||||
|
|
@ -205,8 +235,13 @@ async function fetchPathUpload(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* functoin อัปโหลดไฟล์
|
||||
* @param uploadUrl link อัปโหลด
|
||||
* @param file ไฟล์
|
||||
*/
|
||||
async function uploadfile(uploadUrl: string, file: any) {
|
||||
console.log(uploadUrl);
|
||||
showLoader();
|
||||
await axios
|
||||
.put(uploadUrl, file, {
|
||||
headers: {
|
||||
|
|
@ -218,9 +253,16 @@ async function uploadfile(uploadUrl: string, file: any) {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fecth รายชื่อผู้เซ็นเอกสาร
|
||||
* @param id evaluate ID
|
||||
*/
|
||||
async function fetcheSigner(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -240,14 +282,17 @@ async function fetcheSigner(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function
|
||||
* @param id evaluate ID
|
||||
*/
|
||||
async function fetchCheckSpec(id: string) {
|
||||
console.log("zxczx")
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluationCheckspecByid(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
profile.value =data
|
||||
profile.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -263,12 +308,15 @@ const downloadFile3 = ref<string>("");
|
|||
const downloadFile4 = ref<string>("");
|
||||
const downloadFile5 = ref<string>("");
|
||||
const downloadFile6 = ref<string>("");
|
||||
/**
|
||||
* function ดาวน์โหลดไฟล์
|
||||
* @param fileName ชื่อไฟล์
|
||||
*/
|
||||
async function downloadFile(fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.loadFileDocument("เล่ม 1", store.evaluateId, fileName))
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
if (fileName === "1-แบบพิจารณาคุณสมบัติบุคคล") {
|
||||
downloadFile1.value = res.data.downloadUrl;
|
||||
} else if (fileName === "2-แบบแสดงรายละเอียดการเสนอผลงาน") {
|
||||
|
|
@ -293,6 +341,7 @@ async function downloadFile(fileName: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**lifecycle Hooks*/
|
||||
onMounted(async () => {
|
||||
const ref = {
|
||||
commanderFullnameRef: commanderFullnameRef.value,
|
||||
|
|
@ -309,7 +358,7 @@ onMounted(async () => {
|
|||
if (store.currentStep > 2) {
|
||||
fetcheSigner(store.evaluateId);
|
||||
}
|
||||
fetchCheckSpec(store.evaluateId );
|
||||
fetchCheckSpec(store.evaluateId);
|
||||
emit("update:form", formCommand, ref);
|
||||
downloadFile("1-แบบพิจารณาคุณสมบัติบุคคล");
|
||||
downloadFile("2-แบบแสดงรายละเอียดการเสนอผลงาน");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue