From 7aa2782a869fcb93154382c0b9e0d681b98c6016 Mon Sep 17 00:00:00 2001
From: setthawutttty
Date: Tue, 7 Nov 2023 17:28:47 +0700
Subject: [PATCH] form
---
src/modules/05_leave/componenst/Form.vue | 153 +++---------------
.../05_leave/componenst/Forms/01_SickForm.vue | 6 +-
src/modules/05_leave/store.ts | 52 +++++-
src/modules/05_leave/views/AddPage.vue | 75 +++------
4 files changed, 96 insertions(+), 190 deletions(-)
diff --git a/src/modules/05_leave/componenst/Form.vue b/src/modules/05_leave/componenst/Form.vue
index 7e153f1..d4a05ab 100644
--- a/src/modules/05_leave/componenst/Form.vue
+++ b/src/modules/05_leave/componenst/Form.vue
@@ -1,22 +1,21 @@
@@ -57,7 +46,7 @@ const props = defineProps({
borderless
:enableTimePicker="false"
week-start="0"
- :readonly="routeName != 'addAbsence'"
+ readonly
>
{{ year + 543 }}
@@ -70,7 +59,7 @@ const props = defineProps({
outlined
dense
hide-bottom-space
- :readonly="routeName != 'addAbsence'"
+ readonly
class="full-width datepicker"
:model-value="
formData.dateStart != null ? date2Thai(formData.dateStart) : null
@@ -94,7 +83,7 @@ const props = defineProps({
dense
outlined
readonly
- v-model="formData.subject"
+ v-model="dataStore.typeLeave"
label="เรื่อง"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ file.fileName }}
-
-
-
-
-
-
-
-
-
-
diff --git a/src/modules/05_leave/componenst/Forms/01_SickForm.vue b/src/modules/05_leave/componenst/Forms/01_SickForm.vue
index 95627ea..382a2d6 100644
--- a/src/modules/05_leave/componenst/Forms/01_SickForm.vue
+++ b/src/modules/05_leave/componenst/Forms/01_SickForm.vue
@@ -32,8 +32,7 @@ const props = defineProps({
(อาจดึงมาจากที่อยู่ปัจจุบันโดยอัตโนมัติ แต่ให้ผู้ใช้งานแก้ไขได้)
-->
-
+
diff --git a/src/modules/05_leave/store.ts b/src/modules/05_leave/store.ts
index b53cfac..379bcaa 100644
--- a/src/modules/05_leave/store.ts
+++ b/src/modules/05_leave/store.ts
@@ -5,6 +5,7 @@ import type { FormLeavetMainData, OptionData, formListLeaveData } from "@/module
import { useCounterMixin } from "@/stores/mixin"
export const useLeaveStore = defineStore("Leave", () => {
+ const typeLeave = ref('')
const mixin = useCounterMixin()
const { date2Thai } = mixin
const LeaveType = ref("0")
@@ -244,6 +245,53 @@ export const useLeaveStore = defineStore("Leave", () => {
style: "font-size: 14px; width:10%;",
},
])
+ function typeConvert(item: string,subitem:any) {
+ console.log('first',item)
+ if (item !== '5' && item !== '7') {
+ typeLeave.value = convertSubtitle(item);
+ }else if(item === '5'){
+ typeLeave.value = convertSubtitleInfo(subitem);
+
+ }else if(item === '7'){
+ typeLeave.value = convertSubtitleInfo2(subitem);
+ }
+ }
+
+ function convertSubtitle(val: string) {
+ if (val) {
+ switch (val) {
+ case "0": return "ลาป่วย";
+ case "1": return "ลากิจส่วนตัว";
+ case "2": return "ลาคลอดบุตร";
+ case "3": return "ลาไปช่วยเหลือภริยาที่คลอดบุตร";
+ case "4": return "ลาพักผ่อน";
+ case "5": return "ลาอุปสมบทหรือลาประกอบพิธีฮัจย์ฯ";
+ case "6": return "ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล";
+ case "7": return "ลาไปศึกษา";
+ case "8": return "ลาไปปฎิบัติงานในองค์การระหว่างประเทศ";
+ case "9": return "ลาติดตามคู่สมรส";
+ case "10": return "ลาไปฟื้นฟูสมรรถภาพด้านอาชีพ";
+ }
+ }
+ }
+ function convertSubtitleInfo(val: string) {
+ if (val) {
+ switch (val) {
+ case "0": return "ลาอุปสมบท";
+ case "1": return "ลาประกอบพิธีฮัจย์";
+ }
+ }
+ }
+ function convertSubtitleInfo2(val: string) {
+ if (val) {
+ switch (val) {
+ case "0": return "ลาไปศึกษา";
+ case "1": return "ฝึกอบรม";
+ case "2": return "ปฎิบัติการวิจัย";
+ case "3": return "ดูงาน";
+ }
+ }
+ }
return {
typeOptions,
@@ -264,6 +312,8 @@ export const useLeaveStore = defineStore("Leave", () => {
fiscalyearOP,
fiscalYearyear,
options,
- optionsOrdination
+ optionsOrdination,
+ typeConvert,
+ typeLeave
}
})
diff --git a/src/modules/05_leave/views/AddPage.vue b/src/modules/05_leave/views/AddPage.vue
index 06702f5..acf7f44 100644
--- a/src/modules/05_leave/views/AddPage.vue
+++ b/src/modules/05_leave/views/AddPage.vue
@@ -1,15 +1,15 @@