ลบตัวอย่างฟอร์มลา แก้ไข label ฟอร์มลา

This commit is contained in:
Warunee Tamkoo 2023-11-21 11:53:50 +07:00
parent b536f4a3c1
commit 0705eff57c
4 changed files with 32 additions and 108 deletions

View file

@ -1,40 +1,29 @@
/**
* Router leave
*/
const leave = () => import("@/modules/05_leave/views/Main.vue")
const leave = () => import("@/modules/05_leave/views/Main.vue");
const addAbsence = () => import("@/modules/05_leave/views/AddPage.vue")
const samplePage = () => import("@/modules/05_leave/views/SampleForm.vue")
const addAbsence = () => import("@/modules/05_leave/views/AddPage.vue");
/* const Checkout = () => import("@/modules/04_checkin/views/Checkout.vue");
*/
export default [
{
path: "/leave",
name: "leave",
component: leave,
meta: {
Auth: true,
Key: [7],
},
},
{
path: "/leave/add",
name: "addAbsence",
component: addAbsence,
meta: {
Auth: true,
Key: [7],
},
},
{
path: "/leave/sample",
name: "sample-page",
component: samplePage,
meta: {
Auth: true,
Key: [7],
},
},
]
{
path: "/leave",
name: "leave",
component: leave,
meta: {
Auth: true,
Key: [7],
},
},
{
path: "/leave/add",
name: "addAbsence",
component: addAbsence,
meta: {
Auth: true,
Key: [7],
},
},
];

View file

@ -165,10 +165,10 @@ export const useLeaveStore = defineStore("Leave", () => {
}
const optionsSpecific = ref([
{ id: '0', name: "ลาไปศึกษา" },
{ id: '1', name: "ฝึกอบรม" },
{ id: '2', name: "ปฎิบัติการวิจัย" },
{ id: '3', name: "ดูงาน" },
{ id: 's0', name: "ลาไปศึกษาต่อ" },
{ id: 's1', name: "ลาฝึกอบรม" },
{ id: 's2', name: "ลาปฎิบัติการวิจัย" },
{ id: 's3', name: "ลาดูงาน" },
]);
const optionsOrdination = ref([
{ id: '0', name: "ลาอุปสมบท" },
@ -268,7 +268,7 @@ export const useLeaveStore = defineStore("Leave", () => {
case "4": return "ลาพักผ่อน";
case "5": return "ลาอุปสมบทหรือลาประกอบพิธีฮัจย์ฯ";
case "6": return "ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล";
case "7": return "ลาไปศึกษา";
case "7": return "ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน";
case "8": return "ลาไปปฎิบัติงานในองค์การระหว่างประเทศ";
case "9": return "ลาติดตามคู่สมรส";
case "10": return "ลาไปฟื้นฟูสมรรถภาพด้านอาชีพ";
@ -286,10 +286,10 @@ export const useLeaveStore = defineStore("Leave", () => {
function convertSubtitleInfo2(val: string) {
if (val) {
switch (val) {
case "0": return "ลาไปศึกษา";
case "1": return "ฝึกอบรม";
case "2": return "ปฎิบัติการวิจัย";
case "3": return "ดูงาน";
case "s0": return "ลาไปศึกษาต่อ";
case "s1": return "ลาฝึกอบรม";
case "s2": return "ลาปฎิบัติการวิจัย";
case "s3": return "ลาดูงาน";
}
}
}

View file

@ -133,8 +133,8 @@ const onSubmit = async () => {
<Form6 :on-submit="onSubmit" v-if="model === '5' && modelSpecific === '0'" />
<Form7 :on-submit="onSubmit" v-if="model === '5' && modelSpecific === '1'" />
<Form8 :on-submit="onSubmit" v-if="model === '6'" style="width: 100%" />
<Form9 :on-submit="onSubmit" v-if="model === '7' && modelSpecific === '0'" style="width: 100%" />
<Form10 :on-submit="onSubmit" v-if="model === '7' && modelSpecific != '0' && modelSpecific != ''" />
<Form9 :on-submit="onSubmit" v-if="model === '7' && modelSpecific === 's0'" style="width: 100%" />
<Form10 :on-submit="onSubmit" v-if="model === '7' && modelSpecific != 's0' && modelSpecific != ''" />
<Form11 :on-submit="onSubmit" v-if="model === '8'" />
<Form12 :on-submit="onSubmit" v-if="model === '9'" />
<Form13 :on-submit="onSubmit" v-if="model === '10'" />

View file

@ -1,65 +0,0 @@
<script setup lang="ts">
import { reactive, ref, watch } from "vue"
import SickForm from "@/modules/05_leave/componenst/Forms/01_SickForm.vue"
import HelpWifeBirthForm from "@/modules/05_leave/componenst/Forms/04_HelpWifeBirthForm.vue"
import VacationForm from "@/modules/05_leave/componenst/Forms/05_VacationForm.vue"
import FollowSpouseForm from "@/modules/05_leave/componenst/Forms/12_FollowSpouseForm.vue"
import WorkInternationalForm from "@/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue"
const type = ref<number>(0)
const typeOption = reactive([
{ id: 0, name: "" },
{ id: 1, name: "ลาป่วย" },
{ id: 2, name: "ลากิจ" },
{ id: 3, name: "ลาคลอด" },
{ id: 4, name: "ลาไปช่วยเหลือภริยาที่คลอดบุตร" },
{ id: 5, name: "ลาพักผ่อน" },
{ id: 6, name: "ลาติดตามคู่สมรส" },
{ id: 7, name: "ลาไปปฏิบัติงานในองค์การระหว่างประเทศ" },
])
async function onSubmit() {
console.log("testOnsub")
}
watch(
() => type.value,
() => {
// save store
console.log("ประเภทการลา===>", type.value)
}
)
</script>
<template>
<div class="col-12 row justify-center">
<div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center">
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" />
<div>นใบลา</div>
</div>
<q-card bordered>
<form>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12">
<q-select filled v-model="type" :options="typeOption" label="ประเภทการลา" option-value="id" option-label="name" map-options emit-value />
<SickForm v-if="type == 1 || type == 2 || type == 3" />
<HelpWifeBirthForm v-if="type == 4" />
<VacationForm v-if="type == 5" />
<FollowSpouseForm v-if="type == 6" />
<WorkInternationalForm v-if="type == 7" />
</div>
</div>
<q-separator />
<div class="row col-12 q-pa-md">
<q-space />
<q-btn id="submitForm" unelevated dense class="q-px-md items-center btnBlue" label="บันทึก" @click="onSubmit" />
</div>
</form>
</q-card>
</div>
</div>
</template>