ปรับ Eva
This commit is contained in:
parent
c3d24fdc33
commit
f8cd032c0b
11 changed files with 1254 additions and 798 deletions
|
|
@ -69,11 +69,10 @@ const formDetail = reactive<any>({
|
|||
|
||||
/** function เรียกข้อมูลตรวจสอบคุณสมบัติ*/
|
||||
async function fetchDetail() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.positionBykeycloak())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
formDetail.root = data.root;
|
||||
formDetail.rootId = data.rootId;
|
||||
formDetail.userId = data.id;
|
||||
|
|
@ -89,58 +88,62 @@ async function fetchDetail() {
|
|||
formDetail.birthDate = data.birthDate;
|
||||
// formDetail.govAge = data.govAge; // ยังไม่มี
|
||||
formDetail.salary = data.salary;
|
||||
|
||||
http.get(config.API.dataUserEducations).then((res) => {
|
||||
formDetail.educations = res.data.result;
|
||||
});
|
||||
|
||||
http.get(config.API.dataUserCertificate("certificate")).then((res) => {
|
||||
formDetail.certificates = res.data.result.map(
|
||||
(e: CertificatesForm) => ({
|
||||
certificateNo: e.certificateNo,
|
||||
certificateType: e.certificateType,
|
||||
expireDate: e.expireDate,
|
||||
issueDate: e.issueDate,
|
||||
issuer: e.issuer,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
http.get(config.API.dataUserSalary).then((res) => {
|
||||
formDetail.salaries = res.data.result;
|
||||
});
|
||||
|
||||
http.get(config.API.dataUserCertificate("training")).then((res) => {
|
||||
formDetail.trainings = res.data.result.map((e: any) => ({
|
||||
dateOrder: e.dateOrder,
|
||||
department: e.department,
|
||||
duration: e.duration,
|
||||
endDate: e.endDate,
|
||||
name: e.name,
|
||||
numberOrder: e.numberOrder,
|
||||
place: e.place,
|
||||
startDate: e.startDate,
|
||||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
}));
|
||||
});
|
||||
|
||||
http.get(config.API.dataUserAssessments).then((res) => {
|
||||
formDetail.assessments = res.data.result;
|
||||
});
|
||||
await fetchDataAllDetail();
|
||||
|
||||
emit("update:formDeital", formDetail);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 2500);
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchDataAllDetail() {
|
||||
// ดึงข้อมูลประวัติการศึกษา
|
||||
http.get(config.API.dataUserEducations).then((res) => {
|
||||
formDetail.educations = res.data.result;
|
||||
});
|
||||
|
||||
// ดึงข้อมูลใบอนุญาตประกอบวิชาชีพ
|
||||
http.get(config.API.dataUserCertificate("certificate")).then((res) => {
|
||||
formDetail.certificates = res.data.result.map((e: CertificatesForm) => ({
|
||||
certificateNo: e.certificateNo,
|
||||
certificateType: e.certificateType,
|
||||
expireDate: e.expireDate,
|
||||
issueDate: e.issueDate,
|
||||
issuer: e.issuer,
|
||||
}));
|
||||
});
|
||||
|
||||
// ดึงข้อมูลประวัติการรับราชการ
|
||||
http.get(config.API.dataUserSalary).then((res) => {
|
||||
formDetail.salaries = res.data.result;
|
||||
});
|
||||
|
||||
// ดึงข้อมูลประวัติการฝึกอบรมดูงาน
|
||||
http.get(config.API.dataUserCertificate("training")).then((res) => {
|
||||
formDetail.trainings = res.data.result.map((e: any) => ({
|
||||
dateOrder: e.dateOrder,
|
||||
department: e.department,
|
||||
duration: e.duration,
|
||||
endDate: e.endDate,
|
||||
name: e.name,
|
||||
numberOrder: e.numberOrder,
|
||||
place: e.place,
|
||||
startDate: e.startDate,
|
||||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
}));
|
||||
});
|
||||
|
||||
http.get(config.API.dataUserPerformance).then((res) => {
|
||||
formDetail.assessments = res.data.result;
|
||||
});
|
||||
|
||||
http.get(config.API.dataUserPortfolio).then((res) => {
|
||||
formDetail.experience = res.data.result;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetchData ตรวจสอบคุณสมบัติ
|
||||
* @param id ประเมิน
|
||||
|
|
@ -178,7 +181,8 @@ async function fetchCheckSpec(data: any) {
|
|||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
}));
|
||||
formDetail.assessments = data.assessments;
|
||||
formDetail.assessments = data.performances;
|
||||
formDetail.experience = data.portfolios;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -195,7 +199,6 @@ function formattedNumber(x: number) {
|
|||
|
||||
/** get data */
|
||||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.dataUserGovernment)
|
||||
.then(async (res) => {
|
||||
|
|
@ -207,28 +210,30 @@ function getData() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 2500);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const promises = [];
|
||||
try {
|
||||
showLoader();
|
||||
const promises = [];
|
||||
|
||||
if (route.name === "evaluate-add") {
|
||||
promises.push(fetchDetail());
|
||||
if (route.name === "evaluate-add") {
|
||||
promises.push(fetchDetail());
|
||||
}
|
||||
|
||||
if (props.data) {
|
||||
promises.push(fetchCheckSpec(props.data));
|
||||
}
|
||||
|
||||
promises.push(getData());
|
||||
|
||||
await Promise.all(promises);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
|
||||
if (props.data) {
|
||||
promises.push(fetchCheckSpec(props.data));
|
||||
}
|
||||
|
||||
promises.push(getData());
|
||||
|
||||
await Promise.all(promises);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -537,7 +542,6 @@ onMounted(async () => {
|
|||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
<!-- <TableData :columns="columnSalaries" :row="formDetail.salaries" /> -->
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
|
|
@ -561,7 +565,7 @@ onMounted(async () => {
|
|||
<TableData
|
||||
class="col-12"
|
||||
:columns="columnExperience"
|
||||
:row="formDetail.trainings"
|
||||
:row="formDetail.experience"
|
||||
/>
|
||||
</q-card>
|
||||
|
||||
|
|
@ -570,13 +574,12 @@ onMounted(async () => {
|
|||
<span class="q-ml-lg q-my-sm">ผลงานที่เคยเสนอขอประเมิน (ถ้ามี)</span>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-12 q-pa-sm">-</div>
|
||||
<!-- <div class="col-10">
|
||||
<div class="col-10">
|
||||
<TableData
|
||||
:columns="columnAssessments"
|
||||
:row="formDetail.assessments"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue