Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-01-29 11:22:17 +07:00
commit 374e43032a
5 changed files with 153 additions and 48 deletions

View file

@ -2,6 +2,10 @@
import { ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
const DataStore = useProbationDataStore();
const tabHead = ref<string>("save1");
const route = useRoute();
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
@ -71,6 +75,7 @@ function nextPage() {
<div class="row col-12 items-center">
<div class="q-mr-sm">ครงท {{ i }}</div>
<q-btn
v-if="DataStore.mainTab !== 'tab6'"
size="12px"
flat
dense

View file

@ -21,28 +21,14 @@ const FormReport = defineAsyncComponent(
)
);
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 { messageError, showLoader, hideLoader } = useCounterMixin();
const tab = ref<string>("save1");
const tabs = ref<any[]>([]);
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>("");
@ -137,22 +123,11 @@ onMounted(() => {
</q-tab-panel>
</q-tab-panels>
<!-- <div class="q-gutter-md" v-if="tabs.length === 0">
<div class="q-gutter-md" v-else>
<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 />
</div> -->
</div>
</template>
<style lang="scss" scoped>

View file

@ -0,0 +1,95 @@
<script setup lang="ts">
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";
const $q = useQuasar();
const route = useRoute();
const { messageError, showLoader, hideLoader } = useCounterMixin();
const Header = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
)
);
const SummaryScore = defineAsyncComponent(
() => import("@/modules/05_placement/components/probation/SummaryScore.vue")
);
const assignId = ref<string>(route.params.form.toString());
const tab = ref<string>("save1");
const tabs = ref<any[]>([]);
const dataArrayNumber = ref<number>(1);
const changeTab = (tabVal: string) => {
tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4));
};
/**
* @param id assignId
*/
async function fecthAssign(id: string) {
showLoader();
await http
.get(config.API.evaluateReportcreate(id))
.then((res) => {
tabs.value = res.data.result.result.map((e: any, index: number) => {
return { no: index + 1, ...e };
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
onMounted(() => {
fecthAssign(assignId.value);
});
</script>
<template>
<Header
v-if="tabs.length > 0"
:change-tab="changeTab"
:add-data="() => {}"
:loop="tabs.length"
:FileDownload="() => {}"
:checkPermission="false"
/>
<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">
<SummaryScore :tab="tab" />
</q-tab-panel>
</q-tab-panels>
<div class="q-gutter-md" v-else>
<div class="flex justify-center items-center q-my-md q-gutter-md">
งไมไดบการแบบประเมนผล
</div>
</div>
</template>
<style lang="scss" scoped>
.mt {
margin-top: 25px;
}
</style>

View file

@ -45,22 +45,17 @@ const TabsTemplate3 = defineAsyncComponent(
)
);
const SummaryScore = defineAsyncComponent(
() => import("@/modules/05_placement/components/probation/SummaryScore.vue")
const TabsTemplateSummaryScore = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue"
)
);
const $q = useQuasar();
const mixin = useCounterMixin();
const {
date2Thai,
dateToISO,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const { messageError } = mixin;
const router = useRouter();
const route = useRoute();
@ -288,7 +283,8 @@ onMounted(async () => {
</q-tab-panel>
<q-tab-panel name="tab6">
<SummaryScore />
<!-- <SummaryScore /> -->
<TabsTemplateSummaryScore />
</q-tab-panel>
</q-tab-panels>
</q-layout>

View file

@ -13,6 +13,10 @@ const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
const assignId = ref<string>(route.params.form.toString());
const status = ref<boolean>(false);
const props = defineProps({
tab: { type: String, require: true },
});
const develop_orientation_score = ref<number>();
const develop_self_learning_score = ref<number>();
const develop_training_seminar_score = ref<number>();
@ -54,8 +58,13 @@ const result_option = reactive([
/** get คะแนน */
async function getReportScore() {
showLoader();
const noNumber = props?.tab ? Number(props?.tab.charAt(4)) : "";
await http
.get(config.API.summaryReportDetail(assignId.value))
.get(
config.API.summaryReportDetail(assignId.value) +
`&evaluate_no=${noNumber}`
)
.then((res) => {
const data = res.data.result;
develop_orientation_score.value = data.develop_orientation_score;
@ -138,15 +147,24 @@ onMounted(() => {
</q-item-label>
</q-item-section>
<q-item-section side v-if="achievement_result == 1">
<q-item-section
side
v-if="achievement_result == 1"
style="white-space: nowrap; width: 140px"
>
าน (งกวารอยละ 60)
</q-item-section>
<q-item-section side v-else>
<q-item-section
side
v-else
style="white-space: nowrap; width: 140px"
>
ไมาน (ำกวารอยละ 60)
</q-item-section>
</q-item>
</q-list>
</q-card>
<q-card class="text-top0 col-12">
<q-list dense>
<q-item dense tag="label" v-ripple>
@ -171,10 +189,18 @@ onMounted(() => {
</q-item-label>
</q-item-section>
<q-item-section side v-if="behavior_result == 1">
<q-item-section
style="white-space: nowrap; width: 140px"
side
v-if="behavior_result == 1"
>
าน (งกวารอยละ 60)
</q-item-section>
<q-item-section side v-else>
<q-item-section
style="white-space: nowrap; width: 140px"
side
v-else
>
ไมาน (ำกวารอยละ 60)
</q-item-section>
</q-item>
@ -204,10 +230,18 @@ onMounted(() => {
</q-item-label>
</q-item-section>
<q-item-section side v-if="pass_result == 1">
<q-item-section
side
v-if="pass_result == 1"
style="white-space: nowrap; width: 140px"
>
าน (งกวารอยละ 60)
</q-item-section>
<q-item-section side v-else>
<q-item-section
side
v-else
style="white-space: nowrap; width: 140px"
>
ไมาน (ำกวารอยละ 60)
</q-item-section>
</q-item>