ปรับ ประเมินบุคคล => ข้อมูลส่วนตัว
This commit is contained in:
parent
4d9be43479
commit
864c7c3637
6 changed files with 233 additions and 84 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue