API ประเมืน
This commit is contained in:
parent
0e5d15dc7c
commit
257b4a1424
16 changed files with 700 additions and 186 deletions
|
|
@ -15,13 +15,19 @@ export default {
|
|||
evaluationDoc1: (id: string, type: string) =>
|
||||
`${evaluation}/doc1/${type}/${id}`,
|
||||
evaluationCheckdocV1: (id: string) => `${evaluation}/check-doc-v1/${id}`,
|
||||
evaluationPreparedocV2: (id: string) => `${evaluation}/perpare-doc-v2/${id}`,
|
||||
evaluationPreparedocV2: (id: string) =>
|
||||
`${evaluation}/prepare-doc-v2/approve/${id}`,
|
||||
evaluationPreparedocRejectV2: (id: string) =>
|
||||
`${evaluation}/perpare-doc-v2/reject/${id}`,
|
||||
`${evaluation}/prepare-doc-v2/reject/${id}`,
|
||||
evaluationWaitCheck: (id: string) => `${evaluation}/wait-check-doc-v2/${id}`,
|
||||
evaluationDoc2: (id: string) => `${evaluation}/doc2/reject/${id}`,
|
||||
evaluationHistory: (id: string) => `${evaluation}/step-history/${id}`,
|
||||
evaluationDetail: () => `${env.API_URI}/profile/keycloak`,
|
||||
evaluationSignerDoc1: (id: string) => `${evaluation}/doc1-signer/${id}`,
|
||||
evaluationSignerDoc2: (id: string) => `${evaluation}/doc2-signer/${id}`,
|
||||
evaluationDirectorMeetring: (id: string) =>
|
||||
`${evaluation}/director-meeting/${id}`,
|
||||
evaluationCheckDate: (id: string) => `${evaluation}/check-date/${id}`,
|
||||
|
||||
/**document */
|
||||
loadPathDocument: (val: string, id: string) =>
|
||||
|
|
|
|||
|
|
@ -35,13 +35,22 @@ const mixin = useCounterMixin();
|
|||
const $q = useQuasar();
|
||||
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
|
||||
const { fetchCheckStatus, saveEvaluation, nextPrapare, nextCheckDoc } =
|
||||
evaluationFunctions;
|
||||
const {
|
||||
fetchCheckStatus,
|
||||
saveEvaluation,
|
||||
nextPrapare,
|
||||
nextCheckDoc,
|
||||
nextCheckDoc2,
|
||||
nextPrepareDoc2,
|
||||
} = evaluationFunctions;
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
},
|
||||
});
|
||||
|
||||
const externalLink =
|
||||
|
|
@ -164,6 +173,8 @@ async function saveStep2() {
|
|||
}
|
||||
|
||||
function updateformCommand(val: any, ref: any) {
|
||||
console.log(ref);
|
||||
|
||||
formCommand.commanderFullname = val.commanderFullname;
|
||||
formCommand.commanderPosition = val.commanderPosition;
|
||||
formCommand.commanderAboveFullname = val.commanderAboveFullname;
|
||||
|
|
@ -193,7 +204,7 @@ async function validateStep2() {
|
|||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
saveStep2();
|
||||
store.step === 2 ? saveStep2() : saveStep6();
|
||||
} else {
|
||||
console.log("ไม่ผ่าน");
|
||||
}
|
||||
|
|
@ -204,9 +215,8 @@ async function saveStep3() {
|
|||
nextCheckDoc("approve");
|
||||
}
|
||||
async function updateFilePDF(url: any) {
|
||||
console.log(url);
|
||||
|
||||
pdfSrc.value = url;
|
||||
console.log(url);
|
||||
}
|
||||
|
||||
async function saveStep4() {
|
||||
|
|
@ -216,10 +226,11 @@ async function saveStep5() {
|
|||
console.log("Save 5");
|
||||
}
|
||||
async function saveStep6() {
|
||||
console.log("Save 6");
|
||||
nextCheckDoc2(formCommand);
|
||||
}
|
||||
async function saveStep7() {
|
||||
console.log("Save 7");
|
||||
console.log("777777");
|
||||
nextPrepareDoc2();
|
||||
}
|
||||
async function saveStep8() {
|
||||
console.log("Save 8");
|
||||
|
|
@ -336,14 +347,18 @@ onMounted(async () => {
|
|||
:evaluateId="store.evaluateId"
|
||||
/>
|
||||
<Step4 v-if="store.step === 4" />
|
||||
<Step5 v-if="store.step === 5" />
|
||||
<Step5 v-if="store.step === 5" :evaluateId="store.evaluateId" />
|
||||
<Step6
|
||||
v-if="store.step === 6"
|
||||
@update:form="updateformCommand"
|
||||
:evaluateId="store.evaluateId"
|
||||
/>
|
||||
<Step7 v-if="store.step === 7" />
|
||||
<Step8 v-if="store.step === 8" />
|
||||
<Step7
|
||||
v-if="store.step === 7"
|
||||
@update:file="updateFilePDF"
|
||||
:evaluateId="store.evaluateId"
|
||||
/>
|
||||
<Step8 v-if="store.step === 8" :evaluateId="store.evaluateId" />
|
||||
<Step9 v-if="store.step === 9" />
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
|
@ -359,7 +374,10 @@ onMounted(async () => {
|
|||
@update:formDeital="updateFormDetail"
|
||||
/>
|
||||
<ViewStep3 v-if="store.step === 3 && pdfSrc" :pdfSrc="pdfSrc" />
|
||||
<ViewStep7 v-if="store.step === 7" /> </q-card-section
|
||||
<ViewStep7
|
||||
v-if="store.step === 7 && pdfSrc"
|
||||
:pdfSrc="pdfSrc"
|
||||
/> </q-card-section
|
||||
></q-card>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const $q = useQuasar();
|
|||
const store = useEvaluateStore();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
|
||||
const fullName = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
|
||||
|
|
@ -124,8 +124,8 @@ async function fetchPathUpload(
|
|||
file: any
|
||||
) {
|
||||
const body = {
|
||||
fileList: type,
|
||||
replace: true,
|
||||
fileList: { fileName: type, metadata: {} },
|
||||
|
||||
// "1-แบบพิจารณาคุณสมบัติบุคคล",
|
||||
// "2-แบบแสดงรายละเอียดการเสนอผลงาน",
|
||||
// "3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล (เอกสารแบบ ก.)",
|
||||
|
|
@ -162,11 +162,30 @@ async function uploadfile(uploadUrl: string, file: any) {
|
|||
"Content-Type": file.type,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
.then(() => {
|
||||
success($q, "อัปโหลไฟล์สำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
async function fetcheSigner(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluationSignerDoc1(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formCommand.commanderFullname = data.commanderFullname;
|
||||
formCommand.commanderPosition = data.commanderPosition;
|
||||
formCommand.commanderAboveFullname = data.commanderAboveFullname;
|
||||
formCommand.commanderAbovePosition = data.commanderAbovePosition;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -183,6 +202,9 @@ onMounted(async () => {
|
|||
fileEvaluation5Ref: fileEvaluation5Ref.value,
|
||||
fileEvaluation6Ref: fileEvaluation6Ref.value,
|
||||
};
|
||||
if (store.currentStep > 2) {
|
||||
fetcheSigner(store.evaluateId);
|
||||
}
|
||||
emit("update:form", formCommand, ref);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -11,7 +11,7 @@ import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
|||
const $q = useQuasar();
|
||||
const store = useEvaluateStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
|
|
@ -36,12 +36,11 @@ function handleItemClick(itemNumber: number) {
|
|||
fetchDocument(fileName.value[itemNumber - 1]);
|
||||
}
|
||||
async function fetchDocument(fileName: string) {
|
||||
showLoader();
|
||||
// showLoader();
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.loadFileDocument("เล่ม 1", props.evaluateId, fileName))
|
||||
.then((res) => {
|
||||
console.log(res.data.downloadUrl);
|
||||
downloadFile(res.data.downloadUrl);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -60,9 +59,6 @@ async function downloadFile(url: string) {
|
|||
.then((res) => {
|
||||
const blob = new Blob([res.data]);
|
||||
const objectUrl = URL.createObjectURL(blob);
|
||||
console.log(blob);
|
||||
|
||||
console.log(objectUrl);
|
||||
|
||||
emit("update:file", objectUrl);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,28 +1,72 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const mixins = useCounterMixin();
|
||||
const { date2Thai } = mixins;
|
||||
const status = ref<string>("ANNOUNCE_WEB");
|
||||
const website = ref<string>("https://bma-ehr.frappet.com/");
|
||||
const AnnouncementDate = ref<string | null>(date2Thai(new Date()));
|
||||
const $q = useQuasar();
|
||||
const { date2Thai, success, messageError } = mixins;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
const dateStartAnnounce = ref<string | null>(date2Thai(new Date()));
|
||||
const dateEndAnnounce = ref<string | null>(date2Thai(new Date()));
|
||||
|
||||
const items = ref<any>([
|
||||
{ label: "แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)" },
|
||||
{ label: "ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)" },
|
||||
{ label: "เอกสารแสดงผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)" },
|
||||
{
|
||||
label: "แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
|
||||
fileName: "5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
|
||||
},
|
||||
{
|
||||
label: "ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)",
|
||||
fileName: "10-ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)",
|
||||
},
|
||||
{
|
||||
label: "เอกสารแสดงผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
fileName: "6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
},
|
||||
]);
|
||||
|
||||
function copyLink(link: string) {
|
||||
console.log(`Copying link ${link}`);
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = link;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
async function onClickfetchDocument(fileName: string) {
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.loadFileDocument("เล่ม 1", props.evaluateId, fileName))
|
||||
.then((res) => {
|
||||
const downloadUrl = res.data.downloadUrl;
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = downloadUrl;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
success($q, "คัดลอกลิ้งค์สำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
}));
|
||||
}
|
||||
|
||||
async function fetchCheckDate() {
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.evaluationCheckDate(props.evaluateId))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
dateStartAnnounce.value = date2Thai(data.dateStartAnnounce);
|
||||
dateEndAnnounce.value = date2Thai(data.dateStartAnnounce);
|
||||
})
|
||||
.catch((err) => {}));
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
fetchCheckDate();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -31,7 +75,7 @@ function copyLink(link: string) {
|
|||
<q-banner class="text-weight-bold text-red-14 bg-red-2">
|
||||
<div class="text-weight-bold">
|
||||
<q-icon name="info_outline" color="red-14" size="24px" />
|
||||
ประกาศเมื่อวันที่ {{ AnnouncementDate }}
|
||||
ประกาศเมื่อวันที่ {{ dateStartAnnounce }} ถึง {{ dateEndAnnounce }}
|
||||
</div>
|
||||
</q-banner>
|
||||
<!-- <q-badge
|
||||
|
|
@ -67,7 +111,7 @@ function copyLink(link: string) {
|
|||
round
|
||||
color="primary"
|
||||
icon="mdi-clipboard-outline"
|
||||
@click="copyLink(item.label)"
|
||||
@click="onClickfetchDocument(item.fileName)"
|
||||
>
|
||||
<q-tooltip>คัดลอกลิ้งค์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
import { useQuasar } from "quasar";
|
||||
import ViewPDF from "@/modules/06_evaluate/components/viewstep/viewPDF.vue";
|
||||
|
||||
import type { FormCommand } from "@/modules/06_evaluate/interface/evalute";
|
||||
|
|
@ -7,9 +11,11 @@ import type { FormCommand } from "@/modules/06_evaluate/interface/evalute";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = useEvaluateStore();
|
||||
const mixins = useCounterMixin();
|
||||
const { date2Thai } = mixins;
|
||||
|
||||
const { date2Thai, showLoader, hideLoader, messageError, success } = mixins;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
|
|
@ -19,8 +25,6 @@ const props = defineProps({
|
|||
|
||||
const emit = defineEmits(["update:form"]);
|
||||
|
||||
const lastDateSendPerformance = ref<string | null>(date2Thai(new Date()));
|
||||
|
||||
const fileEvaluation1 = ref<any>();
|
||||
const pdfSrc = ref<any>();
|
||||
|
||||
|
|
@ -35,6 +39,7 @@ const commanderFullnameRef = ref<object | null>(null);
|
|||
const commanderPositionRef = ref<object | null>(null);
|
||||
const commanderAboveFullnameRef = ref<object | null>(null);
|
||||
const commanderAbovePositionRef = ref<object | null>(null);
|
||||
const fileEvaluation1Ref = ref<object | null>(null);
|
||||
|
||||
const modalView = ref<boolean>(false);
|
||||
function onClickViewPDF(file: any) {
|
||||
|
|
@ -48,17 +53,110 @@ const updateInput = (value: any) => {
|
|||
commanderPositionRef: commanderPositionRef.value,
|
||||
commanderAboveFullnameRef: commanderAboveFullnameRef.value,
|
||||
commanderAbovePositionRef: commanderAbovePositionRef.value,
|
||||
fileEvaluation1Ref: fileEvaluation1Ref.value,
|
||||
};
|
||||
emit("update:form", value, ref);
|
||||
};
|
||||
|
||||
async function fetchPathUpload(
|
||||
volume: string,
|
||||
id: string | undefined,
|
||||
type: string,
|
||||
file: any
|
||||
) {
|
||||
const body = {
|
||||
fileList: { fileName: type, metadata: {} },
|
||||
|
||||
// "1-แบบพิจารณาคุณสมบัติบุคคล",
|
||||
// "2-แบบแสดงรายละเอียดการเสนอผลงาน",
|
||||
// "3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล (เอกสารแบบ ก.)",
|
||||
// "4-แบบประเมินคุณลักษณะบุคคล",
|
||||
// "5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
|
||||
// "6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
};
|
||||
if (id && file) {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.loadPathDocument(volume, id), body)
|
||||
.then((res) => {
|
||||
const foundKey: string | undefined = Object.keys(res.data).find(
|
||||
(key) =>
|
||||
res.data[key]?.fileName !== undefined &&
|
||||
res.data[key]?.fileName !== ""
|
||||
);
|
||||
foundKey && uploadfile(res.data[foundKey]?.uploadUrl, file);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function uploadfile(uploadUrl: string, file: any) {
|
||||
console.log(uploadUrl);
|
||||
await axios
|
||||
.put(uploadUrl, file, {
|
||||
headers: {
|
||||
"Content-Type": file.type,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "อัปโหลไฟล์สำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
async function fetcheSigner(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluationSignerDoc2(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formCommand.commanderFullname = data.commanderFullnameDoc2;
|
||||
formCommand.commanderPosition = data.commanderPositionDoc2;
|
||||
formCommand.commanderAboveFullname = data.commanderAboveFullnameDoc2;
|
||||
formCommand.commanderAbovePosition = data.commanderAbovePositionDoc2;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const dateStartPrepareDoc2 = ref<string | null>(date2Thai(new Date()));
|
||||
const dateEndPrepareDoc2 = ref<string | null>(date2Thai(new Date()));
|
||||
|
||||
async function fetchCheckDate() {
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.evaluationCheckDate(props.evaluateId))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
dateStartPrepareDoc2.value = date2Thai(data.dateStartPrepareDoc2);
|
||||
dateEndPrepareDoc2.value = date2Thai(data.dateEndPrepareDoc2);
|
||||
})
|
||||
.catch((err) => {}));
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const ref = {
|
||||
commanderFullnameRef: commanderFullnameRef.value,
|
||||
commanderPositionRef: commanderPositionRef.value,
|
||||
commanderAboveFullnameRef: commanderAboveFullnameRef.value,
|
||||
commanderAbovePositionRef: commanderAbovePositionRef.value,
|
||||
fileEvaluation1Ref: fileEvaluation1Ref.value,
|
||||
};
|
||||
if (store.currentStep > 2) {
|
||||
fetcheSigner(store.evaluateId);
|
||||
}
|
||||
await fetchCheckDate();
|
||||
emit("update:form", formCommand, ref);
|
||||
// props.evaluateId && (await fetchPathUpload("เล่ม 2", props.evaluateId));
|
||||
});
|
||||
|
|
@ -70,7 +168,7 @@ onMounted(async () => {
|
|||
<q-banner class="text-weight-bold text-red-14 bg-red-2">
|
||||
<div class="text-weight-bold">
|
||||
<q-icon name="info_outline" color="red-14" size="24px" />
|
||||
วันสุดท้ายของการส่งผลงานคือวันที่ {{ lastDateSendPerformance }}
|
||||
วันสุดท้ายของการส่งผลงานคือวันที่ {{ dateEndPrepareDoc2 }}
|
||||
</div>
|
||||
</q-banner>
|
||||
</div>
|
||||
|
|
@ -109,6 +207,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation1Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation1"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -123,7 +223,20 @@ onMounted(async () => {
|
|||
</q-file>
|
||||
</div>
|
||||
<div class="col-2 self-center text-center q-pl-none">
|
||||
<q-btn flat round dense color="primary" icon="mdi-upload"
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
fetchPathUpload(
|
||||
'เล่ม 2',
|
||||
props.evaluateId,
|
||||
'1-เอกสารเล่ม 2',
|
||||
fileEvaluation1
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,73 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
const store = useEvaluateStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:file"]);
|
||||
|
||||
const selectedItem = ref(1);
|
||||
|
||||
function handleItemClick(itemNumber: number) {
|
||||
store.tabPanels = itemNumber.toString();
|
||||
selectedItem.value = itemNumber;
|
||||
async function fetchDocument() {
|
||||
showLoader();
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(
|
||||
config.API.loadFileDocument(
|
||||
"เล่ม 2",
|
||||
props.evaluateId,
|
||||
"1-เอกสารเล่ม 2"
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
downloadFile(res.data.downloadUrl);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
}));
|
||||
}
|
||||
|
||||
async function downloadFile(url: string) {
|
||||
await axios
|
||||
.get(url, {
|
||||
responseType: "blob",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
const blob = new Blob([res.data]);
|
||||
const objectUrl = URL.createObjectURL(blob);
|
||||
|
||||
emit("update:file", objectUrl);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchDocument();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -23,7 +77,6 @@ function handleItemClick(itemNumber: number) {
|
|||
v-ripple
|
||||
:active="selectedItem === 1 ? true : false"
|
||||
active-class="text-primary"
|
||||
@click="handleItemClick(1)"
|
||||
>
|
||||
<q-item-section>เอกสารเล่ม 2</q-item-section>
|
||||
</q-item>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import axios from "axios";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
import TableDirector from "@/modules/06_evaluate/components/directorandmeet/Table.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
const status = ref<string>("WAIT_CHECK_DOC_V2");
|
||||
const tabMenu = ref<string>("director");
|
||||
|
||||
|
|
@ -45,6 +62,71 @@ async function onClickDowloadFile(
|
|||
};
|
||||
await genReport(body, fileName);
|
||||
}
|
||||
|
||||
const directorList = ref<any>();
|
||||
const meetingList = ref<any>();
|
||||
|
||||
async function fetchDirector() {
|
||||
showLoader();
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.evaluationDirectorMeetring(props.evaluateId))
|
||||
.then((res) => {})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
}));
|
||||
}
|
||||
|
||||
async function fetchPathUpload(
|
||||
volume: string,
|
||||
id: string | undefined,
|
||||
type: string,
|
||||
file: any
|
||||
) {
|
||||
const body = {
|
||||
fileList: { fileName: type, metadata: {} },
|
||||
};
|
||||
if (id && file) {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.loadPathDocument(volume, id), body)
|
||||
.then((res) => {
|
||||
const foundKey: string | undefined = Object.keys(res.data).find(
|
||||
(key) =>
|
||||
res.data[key]?.fileName !== undefined &&
|
||||
res.data[key]?.fileName !== ""
|
||||
);
|
||||
foundKey && uploadfile(res.data[foundKey]?.uploadUrl, file);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function uploadfile(uploadUrl: string, file: any) {
|
||||
console.log(uploadUrl);
|
||||
await axios
|
||||
.put(uploadUrl, file, {
|
||||
headers: {
|
||||
"Content-Type": file.type,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "อัปโหลไฟล์สำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchDirector();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -99,7 +181,7 @@ async function onClickDowloadFile(
|
|||
<div class="row">
|
||||
<div class="col-12 q-pa-sm">
|
||||
<div class="row q-col-gutter-md col-12">
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<!-- <div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
class="col-12"
|
||||
outline
|
||||
|
|
@ -116,7 +198,7 @@ async function onClickDowloadFile(
|
|||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluationEdit"
|
||||
|
|
@ -146,7 +228,20 @@ async function onClickDowloadFile(
|
|||
</q-file>
|
||||
</div>
|
||||
<div class="col-2 self-center text-center q-pl-none">
|
||||
<q-btn flat round dense color="primary" icon="mdi-upload"
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
fetchPathUpload(
|
||||
'เล่ม 2',
|
||||
props.evaluateId,
|
||||
'2-เอกสารเล่ม 2 (ฉบับแก้ไข)',
|
||||
fileEvaluationEdit
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
const stroe = useEvaluateStore();
|
||||
const link = ref<string>("https://bma-ehr-publish.frappet.synology.me/");
|
||||
|
||||
|
||||
|
||||
const status = ref<string>("DONE");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<!-- <q-badge
|
||||
v-if="status == 'DONE'"
|
||||
outline
|
||||
color="green"
|
||||
label="เสร็จสิ้น"
|
||||
class="q-pa-sm"
|
||||
style="font-size: 16px"
|
||||
/> -->
|
||||
<div>
|
||||
<p class="text-weight-bold" style="font-size: 18px">Public URL</p>
|
||||
<a :href="link" target="_blank">{{ link }}</a>
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
class="q-mt-md"
|
||||
outline
|
||||
icon-right="mdi-clipboard-outline"
|
||||
label="เสร็จสิ้น"
|
||||
label="คัดลอกลิ้งค์"
|
||||
color="primary"
|
||||
>
|
||||
<q-tooltip> คัดลอกลิ้งค์ </q-tooltip></q-btn
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ const props = defineProps({
|
|||
type: Array as () => any[],
|
||||
require: true,
|
||||
},
|
||||
row: {
|
||||
type: Array as () => any[],
|
||||
require: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -14,6 +18,7 @@ const props = defineProps({
|
|||
bordered
|
||||
class="custom-header-table"
|
||||
:columns="props.columns"
|
||||
:rows="props.row"
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
style="width: 625px"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import type {
|
||||
EducationForm,
|
||||
CertificatesForm,
|
||||
} from "@/modules/06_evaluate/interface/evalute";
|
||||
|
||||
import TableData from "@/modules/06_evaluate/components/viewstep/tableStep1.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -15,31 +20,31 @@ const $q = useQuasar();
|
|||
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
const {
|
||||
columnsLicense,
|
||||
columnPeriodhistory,
|
||||
columnTrainingHistory,
|
||||
columnsCertificates,
|
||||
columnSalaries,
|
||||
columnTraining,
|
||||
columnProjectsProposed,
|
||||
} = store;
|
||||
|
||||
const emit = defineEmits(["update:formDeital"]);
|
||||
|
||||
const formDetail = reactive({
|
||||
UserId: "",
|
||||
CitizenId: "",
|
||||
Prefix: "",
|
||||
FullName: "",
|
||||
Position: "",
|
||||
Oc: "",
|
||||
Salary: "",
|
||||
PositionLevel: "",
|
||||
PosNo: "",
|
||||
BirthDate: "",
|
||||
GovAge: "",
|
||||
Educations: [],
|
||||
Certificates: [],
|
||||
Salaries: [],
|
||||
Trainings: [],
|
||||
Assessments: [],
|
||||
userId: "",
|
||||
citizenId: "",
|
||||
prefix: "",
|
||||
fullName: "",
|
||||
position: "",
|
||||
oc: "",
|
||||
salary: "",
|
||||
positionLevel: "",
|
||||
posNo: "",
|
||||
birthDate: "",
|
||||
govAge: "",
|
||||
educations: [] as EducationForm[],
|
||||
certificates: [],
|
||||
salaries: [],
|
||||
trainings: [],
|
||||
assessments: [],
|
||||
// Type: "",
|
||||
// Step: "",
|
||||
});
|
||||
|
|
@ -50,25 +55,70 @@ async function fetchDetail() {
|
|||
.get(config.API.evaluationDetail())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formDetail.UserId = data.id;
|
||||
formDetail.CitizenId = data.citizenId;
|
||||
formDetail.Prefix = data.prefix;
|
||||
formDetail.FullName = `${data.firstName} ${data.lastName}`;
|
||||
formDetail.Position = data.position;
|
||||
formDetail.Oc = data.oc;
|
||||
formDetail.Salary = data.salary;
|
||||
formDetail.PositionLevel = data.positionLevel;
|
||||
formDetail.PosNo = data.posNo;
|
||||
formDetail.BirthDate = data.birthDate && date2Thai(data.birthDate);
|
||||
formDetail.GovAge = data.govAge;
|
||||
formDetail.Educations = data.educations;
|
||||
formDetail.Certificates = data.certificates;
|
||||
formDetail.Salaries = data.salaries;
|
||||
formDetail.Trainings = data.trainings;
|
||||
formDetail.Assessments = data.assessments;
|
||||
formDetail.userId = data.id;
|
||||
formDetail.citizenId = data.citizenId;
|
||||
formDetail.prefix = data.prefix;
|
||||
formDetail.fullName = `${data.firstName} ${data.lastName}`;
|
||||
formDetail.position = data.position;
|
||||
formDetail.oc = data.oc;
|
||||
formDetail.salary = data.salary;
|
||||
formDetail.positionLevel = data.positionLevel;
|
||||
formDetail.posNo = data.posNo;
|
||||
formDetail.birthDate = data.birthDate && date2Thai(data.birthDate);
|
||||
formDetail.govAge = data.govAge;
|
||||
formDetail.educations = data.educations;
|
||||
|
||||
formDetail.certificates = data.certificates.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.trainings.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.assessments;
|
||||
// fromDetail.Type = data.
|
||||
// fromDetail.Step = data.
|
||||
|
||||
console.log(formDetail);
|
||||
|
||||
emit("update:formDeital", data);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -99,7 +149,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.Prefix"
|
||||
:model-value="formDetail.prefix"
|
||||
label="คำนำหน้าชื่อ"
|
||||
></q-input>
|
||||
</div>
|
||||
|
|
@ -107,14 +157,14 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.FullName"
|
||||
:model-value="formDetail.fullName"
|
||||
label="ชื่อ - นามสกุล"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
:model-value="formDetail.BirthDate"
|
||||
:model-value="formDetail.birthDate"
|
||||
readonly
|
||||
label="วันเดือนปีเกิด"
|
||||
>
|
||||
|
|
@ -127,7 +177,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.Position"
|
||||
:model-value="formDetail.position"
|
||||
label="ตำแหน่ง"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -135,7 +185,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.PosNo"
|
||||
:model-value="formDetail.posNo"
|
||||
label="ตำแหน่งเลขที่"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -143,7 +193,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.Oc"
|
||||
:model-value="formDetail.oc"
|
||||
label="สังกัด"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -151,7 +201,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.Salary"
|
||||
:model-value="formDetail.salary"
|
||||
label="เงินเดือน"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -160,7 +210,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.PositionLevel"
|
||||
:model-value="formDetail.positionLevel"
|
||||
label="ระดับปัจจุบัน"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -169,7 +219,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.PositionLevel"
|
||||
:model-value="formDetail.positionLevel"
|
||||
label="ระดับที่ประเมิน"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -178,7 +228,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="formDetail.GovAge"
|
||||
:model-value="formDetail.govAge"
|
||||
label="อายุราชการ"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -187,15 +237,19 @@ onMounted(async () => {
|
|||
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div class="text-weight-bold row items-center bg-grey-2">
|
||||
<span class="q-ml-lg q-my-sm">ประวัติการศึกษา</span>
|
||||
<span class="q-ml-lg q-my-sm">ประวัติการศึกษา </span>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div
|
||||
class="row q-pa-sm"
|
||||
v-for="(education, index) in formDetail.educations"
|
||||
:key="index"
|
||||
>
|
||||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
model-value="ปริญญาตรี"
|
||||
:model-value="education.educationLevel"
|
||||
label="ระดับศึกษา"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -204,7 +258,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
model-value="มหาวิทยาลัยก."
|
||||
:model-value="education.institute"
|
||||
label="สถานศึกษา"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -212,7 +266,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
model-value="19/03/44"
|
||||
:model-value="date2Thai(education.startDate)"
|
||||
readonly
|
||||
label="ตั้งแต่"
|
||||
>
|
||||
|
|
@ -223,7 +277,12 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input borderless model-value="19/03/44" readonly label="ถึง">
|
||||
<q-input
|
||||
borderless
|
||||
:model-value="date2Thai(education.endDate)"
|
||||
readonly
|
||||
label="ถึง"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon class="size-icon" name="o_calendar_today" />
|
||||
</template>
|
||||
|
|
@ -232,7 +291,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
model-value="19/03/44"
|
||||
:model-value="date2Thai(education.finishDate)"
|
||||
readonly
|
||||
label="วันทราสำเร็จการศึกษา"
|
||||
>
|
||||
|
|
@ -246,7 +305,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
model-value="ปริญญาตรี"
|
||||
:model-value="education.degree"
|
||||
label="วุฒิการศึกษาในตําแหน่ง"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -255,7 +314,7 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
model-value="ปริญญาตรี"
|
||||
:model-value="education.degree"
|
||||
label="วุฒิการศึกษา"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -264,27 +323,38 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
model-value="-"
|
||||
:model-value="education.field"
|
||||
label="สาขาวิชา/ทาง"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input borderless readonly model-value="-" label="ทุน" />
|
||||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.fundName"
|
||||
label="ทุน"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
model-value="3.33"
|
||||
:model-value="education.gpa"
|
||||
label="เกรดเฉลี่ย"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-4 col-md-6">
|
||||
<q-input borderless readonly model-value="ไทย" label="ประเทศ" />
|
||||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.country"
|
||||
label="ประเทศ"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
</q-card>
|
||||
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
|
|
@ -294,7 +364,10 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<TableData :columns="columnsLicense" />
|
||||
<TableData
|
||||
:columns="columnsCertificates"
|
||||
:row="formDetail.certificates"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -306,7 +379,7 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<TableData :columns="columnPeriodhistory" />
|
||||
<TableData :columns="columnSalaries" :row="formDetail.salaries" />
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -318,7 +391,10 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<TableData :columns="columnTrainingHistory" />
|
||||
<TableData
|
||||
:columns="columnTraining"
|
||||
:row="formDetail.trainings"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -330,7 +406,10 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<TableData :columns="columnTrainingHistory" />
|
||||
<!-- <TableData
|
||||
:columns="columnTraining"
|
||||
:row="formDetail.Trainings"
|
||||
/> -->
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
<script setup lang="ts">
|
||||
import ViewPDF from "@/modules/06_evaluate/components/viewstep/viewPDF.vue";
|
||||
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
const store = useEvaluateStore();
|
||||
const props = defineProps({
|
||||
pdfSrc: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-tab-panels v-model="store.tabPanels" animated swipeable vertical>
|
||||
<q-tab-panel name="1">
|
||||
<ViewPDF />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
<ViewPDF :pdfSrc="props.pdfSrc" />
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -30,4 +30,36 @@ interface FormCommandRef {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type { FormCommand, FormCommandRef, FormSpec };
|
||||
interface EducationForm {
|
||||
country: string;
|
||||
degree: string;
|
||||
duration: string;
|
||||
durationYear: number;
|
||||
educationLevel: string;
|
||||
endDate: Date;
|
||||
field: string;
|
||||
finishDate: Date;
|
||||
fundName: string;
|
||||
gpa: string;
|
||||
institute: string;
|
||||
isDate: boolean;
|
||||
isEducation: boolean;
|
||||
other: string;
|
||||
startDate: Date;
|
||||
}
|
||||
|
||||
interface CertificatesForm {
|
||||
certificateNo: string;
|
||||
certificateType: string;
|
||||
expireDate: Date;
|
||||
issueDate: Date;
|
||||
issuer: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
FormCommand,
|
||||
FormCommandRef,
|
||||
FormSpec,
|
||||
EducationForm,
|
||||
CertificatesForm,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,58 +5,58 @@ import type { QTableProps } from "quasar";
|
|||
|
||||
export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||
/** columns TableViewStep1*/
|
||||
const columnsLicense = ref<QTableProps["columns"]>([
|
||||
const columnsCertificates = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "licenseName",
|
||||
align: "center",
|
||||
name: "certificateType",
|
||||
align: "left",
|
||||
label: "ชื่อใบอนุณาต",
|
||||
sortable: false,
|
||||
field: "licenseName",
|
||||
field: "certificateType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "licensingAgency",
|
||||
name: "issuer",
|
||||
align: "left",
|
||||
label: "หน่วยงานผู้ออกใบอนุญาต",
|
||||
sortable: true,
|
||||
field: "licensingAgency",
|
||||
field: "issuer",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "licenseNumber",
|
||||
name: "certificateNo",
|
||||
align: "left",
|
||||
label: "เลขที่ใบอนุญาต",
|
||||
sortable: true,
|
||||
field: "licenseNumber",
|
||||
field: "certificateNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "licenseDate",
|
||||
name: "issueDate",
|
||||
align: "left",
|
||||
label: "วันที่ออกใบอนุญาต",
|
||||
sortable: true,
|
||||
field: "licenseDate",
|
||||
field: "issueDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "expirationDate",
|
||||
name: "expireDate",
|
||||
align: "left",
|
||||
label: "วันที่หมดอายุ",
|
||||
sortable: true,
|
||||
field: "expirationDate",
|
||||
field: "expireDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
const columnPeriodhistory = ref<QTableProps["columns"]>([
|
||||
const columnSalaries = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
align: "center",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปี",
|
||||
sortable: false,
|
||||
field: "date",
|
||||
|
|
@ -64,11 +64,11 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "affiliation",
|
||||
name: "oc",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "affiliation",
|
||||
field: "oc",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -82,11 +82,11 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionNumber",
|
||||
name: "posNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "positionNumber",
|
||||
field: "posNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -146,67 +146,67 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
|||
},
|
||||
]);
|
||||
|
||||
const columnTrainingHistory = ref<QTableProps["columns"]>([
|
||||
const columnTraining = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "projectName",
|
||||
align: "center",
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อโครงการ/หลักสูตรการฝึกอบรม",
|
||||
sortable: false,
|
||||
field: "projectName",
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "trainingTopics",
|
||||
name: "topic",
|
||||
align: "left",
|
||||
label: "หัวข้อการฝึกอบรม/ดูงาน",
|
||||
sortable: true,
|
||||
field: "trainingTopics",
|
||||
field: "topic",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "trainingStartDate",
|
||||
name: "startDate",
|
||||
align: "left",
|
||||
label: "วันเริ่มต้นการฝึกอบรม/ดูงาน",
|
||||
sortable: true,
|
||||
field: "trainingStartDate",
|
||||
field: "startDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "trainingEndDate",
|
||||
name: "endDate",
|
||||
align: "left",
|
||||
label: "วันสิ้นสุดการฝึกอบรม/ดูงาน",
|
||||
sortable: true,
|
||||
field: "trainingEndDate",
|
||||
field: "endDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "trainingYear",
|
||||
name: "yearly",
|
||||
align: "left",
|
||||
label: "ปีที่อบรม/ดูงาน",
|
||||
sortable: true,
|
||||
field: "trainingYear",
|
||||
field: "yearly",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "trainingTotalTime",
|
||||
name: "duration",
|
||||
align: "left",
|
||||
label: "รวมระยะเวลาในการฝึกอบรม/ดูงาน",
|
||||
sortable: true,
|
||||
field: "trainingTotalTime",
|
||||
field: "duration",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "trainingAgency",
|
||||
name: "department",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน",
|
||||
sortable: true,
|
||||
field: "trainingAgency",
|
||||
field: "department",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -261,9 +261,9 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
|||
]);
|
||||
|
||||
return {
|
||||
columnsLicense,
|
||||
columnPeriodhistory,
|
||||
columnTrainingHistory,
|
||||
columnsCertificates,
|
||||
columnSalaries,
|
||||
columnTraining,
|
||||
columnProjectsProposed,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@ const { showLoader, hideLoader, messageError } = mixin;
|
|||
<q-separator />
|
||||
<q-tab-panels v-model="store.tabMenu" animated>
|
||||
<q-tab-panel name="1">
|
||||
<Tab1 :title="'ชำนาญการ'" />
|
||||
<Tab1 :title="'ชำนาญการ'" :step="store.step" />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="2">
|
||||
<Tab1 :title="'ชำนาญการพิเศษ'"
|
||||
<Tab1 :title="'ชำนาญการพิเศษ'" :step="store.step"
|
||||
/></q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue