ปรับฟอร์มการลา

This commit is contained in:
Warunee Tamkoo 2023-11-09 16:00:55 +07:00
parent e850f4fd8a
commit ca4c3565bd
7 changed files with 431 additions and 391 deletions

View file

@ -1,294 +1,347 @@
<script setup lang="ts">
import { ref, reactive, watch } from "vue"
import type { FormData, FormRef } from "@/modules/05_leave/interface/request/SickForm"
import { useCounterMixin } from "@/stores/mixin"
import { ref, reactive, watch } from "vue";
import type {
FormData,
FormRef,
} from "@/modules/05_leave/interface/request/SickForm";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin()
const { date2Thai } = mixin
const edit = ref<boolean>(true)
const halfDay = ref<string>("day")
const mixin = useCounterMixin();
const { date2Thai } = mixin;
const edit = ref<boolean>(true);
const halfDay = ref<string>("day");
/** รับ props มาจากหน้าหลัก */
const props = defineProps({
data: {
type: Object,
default: null,
},
onSubmit: {
type: Function,
default: () => "",
},
})
// form
data: {
type: Object,
default: null,
},
onSubmit: {
type: Function,
default: () => "",
},
});
/** ข้อมูล v-model ของฟอร์ม */
const formData = reactive<FormData>({
leaveNo: "",
startLeaveDate: null,
endLeaveDate: null,
contractTel: "",
leaveTotal: "",
leaveContactTel: "",
leaveContactLocation: "",
leaveDetail: "",
file: [],
})
leaveNo: "",
startLeaveDate: null,
endLeaveDate: null,
contractTel: "",
leaveTotal: "",
leaveContactTel: "",
leaveContactLocation: "",
leaveDetail: "",
file: [],
});
const leaveNoRef = ref<object | null>(null)
const startLeaveDateRef = ref<object | null>(null)
const endLeaveDateRef = ref<object | null>(null)
const contractTelRef = ref<object | null>(null)
const leaveTotalRef = ref<object | null>(null)
const leaveContactTelRef = ref<object | null>(null)
const leaveContactLocationRef = ref<object | null>(null)
const leaveDetailRef = ref<object | null>(null)
const fileRef = ref<object | null>(null)
/** ตัวแปร ref สำหรับแสดง validate */
const leaveNoRef = ref<object | null>(null);
const startLeaveDateRef = ref<object | null>(null);
const endLeaveDateRef = ref<object | null>(null);
const contractTelRef = ref<object | null>(null);
const leaveTotalRef = ref<object | null>(null);
const leaveContactTelRef = ref<object | null>(null);
const leaveContactLocationRef = ref<object | null>(null);
const leaveDetailRef = ref<object | null>(null);
const fileRef = ref<object | null>(null);
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const FormRef: FormRef = {
leaveNo: leaveNoRef,
startLeaveDate: startLeaveDateRef,
endLeaveDate: endLeaveDateRef,
contractTel: contractTelRef,
leaveTotal: leaveTotalRef,
leaveContactTel: leaveContactTelRef,
leaveContactLocation: leaveContactLocationRef,
leaveDetail: leaveDetailRef,
file: fileRef,
}
leaveNo: leaveNoRef,
startLeaveDate: startLeaveDateRef,
endLeaveDate: endLeaveDateRef,
contractTel: contractTelRef,
leaveTotal: leaveTotalRef,
leaveContactTel: leaveContactTelRef,
leaveContactLocation: leaveContactLocationRef,
leaveDetail: leaveDetailRef,
file: fileRef,
};
/** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */
watch(props.data, async () => {
// console.log("data==>", props.data)
formData.leaveNo = props.data.leaveNo
formData.startLeaveDate = props.data.startLeaveDate
formData.endLeaveDate = props.data.endLeaveDate
formData.contractTel = props.data.contractTel
formData.leaveTotal = props.data.leaveTotal
formData.leaveContactTel = props.data.leaveContactTel
formData.leaveDetail = props.data.leaveDetail
formData.file = props.data.file
})
const fileDocDataUpload = ref<File[]>([])
// console.log("data==>", props.data)
formData.leaveNo = props.data.leaveNo;
formData.startLeaveDate = props.data.startLeaveDate;
formData.endLeaveDate = props.data.endLeaveDate;
formData.contractTel = props.data.contractTel;
formData.leaveTotal = props.data.leaveTotal;
formData.leaveContactTel = props.data.leaveContactTel;
formData.leaveDetail = props.data.leaveDetail;
formData.file = props.data.file;
});
const fileUploadDoc = async (files: any) => {
files.forEach((file: any) => {
fileDocDataUpload.value.push(file)
})
/** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */
const fileDocDataUpload = ref<File[]>([]);
async function fileUploadDoc(files: any) {
files.forEach((file: any) => {
fileDocDataUpload.value.push(file);
});
}
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
function onValidate() {
const hasError = []
for (const key in FormRef) {
if (Object.prototype.hasOwnProperty.call(FormRef, key)) {
const property = FormRef[key]
if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate()
hasError.push(isValid)
}
}
}
if (hasError.every(result => result === true)) {
props.onSubmit()
}
const hasError = [];
for (const key in FormRef) {
if (Object.prototype.hasOwnProperty.call(FormRef, key)) {
const property = FormRef[key];
if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate();
hasError.push(isValid);
}
}
}
if (hasError.every((result) => result === true)) {
props.onSubmit();
}
}
</script>
<!-- ฟอรมลาปวย ลาคลอดบตร และลากจสวนต -->
<template>
<form @submit.prevent.stop="onValidate">
<div>
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<!-- ลาปวย ลาคลอดบตร และลากจสวนต
<ul>
<li>เขยนท</li>
<li>ลาตงแตนท</li>
<li>ลาถงวนท</li>
<li>จำนวนวนทลา (frontend คำนวนให Auto)</li>
<li>วเลอกใหลาครงวนเช หรอครงวนบายได</li>
<li>ลาครงสดทายในประเภทน เมอวนท (Auto)</li>
<li>อยดตอไดระหวางลา</li>
<li>รายละเอยด (ไมงคบกรอก)</li>
<li>เอกสารประกอบ</li>
</ul>
<p>
*หมายเหต (กรณลาปวยและลาก สามารถเลอกใหลาครงวนเช
หรอครงวนบายได) อยดตอไดระหวางลา
(อาจดงมาจากทอยจจนโดยอตโนม แตใหใชงานแกไขได)
</p> -->
<form @submit.prevent.stop="onValidate">
<div>
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12">
<q-card bordered class="q-pa-md bg-grey-1">
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-input
class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[(val) => !!val || `${'เขียนที่'}`]"
/>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12">
<q-card bordered class="q-pa-md bg-grey-1">
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-input
class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[val => !!val || `${'เขียนที่'}`]"
/>
<div class="col-md-4 col-sm-12">
<q-radio v-model="halfDay" val="day" label="ลาทั้งวัน" />
<q-radio
v-model="halfDay"
val="half_day_morning"
label="ลาครึ่งวันเช้า"
/>
<q-radio
v-model="halfDay"
val="half_day_afternoon"
label="ลาครึ่งวันบ่าย"
/>
</div>
<div class="col-md-4 col-sm-12">
<q-radio v-model="halfDay" val="day" label="ลาทั้งวัน" />
<q-radio v-model="halfDay" val="half_day_morning" label="ลาครึ่งวันเช้า" />
<q-radio v-model="halfDay" val="half_day_afternoon" label="ลาครึ่งวันบ่าย" />
</div>
<datepicker
class="col-md-3 col-sm-12"
menu-class-name="modalfix"
v-model="formData.startLeaveDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:readonly="!edit"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
ref="startLeaveDateRef"
for="startLeaveDateRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="
formData.startLeaveDate != null
? date2Thai(formData.startLeaveDate)
: null
"
:label="`${'ลาตั้งแต่วันที่'}`"
:rules="[
(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`,
]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
class="col-md-3 col-sm-12"
menu-class-name="modalfix"
v-model="formData.startLeaveDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:readonly="!edit"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
ref="startLeaveDateRef"
for="startLeaveDateRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null"
:label="`${'ลาตั้งแต่วันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
class="col-md-3 col-sm-12"
menu-class-name="modalfix"
v-model="formData.endLeaveDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:readonly="!edit"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
ref="endLeaveDateRef"
for="endLeaveDateRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="
formData.endLeaveDate != null
? date2Thai(formData.endLeaveDate)
: null
"
:label="`${'ลาถึงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-input
class="col-md-2 col-sm-12"
dense
outlined
ref="leaveTotalRef"
for="leaveTotalRef"
type="number"
v-model="formData.leaveTotal"
label="จำนวนวันที่ลา"
readonly
:rules="[(val) => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/>
<datepicker
class="col-md-3 col-sm-12"
menu-class-name="modalfix"
v-model="formData.endLeaveDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:readonly="!edit"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
ref="endLeaveDateRef"
for="endLeaveDateRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.endLeaveDate != null ? date2Thai(formData.endLeaveDate) : null"
:label="`${'ลาถึงวันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-input
class="col-md-2 col-sm-12"
dense
outlined
ref="leaveTotalRef"
for="leaveTotalRef"
type="number"
v-model="formData.leaveTotal"
label="จำนวนวันที่ลา"
readonly
:rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/>
<q-input
class="col-3"
dense
outlined
ref="leaveContactTelRef"
for="leaveContactTelRef"
v-model="formData.leaveContactTel"
mask="(###)-###-####"
unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit"
:rules="[
(val) => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`,
]"
/>
<q-input
class="col-3"
dense
outlined
ref="leaveContactTelRef"
for="leaveContactTelRef"
v-model="formData.leaveContactTel"
mask="(###)-###-####"
unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit"
:rules="[val => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`]"
/>
<q-input
class="col-md-9 col-sm-12"
dense
outlined
ref="leaveContactLocationRef"
for="leaveContactLocationRef"
v-model="formData.leaveContactLocation"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit"
:rules="[
(val) =>
!!val || `${'กรุณากรอกที่อยู่ที่ติดต่อได้ระหว่างลา'}`,
]"
/>
<q-input
class="col-md-9 col-sm-12"
dense
outlined
ref="leaveContactLocationRef"
for="leaveContactLocationRef"
v-model="formData.leaveContactLocation"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit"
:rules="[val => !!val || `${'กรุณากรอกที่อยู่ที่ติดต่อได้ระหว่างลา'}`]"
/>
<q-input
type="textarea"
class="col-md-12 col-sm-12"
dense
outlined
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formData.leaveDetail"
label="รายละเอียด"
:readonly="!edit"
/>
<q-input
type="textarea"
class="col-md-12 col-sm-12"
dense
outlined
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formData.leaveDetail"
label="รายละเอียด"
:readonly="!edit"
/>
<q-file
v-model="formData.file"
@added="fileUploadDoc"
dense
label="เอกสารประกอบ"
outlined
use-chips
multiple
class="q-pl-sm col-12"
>
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
<q-file v-model="formData.file" @added="fileUploadDoc" dense label="เอกสารประกอบ" outlined use-chips multiple class="q-pl-sm col-12">
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
<div class="col-12 row" v-if="!edit">
<div
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
>
<div class="q-pl-sm text-weight-bold text-dark">
เอกสารเพมเต
</div>
</div>
<q-card bordered flat class="full-width">
<q-list separator>
<q-item
v-for="(file, index) in formData.file"
:key="index"
class="q-my-xs"
>
<q-item-section>
<q-item-label class="full-width ellipsis">
{{ file.name }}
</q-item-label>
<q-item-label caption> </q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</div>
</q-card>
</div>
</div>
</div>
<div class="col-12 row" v-if="!edit">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">เอกสารเพมเต</div>
</div>
<q-card bordered flat class="full-width">
<q-list separator>
<q-item v-for="(file, index) in formData.file" :key="index" class="q-my-xs">
<q-item-section>
<q-item-label class="full-width ellipsis">
{{ file.name }}
</q-item-label>
<q-item-label caption> </q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</div>
</q-card>
</div>
</div>
</div>
<q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md">
<q-space />
<q-btn id="onSubmit" type="submit" unelevated dense class="q-px-md items-center btnBlue" label="บันทึก" />
</div>
</form>
<q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md">
<q-space />
<q-btn
id="onSubmit"
type="submit"
unelevated
dense
class="q-px-md items-center btnBlue"
label="บันทึก"
/>
</div>
</form>
</template>

View file

@ -5,7 +5,7 @@ import type { FormRef09 } from "@/modules/05_leave/interface/request/AddAbsence"
import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, dialogConfirm ,arabicNumberToText} = mixin;
const { date2Thai, dialogConfirm ,arabicNumberToText, calculateDurationYmd} = mixin;
const edit = ref<boolean>(true);
const props = defineProps({
data: {
@ -96,23 +96,7 @@ function onSubmit() {
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
);
}
function calculateDuration(startDate: string | null, endDate: string | null) {
if (startDate && endDate) {
const start = new Date(startDate);
const end = new Date(endDate);
const duration = end.getTime() - start.getTime(); //
const days = Math.floor(duration / (1000 * 60 * 60 * 24));
const months = Math.floor(duration / (1000 * 60 * 60 * 24 * 30.44));
const years = Math.floor(duration / (1000 * 60 * 60 * 24 * 30.44 * 12));
// return `${days} , ${months} , ${years} `;
return `${years} ปี, ${months} เดือน, ${days} วัน`;
}
return "";
}
const formattedSalary = computed(() => {
return formData.salary !== null
? formData.salary.toLocaleString("th-TH")
@ -334,7 +318,7 @@ const formattedSalary = computed(() => {
>
ระยะเวลา
{{
calculateDuration(formData.dateLeaveStart, formData.dateLeaveEnd)
calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd)
}}
</p>
</div>

View file

@ -5,7 +5,7 @@ import type { FormRef10 } from "@/modules/05_leave/interface/request/AddAbsence"
import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, dialogConfirm ,arabicNumberToText} = mixin;
const { date2Thai, dialogConfirm ,arabicNumberToText, calculateDurationYmd} = mixin;
const edit = ref<boolean>(true);
const props = defineProps({
data: {
@ -93,23 +93,7 @@ function onSubmit() {
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
);
}
function calculateDuration(startDate: string | null, endDate: string | null) {
if (startDate && endDate) {
const start = new Date(startDate);
const end = new Date(endDate);
const duration = end.getTime() - start.getTime(); //
const days = Math.floor(duration / (1000 * 60 * 60 * 24));
const months = Math.floor(duration / (1000 * 60 * 60 * 24 * 30.44));
const years = Math.floor(duration / (1000 * 60 * 60 * 24 * 30.44 * 12));
// return `${days} , ${months} , ${years} `;
return `${years} ปี, ${months} เดือน, ${days} วัน`;
}
return "";
}
const formattedSalary = computed(() => {
return formData.salary !== null
? formData.salary.toLocaleString("th-TH")
@ -331,7 +315,7 @@ const formattedSalary = computed(() => {
>
ระยะเวลา
{{
calculateDuration(formData.dateLeaveStart, formData.dateLeaveEnd)
calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd)
}}
</p>
</div>

View file

@ -5,7 +5,7 @@ import type { FormRef13 } from "@/modules/05_leave/interface/request/AddAbsence"
import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, dialogConfirm, arabicNumberToText } = mixin;
const { date2Thai, dialogConfirm, calculateDurationYmd } = mixin;
const edit = ref<boolean>(true);
const isSave = ref<boolean>(false);
const props = defineProps({
@ -60,38 +60,23 @@ function onSubmit() {
dialogConfirm(
$q,
async () => {
if(isSave.value === false){
if (isSave.value === false) {
props.onSubmit();
console.log(formData);
isSave.value = true;
}else{
console.log('savefile อัปโหลด',filesUpload.value)
} else {
console.log("savefile อัปโหลด", filesUpload.value);
}
},
!isSave.value ?
"ยืนยันการบันทึกข้อมูล":"ยืนยันการอัพโหลดไฟล์",
!isSave.value ? "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?":"ต้องการยืนยันการอัพโหลดไฟล์นี้หรือไม่ ?"
!isSave.value ? "ยืนยันการบันทึกข้อมูล" : "ยืนยันการอัพโหลดไฟล์",
!isSave.value
? "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
: "ต้องการยืนยันการอัพโหลดไฟล์นี้หรือไม่ ?"
);
}
function calculateDuration(startDate: string | null, endDate: string | null) {
if (startDate && endDate) {
const start = new Date(startDate);
const end = new Date(endDate);
const duration = end.getTime() - start.getTime(); //
const days = Math.floor(duration / (1000 * 60 * 60 * 24));
const months = Math.floor(duration / (1000 * 60 * 60 * 24 * 30.44));
const years = Math.floor(duration / (1000 * 60 * 60 * 24 * 30.44 * 12));
// return `${days} , ${months} , ${years} `;
return `${years} ปี, ${months} เดือน, ${days} วัน`;
}
return "";
}
function upLoadFile(){
console.log('upload',filesUpload.value)
function upLoadFile() {
console.log("upload", filesUpload.value);
}
</script>
@ -218,7 +203,7 @@ function upLoadFile(){
>
ระยะเวลา
{{
calculateDuration(formData.dateLeaveStart, formData.dateLeaveEnd)
calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd)
}}
</p>
</div>
@ -273,6 +258,7 @@ function upLoadFile(){
</div>
</div>
</q-card>
<div v-if="isSave" class="q-mt-md">
<q-icon name="mdi-numeric-4-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">
@ -285,50 +271,60 @@ function upLoadFile(){
<div class="q-pl-sm text-weight-bold text-dark text-center">
ดาวนโหลด
</div>
<q-btn color="primary" icon="download" label="ดาวน์โหลดแบบฟอร์ม" />
<q-btn
color="primary"
icon="download"
label="ดาวน์โหลดแบบฟอร์ม"
/>
</div>
</div>
<div class="col-10 col-sm-5 col-md-4 q-my-sm ">
<div class="col-10 col-sm-5 col-md-4 q-my-sm">
<div class="column q-mx-xs">
<div class="q-pl-sm text-weight-bold text-dark text-center">
พโหลด
</div>
<q-file
v-model="filesUpload"
dense
label="แบบฟอร์ม"
outlined
bg-color="white"
multiple
>
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
<q-file
v-model="filesUpload"
dense
label="แบบฟอร์ม"
outlined
bg-color="white"
multiple
>
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
</div>
</div>
<div class="col-md-1 self-end q-mb-sm">
<q-btn v-if="filesUpload" flat round color="primary" icon="mdi-arrow-up-bold" @click="upLoadFile"><q-tooltip>ปโหลด</q-tooltip></q-btn>
<q-btn
v-if="filesUpload"
flat
round
color="primary"
icon="mdi-arrow-up-bold"
@click="upLoadFile"
><q-tooltip>ปโหลด</q-tooltip></q-btn
>
</div>
</div>
</q-card>
</div>
<div v-if="!isSave">
<q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md">
<q-space />
<q-btn
id="onSubmit"
type="submit"
unelevated
dense
class="q-px-md items-center btnBlue"
label="บันทึก"
/>
<q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md">
<q-space />
<q-btn
id="onSubmit"
type="submit"
unelevated
dense
class="q-px-md items-center btnBlue"
label="บันทึก"
/>
</div>
</div>
</div>
</form>
</template>

View file

@ -140,7 +140,7 @@ const formData = reactive<FormData>({
readonly
bg-color="white"
v-model="formData.leaveReceived"
label="จำนวนสิทธิ์การลาที่ได้รับในแต่ละประเภท"
label="จำนวนสิทธิ์การลาที่ได้รับ"
/>
<q-input
class="col-12 col-sm-4"
@ -149,7 +149,7 @@ const formData = reactive<FormData>({
readonly
bg-color="white"
v-model="formData.leaveUse"
label="จำนวนสิทธิ์การลาที่ใช้ไปในแต่ละประเภท"
label="จำนวนสิทธิ์การลาที่ใช้ไป"
/>
<q-input
class="col-12 col-sm-4"
@ -158,7 +158,7 @@ const formData = reactive<FormData>({
readonly
bg-color="white"
v-model="formData.leaveRemaining"
label="จำนวนสิทธิ์การลาคงเหลือในแต่ละประเภท"
label="จำนวนสิทธิ์การลาคงเหลือ"
/>
</div>
</q-card>