ปรับ form ทดลองงาน
This commit is contained in:
parent
328dd6e1a3
commit
8e10d6dee9
8 changed files with 632 additions and 485 deletions
|
|
@ -5,6 +5,7 @@ import config from "@/app.config";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
|
||||
|
||||
const Header = defineAsyncComponent(
|
||||
() =>
|
||||
|
|
@ -23,10 +24,12 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const assignStore = useAssignDataStore();
|
||||
const { fecthdataAssign } = assignStore;
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const personalId = ref<string>(route.params.personalId.toString());
|
||||
const fullname = ref<string>("")
|
||||
const fullname = ref<string>("");
|
||||
const tab = ref<string>("save1");
|
||||
const tabs = ref<any>([]);
|
||||
const dataArrayNumber = ref<number>(1);
|
||||
|
|
@ -45,10 +48,11 @@ const fecthAssign = async (id: string) => {
|
|||
showLoader();
|
||||
await http
|
||||
.get(config.API.createformCommader(id))
|
||||
.then((res: any) => {
|
||||
evaluate.value = res.data.data.evaluate;
|
||||
fullname.value = res.data.data.person.name;
|
||||
.then(async (res: any) => {
|
||||
await fecthdataAssign(res.data.data);
|
||||
evaluate.value = assignStore.evaluate;
|
||||
tabs.value = evaluate.value;
|
||||
fullname.value = res.data.data.person.name;
|
||||
dataArrayNumber.value = 1;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
|
|
@ -76,7 +80,10 @@ const FileDownload = async (type: string) => {
|
|||
responseType: "blob",
|
||||
})
|
||||
.then(async (res) => {
|
||||
downloadFile(res, `แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`);
|
||||
downloadFile(
|
||||
res,
|
||||
`แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -101,13 +108,35 @@ const addData = () => {
|
|||
:FileDownload="FileDownload"
|
||||
/>
|
||||
|
||||
<q-page-container v-if="tabs.length > 0">
|
||||
<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 assignStore.evaluate"
|
||||
:name="`save${item.no}`"
|
||||
:key="item.no"
|
||||
>
|
||||
<FormEvaluate
|
||||
:tab="tab"
|
||||
:data="assignStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
|
||||
action="edit"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
<!-- <q-page-container v-if="tabs.length > 0">
|
||||
<FormEvaluate
|
||||
:tab="tab"
|
||||
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
|
||||
action="edit"
|
||||
/>
|
||||
</q-page-container>
|
||||
</q-page-container> -->
|
||||
|
||||
<div v-else class="q-gutter-md">
|
||||
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||
|
|
@ -115,3 +144,8 @@ const addData = () => {
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.mt {
|
||||
margin-top: 25px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue