API ประเมิน step 1-4

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-21 17:51:13 +07:00
parent d305b753bf
commit 0e5d15dc7c
12 changed files with 444 additions and 191 deletions

View file

@ -14,7 +14,7 @@ const { showLoader, hideLoader, messageError } = mixin;
/** function เช็คการยื่นข้อประเมิน*/
async function fetchCheckStatus() {
store.showLoadStatus = false;
store.currentStep = 1;
// = 1;
showLoader();
await http
.get(config.API.evaluationCheckStatus())
@ -41,27 +41,28 @@ async function fetchCheckStep(id: string) {
const data = res.data.result;
let step =
data.Step === "CHECK_SPEC"
data.step === "CHECK_SPEC"
? 1
: data.Step === "PREPARE_DOC_V1"
: data.step === "PREPARE_DOC_V1"
? 2
: data.Step === "CHECK_DOC_V1"
: data.step === "CHECK_DOC_V1"
? 3
: data.Step === "WAIT_CHECK_DOC_V1"
: data.step === "WAIT_CHECK_DOC_V1"
? 4
: data.Step === "ANNOUNCE_WEB"
: data.step === "ANNOUNCE_WEB"
? 5
: data.Step === "PREPARE_DOC_V2"
: data.step === "PREPARE_DOC_V2"
? 6
: data.Step === "CHECK_DOC_V2"
: data.step === "CHECK_DOC_V2"
? 7
: data.Step === "WAIT_CHECK_DOC_V2"
: data.step === "WAIT_CHECK_DOC_V2"
? 8
: data.Step === "DONE"
: data.step === "DONE"
? 9
: 1;
store.currentStep = step;
store.step = step;
store.currentStep = 2;
store.step = 2;
})
.catch((err) => {
messageError($q, err);
@ -69,118 +70,45 @@ async function fetchCheckStep(id: string) {
.finally(() => {
store.showLoadStatus = true;
});
} else (store.step = 1), (store.showLoadStatus = true);
} else
((store.step = 1), (store.currentStep = 1)), (store.showLoadStatus = true);
}
async function saveEvaluation(body: any) {
const data = {
IsEducationalQft: body.isEducationalQft,
IsGovermantServiceHtr: body.isGovermantServiceHtr,
IsOperatingExp: body.isOperatingExp,
IsMinPeriodOfTenure: body.isMinPeriodOfTenure,
IsHaveSpecificQft: body.isHaveSpecificQft,
IsHaveProLicense: body.isHaveProLicense,
IsHaveMinPeriodOrHoldPos: body.isHaveMinPeriodOrHoldPos,
async function saveEvaluation(formSpec: any, detail: any) {
const form = {
userId: detail.id,
citizenId: detail.citizenId,
prefix: detail.prefix,
fullName: `${detail.firstName} ${detail.lastName}.`,
position: detail.position,
oc: detail.oc,
salary: detail.salary.toString(),
positionLevel: detail.positionLevel,
posNo: detail.posNo,
birthDate: detail.birthDate,
govAge: detail.govAge,
type: "",
step: "",
isEducationalQft: formSpec.isEducationalQft,
isGovermantServiceHtr: formSpec.isGovermantServiceHtr,
isOperatingExp: formSpec.isOperatingExp,
isMinPeriodOfTenure: formSpec.isMinPeriodOfTenure,
isHaveSpecificQft: formSpec.isHaveSpecificQft,
isHaveProLicense: formSpec.isHaveProLicense,
isHaveMinPeriodOrHoldPos: formSpec.isHaveMinPeriodOrHoldPos,
reason: "",
educations: [...detail.educations],
certificates: [...detail.certificates],
salaries: [],
trainings: [...detail.trainings],
assessments: [...detail.assessments],
};
console.log(data);
// const form = {
// UserId: "08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6",
// CitizenId: "1540200054020",
// Prefix: "นางสาว",
// FullName: "สาวิตรี ศรีสมัย",
// Position: "นักทรัพยากรบุคคล",
// Oc: "สำนักปลัดกรุงเทพมหานคร/สำนักงานการเจ้าหน้าที่",
// Salary: "10000",
// PositionLevel: "นักทรัพยากรบุคคล",
// PosNo: "10",
// BirthDate: "string",
// GovAge: "string",
// Type: "string",
// Step: "string",
// IsEducationalQft: true,
// IsGovermantServiceHtr: true,
// IsOperatingExp: true,
// IsMinPeriodOfTenure: true,
// IsHaveSpecificQft: true,
// IsHaveProLicense: true,
// IsHaveMinPeriodOrHoldPos: true,
// Reason: "string",
// Educations: [
// {
// EducationLevel: "string",
// Institute: "string",
// IsDate: true,
// StartDate: "2023-12-19T03:20:04.460Z",
// EndDate: "2023-12-19T03:20:04.460Z",
// FinishDate: "2023-12-19T03:20:04.460Z",
// IsEducation: true,
// Degree: "string",
// Field: "string",
// FundName: "string",
// Gpa: "string",
// Country: "string",
// Other: "string",
// Duration: "string",
// DurationYear: "string",
// },
// ],
// Certificates: [
// {
// Step: "string",
// CertificateType: "string",
// Issuer: "string",
// CertificateNo: "string",
// IssueDate: "2023-12-19T03:20:04.460Z",
// ExpireDate: "2023-12-19T03:20:04.460Z",
// },
// ],
// Salaries: [
// {
// Step: "string",
// Date: "2023-12-19T03:20:04.460Z",
// Amount: 0,
// PositionSalaryAmount: 0,
// MouthSalaryAmount: 0,
// Position: "string",
// PosNo: "string",
// SalaryClass: "string",
// SalaryRef: "string",
// RefCommandNo: "string",
// RefCommandDate: "2023-12-19T03:20:04.460Z",
// SalaryStatus: "string",
// },
// ],
// Trainings: [
// {
// Name: "string",
// Topic: "string",
// StartDate: "2023-12-19T03:20:04.460Z",
// EndDate: "2023-12-19T03:20:04.460Z",
// Yearly: 0,
// Place: "string",
// Duration: "string",
// Department: "string",
// NumberOrder: "string",
// DateOrder: "2023-12-19T03:20:04.460Z",
// },
// ],
// Assessments: [
// {
// Date: "2023-12-19T03:20:04.460Z",
// Point1Total: 0,
// Point1: 0,
// Point2Total: 0,
// Point2: 0,
// PointSumTotal: 0,
// PointSum: 0,
// },
// ],
// };
console.log(form);
showLoader();
await http
.post(config.API.evaluationCheckspec(), data)
.post(config.API.evaluationCheckspec(), form)
.then((res) => {
console.log(res);
})