ปรับ code ประเมิน
This commit is contained in:
parent
53c253d394
commit
69851f26b9
14 changed files with 220 additions and 419 deletions
|
|
@ -7,6 +7,7 @@ import config from "@/app.config";
|
|||
|
||||
/** import Type*/
|
||||
import type {
|
||||
PersonInformation,
|
||||
FormSpec,
|
||||
FormCommand,
|
||||
FormCommandRef,
|
||||
|
|
@ -14,21 +15,19 @@ import type {
|
|||
|
||||
/** import Components*/
|
||||
import Stepper from "@/modules/06_evaluate/components/Stepper.vue";
|
||||
import Step1 from "@/modules/06_evaluate/components/step/step1.vue";
|
||||
import Step2 from "@/modules/06_evaluate/components/step/step2.vue";
|
||||
import Step3 from "@/modules/06_evaluate/components/step/step3.vue";
|
||||
import Step4 from "@/modules/06_evaluate/components/step/step4.vue";
|
||||
import Step5 from "@/modules/06_evaluate/components/step/step5.vue";
|
||||
import Step6 from "@/modules/06_evaluate/components/step/step6.vue";
|
||||
import Step7 from "@/modules/06_evaluate/components/step/step7.vue";
|
||||
import Step8 from "@/modules/06_evaluate/components/step/step8.vue";
|
||||
import Step9 from "@/modules/06_evaluate/components/step/step9.vue";
|
||||
|
||||
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 PopupHistory from "@/modules/06_evaluate/components/viewstep/popupHistory.vue";
|
||||
import Step1 from "@/modules/06_evaluate/components/step/step1.vue"; // 1.ตรวจสอบคุณสมบัติ
|
||||
import Step2 from "@/modules/06_evaluate/components/step/step2.vue"; // 2.จัดเตรียมเอกสารเล่ม 1
|
||||
import Step3 from "@/modules/06_evaluate/components/step/step3.vue"; // 3.ตรวจสอบเอกสารเล่ม 1
|
||||
import Step4 from "@/modules/06_evaluate/components/step/step4.vue"; // 4.รอตรวจสอบคุณสมบัติ
|
||||
import Step5 from "@/modules/06_evaluate/components/step/step5.vue"; // 5.ประกาศบนเว็บไซต์
|
||||
import Step6 from "@/modules/06_evaluate/components/step/step6.vue"; // 6.จัดเตรียมเอกสารเล่ม 2
|
||||
import Step7 from "@/modules/06_evaluate/components/step/step7.vue"; // 7.รอพิจารณาผลการประเมิน 2
|
||||
import Step8 from "@/modules/06_evaluate/components/step/step8.vue"; // 8.ตรวจสอบความถูกต้องของเอกสารเล่ม 2
|
||||
import Step9 from "@/modules/06_evaluate/components/step/step9.vue"; // 9.เสร็จสิ้น
|
||||
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 PopupHistory from "@/modules/06_evaluate/components/viewstep/popupHistory.vue"; // ประวัติการประเมิน
|
||||
|
||||
/** import Store*/
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
|
@ -60,16 +59,8 @@ async function onCilckNextStep() {
|
|||
? await saveStep1
|
||||
: store.step === 3
|
||||
? await saveStep3
|
||||
: store.step === 4
|
||||
? await saveStep4
|
||||
: store.step === 5
|
||||
? await saveStep5
|
||||
: store.step === 7
|
||||
? await saveStep7
|
||||
: store.step === 8
|
||||
? await saveStep8
|
||||
: store.step === 9
|
||||
? await saveStep9
|
||||
: null;
|
||||
store.step === 2 || store.step === 6
|
||||
? validateForm()
|
||||
|
|
@ -97,7 +88,7 @@ async function onCilckNextStep() {
|
|||
/** function validateForm Step 2,4*/
|
||||
async function validateForm() {
|
||||
store.checkFileupload = !store.checkFileupload;
|
||||
const emptyValues = downloadFileRef.value.filter((e: any) => e === "");
|
||||
const emptyValues = downloadFileRef.value.filter((e: string) => e === "");
|
||||
const hasError = [];
|
||||
for (const key in formCommandRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(formCommandRef, key)) {
|
||||
|
|
@ -129,30 +120,20 @@ async function validateForm() {
|
|||
|
||||
const pdfSrc = ref<any>();
|
||||
const urlDownloadFile = ref<string>("");
|
||||
/**
|
||||
* function update ลิงก์ PDF
|
||||
* @param url ลิงก์ PDF
|
||||
* @param urlDownload ลิงก์ดาวน์โหลด
|
||||
*/
|
||||
async function updateFilePDF(url: any, urlDownload: string) {
|
||||
pdfSrc.value = url;
|
||||
urlDownloadFile.value = urlDownload;
|
||||
}
|
||||
|
||||
// /** function เช็คการยื่นข้อประเมิน*/
|
||||
// async function fetchCheckStatus() {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.evaluationCheckStatus())
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// const id =
|
||||
// route.params.type === "expert" ? data.expertId : data.specialExpertId;
|
||||
// router.push(`/evaluate/detail/${route.params.type}/${id}`);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* function เช็ตสถานะขั้ยตอน
|
||||
* @param id idประเมิน
|
||||
*/
|
||||
async function fetchCheckStep(id: string) {
|
||||
showLoadStatus.value = false;
|
||||
if (id) {
|
||||
|
|
@ -205,7 +186,11 @@ const formSpec = reactive<FormSpec>({
|
|||
isHaveMinPeriodOrHoldPos: false, // มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งหรือเคยดำรงตำแหน่งในสายงานที่จะคัดเลือกตามคุณวุฒิของบุคคลและระดับตำแหน่งที่จะคัดเลือก
|
||||
});
|
||||
const formDetail = ref<any>();
|
||||
const formDataStep1 = ref<any>();
|
||||
const formDataStep1 = ref<PersonInformation>();
|
||||
/**
|
||||
* function เรียกข่้อมูลตรวจสอบคุณสมบัติ
|
||||
* @param id id ประเมิน
|
||||
*/
|
||||
async function fetchDataStep1(id: string) {
|
||||
showLoadStatus.value = false;
|
||||
showLoader();
|
||||
|
|
@ -224,6 +209,10 @@ async function fetchDataStep1(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัปเดทคุณสมบัติ
|
||||
* @param data ข้อมูลคุณสมบัติ
|
||||
*/
|
||||
async function updateCheckSpec(data: FormSpec) {
|
||||
formSpec.isEducationalQft = data.isEducationalQft;
|
||||
formSpec.isGovermantServiceHtr = data.isGovermantServiceHtr;
|
||||
|
|
@ -233,11 +222,14 @@ async function updateCheckSpec(data: FormSpec) {
|
|||
formSpec.isHaveProLicense = data.isHaveProLicense;
|
||||
formSpec.isHaveMinPeriodOrHoldPos = data.isHaveMinPeriodOrHoldPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* funciton อัปเดทข้อมูลส่วนตัว
|
||||
* @param data ข้อมูลส่วนตัว
|
||||
*/
|
||||
function updateFormDetail(data: any) {
|
||||
formDetail.value = data;
|
||||
}
|
||||
|
||||
/** function บันทักตรวจสอบคุณสมบัติ*/
|
||||
async function saveStep1() {
|
||||
const salaries = formDetail.value.trainings.map((e: any) => ({
|
||||
amount: e.amount,
|
||||
|
|
@ -355,7 +347,11 @@ const formCommandRef: FormCommandRef = {
|
|||
assignedPosition: assignedPositionRef,
|
||||
};
|
||||
const downloadFileRef = ref<any>();
|
||||
|
||||
/**
|
||||
* function อัปเดท ผลงาน,ผู้เซ็นเอกสาร, Ref
|
||||
* @param val ผู้เซ็นเอกสาร
|
||||
* @param ref validate
|
||||
*/
|
||||
function updateformCommand(val: any, ref: any) {
|
||||
formCommand.commanderFullname = val.commanderFullname;
|
||||
formCommand.commanderPosition = val.commanderPosition;
|
||||
|
|
@ -380,7 +376,7 @@ function updateformCommand(val: any, ref: any) {
|
|||
assignedPositionRef.value = ref.assignedPosition;
|
||||
statusUpload.value = ref.statusUpload;
|
||||
}
|
||||
|
||||
/** function บันทึกข้อมูล ผลงานม,ผู้เซ็นเอกสาร*/
|
||||
async function saveStep2() {
|
||||
const body = {
|
||||
commanderFullname: formCommand.commanderFullname,
|
||||
|
|
@ -419,7 +415,7 @@ async function saveStep2() {
|
|||
"ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
/** function ดำเนินการต่อไป 3.ตรวจสอบเอกสารเล่ม 1*/
|
||||
async function nextTostep3() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -445,6 +441,7 @@ async function nextTostep3() {
|
|||
}
|
||||
|
||||
/** STEP3*/
|
||||
/** function ยืนยันการยื่นเอกสารไปยัง 4.รอตรวจสอบคุณสมบัติ*/
|
||||
async function saveStep3() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -459,14 +456,9 @@ async function saveStep3() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
async function saveStep4() {
|
||||
console.log("Save 4");
|
||||
}
|
||||
async function saveStep5() {
|
||||
console.log("Save 5");
|
||||
}
|
||||
|
||||
/** STEP 6*/
|
||||
/** function บันทึกข้อมูล ผลงานม,ผู้เซ็นเอกสาร*/
|
||||
async function saveStep6() {
|
||||
const body = {
|
||||
commanderAboveFullnameDoc2: formCommand.commanderAboveFullname,
|
||||
|
|
@ -505,7 +497,7 @@ async function saveStep6() {
|
|||
"ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
/** function ดำเนินการต่อไป 7.รอพิจารณาผลการประเมิน 2*/
|
||||
async function nextTostep7() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -529,6 +521,8 @@ async function nextTostep7() {
|
|||
}
|
||||
|
||||
/** STEP 7*/
|
||||
/** function ยืนยันการยื่นเอกสารไปยัง 8.ตรวจสอบความถูกต้องของเอกสารเล่ม 2
|
||||
*/
|
||||
async function saveStep7() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -541,13 +535,8 @@ async function saveStep7() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
async function saveStep8() {
|
||||
console.log("Save 8");
|
||||
}
|
||||
async function saveStep9() {
|
||||
console.log("Save 9");
|
||||
}
|
||||
|
||||
/** function callblck ทำงานเมื่อมีการเปลี่ยน Step*/
|
||||
watch(
|
||||
() => store.step,
|
||||
() => {
|
||||
|
|
@ -558,6 +547,7 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/** Hook lifecycle*/
|
||||
onMounted(async () => {
|
||||
route.params.id && fetchCheckStep(route.params.id.toString());
|
||||
route.name === "evaluate-add" &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue