diff --git a/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue b/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue index 83456b845..530c6c576 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue @@ -207,9 +207,9 @@ function getStep() { ? 5 : data.step === "PREPARE_DOC_V2" ? 6 - : data.step === "CHECK_DOC_V2" - ? 7 : data.step === "WAIT_CHECK_DOC_V2" + ? 7 + : data.step === "CHECK_DOC_V2" ? 8 : data.step === "DONE" ? 9 diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue index 61e2a997b..fdfed9d63 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue @@ -111,7 +111,6 @@ async function onClickDowloadFile( /** ติดต่อผู้ขอประเมิน */ function openPopUp() { - console.log("12"); modalEvaluation.value = true; } @@ -192,9 +191,9 @@ function getStep() { ? 5 : data.step === "PREPARE_DOC_V2" ? 6 - : data.step === "CHECK_DOC_V2" - ? 7 : data.step === "WAIT_CHECK_DOC_V2" + ? 7 + : data.step === "CHECK_DOC_V2" ? 8 : data.step === "DONE" ? 9 @@ -255,27 +254,30 @@ function fileUpLoad(url: string) { }); } +const myForm = ref(); function sentMessenger() { - // dialogConfirm($q, () => { - showLoader(); - http - .put(config.API.evaluationSentToContact(id.value), { - subject: title.value, - body: messenger.value, - }) - .then((res) => { - title.value = ""; - messenger.value = ""; - success($q, "ส่งข้อความสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - modalEvaluation.value = false; - hideLoader(); - }); - // }); + myForm.value.validate().then(async (result: boolean) => { + if (result) { + showLoader(); + http + .put(config.API.evaluationSentToContact(id.value), { + subject: title.value, + body: messenger.value, + }) + .then((res) => { + success($q, "ส่งข้อความสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + modalEvaluation.value = false; + title.value = ""; + messenger.value = ""; + hideLoader(); + }); + } + }); } const download10Url = ref(""); @@ -466,27 +468,31 @@ onMounted(() => { -
-
- + +
+
+ +
+
+ +
-
- -
-
+ diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue index db2924f81..5608e81ae 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue @@ -18,7 +18,14 @@ const fullName = ref( ); const $q = useQuasar(); const mixin = useCounterMixin(); -const { date2Thai, showLoader, hideLoader, messageError, success } = mixin; +const { + date2Thai, + showLoader, + hideLoader, + messageError, + success, + dialogConfirm, +} = mixin; const router = useRouter(); const route = useRoute(); const id = ref(route.params.id as string); @@ -29,7 +36,6 @@ const pdfSrc = ref(); const nameOfWork = ref(""); const nameOfOwner = ref(""); const position = ref(""); -const status = ref("WAIT_CHECK_DOC_V2"); const fileEvaluation81 = ref(); const fileEvaluation82 = ref(); const fileEvaluation83 = ref(); @@ -178,34 +184,37 @@ function fileUpLoad(url: string, file: any) { // } function confirmApprove() { - const data = { - metadata: { - additionalProp1: nameOfWork.value, - additionalProp2: nameOfOwner.value, - additionalProp3: position.value, + dialogConfirm( + $q, + () => { + const data = { + metadata: { + additionalProp1: nameOfWork.value, + additionalProp2: nameOfOwner.value, + additionalProp3: position.value, + }, + }; + showLoader(); + http + .patch( + config.API.evaluationPatchData("เล่ม 2", id.value, "1-เอกสารเล่ม 2"), + data + ) + .then((res) => { + console.log(res); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + nextStep(); + modalConfirm.value = false; + hideLoader(); + }); }, - }; - showLoader(); - http - .patch( - config.API.evaluationPatchData( - "เล่ม 2", - id.value, - "2-เอกสารเล่ม 2 (ฉบับแก้ไข)" - ), - data - ) - .then((res) => { - console.log(res); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - nextStep(); - modalConfirm.value = false; - hideLoader(); - }); + "ยืนยันผลการพิจารณา", + "ต้องการยืนยันผลการพิจารณาใช่หรือไม่?" + ); } function nextStep() { diff --git a/src/modules/12_evaluatePersonal/store/Evaluate.ts b/src/modules/12_evaluatePersonal/store/Evaluate.ts index ee3004ab8..00afba4ce 100644 --- a/src/modules/12_evaluatePersonal/store/Evaluate.ts +++ b/src/modules/12_evaluatePersonal/store/Evaluate.ts @@ -13,19 +13,19 @@ export const useEvalutuonStore = defineStore("EvalutuonStore", () => { case "CHECK_SPEC": return "ตรวจสอบคุณสมบัติด้วยตนเอง"; case "PREPARE_DOC_V1": - return "จัดเตรียมเอกสารเล่ม"; + return "จัดเตรียมเอกสารเล่ม 1"; case "CHECK_DOC_V1": - return "ตรวจสอบความถูกต้องของเอกสารเล่ม"; + return "ตรวจสอบความถูกต้องของเอกสารเล่ม 1"; case "WAIT_CHECK_DOC_V1": return "รอตรวจสอบคุณสมบัติ"; case "ANNOUNCE_WEB": return "ประกาศบนเว็บไซต์"; case "PREPARE_DOC_V2": - return "จัดเตรียมเอกสารเล่ม"; + return "จัดเตรียมเอกสารเล่ม 2"; case "WAIT_CHECK_DOC_V2": - return "รอพิจารณาผลการประเมิน"; + return "ตรวจสอบความถูกต้องของเอกสารเล่ม 2"; case "CHECK_DOC_V2": - return "ตรวจสอบความถูกต้องของเอกสารเล่ม"; + return "รอพิจารณาผลการประเมิน"; case "DONE": return "เสร็จสิ้น"; }