Merge branch 'nice_dev' into develop
This commit is contained in:
commit
168b17da44
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}`,
|
||||
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}`,
|
||||
|
||||
// บันทึกผล (ผู้บังคับบัญชา)
|
||||
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}`,
|
||||
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 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 routeName = router.currentRoute.value.name;
|
||||
|
|
@ -382,7 +382,7 @@ const editData = async (data: any) => {
|
|||
<template>
|
||||
<div class="row col-12 no-margin q-pa-sm">
|
||||
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
||||
<div>แบบบันทึกผล</div>
|
||||
<div>แบบบันทึกผล (ผู้ดูเเล)</div>
|
||||
<!-- <q-space /> -->
|
||||
<div v-if="status == false">
|
||||
<q-btn
|
||||
|
|
@ -478,7 +478,6 @@ const editData = async (data: any) => {
|
|||
label="ระดับการประเมินพฤติกรรม"
|
||||
:disable="!status"
|
||||
>
|
||||
|
||||
<template v-slot:tip-1>
|
||||
<q-tooltip>ต่ำกว่าความคาดหวังมาก (1)</q-tooltip>
|
||||
</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"
|
||||
)
|
||||
);
|
||||
const TabsTemplateCommader = defineAsyncComponent(
|
||||
() =>
|
||||
import(
|
||||
"@/modules/05_placement/components/probation/FormEvaluation/Template1Commader.vue"
|
||||
)
|
||||
);
|
||||
const TabsTemplate2 = defineAsyncComponent(
|
||||
() =>
|
||||
import(
|
||||
|
|
@ -126,7 +132,30 @@ const clickBack = () => {
|
|||
<q-icon size="18px" name="mdi-file-edit" />
|
||||
</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
|
||||
|
|
@ -223,6 +252,10 @@ const clickBack = () => {
|
|||
<TabsTemplate1 :activeTab="activeTab" />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="tab8">
|
||||
<TabsTemplateCommader />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="tab3">
|
||||
<TabsTemplate2 />
|
||||
</q-tab-panel>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ const FormEvaluateScoreAdd = () =>
|
|||
import(
|
||||
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue"
|
||||
);
|
||||
const FormSaveResultAddCommander = () => import("./components/probation/FormEvaluation/FormSaveResultAddCommander.vue")
|
||||
|
||||
// คำสั่งช่วยราชการ/ส่งตัวกลับ
|
||||
const RepatriationOrder = () =>
|
||||
|
|
@ -150,6 +151,16 @@ export default [
|
|||
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",
|
||||
name: "probationFormAddevaluascore",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ export const useProbationDataStore = defineStore("probationStore", () => {
|
|||
const director = ref<any>([])
|
||||
|
||||
const fecthdataAssign = async (data: any) => {
|
||||
console.log(data);
|
||||
|
||||
assign.value = await data.assign
|
||||
evaluate.value = await data.evaluate
|
||||
tabs.value = await data.evaluate
|
||||
|
|
@ -79,7 +81,7 @@ export const useProbationDataStore = defineStore("probationStore", () => {
|
|||
label: "ปฏิบัติบัติหน้าที่อย่างตรงไปตรงมาโดยยึดหลักจรรยาบรรณวิชาชีพ",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
return {
|
||||
fecthdataAssign,
|
||||
fecthAssignoutput,
|
||||
|
|
|
|||
|
|
@ -246,9 +246,8 @@ const downloadReport = async (
|
|||
</q-btn>
|
||||
<q-btn
|
||||
unelevated
|
||||
icon="mdi-eye"
|
||||
icon="mdi-refresh"
|
||||
color="primary"
|
||||
label="แสดงรายงาน"
|
||||
@click="conditionDocument('show')"
|
||||
/>
|
||||
<q-btn
|
||||
|
|
@ -256,7 +255,6 @@ const downloadReport = async (
|
|||
color="blue"
|
||||
icon="mdi-fullscreen"
|
||||
@click="dialog = true"
|
||||
dense
|
||||
/>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue