fix การทดลองปฏิบัติหน้าที่ราชการ
This commit is contained in:
parent
c10e96e2a4
commit
9f1bcd1551
3 changed files with 244 additions and 60 deletions
|
|
@ -775,7 +775,7 @@ async function getAssign() {
|
||||||
...dataPerson,
|
...dataPerson,
|
||||||
name: `${dataPerson.name} (${dataPerson.position}${
|
name: `${dataPerson.name} (${dataPerson.position}${
|
||||||
dataPerson.positionLevel && dataPerson.positionType
|
dataPerson.positionLevel && dataPerson.positionType
|
||||||
? ", " + dataPerson.positionType + " : " + dataPerson.positionLevel
|
? dataPerson.positionLevel
|
||||||
: ""
|
: ""
|
||||||
})`,
|
})`,
|
||||||
}));
|
}));
|
||||||
|
|
@ -1009,7 +1009,7 @@ function updateAppointMent() {
|
||||||
...dataPerson,
|
...dataPerson,
|
||||||
name: `${dataPerson.name} (${dataPerson.position}${
|
name: `${dataPerson.name} (${dataPerson.position}${
|
||||||
dataPerson.positionLevel && dataPerson.positionType
|
dataPerson.positionLevel && dataPerson.positionType
|
||||||
? ", " + dataPerson.positionType + " : " + dataPerson.positionLevel
|
? + dataPerson.positionLevel
|
||||||
: ""
|
: ""
|
||||||
})`,
|
})`,
|
||||||
}));
|
}));
|
||||||
|
|
@ -1035,7 +1035,7 @@ function updateAppointMent() {
|
||||||
label: dataPerson.position
|
label: dataPerson.position
|
||||||
? `${dataPerson.name} (${dataPerson.position}${
|
? `${dataPerson.name} (${dataPerson.position}${
|
||||||
dataPerson.positionLevel && dataPerson.positionType
|
dataPerson.positionLevel && dataPerson.positionType
|
||||||
? ", " + dataPerson.positionType + " : " + dataPerson.positionLevel
|
? +dataPerson.positionLevel
|
||||||
: ""
|
: ""
|
||||||
})`
|
})`
|
||||||
: dataPerson.name,
|
: dataPerson.name,
|
||||||
|
|
|
||||||
|
|
@ -63,63 +63,93 @@ const optionsResult = ref<any>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
tab: { type: String, require: true },
|
||||||
|
data: { type: Object, require: true },
|
||||||
|
});
|
||||||
|
|
||||||
/** get ข้อมูลรายการมอยหมาย เก็บไว้ตัวแปร
|
/** get ข้อมูลรายการมอยหมาย เก็บไว้ตัวแปร
|
||||||
* @param id personal id
|
* @param id personal id
|
||||||
*/
|
*/
|
||||||
async function fecthAssign(id: string) {
|
async function fecthAssign() {
|
||||||
showLoader();
|
const data = props.data;
|
||||||
await http
|
|
||||||
.get(config.API.evaluateReportcreate(id))
|
|
||||||
.then((res) => {
|
|
||||||
assign.value = res.data.result.assign;
|
|
||||||
person.value = res.data.result.person;
|
|
||||||
mentors.value = res.data.result.mentors;
|
|
||||||
date_start.value = res.data.result.assign.date_start;
|
|
||||||
date_finish.value = res.data.result.assign.date_finish;
|
|
||||||
|
|
||||||
if (
|
assign.value = data?.assign;
|
||||||
res.data.result.result.develop_complete != null &&
|
person.value = data?.person;
|
||||||
res.data.result.result.evaluate_result != null
|
mentors.value = data?.mentors;
|
||||||
) {
|
date_start.value = data?.assign.date_start;
|
||||||
develop.value = res.data.result.result.develop_complete;
|
date_finish.value = data?.assign.date_finish;
|
||||||
result.value = res.data.result.result.evaluate_result;
|
if (
|
||||||
changeReson52(Number(res.data.result.result.evaluate_result));
|
data?.result.develop_complete != null &&
|
||||||
}
|
data?.result.evaluate_result != null
|
||||||
|
) {
|
||||||
|
develop.value = data.result.develop_complete;
|
||||||
|
result.value = data.result.evaluate_result;
|
||||||
|
changeReson52(Number(data.result.evaluate_result));
|
||||||
|
}
|
||||||
|
director_id.value = data?.chairman;
|
||||||
|
director_id2.value = data?.commander;
|
||||||
|
if (mentors.value.length != 0) {
|
||||||
|
director_id3.value = mentors.value[0];
|
||||||
|
}
|
||||||
|
commander.value = data?.commander;
|
||||||
|
optionDirector.value = mentors.value;
|
||||||
|
|
||||||
director_id.value = res.data.result.chairman;
|
// showLoader();
|
||||||
director_id2.value = res.data.result.commander;
|
// await http
|
||||||
if (mentors.value.length != 0) {
|
// .get(config.API.evaluateReportcreate(id))
|
||||||
director_id3.value = mentors.value[0];
|
// .then((res) => {
|
||||||
}
|
// assign.value = res.data.result.assign;
|
||||||
commander.value = res.data.result.commander;
|
// person.value = res.data.result.person;
|
||||||
optionDirector.value = mentors.value;
|
// mentors.value = res.data.result.mentors;
|
||||||
})
|
// date_start.value = res.data.result.assign.date_start;
|
||||||
.catch((e) => {
|
// date_finish.value = res.data.result.assign.date_finish;
|
||||||
// messageError($q, e);
|
|
||||||
})
|
// if (
|
||||||
.finally(() => {
|
// res.data.result.result.develop_complete != null &&
|
||||||
hideLoader();
|
// res.data.result.result.evaluate_result != null
|
||||||
});
|
// ) {
|
||||||
|
// develop.value = res.data.result.result.develop_complete;
|
||||||
|
// result.value = res.data.result.result.evaluate_result;
|
||||||
|
// changeReson52(Number(res.data.result.result.evaluate_result));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// director_id.value = res.data.result.chairman;
|
||||||
|
// director_id2.value = res.data.result.commander;
|
||||||
|
// if (mentors.value.length != 0) {
|
||||||
|
// director_id3.value = mentors.value[0];
|
||||||
|
// }
|
||||||
|
// commander.value = res.data.result.commander;
|
||||||
|
// optionDirector.value = mentors.value;
|
||||||
|
// })
|
||||||
|
// .catch((e) => {
|
||||||
|
// // messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** get ข้อมูล เก็บไว้ตัวแปร
|
/** get ข้อมูล เก็บไว้ตัวแปร
|
||||||
* @param id personal id
|
* @param id personal id
|
||||||
*/
|
*/
|
||||||
const fecthResult = async (id: string) => {
|
const fecthResult = async (id: string) => {
|
||||||
|
const noNumber = props?.tab ? Number(props?.tab.charAt(4)) : "";
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.createformReport(id))
|
.get(config.API.createformReport(id) + `&evaluate_no=${noNumber}`)
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
if (res.data.result != null) {
|
if (res.data.result != null) {
|
||||||
const data = await res.data.result.evaluate;
|
const data = await res.data.result.evaluate;
|
||||||
ID.value = data.id;
|
ID.value = data.id;
|
||||||
date_start.value = data.date_start;
|
date_start.value = data.date_start;
|
||||||
date_finish.value = data.date_finish;
|
date_finish.value = data.date_finish;
|
||||||
develop.value = await Number(data.develop_complete);
|
develop.value = Number(data.develop_complete);
|
||||||
result.value = await Number(data.pass_result);
|
result.value = Number(data.pass_result);
|
||||||
reson.value = await data.reson;
|
reson.value = data.reson;
|
||||||
chairman_dated.value = await data.chairman_dated;
|
chairman_dated.value = data.chairman_dated;
|
||||||
director1_dated.value = await data.director1_dated;
|
director1_dated.value = data.director1_dated;
|
||||||
director2_dated.value = await data.director2_dated;
|
director2_dated.value = data.director2_dated;
|
||||||
status.value = false;
|
status.value = false;
|
||||||
action.value = "edit";
|
action.value = "edit";
|
||||||
expand_month.value = data.expand_month;
|
expand_month.value = data.expand_month;
|
||||||
|
|
@ -188,7 +218,8 @@ async function postData(action: string) {
|
||||||
chairman_dated: chairman_dated.value,
|
chairman_dated: chairman_dated.value,
|
||||||
director1_dated: director1_dated.value,
|
director1_dated: director1_dated.value,
|
||||||
director2_dated: director2_dated.value,
|
director2_dated: director2_dated.value,
|
||||||
expand_month: expand_month.value,
|
expand_month: expand_month.value ? expand_month.value : undefined,
|
||||||
|
evaluate_no: props?.tab ? Number(props?.tab.charAt(4)) : undefined,
|
||||||
};
|
};
|
||||||
if (action === "post") {
|
if (action === "post") {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -255,7 +286,7 @@ function changeReson52(val: number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fecthAssign(assignId.value);
|
fecthAssign();
|
||||||
fecthResult(assignId.value);
|
fecthResult(assignId.value);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -264,7 +295,7 @@ onMounted(() => {
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
||||||
<div>แบบรายงานการประเมินฯ</div>
|
<div>แบบรายงานการประเมินฯ</div>
|
||||||
<q-btn
|
<!-- <q-btn
|
||||||
v-if="!status"
|
v-if="!status"
|
||||||
size="12px"
|
size="12px"
|
||||||
flat
|
flat
|
||||||
|
|
@ -289,7 +320,7 @@ onMounted(() => {
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
|
|
@ -317,7 +348,9 @@ onMounted(() => {
|
||||||
<div class="col-12 text-top0 row items-center">
|
<div class="col-12 text-top0 row items-center">
|
||||||
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
|
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
|
||||||
ประเมินผล
|
ประเมินผล
|
||||||
<span class="text-primary q-pr-sm"> ครั้งที่ 1 </span>
|
<span class="text-primary q-pr-sm">
|
||||||
|
ครั้งที่ {{ props?.tab ? props?.tab.charAt(4) : "" }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 text-top0 row items-center">
|
<div class="col-12 text-top0 row items-center">
|
||||||
|
|
@ -326,7 +359,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-form ref="myForm">
|
<q-form ref="myForm" class="col-12">
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="col-12 row q-col-gutter-md">
|
<div class="col-12 row q-col-gutter-md">
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
|
@ -507,6 +540,11 @@ onMounted(() => {
|
||||||
label="จำนวนเดือน"
|
label="จำนวนเดือน"
|
||||||
:rules="[(val:string) => !!val || 'กรุณากรอกจำนวนเดือน']"
|
:rules="[(val:string) => !!val || 'กรุณากรอกจำนวนเดือน']"
|
||||||
type="number"
|
type="number"
|
||||||
|
:readonly="
|
||||||
|
!status ||
|
||||||
|
checkRoutePermisson ||
|
||||||
|
probationStore.dataPermissions?.tab6.isEdit == false
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -621,11 +659,8 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 row q-mt-xs">
|
<!-- <div class="col-12 row q-mt-xs">
|
||||||
<div class="col-12 text-top2 row items-center">
|
<div class="col-12 text-top2 row items-center">คณะกรรมการ</div>
|
||||||
คณะกรรมการ
|
|
||||||
<!-- ความเห็นของผู้มีอำนาจสั่งบรรจุตามมาตรา 52 -->
|
|
||||||
</div>
|
|
||||||
<div class="col-12 row q-col-gutter-md">
|
<div class="col-12 row q-col-gutter-md">
|
||||||
<q-select
|
<q-select
|
||||||
class="col-xs-12 col-sm-8"
|
class="col-xs-12 col-sm-8"
|
||||||
|
|
@ -685,12 +720,11 @@ onMounted(() => {
|
||||||
</datepicker>
|
</datepicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="col-12 row q-mt-xs">
|
<!-- <div class="col-12 row q-mt-xs">
|
||||||
<div class="col-12 text-top2 row items-center">
|
<div class="col-12 text-top2 row items-center">
|
||||||
คณะกรรมการ
|
คณะกรรมการ
|
||||||
<!-- ผู้มีอำนาจสั่งบรรจุตามมาตรา 52 -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 row q-col-gutter-md">
|
<div class="col-12 row q-col-gutter-md">
|
||||||
|
|
@ -753,7 +787,7 @@ onMounted(() => {
|
||||||
</datepicker>
|
</datepicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,166 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, defineAsyncComponent } from "vue";
|
import { ref, defineAsyncComponent, onMounted } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import genReport from "@/plugins/genreport";
|
||||||
|
|
||||||
|
const Header = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
const FormReport = defineAsyncComponent(
|
const FormReport = defineAsyncComponent(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
"@/modules/05_placement/components/probation/FormEvaluation/FormReport.vue"
|
"@/modules/05_placement/components/probation/FormEvaluation/FormReport.vue"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const probationStore = useProbationDataStore();
|
||||||
|
const {
|
||||||
|
date2Thai,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
dialogConfirm,
|
||||||
|
dialogMessageNotify,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
|
const tab = ref<string>("save1");
|
||||||
|
const tabs = ref<any[]>([{ no: 1 }, { no: 2 }]);
|
||||||
|
const dataArrayNumber = ref<number>(1);
|
||||||
|
const evaluate = ref<any>([]);
|
||||||
|
const assignId = ref<string>(route.params.form.toString());
|
||||||
|
const personalId = ref<string>(route.params.personalId.toString());
|
||||||
|
const isLoad = ref<boolean>(false);
|
||||||
|
const fullName = ref<string>("");
|
||||||
|
|
||||||
|
const dataResult = ref<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id assignId
|
||||||
|
*/
|
||||||
|
async function fecthAssign(id: string) {
|
||||||
|
isLoad.value = false;
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.evaluateReportcreate(id))
|
||||||
|
.then((res) => {
|
||||||
|
dataResult.value = res.data.result;
|
||||||
|
fullName.value = res.data.result.person.name;
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
tabs.value = res.data.result.result.map((e: any, index: number) => {
|
||||||
|
return { no: index + 1, ...e };
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
isLoad.value = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* download file
|
||||||
|
* @param type type
|
||||||
|
*/
|
||||||
|
async function onDownloadFile(type: string) {
|
||||||
|
const noNumber = tab.value ? Number(tab.value.charAt(4)) : "";
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.reportEvaluateResult(type, assignId.value) + `/${noNumber}`)
|
||||||
|
.then(async (res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
await genReport(
|
||||||
|
data,
|
||||||
|
`แบบรายงานการประเมินฯ${fullName.value}.${type}`,
|
||||||
|
type
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch(async (e) => {
|
||||||
|
messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const changeTab = (tabVal: string) => {
|
||||||
|
tab.value = tabVal;
|
||||||
|
dataArrayNumber.value = Number(tabVal.charAt(4));
|
||||||
|
};
|
||||||
|
|
||||||
|
/** ไปหน้า page add */
|
||||||
|
function addData() {
|
||||||
|
tabs.value.push({ no: 2 });
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fecthAssign(assignId.value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 q-ma-sm">
|
<Header
|
||||||
|
v-if="tabs.length > 0"
|
||||||
|
:change-tab="changeTab"
|
||||||
|
:add-data="addData"
|
||||||
|
:loop="tabs.length"
|
||||||
|
:FileDownload="onDownloadFile"
|
||||||
|
:checkPermission="
|
||||||
|
probationStore?.dataPermissions?.tab6?.isEdit && tabs.length === 1
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<q-tab-panels
|
||||||
|
v-model="tab"
|
||||||
|
animated
|
||||||
|
swipeable
|
||||||
|
vertical
|
||||||
|
transition-prev="jump-up"
|
||||||
|
transition-next="jump-up"
|
||||||
|
v-if="tabs.length > 0"
|
||||||
|
class="mt"
|
||||||
|
>
|
||||||
|
<q-tab-panel v-for="item in tabs" :name="`save${item.no}`" :key="item.no">
|
||||||
|
<FormReport :tab="tab" :data="dataResult" action="edit" v-if="isLoad" />
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
|
|
||||||
|
<!-- <div class="q-gutter-md" v-if="tabs.length === 0">
|
||||||
|
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||||
|
<q-btn
|
||||||
|
v-if="!checkRoutePermisson"
|
||||||
|
outline
|
||||||
|
color="primary"
|
||||||
|
label="สร้างแบบประเมิน"
|
||||||
|
@click="addData"
|
||||||
|
:disable="probationStore.dataPermissions?.tab5.isEdit == false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<!-- <div class="col-12 q-ma-sm">
|
||||||
<FormReport />
|
<FormReport />
|
||||||
</div>
|
</div> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mt {
|
||||||
|
margin-top: 25px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue