เพิ่มแบบบันทึกผลผู้บัญชาการ
This commit is contained in:
parent
730dc03e4f
commit
9a37db5219
9 changed files with 3090 additions and 9 deletions
|
|
@ -42,7 +42,10 @@ export default {
|
||||||
formevaluateRecord: (id: string) => `${evaluate}/evaluate-record/create?assign_id=${id}`,
|
formevaluateRecord: (id: string) => `${evaluate}/evaluate-record/create?assign_id=${id}`,
|
||||||
createformevaluate: (id: string) => `${evaluate}/evaluate-record?assign_id=${id}`,
|
createformevaluate: (id: string) => `${evaluate}/evaluate-record?assign_id=${id}`,
|
||||||
editFormEvaluate: (id: string, evaluate_id: string) => `${evaluate}/evaluate-record?assign_id=${id}&evaluate_id=${evaluate_id}`,
|
editFormEvaluate: (id: string, evaluate_id: string) => `${evaluate}/evaluate-record?assign_id=${id}&evaluate_id=${evaluate_id}`,
|
||||||
|
// บันทึกผล (ผู้บังคับบัญชา)
|
||||||
|
formevaluateCommander: (id: string) => `${evaluate}/evaluate-record/commander?assign_id=${id}`,
|
||||||
|
formevaluateRecordCommander: (id: string) => `${evaluate}/evaluate-record/create/commander?assign_id=${id}`,
|
||||||
|
editEvaluateCommander: (id: string, evaluate_id: string) => `${evaluate}/evaluate-record/commander?assign_id=${id}&evaluate_id=${evaluate_id}`,
|
||||||
//แบบประเมินผล (ผู้บังคับบัญชา)
|
//แบบประเมินผล (ผู้บังคับบัญชา)
|
||||||
evaluateCreate: (id: string) => `${evaluate}/evaluate/create?assign_id=${id}`,
|
evaluateCreate: (id: string) => `${evaluate}/evaluate/create?assign_id=${id}`,
|
||||||
evaluatecommader: (id: string, no: string) => `${evaluate}/evaluate?assign_id=${id}&evaluate_no=${no}`,
|
evaluatecommader: (id: string, no: string) => `${evaluate}/evaluate?assign_id=${id}&evaluate_no=${no}`,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { useRouter, useRoute } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import criterion from "@/modules/05_placement/components/Other/Criterion.vue"
|
import criterion from "@/modules/05_placement/components/Other/Criterion.vue";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const routeName = router.currentRoute.value.name;
|
const routeName = router.currentRoute.value.name;
|
||||||
|
|
@ -382,7 +382,7 @@ const editData = async (data: any) => {
|
||||||
<template>
|
<template>
|
||||||
<div class="row col-12 no-margin q-pa-sm">
|
<div class="row col-12 no-margin q-pa-sm">
|
||||||
<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-space /> -->
|
<!-- <q-space /> -->
|
||||||
<div v-if="status == false">
|
<div v-if="status == false">
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -478,7 +478,6 @@ const editData = async (data: any) => {
|
||||||
label="ระดับการประเมินพฤติกรรม"
|
label="ระดับการประเมินพฤติกรรม"
|
||||||
:disable="!status"
|
:disable="!status"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template v-slot:tip-1>
|
<template v-slot:tip-1>
|
||||||
<q-tooltip>ต่ำกว่าความคาดหวังมาก (1)</q-tooltip>
|
<q-tooltip>ต่ำกว่าความคาดหวังมาก (1)</q-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,175 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, defineAsyncComponent, watch, onMounted, onUpdated } from "vue";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||||
|
const Header = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const FormSaveResultCommader = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResultCommader.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const $q = useQuasar();
|
||||||
|
const probationStore = useProbationDataStore();
|
||||||
|
const { fecthdataAssign } = probationStore;
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
|
const assignId = ref<string>(route.params.form.toString());
|
||||||
|
const personalId = ref<string>(route.params.personalId.toString());
|
||||||
|
const fullname = ref<string>("");
|
||||||
|
const tab = ref<string>("save1");
|
||||||
|
const dataArrayNumber = ref<number>();
|
||||||
|
const dataRole = ref<string>("mentor");
|
||||||
|
onMounted(async () => {
|
||||||
|
await fecthAssign(assignId.value);
|
||||||
|
});
|
||||||
|
const fecthAssign = async (id: string) => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.formevaluateCommander(id))
|
||||||
|
.then(async (res: any) => {
|
||||||
|
console.log(res);
|
||||||
|
await fecthdataAssign(res.data.data);
|
||||||
|
fullname.value = res.data.data.experimentee
|
||||||
|
? res.data.data.experimentee.name
|
||||||
|
: "";
|
||||||
|
dataArrayNumber.value = 1;
|
||||||
|
})
|
||||||
|
.catch((e: any) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const changeTab = (tabVal: string) => {
|
||||||
|
tab.value = tabVal;
|
||||||
|
dataArrayNumber.value = Number(tabVal.charAt(4));
|
||||||
|
};
|
||||||
|
const downloadFile = (response: any, filename: string) => {
|
||||||
|
const link = document.createElement("a");
|
||||||
|
var fileName = filename;
|
||||||
|
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||||
|
link.setAttribute("download", fileName);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
};
|
||||||
|
const FileDownload = async (type: string) => {
|
||||||
|
let numTab = probationStore.evaluate.find(
|
||||||
|
(e: any) => e.no === dataArrayNumber.value
|
||||||
|
);
|
||||||
|
//ผู้ดูเเล
|
||||||
|
if (dataRole.value == "mentor") {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.reportEvaluateRecord1(type, numTab.id), {
|
||||||
|
responseType: "blob",
|
||||||
|
})
|
||||||
|
.then(async (res) => {
|
||||||
|
downloadFile(
|
||||||
|
res,
|
||||||
|
`แบบบันทึกผล(ผู้บักคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//ผุ้บังคับ
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.reportEvaluateRecord1(type, numTab.id), {
|
||||||
|
responseType: "blob",
|
||||||
|
})
|
||||||
|
.then(async (res) => {
|
||||||
|
downloadFile(
|
||||||
|
res,
|
||||||
|
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const addData = () => {
|
||||||
|
router.push(
|
||||||
|
`/probation/detail/addevaluacommander/${personalId.value}/${assignId.value}`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Header
|
||||||
|
v-if="probationStore.tabs.length > 0"
|
||||||
|
:change-tab="changeTab"
|
||||||
|
:add-data="addData"
|
||||||
|
:loop="probationStore.tabs.length"
|
||||||
|
:FileDownload="FileDownload"
|
||||||
|
/>
|
||||||
|
<q-tab-panels
|
||||||
|
v-model="tab"
|
||||||
|
animated
|
||||||
|
swipeable
|
||||||
|
vertical
|
||||||
|
transition-prev="jump-up"
|
||||||
|
transition-next="jump-up"
|
||||||
|
v-if="probationStore.tabs.length > 0"
|
||||||
|
class="mt"
|
||||||
|
>
|
||||||
|
<q-tab-panel
|
||||||
|
v-for="item in probationStore.evaluate"
|
||||||
|
:name="`save${item.no}`"
|
||||||
|
:key="item.no"
|
||||||
|
>
|
||||||
|
<FormSaveResultCommader
|
||||||
|
:tab="tab"
|
||||||
|
:data="probationStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
|
||||||
|
action="edit"
|
||||||
|
/>
|
||||||
|
</q-tab-panel>
|
||||||
|
|
||||||
|
<!-- <q-page-container>
|
||||||
|
<FormSaveResult
|
||||||
|
:tab="tab"
|
||||||
|
:data="probationStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
|
||||||
|
action="edit"
|
||||||
|
/>
|
||||||
|
</q-page-container> -->
|
||||||
|
</q-tab-panels>
|
||||||
|
|
||||||
|
<div class="q-gutter-md" v-else-if="probationStore.tabs.length == 0">
|
||||||
|
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||||
|
<q-btn
|
||||||
|
outline
|
||||||
|
color="primary"
|
||||||
|
label="สร้างแบบบันทึกผล"
|
||||||
|
@click="addData"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mt {
|
||||||
|
margin-top: 25px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -13,6 +13,12 @@ const TabsTemplate1 = defineAsyncComponent(
|
||||||
"@/modules/05_placement/components/probation/FormEvaluation/Template1.vue"
|
"@/modules/05_placement/components/probation/FormEvaluation/Template1.vue"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
const TabsTemplateCommader = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/Template1Commader.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
const TabsTemplate2 = defineAsyncComponent(
|
const TabsTemplate2 = defineAsyncComponent(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
|
|
@ -126,7 +132,30 @@ const clickBack = () => {
|
||||||
<q-icon size="18px" name="mdi-file-edit" />
|
<q-icon size="18px" name="mdi-file-edit" />
|
||||||
</q-item-section> -->
|
</q-item-section> -->
|
||||||
|
|
||||||
<q-item-section> แบบบันทึกผล </q-item-section>
|
<q-item-section>
|
||||||
|
แบบบันทึกผล
|
||||||
|
<br />
|
||||||
|
<div class="text-caption text-grey-7">(ผู้ดูแล)</div>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item
|
||||||
|
dense
|
||||||
|
class="q-py-sm"
|
||||||
|
active-class="text-primary bg-teal-1 text-weight-medium"
|
||||||
|
clickable
|
||||||
|
v-ripple
|
||||||
|
:active="activeTab == 'tab8'"
|
||||||
|
@click="changeTab('tab8')"
|
||||||
|
>
|
||||||
|
<!-- <q-item-section avatar style="min-width: 40px">
|
||||||
|
<q-icon size="18px" name="mdi-file-edit" />
|
||||||
|
</q-item-section> -->
|
||||||
|
|
||||||
|
<q-item-section>
|
||||||
|
แบบบันทึกผล
|
||||||
|
<br />
|
||||||
|
<div class="text-caption text-grey-7">(ผู้บังคับบัญชา)</div>
|
||||||
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
<q-item
|
<q-item
|
||||||
|
|
@ -223,6 +252,10 @@ const clickBack = () => {
|
||||||
<TabsTemplate1 :activeTab="activeTab" />
|
<TabsTemplate1 :activeTab="activeTab" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
||||||
|
<q-tab-panel name="tab8">
|
||||||
|
<TabsTemplateCommader />
|
||||||
|
</q-tab-panel>
|
||||||
|
|
||||||
<q-tab-panel name="tab3">
|
<q-tab-panel name="tab3">
|
||||||
<TabsTemplate2 />
|
<TabsTemplate2 />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ const FormEvaluateScoreAdd = () =>
|
||||||
import(
|
import(
|
||||||
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue"
|
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue"
|
||||||
);
|
);
|
||||||
|
const FormSaveResultAddCommander = () => import("./components/probation/FormEvaluation/FormSaveResultAddCommander.vue")
|
||||||
|
|
||||||
// คำสั่งช่วยราชการ/ส่งตัวกลับ
|
// คำสั่งช่วยราชการ/ส่งตัวกลับ
|
||||||
const RepatriationOrder = () =>
|
const RepatriationOrder = () =>
|
||||||
|
|
@ -150,6 +151,16 @@ export default [
|
||||||
Role: "placement",
|
Role: "placement",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/probation/detail/addevaluacommander/:id/:form",
|
||||||
|
name: "probationFormAddevaluaCommander",
|
||||||
|
component: FormSaveResultAddCommander,
|
||||||
|
meta: {
|
||||||
|
Auth: true,
|
||||||
|
Key: [6.3],
|
||||||
|
Role: "placement",
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/probation/detail/addevaluascore/:id/:form",
|
path: "/probation/detail/addevaluascore/:id/:form",
|
||||||
name: "probationFormAddevaluascore",
|
name: "probationFormAddevaluascore",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ export const useProbationDataStore = defineStore("probationStore", () => {
|
||||||
const director = ref<any>([])
|
const director = ref<any>([])
|
||||||
|
|
||||||
const fecthdataAssign = async (data: any) => {
|
const fecthdataAssign = async (data: any) => {
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
assign.value = await data.assign
|
assign.value = await data.assign
|
||||||
evaluate.value = await data.evaluate
|
evaluate.value = await data.evaluate
|
||||||
tabs.value = await data.evaluate
|
tabs.value = await data.evaluate
|
||||||
|
|
@ -79,7 +81,7 @@ export const useProbationDataStore = defineStore("probationStore", () => {
|
||||||
label: "ปฏิบัติบัติหน้าที่อย่างตรงไปตรงมาโดยยึดหลักจรรยาบรรณวิชาชีพ",
|
label: "ปฏิบัติบัติหน้าที่อย่างตรงไปตรงมาโดยยึดหลักจรรยาบรรณวิชาชีพ",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fecthdataAssign,
|
fecthdataAssign,
|
||||||
fecthAssignoutput,
|
fecthAssignoutput,
|
||||||
|
|
|
||||||
|
|
@ -246,9 +246,8 @@ const downloadReport = async (
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
unelevated
|
unelevated
|
||||||
icon="mdi-eye"
|
icon="mdi-refresh"
|
||||||
color="primary"
|
color="primary"
|
||||||
label="แสดงรายงาน"
|
|
||||||
@click="conditionDocument('show')"
|
@click="conditionDocument('show')"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -256,7 +255,6 @@ const downloadReport = async (
|
||||||
color="blue"
|
color="blue"
|
||||||
icon="mdi-fullscreen"
|
icon="mdi-fullscreen"
|
||||||
@click="dialog = true"
|
@click="dialog = true"
|
||||||
dense
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue