ปรับ ประเมินบุคคล => ข้อมูลส่วนตัว

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-26 11:09:51 +07:00
parent 4d9be43479
commit 864c7c3637
6 changed files with 233 additions and 84 deletions

View file

@ -24,7 +24,6 @@ import ViewStep1 from "@/modules/06_evaluate/components/viewstep/viewStep1.vue";
import ViewStep3 from "@/modules/06_evaluate/components/viewstep/viewStep3.vue"; import ViewStep3 from "@/modules/06_evaluate/components/viewstep/viewStep3.vue";
import ViewStep7 from "@/modules/06_evaluate/components/viewstep/viewStep7.vue"; import ViewStep7 from "@/modules/06_evaluate/components/viewstep/viewStep7.vue";
import DialogMain from "@/modules/06_evaluate/components/directorandmeet/DialogMain.vue";
import PopupHistory from "@/modules/06_evaluate/components/viewstep/popupHistory.vue"; import PopupHistory from "@/modules/06_evaluate/components/viewstep/popupHistory.vue";
import { useEvaluateStore } from "@/modules/06_evaluate/store"; import { useEvaluateStore } from "@/modules/06_evaluate/store";
@ -380,6 +379,7 @@ onMounted(async () => {
<ViewStep1 <ViewStep1
v-if="store.step === 1" v-if="store.step === 1"
@update:formDeital="updateFormDetail" @update:formDeital="updateFormDetail"
:evaluateId="store.evaluateId"
/> />
<ViewStep3 v-if="store.step === 3 && pdfSrc" :pdfSrc="pdfSrc" /> <ViewStep3 v-if="store.step === 3 && pdfSrc" :pdfSrc="pdfSrc" />
<ViewStep7 <ViewStep7

View file

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from "vue"; import { ref, watch } from "vue";
/** importComponents*/
import HeaderDialog from "@/components/DialogHeader.vue"; import HeaderDialog from "@/components/DialogHeader.vue";
import TableView from "@/modules/06_evaluate/components/directorandmeet/Table.vue"; import TableView from "@/modules/06_evaluate/components/directorandmeet/Table.vue";
@ -28,17 +29,19 @@ const props = defineProps({
const tabMenu = ref<string>("director"); const tabMenu = ref<string>("director");
/** watch modal true fetchData */
watch([() => props.modal, () => tabMenu.value], () => { watch([() => props.modal, () => tabMenu.value], () => {
props.modal && fetchData(); props.modal && fetchData();
}); });
/** function fetchData */
function fetchData() { function fetchData() {
const functionMain = const functionMain =
tabMenu.value === "director" tabMenu.value === "director"
? props.fetchDirector?.() ? props.fetchDirector?.() // fetchDataDirector
: props.fetchMeeting?.(); : props.fetchMeeting?.(); // fetchDataMeeting
return functionMain; return functionMain; // returnFunction
} }
</script> </script>
@ -85,10 +88,6 @@ function fetchData() {
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<!-- <q-card-actions align="right" class="bg-white text-teal">
<q-btn flat label="OK" v-close-popup />
</q-card-actions> -->
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>

View file

@ -8,10 +8,11 @@ const props = defineProps({
type: String, type: String,
}, },
row: { row: {
type: Object, type: Array as () => any[],
}, },
}); });
/** columnsDirector*/
const columnsDrictor = ref<QTableProps["columns"]>([ const columnsDrictor = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -68,6 +69,8 @@ const columnsDrictor = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
/** columnsMeeting*/
const columnsMeeting = ref<QTableProps["columns"]>([ const columnsMeeting = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -107,6 +110,7 @@ const columnsMeeting = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const columns = ref<QTableProps["columns"]>([]); const columns = ref<QTableProps["columns"]>([]);
onMounted(() => { onMounted(() => {

View file

@ -4,16 +4,21 @@ import { useQuasar } from "quasar";
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"; /** importComponents*/
import { useEvaluateStore } from "@/modules/06_evaluate/store";
import PopupCheckFeatures from "@/modules/06_evaluate/components/PopupCheckFeatures.vue"; 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 mixin = useCounterMixin();
const $q = useQuasar(); const $q = useQuasar();
const store = useEvaluateStore(); const store = useEvaluateStore();
const { showLoader, hideLoader, messageError } = mixin; const { showLoader, hideLoader, messageError } = mixin;
/** props ID จาก Tab1.vue*/
const props = defineProps({ const props = defineProps({
evaluateId: { evaluateId: {
type: String, type: String,
@ -21,9 +26,10 @@ const props = defineProps({
educations: Array, educations: Array,
}); });
const emit = defineEmits(["update:spec"]);
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const show = ref<boolean>(false); const show = ref<boolean>(false);
const emit = defineEmits(["update:spec"]);
const formData = reactive<any>({ const formData = reactive<any>({
isEducationalQft: false, // isEducationalQft: false, //
@ -34,10 +40,16 @@ const formData = reactive<any>({
isHaveProLicense: false, // isHaveProLicense: false, //
isHaveMinPeriodOrHoldPos: false, // ] isHaveMinPeriodOrHoldPos: false, // ]
}); });
/** function อัปเดทตรวจสอบคุณสมบัติ*/
async function updateValue() { async function updateValue() {
emit("update:spec", formData); emit("update:spec", formData);
} }
/**
* function fetchData ตรวจสอบคณสมบ
* @param id ประเม
*/
async function fetchCheckSpec(id: string) { async function fetchCheckSpec(id: string) {
showLoader(); showLoader();
await http await http
@ -60,18 +72,22 @@ async function fetchCheckSpec(id: string) {
}); });
} }
/**
* function openPopup
* @param status
*/
function openModal(status: boolean) { function openModal(status: boolean) {
modal.value = true; modal.value = true;
show.value = status; show.value = status;
} }
/** function closePopup*/
function closeModal() { function closeModal() {
modal.value = false; modal.value = false;
} }
/**hook lifecycle*/
onMounted(() => { onMounted(() => {
console.log(store.step);
props.evaluateId && fetchCheckSpec(props.evaluateId); props.evaluateId && fetchCheckSpec(props.evaluateId);
}); });
</script> </script>

View file

@ -1,36 +1,38 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, reactive } from "vue"; import { ref, onMounted, reactive } from "vue";
import { VuePDF, usePDF } from "@tato30/vue-pdf";
import { useQuasar } from "quasar";
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 genReport from "@/plugins/genreport";
import { VuePDF, usePDF } from "@tato30/vue-pdf";
import { useQuasar } from "quasar";
import axios from "axios"; import axios from "axios";
import genReport from "@/plugins/genreport";
/** importType*/
import type { FormCommand } from "@/modules/06_evaluate/interface/evalute"; import type { FormCommand } from "@/modules/06_evaluate/interface/evalute";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateStore } from "@/modules/06_evaluate/store"; import { useEvaluateStore } from "@/modules/06_evaluate/store";
/** use*/
const $q = useQuasar(); const $q = useQuasar();
const store = useEvaluateStore(); const store = useEvaluateStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, date2Thai, messageError, success } = mixin; const { showLoader, hideLoader, date2Thai, messageError, success } = mixin;
const fullName = ref<string>( /** props ID จาก Tab1.vue*/
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
);
const props = defineProps({ const props = defineProps({
evaluateId: { evaluateId: {
type: String, type: String,
}, },
}); });
/** emit */
const emit = defineEmits(["update:form"]); const emit = defineEmits(["update:form"]);
/** form ผู้เซ็นเอกสาร*/
const formCommand = reactive<FormCommand>({ const formCommand = reactive<FormCommand>({
commanderFullname: "", commanderFullname: "",
commanderPosition: "", commanderPosition: "",
@ -38,6 +40,7 @@ const formCommand = reactive<FormCommand>({
commanderAbovePosition: "", commanderAbovePosition: "",
}); });
/** formRef */
const commanderFullnameRef = ref<object | null>(null); const commanderFullnameRef = ref<object | null>(null);
const commanderPositionRef = ref<object | null>(null); const commanderPositionRef = ref<object | null>(null);
const commanderAboveFullnameRef = 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 fileEvaluation5Ref = ref<object | null>(null);
const fileEvaluation6Ref = 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 = { const ref = {
commanderFullnameRef: commanderFullnameRef.value, commanderFullnameRef: commanderFullnameRef.value,
commanderPositionRef: commanderPositionRef.value, commanderPositionRef: commanderPositionRef.value,
@ -62,9 +69,10 @@ const updateInput = (value: any) => {
fileEvaluation5Ref: fileEvaluation5Ref.value, fileEvaluation5Ref: fileEvaluation5Ref.value,
fileEvaluation6Ref: fileEvaluation6Ref.value, fileEvaluation6Ref: fileEvaluation6Ref.value,
}; };
emit("update:form", value, ref); emit("update:form", val, ref); //
}; }
/** ตัวแปร file*/
const fileEvaluation1 = ref<any>(); const fileEvaluation1 = ref<any>();
const fileEvaluation2 = ref<any>(); const fileEvaluation2 = ref<any>();
const fileEvaluation3 = ref<any>(); const fileEvaluation3 = ref<any>();
@ -83,64 +91,77 @@ function onClickViewPDF(file: any) {
modalView.value = true; modalView.value = true;
} }
/** ไปหน้าต่อไปของรายงาน */ /** function ไปหน้าต่อไปของรายงาน */
function nextPage() { function nextPage() {
if (page.value < numOfPages.value) { if (page.value < numOfPages.value) {
page.value++; page.value++;
} }
} }
/** กลับหน้าก่อนหน้าของรายงาน */ /** function กลับหน้าก่อนหน้าของรายงาน */
function backPage() { function backPage() {
if (page.value !== 1) { if (page.value !== 1) {
page.value--; page.value--;
} }
} }
/**
* funcion ดาวนโหลดไฟล
* @param tp templatname
* @param templateName
* @param fileName ไฟล
*/
async function onClickDowloadFile( async function onClickDowloadFile(
tp: string, tp: string,
templateName: string, templateName: string,
fileName: string fileName: string
) { ) {
showLoader(); showLoader();
let educations: any = []; let educations: any = [];
if(profile.value!=null){ if (profile.value != null) {
profile.value.education.map((e: any) => { profile.value.education.map((e: any) => {
educations.push({ educations.push({
educationLevel: e.educationLevel ?? "", educationLevel: e.educationLevel ?? "",
finishYear: e.finishDate == null ? "":new Date(e.finishDate).getFullYear()+543, finishYear:
institute: e.institute ?? "", e.finishDate == null
}); ? ""
});} : new Date(e.finishDate).getFullYear() + 543,
let certificates: any = []; institute: e.institute ?? "",
if(profile.value!=null){ });
profile.value.certificate.map((e: any) => { });
certificates.push({ }
certificateNo: e.certificateNo ?? "", let certificates: any = [];
certificateType: e.certificateType ?? "", if (profile.value != null) {
issuer: e.issuer ?? "", profile.value.certificate.map((e: any) => {
}); certificates.push({
});} certificateNo: e.certificateNo ?? "",
let salaries: any = []; certificateType: e.certificateType ?? "",
if(profile.value!=null){ issuer: e.issuer ?? "",
profile.value.salaries.map((e: any) => { });
salaries.push({ });
date: e.date == null ? "":date2Thai(new Date(e.date)), }
position: e.position ?? "", let salaries: any = [];
amount: e.amount ?? "", if (profile.value != null) {
}); profile.value.salaries.map((e: any) => {
});} salaries.push({
let trainings: any = []; date: e.date == null ? "" : date2Thai(new Date(e.date)),
if(profile.value!=null){ position: e.position ?? "",
profile.value.training.map((e: any) => { amount: e.amount ?? "",
trainings.push({ });
yearly: e.yearly ?? "", });
startDate: e.startDate == null ? "":date2Thai(new Date(e.startDate)), }
endDate: e.endDate == null ? "":date2Thai(new Date(e.endDate)), let trainings: any = [];
name: e.name ?? "", if (profile.value != null) {
topic: e.topic ?? "", 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( const data = Object.assign(
{ educations: educations }, { educations: educations },
{ certificates: certificates }, { certificates: certificates },
@ -151,9 +172,19 @@ async function onClickDowloadFile(
{ positionLevel: profile.value == null ? "" : profile.value.positionLevel }, { positionLevel: profile.value == null ? "" : profile.value.positionLevel },
{ posNo: profile.value == null ? "" : profile.value.posNo }, { posNo: profile.value == null ? "" : profile.value.posNo },
{ oc: profile.value == null ? "" : profile.value.oc }, { 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 }, { 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_005" || tp === "EV1_007" ? { organizationName: "-" } : null,
tp === "EV1_007" ? { positionName: "-" } : null, tp === "EV1_007" ? { positionName: "-" } : null,
tp === "EV1_007" ? { positionLeaveName: "-" } : null tp === "EV1_007" ? { positionLeaveName: "-" } : null
@ -163,10 +194,16 @@ async function onClickDowloadFile(
reportName: templateName, reportName: templateName,
data: data, 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( async function fetchPathUpload(
volume: string, volume: string,
id: string | undefined, id: string | undefined,
@ -175,13 +212,6 @@ async function fetchPathUpload(
) { ) {
const body = { const body = {
fileList: { fileName: type, metadata: {} }, fileList: { fileName: type, metadata: {} },
// "1-",
// "2-",
// "3- ( .)",
// "4-",
// "5- ( 9)",
// "6- ( 11)",
}; };
if (id && file) { if (id && file) {
showLoader(); showLoader();
@ -205,8 +235,13 @@ async function fetchPathUpload(
} }
} }
/**
* functoin ปโหลดไฟล
* @param uploadUrl link ปโหลด
* @param file ไฟล
*/
async function uploadfile(uploadUrl: string, file: any) { async function uploadfile(uploadUrl: string, file: any) {
console.log(uploadUrl); showLoader();
await axios await axios
.put(uploadUrl, file, { .put(uploadUrl, file, {
headers: { headers: {
@ -218,9 +253,16 @@ async function uploadfile(uploadUrl: string, file: any) {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader();
}); });
} }
/**
* function fecth รายชอผเซนเอกสาร
* @param id evaluate ID
*/
async function fetcheSigner(id: string) { async function fetcheSigner(id: string) {
showLoader(); showLoader();
await http await http
@ -240,14 +282,17 @@ async function fetcheSigner(id: string) {
}); });
} }
/**
* function
* @param id evaluate ID
*/
async function fetchCheckSpec(id: string) { async function fetchCheckSpec(id: string) {
console.log("zxczx")
showLoader(); showLoader();
await http await http
.get(config.API.evaluationCheckspecByid(id)) .get(config.API.evaluationCheckspecByid(id))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
profile.value =data profile.value = data;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -263,12 +308,15 @@ const downloadFile3 = ref<string>("");
const downloadFile4 = ref<string>(""); const downloadFile4 = ref<string>("");
const downloadFile5 = ref<string>(""); const downloadFile5 = ref<string>("");
const downloadFile6 = ref<string>(""); const downloadFile6 = ref<string>("");
/**
* function ดาวนโหลดไฟล
* @param fileName อไฟล
*/
async function downloadFile(fileName: string) { async function downloadFile(fileName: string) {
showLoader(); showLoader();
await http await http
.get(config.API.loadFileDocument("เล่ม 1", store.evaluateId, fileName)) .get(config.API.loadFileDocument("เล่ม 1", store.evaluateId, fileName))
.then((res) => { .then((res) => {
console.log(res.data);
if (fileName === "1-แบบพิจารณาคุณสมบัติบุคคล") { if (fileName === "1-แบบพิจารณาคุณสมบัติบุคคล") {
downloadFile1.value = res.data.downloadUrl; downloadFile1.value = res.data.downloadUrl;
} else if (fileName === "2-แบบแสดงรายละเอียดการเสนอผลงาน") { } else if (fileName === "2-แบบแสดงรายละเอียดการเสนอผลงาน") {
@ -293,6 +341,7 @@ async function downloadFile(fileName: string) {
}); });
} }
/**lifecycle Hooks*/
onMounted(async () => { onMounted(async () => {
const ref = { const ref = {
commanderFullnameRef: commanderFullnameRef.value, commanderFullnameRef: commanderFullnameRef.value,
@ -309,7 +358,7 @@ onMounted(async () => {
if (store.currentStep > 2) { if (store.currentStep > 2) {
fetcheSigner(store.evaluateId); fetcheSigner(store.evaluateId);
} }
fetchCheckSpec(store.evaluateId ); fetchCheckSpec(store.evaluateId);
emit("update:form", formCommand, ref); emit("update:form", formCommand, ref);
downloadFile("1-แบบพิจารณาคุณสมบัติบุคคล"); downloadFile("1-แบบพิจารณาคุณสมบัติบุคคล");
downloadFile("2-แบบแสดงรายละเอียดการเสนอผลงาน"); downloadFile("2-แบบแสดงรายละเอียดการเสนอผลงาน");

View file

@ -26,6 +26,13 @@ const {
columnProjectsProposed, columnProjectsProposed,
} = store; } = store;
/** props ID จาก Tab1.vue*/
const props = defineProps({
evaluateId: {
type: String,
},
});
const emit = defineEmits(["update:formDeital"]); const emit = defineEmits(["update:formDeital"]);
const formDetail = reactive({ const formDetail = reactive({
@ -117,8 +124,6 @@ async function fetchDetail() {
// fromDetail.Type = data. // fromDetail.Type = data.
// fromDetail.Step = data. // fromDetail.Step = data.
console.log(formDetail);
emit("update:formDeital", data); emit("update:formDeital", data);
}) })
.catch((err) => { .catch((err) => {
@ -129,8 +134,84 @@ async function fetchDetail() {
}); });
} }
/**
* function fetchData ตรวจสอบคณสมบ
* @param id ประเม
*/
async function fetchCheckSpec(id: string) {
showLoader();
await http
.get(config.API.evaluationCheckspecByid(id))
.then((res) => {
const data = res.data.result;
formDetail.userId = data.id;
formDetail.citizenId = data.citizenId;
formDetail.prefix = data.prefix;
formDetail.fullName = data.fullName;
formDetail.position = data.position;
formDetail.oc = data.oc;
formDetail.salary = data.salary.toLocaleString("th-TH");
formDetail.positionLevel = data.positionLevel;
formDetail.posNo = data.posNo;
formDetail.birthDate = data.birthDate && date2Thai(data.birthDate);
formDetail.govAge = data.govAge;
formDetail.educations = data.education;
formDetail.certificates = data.certificate.map((e: CertificatesForm) => ({
certificateNo: e.certificateNo,
certificateType: e.certificateType,
expireDate: date2Thai(e.expireDate),
issueDate: date2Thai(e.issueDate),
issuer: e.issuer,
}));
formDetail.salaries = data.salaries.map((e: any) => ({
amount: e.amount,
date: date2Thai(e.date),
mouthSalaryAmount: e.mouthSalaryAmount ? e.mouthSalaryAmount : 0,
posNo: e.posNo,
position: e.position,
positionSalaryAmount: e.positionSalaryAmount
? e.positionSalaryAmount
: 0,
refCommandDate: e.refCommandDate ? e.refCommandDate : "",
refCommandNo: e.refCommandNo ? e.refCommandNo : "",
salaryClass: e.salaryClass ? e.salaryClass : "",
salaryRef: e.salaryRef ? e.salaryRef : "",
salaryStatus: e.salaryStatus ? e.salariesStatus : "",
//
oc: "-",
lineWork: "-",
side: "-",
positionType: "-",
level: "-",
positionsAdministrative: "-",
aspectAdministrative: "-",
}));
formDetail.trainings = data.training.map((e: any) => ({
dateOrder: date2Thai(e.dateOrder),
department: e.department,
duration: e.duration,
endDate: date2Thai(e.endDate),
name: e.name,
numberOrder: e.numberOrder,
place: e.place,
startDate: date2Thai(e.startDate),
topic: e.topic,
yearly: e.yearly,
}));
formDetail.assessments = data.assessment;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(async () => { onMounted(async () => {
fetchDetail(); props.evaluateId ? fetchCheckSpec(props.evaluateId) : fetchDetail();
}); });
</script> </script>