ประเมินบุคคล
This commit is contained in:
parent
aa23748eb2
commit
e33d5eed1b
13 changed files with 757 additions and 164 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -8,9 +9,16 @@ import HeaderDialog from "@/components/DialogHeader.vue";
|
|||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const route = useRoute();
|
||||
const mixins = useCounterMixin();
|
||||
const { showLoader, hideLoader, date2Thai } = mixins;
|
||||
|
||||
// const evaluateId = ref<string>(route.params.id.toString());
|
||||
|
||||
const evaluateId = computed(() => {
|
||||
const id = route.params.id ? route.params.id.toString() : "";
|
||||
return id;
|
||||
});
|
||||
/** รับ props Tab 1 */
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
|
@ -89,7 +97,7 @@ async function fetchListHistory(id: string) {
|
|||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
props.modal && props.id && fetchListHistory(props.id);
|
||||
props.modal && fetchListHistory(evaluateId.value);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import type {
|
||||
EducationForm,
|
||||
|
|
@ -17,6 +18,7 @@ import { useEvaluateDetailStore } from "@/modules/06_evaluate/stores/evaluteDeta
|
|||
const mixin = useCounterMixin();
|
||||
const store = useEvaluateDetailStore();
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
const {
|
||||
|
|
@ -26,10 +28,9 @@ const {
|
|||
columnProjectsProposed,
|
||||
} = store;
|
||||
|
||||
/** props ID จาก Tab1.vue*/
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
type: String,
|
||||
data: {
|
||||
type: Array,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -52,8 +53,6 @@ const formDetail = reactive({
|
|||
salaries: [],
|
||||
trainings: [],
|
||||
assessments: [],
|
||||
// Type: "",
|
||||
// Step: "",
|
||||
});
|
||||
|
||||
async function fetchDetail() {
|
||||
|
|
@ -121,16 +120,15 @@ async function fetchDetail() {
|
|||
yearly: e.yearly,
|
||||
}));
|
||||
formDetail.assessments = data.assessments;
|
||||
// fromDetail.Type = data.
|
||||
// fromDetail.Step = data.
|
||||
|
||||
emit("update:formDeital", data);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -138,80 +136,67 @@ async function fetchDetail() {
|
|||
* function fetchData ตรวจสอบคุณสมบัติ
|
||||
* @param id ประเมิน
|
||||
*/
|
||||
async function fetchCheckSpec(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluationCheckspecByid(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formDetail.userId = data.id;
|
||||
formDetail.citizenId = data.citizenId;
|
||||
formDetail.prefix = data.prefix;
|
||||
formDetail.fullName = data.fullName;
|
||||
formDetail.position = data.position;
|
||||
formDetail.oc = data.oc;
|
||||
formDetail.salary = data.salary.toLocaleString("th-TH");
|
||||
formDetail.positionLevel = data.positionLevel;
|
||||
formDetail.posNo = data.posNo;
|
||||
formDetail.birthDate = data.birthDate && date2Thai(data.birthDate);
|
||||
formDetail.govAge = data.govAge;
|
||||
formDetail.educations = data.education;
|
||||
async function fetchCheckSpec(data: any) {
|
||||
formDetail.userId = data.id;
|
||||
formDetail.citizenId = data.citizenId;
|
||||
formDetail.prefix = data.prefix;
|
||||
formDetail.fullName = data.fullName;
|
||||
formDetail.position = data.position;
|
||||
formDetail.oc = data.oc;
|
||||
formDetail.salary = data.salary.toLocaleString("th-TH");
|
||||
formDetail.positionLevel = data.positionLevel;
|
||||
formDetail.posNo = data.posNo;
|
||||
formDetail.birthDate = data.birthDate && date2Thai(data.birthDate);
|
||||
formDetail.govAge = data.govAge;
|
||||
formDetail.educations = data.education;
|
||||
|
||||
formDetail.certificates = data.certificate.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 : "",
|
||||
formDetail.certificates = data.certificate.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.training.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.assessment;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
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.training.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.assessment;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
props.evaluateId ? fetchCheckSpec(props.evaluateId) : fetchDetail();
|
||||
route.name === "evaluate-add" && (await fetchDetail());
|
||||
props.data && fetchCheckSpec(props.data);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue