API ประเมืน
This commit is contained in:
parent
0e5d15dc7c
commit
257b4a1424
16 changed files with 700 additions and 186 deletions
|
|
@ -61,8 +61,8 @@ async function fetchCheckStep(id: string) {
|
|||
? 9
|
||||
: 1;
|
||||
|
||||
store.currentStep = 2;
|
||||
store.step = 2;
|
||||
store.currentStep = 8;
|
||||
store.step = 8;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -75,6 +75,38 @@ async function fetchCheckStep(id: string) {
|
|||
}
|
||||
|
||||
async function saveEvaluation(formSpec: any, detail: any) {
|
||||
const salaries = detail.trainings.map((e: any) => ({
|
||||
amount: e.amount,
|
||||
date: e.date,
|
||||
mouthSalaryAmount: e.mouthSalaryAmount ? e.mouthSalaryAmount : 0,
|
||||
posNo: e.posNo,
|
||||
position: e.position,
|
||||
positionSalaryAmount: e.positionSalaryAmount ? e.positionSalaryAmount : 0,
|
||||
refCommandDate: e.refCommandDate,
|
||||
refCommandNo: e.refCommandNo ? e.refCommandNo : "",
|
||||
salaryClass: e.salaryClass ? e.salaryClass : "",
|
||||
salaryRef: e.salaryRef ? e.salaryRef : "",
|
||||
salaryStatus: e.salaryStatus ? e.salariesStatus : "",
|
||||
}));
|
||||
|
||||
const educations = detail.educations.map((e: any) => ({
|
||||
country: e.country,
|
||||
degree: e.degree,
|
||||
duration: e.duration,
|
||||
durationYear: e.durationYear.toString(),
|
||||
educationLevel: e.educationLevel,
|
||||
endDate: e.endDate,
|
||||
field: e.field,
|
||||
finishDate: e.finishDate,
|
||||
fundName: e.fundName,
|
||||
gpa: e.gpa,
|
||||
institute: e.institute,
|
||||
isDate: e.isDate,
|
||||
isEducation: e.isEducation,
|
||||
other: e.other,
|
||||
startDate: e.startDate,
|
||||
}));
|
||||
|
||||
const form = {
|
||||
userId: detail.id,
|
||||
citizenId: detail.citizenId,
|
||||
|
|
@ -97,15 +129,13 @@ async function saveEvaluation(formSpec: any, detail: any) {
|
|||
isHaveProLicense: formSpec.isHaveProLicense,
|
||||
isHaveMinPeriodOrHoldPos: formSpec.isHaveMinPeriodOrHoldPos,
|
||||
reason: "",
|
||||
educations: [...detail.educations],
|
||||
educations: [...educations],
|
||||
certificates: [...detail.certificates],
|
||||
salaries: [],
|
||||
salaries: [...salaries],
|
||||
trainings: [...detail.trainings],
|
||||
assessments: [...detail.assessments],
|
||||
};
|
||||
|
||||
console.log(form);
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.evaluationCheckspec(), form)
|
||||
|
|
@ -168,14 +198,33 @@ async function nextCheckDoc(type: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function nextCheckDoc2() {
|
||||
async function nextCheckDoc2(data: any) {
|
||||
const body = {
|
||||
commanderAboveFullnameDoc2: data.commanderAboveFullname,
|
||||
commanderAbovePositionDoc2: data.commanderAbovePosition,
|
||||
commanderFullnameDoc2: data.commanderFullname,
|
||||
commanderPositionDoc2: data.commanderPosition,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.evaluationCheckdocV1(store.evaluateId))
|
||||
.put(config.API.evaluationCheckdocV1(store.evaluateId), body)
|
||||
.then((res) => {})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
fetchCheckStatus();
|
||||
});
|
||||
}
|
||||
|
||||
async function nextPrepareDoc2() {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.evaluationPreparedocV2(store.evaluateId))
|
||||
.then((res) => {})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
fetchCheckStatus();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -186,4 +235,5 @@ export default {
|
|||
peviousPrapare,
|
||||
nextCheckDoc,
|
||||
nextCheckDoc2,
|
||||
nextPrepareDoc2,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue