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

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 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 { useEvaluateStore } from "@/modules/06_evaluate/store";
@ -380,6 +379,7 @@ onMounted(async () => {
<ViewStep1
v-if="store.step === 1"
@update:formDeital="updateFormDetail"
:evaluateId="store.evaluateId"
/>
<ViewStep3 v-if="store.step === 3 && pdfSrc" :pdfSrc="pdfSrc" />
<ViewStep7

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, watch } from "vue";
/** importComponents*/
import HeaderDialog from "@/components/DialogHeader.vue";
import TableView from "@/modules/06_evaluate/components/directorandmeet/Table.vue";
@ -28,17 +29,19 @@ const props = defineProps({
const tabMenu = ref<string>("director");
/** watch modal true fetchData */
watch([() => props.modal, () => tabMenu.value], () => {
props.modal && fetchData();
});
/** function fetchData */
function fetchData() {
const functionMain =
tabMenu.value === "director"
? props.fetchDirector?.()
: props.fetchMeeting?.();
? props.fetchDirector?.() // fetchDataDirector
: props.fetchMeeting?.(); // fetchDataMeeting
return functionMain;
return functionMain; // returnFunction
}
</script>
@ -85,10 +88,6 @@ function fetchData() {
</div>
</div>
</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-dialog>
</template>

View file

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

View file

@ -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>

View file

@ -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-แบบแสดงรายละเอียดการเสนอผลงาน");

View file

@ -26,6 +26,13 @@ const {
columnProjectsProposed,
} = store;
/** props ID จาก Tab1.vue*/
const props = defineProps({
evaluateId: {
type: String,
},
});
const emit = defineEmits(["update:formDeital"]);
const formDetail = reactive({
@ -117,8 +124,6 @@ async function fetchDetail() {
// fromDetail.Type = data.
// fromDetail.Step = data.
console.log(formDetail);
emit("update:formDeital", data);
})
.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 () => {
fetchDetail();
props.evaluateId ? fetchCheckSpec(props.evaluateId) : fetchDetail();
});
</script>