Merge branch 'nice_dev' into develop
This commit is contained in:
commit
ac73bb0cc0
4 changed files with 81 additions and 57 deletions
|
|
@ -6,7 +6,6 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const personalId = ref<string>(route.params.personalId.toString());
|
||||
|
||||
|
||||
const tabHead = ref<string>("save1");
|
||||
const props = defineProps({
|
||||
|
|
@ -39,7 +38,7 @@ const nextPage = () => {
|
|||
<template>
|
||||
<q-header class="bg-grey-1">
|
||||
<div class="bg-grey-1">
|
||||
|{{tabHead}}|
|
||||
|{{ tabHead }}|
|
||||
<div class="col-12 row q-gutter-x-md items-center">
|
||||
<q-tabs
|
||||
dense
|
||||
|
|
@ -48,35 +47,34 @@ const nextPage = () => {
|
|||
indicator-color="grey-1"
|
||||
class="text-grey-7"
|
||||
>
|
||||
|
||||
<q-tab v-for="i in loop" :name="`save${i}`" :label="`ครั้งที่ ${i}`">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-download"
|
||||
:disable="tabHead !== 'save'+i"
|
||||
:color="tabHead !== 'save'+i ? 'grey' : 'add'"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .PDF</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-tab>
|
||||
<q-tab v-for="i in loop" :name="`save${i}`" :label="`ครั้งที่ ${i}`">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-download"
|
||||
:disable="tabHead !== 'save' + i"
|
||||
:color="tabHead !== 'save' + i ? 'grey' : 'add'"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .PDF</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-tab>
|
||||
|
||||
<!-- <q-tab name="save3" label="ครั้งที่ 3" />
|
||||
<q-btn size="12px" flat dense icon="mdi-download" :disable="tab !== 'save3'"
|
||||
|
|
|
|||
|
|
@ -4,10 +4,16 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
const Header = defineAsyncComponent(
|
||||
() =>import("@/modules/05_placement/components/probation/FormEvaluation/Header.vue")
|
||||
() =>
|
||||
import(
|
||||
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
|
||||
)
|
||||
);
|
||||
const FormSaveResult = defineAsyncComponent(
|
||||
() => import( "@/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue")
|
||||
() =>
|
||||
import(
|
||||
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue"
|
||||
)
|
||||
);
|
||||
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -29,7 +35,7 @@ const activeTab = ref<string>("tab2");
|
|||
|
||||
onMounted(async () => {
|
||||
await fecthAssign(assignId.value);
|
||||
tab.value ='save1'
|
||||
tab.value = "save1";
|
||||
});
|
||||
|
||||
const fecthAssign = async (id: string) => {
|
||||
|
|
@ -51,18 +57,24 @@ const fecthAssign = async (id: string) => {
|
|||
};
|
||||
|
||||
const changeTab = (tabVal: string) => {
|
||||
console.log("tabVal===>",tabVal);
|
||||
console.log("tabVal===>", tabVal);
|
||||
tab.value = tabVal;
|
||||
};
|
||||
const addData = () => {
|
||||
router.push(
|
||||
`/probation/detail/addresult/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
`/probation/detail/addresult/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header :change-tab="changeTab" :activeTab="activeTab" :add-data="addData" :loop="tabs.length"/>
|
||||
<Header
|
||||
:change-tab="changeTab"
|
||||
:activeTab="activeTab"
|
||||
:add-data="addData"
|
||||
:loop="tabs.length"
|
||||
v-if="tabs.length > 0"
|
||||
/>
|
||||
<!-- <q-header class="bg-grey-1">
|
||||
<div class="bg-grey-1">
|
||||
<div class="col-12 row q-gutter-xs-md items-center">
|
||||
|
|
@ -99,21 +111,18 @@ const addData = () => {
|
|||
</q-header> -->
|
||||
<q-page-container>
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<q-tab-panel v-for="tabName in tabs" :key="tabName" :name="'save' + tabName.no">
|
||||
<q-tab-panel
|
||||
v-for="tabName in tabs"
|
||||
:key="tabName"
|
||||
:name="'save' + tabName.no"
|
||||
>
|
||||
<FormSaveResult :tab="tab" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-page-container>
|
||||
|
||||
<!-- <q-page-container>
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<q-tab-panel name="save1">
|
||||
<FormSaveResult :tab="tab" />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="save2">
|
||||
<FormSaveResult :tab="tab" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-page-container> -->
|
||||
<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 outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ const fecthAssign = async (id: string) => {
|
|||
await http
|
||||
.get(config.API.evaluateCreate(id))
|
||||
.then((res: any) => {
|
||||
if (res.data.data.evaluate_no > 2) {
|
||||
if (res.data.data.evaluate_no > 0) {
|
||||
tabs.value = res.data.data.evaluate;
|
||||
} else tabs.value.push({ no: 1 }, { no: 2 });
|
||||
}
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
|
|
@ -56,7 +56,9 @@ const fecthAssign = async (id: string) => {
|
|||
});
|
||||
};
|
||||
const addData = () => {
|
||||
router.push(`/probation/detail/addevalua/${personalId.value}/${assignId.value}`);
|
||||
router.push(
|
||||
`/probation/detail/addevalua/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -66,6 +68,7 @@ const addData = () => {
|
|||
:activeTab="activeTab"
|
||||
:loop="tabs.length"
|
||||
:add-data="addData"
|
||||
v-if="tabs.length > 0"
|
||||
/>
|
||||
|
||||
<!-- <q-page-container>
|
||||
|
|
@ -90,4 +93,10 @@ const addData = () => {
|
|||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-page-container>
|
||||
|
||||
<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 outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ const fecthAssign = async (id: string) => {
|
|||
await http
|
||||
.get(config.API.evaluateChairman(id))
|
||||
.then((res: any) => {
|
||||
if (res.data.data.evaluate_no > 2) {
|
||||
if (res.data.data.evaluate_no > 0 {
|
||||
tabs.value = res.data.data.evaluate;
|
||||
} else tabs.value.push({ no: 1 }, { no: 2 });
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -51,7 +51,9 @@ const fecthAssign = async (id: string) => {
|
|||
});
|
||||
};
|
||||
const addData = () => {
|
||||
router.push(`/probation/detail/addevaluascore/${personalId.value}/${assignId.value}`);
|
||||
router.push(
|
||||
`/probation/detail/addevaluascore/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
};
|
||||
const changeTab = (tabVal: string) => {
|
||||
tab.value = tabVal;
|
||||
|
|
@ -64,6 +66,7 @@ const changeTab = (tabVal: string) => {
|
|||
:activeTab="activeTab"
|
||||
:loop="tabs.length"
|
||||
:add-data="addData"
|
||||
v-if="tabs.length > 0"
|
||||
/>
|
||||
|
||||
<!-- <q-page-container>
|
||||
|
|
@ -88,4 +91,9 @@ const changeTab = (tabVal: string) => {
|
|||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-page-container>
|
||||
<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 outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue