แก้ไข ฟอร์มการลา

This commit is contained in:
AnandaTon 2023-11-10 11:43:30 +07:00
parent 7c6aa537f0
commit e10f0a9d98
5 changed files with 897 additions and 956 deletions

View file

@ -100,184 +100,180 @@ function onValidate() {
<!-- ฟอรมลาปวย ลาคลอดบตร และลากจสวนต --> <!-- ฟอรมลาปวย ลาคลอดบตร และลากจสวนต -->
<template> <template>
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<form @submit.prevent.stop="onValidate"> <form @submit.prevent.stop="onValidate">
<div> <q-card bordered class="q-pa-md bg-grey-1">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <q-input
<div class="col-12 row q-col-gutter-md q-pa-md"> class="col-12 col-sm-12"
<div class="col-xs-12 col-sm-12"> ref="leaveNoRef"
<q-card bordered class="q-pa-md bg-grey-1"> for="leaveNoRef"
<div class="col-12 row q-pa-sm q-col-gutter-sm"> dense
<q-input outlined
class="col-12 col-sm-12" v-model="formData.leaveNo"
ref="leaveNoRef" label="เขียนที่"
for="leaveNoRef" :readonly="!edit"
dense :rules="[val => !!val || `${'เขียนที่'}`]"
outlined />
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[val => !!val || `${'เขียนที่'}`]"
/>
<div class="col-md-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<q-radio v-model="formData.halfDay" val="day" label="ลาทั้งวัน" /> <q-radio v-model="formData.halfDay" val="day" label="ลาทั้งวัน" />
<q-radio v-model="formData.halfDay" val="half_day_morning" label="ลาครึ่งวันเช้า" /> <q-radio v-model="formData.halfDay" val="half_day_morning" label="ลาครึ่งวันเช้า" />
<q-radio v-model="formData.halfDay" val="half_day_afternoon" label="ลาครึ่งวันบ่าย" /> <q-radio v-model="formData.halfDay" val="half_day_afternoon" label="ลาครึ่งวันบ่าย" />
</div> </div>
<datepicker <datepicker
class="col-md-3 col-sm-12" class="col-md-3 col-sm-12"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formData.startLeaveDate" v-model="formData.startLeaveDate"
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="!edit" :readonly="!edit"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
outlined outlined
dense dense
ref="startLeaveDateRef" ref="startLeaveDateRef"
for="startLeaveDateRef" for="startLeaveDateRef"
hide-bottom-space hide-bottom-space
:readonly="!edit" :readonly="!edit"
class="full-width datepicker" class="full-width datepicker"
:model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null" :model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null"
:label="`${'ลาตั้งแต่วันที่'}`" :label="`${'ลาตั้งแต่วันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]" :rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon> <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<datepicker <datepicker
class="col-md-3 col-sm-12" class="col-md-3 col-sm-12"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formData.endLeaveDate" v-model="formData.endLeaveDate"
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="!edit" :readonly="!edit"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
outlined outlined
dense dense
ref="endLeaveDateRef" ref="endLeaveDateRef"
for="endLeaveDateRef" for="endLeaveDateRef"
hide-bottom-space hide-bottom-space
:readonly="!edit" :readonly="!edit"
class="full-width datepicker" class="full-width datepicker"
:model-value="formData.endLeaveDate != null ? date2Thai(formData.endLeaveDate) : null" :model-value="formData.endLeaveDate != null ? date2Thai(formData.endLeaveDate) : null"
:label="`${'ลาถึงวันที่'}`" :label="`${'ลาถึงวันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]" :rules="[val => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon> <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<q-input <q-input
class="col-md-2 col-sm-12" class="col-md-2 col-sm-12"
dense dense
outlined outlined
ref="leaveTotalRef" ref="leaveTotalRef"
for="leaveTotalRef" for="leaveTotalRef"
type="number" type="number"
v-model="formData.leaveTotal" v-model="formData.leaveTotal"
label="จำนวนวันที่ลา" label="จำนวนวันที่ลา"
readonly readonly
:rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]" :rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/> />
<q-input <q-input
class="col-3" class="col-3"
dense dense
outlined outlined
ref="leaveContactTelRef" ref="leaveContactTelRef"
for="leaveContactTelRef" for="leaveContactTelRef"
v-model="formData.leaveContactTel" v-model="formData.leaveContactTel"
mask="(###)-###-####" mask="(###)-###-####"
unmasked-value unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้" label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit" :readonly="!edit"
:rules="[val => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`]" :rules="[val => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`]"
/> />
<q-input <q-input
class="col-md-9 col-sm-12" class="col-md-9 col-sm-12"
dense dense
outlined outlined
ref="leaveContactLocationRef" ref="leaveContactLocationRef"
for="leaveContactLocationRef" for="leaveContactLocationRef"
v-model="formData.leaveContactLocation" v-model="formData.leaveContactLocation"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา" label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit" :readonly="!edit"
:rules="[val => !!val || `${'กรุณากรอกที่อยู่ที่ติดต่อได้ระหว่างลา'}`]" :rules="[val => !!val || `${'กรุณากรอกที่อยู่ที่ติดต่อได้ระหว่างลา'}`]"
/> />
<q-input <q-input type="textarea" class="col-md-12 col-sm-12" dense outlined ref="leaveDetailRef" for="leaveDetailRef" v-model="formData.leaveDetail" label="รายละเอียด" :readonly="!edit" />
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"> <q-file
<template v-slot:prepend> ref="fileRef"
<q-icon name="attach_file" color="primary" /> for="fileRef"
</template> v-model="formData.file"
</q-file> @added="fileUploadDoc"
dense
label="เอกสารประกอบ"
outlined
use-chips
multiple
class="q-pl-sm col-12"
:rules="[val => !!val || `${'กรุณาเลือกไฟล์'}`]"
>
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
<div class="col-12 row" v-if="!edit"> <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="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 class="q-pl-sm text-weight-bold text-dark">เอกสารเพมเต</div>
</div> </div>
<q-card bordered flat class="full-width"> <q-card bordered flat class="full-width">
<q-list separator> <q-list separator>
<q-item v-for="(file, index) in formData.file" :key="index" class="q-my-xs"> <q-item v-for="(file, index) in formData.file" :key="index" class="q-my-xs">
<q-item-section> <q-item-section>
<q-item-label class="full-width ellipsis"> <q-item-label class="full-width ellipsis">
{{ file.name }} {{ file.name }}
</q-item-label> </q-item-label>
<q-item-label caption> </q-item-label> <q-item-label caption> </q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-card>
</div>
</div>
</q-card> </q-card>
</div> </div>
</div> </div>
</div> </q-card>
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />

View file

@ -104,9 +104,9 @@ function onValidate() {
</script> </script>
<template> <template>
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<form @submit.prevent.stop="onValidate"> <form @submit.prevent.stop="onValidate">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<!-- ลาไปชวยเหลอภรยาทคลอดบตร <!-- ลาไปชวยเหลอภรยาทคลอดบตร
<ul> <ul>
<li>เขยนท</li> <li>เขยนท</li>
@ -123,224 +123,209 @@ function onValidate() {
<p> <p>
*หมายเหต อยดตอไดระหวางลา (อาจดงมาจากทอยจจนโดยอตโนม แตใหใชงานแกไขได) *หมายเหต อยดตอไดระหวางลา (อาจดงมาจากทอยจจนโดยอตโนม แตใหใชงานแกไขได)
</p> --> </p> -->
<div class="col-12 row q-col-gutter-md q-pa-md"> <q-card bordered class="q-pa-md bg-grey-1">
<div class="col-xs-12 col-sm-12"> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-card bordered class="q-pa-md bg-grey-1"> <q-input
<div class="col-12 row q-pa-sm q-col-gutter-sm"> class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[val => !!val || `${'เขียนที่'}`]"
/>
<datepicker
class="col-md-4 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 <q-input
class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined outlined
v-model="formData.leaveNo" dense
label="เขียนที่" ref="startLeaveDateRef"
:readonly="!edit" for="startLeaveDateRef"
:rules="[val => !!val || `${'เขียนที่'}`]" hide-bottom-space
/>
<div class="col-md-3 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="wifeNameRef"
for="wifeNameRef"
dense
outlined
v-model="formData.wifeName"
label="ชื่อภรรยา"
:readonly="!edit"
:rules="[val => !!val || `${'ชื่อภรรยา'}`]"
/>
</div>
<datepicker
class="col-md-3 col-sm-12"
menu-class-name="modalfix"
v-model="formData.brithDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:readonly="!edit" :readonly="!edit"
class="full-width datepicker"
:model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null"
:label="`${'ลาตั้งแต่วันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
ref="brithDateRef"
for="brithDateRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.brithDate != null ? date2Thai(formData.brithDate) : 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-3 col-sm-12"
dense
outlined
ref="leaveTotalRef"
for="leaveTotalRef"
type="number"
v-model="formData.leaveTotal"
label="จำนวนวันที่ลา"
readonly
:rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/>
<q-input
class="col-9"
dense
outlined
ref="leaveContactTelRef"
for="leaveContactTelRef"
v-model="formData.leaveContactTel"
mask="(###)-###-####"
unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit"
:rules="[val => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`]"
/>
<q-input
class="col-md-12 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-file v-model="formData.file" @added="fileUploadDoc" dense label="เอกสารประกอบ" outlined use-chips multiple class="q-pl-sm col-12">
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
</q-file> </q-input>
</template>
</datepicker>
<div class="col-12 row" v-if="!edit"> <datepicker
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> class="col-md-4 col-sm-12"
<div class="q-pl-sm text-weight-bold text-dark">เอกสารเพมเต</div> menu-class-name="modalfix"
</div> v-model="formData.endLeaveDate"
<q-card bordered flat class="full-width"> :locale="'th'"
<q-list separator> autoApply
<q-item v-for="(file, index) in formData.file" :key="index" class="q-my-xs"> borderless
<q-item-section> :enableTimePicker="false"
<q-item-label class="full-width ellipsis"> week-start="0"
{{ file.name }} :readonly="!edit"
</q-item-label> >
<q-item-label caption> </q-item-label> <template #year="{ year }">
</q-item-section> {{ year + 543 }}
</q-item> </template>
</q-list> <template #year-overlay-value="{ value }">
</q-card> {{ parseInt(value + 543) }}
</div> </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-4 col-sm-12"
dense
outlined
ref="leaveTotalRef"
for="leaveTotalRef"
type="number"
v-model="formData.leaveTotal"
label="จำนวนวันที่ลา"
readonly
:rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/>
<div class="col-md-4 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="wifeNameRef"
for="wifeNameRef"
dense
outlined
v-model="formData.wifeName"
label="ชื่อภรรยา"
:readonly="!edit"
:rules="[val => !!val || `${'ชื่อภรรยา'}`]"
/>
</div>
<datepicker
class="col-md-4 col-sm-12"
menu-class-name="modalfix"
v-model="formData.brithDate"
: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="brithDateRef"
for="brithDateRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.brithDate != null ? date2Thai(formData.brithDate) : 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-4"
dense
outlined
ref="leaveContactTelRef"
for="leaveContactTelRef"
v-model="formData.leaveContactTel"
mask="(###)-###-####"
unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit"
:rules="[val => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`]"
/>
<q-input
class="col-md-12 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-file ref="fileRef" 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> </div>
</q-card> <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> </div>
</div> </q-card>
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">
<q-space /> <q-space />

View file

@ -120,201 +120,188 @@ function onValidate() {
<li>เอกสารประกอบ</li> <li>เอกสารประกอบ</li>
</ul> </ul>
</div> --> </div> -->
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<form @submit.prevent.stop="onValidate"> <form @submit.prevent.stop="onValidate">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <q-card bordered class="q-pa-md bg-grey-1">
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-12 row q-col-gutter-md q-pa-md"> <q-input
<div class="col-xs-12 col-sm-12"> class="col-12 col-sm-12"
<q-card bordered class="q-pa-md bg-grey-1"> ref="leaveNoRef"
<div class="col-12 row q-pa-sm q-col-gutter-sm"> for="leaveNoRef"
dense
outlined
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[val => !!val || `${'เขียนที่'}`]"
/>
<div class="col-md-6 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="lastYearVacationRef"
for="lastYearVacationRef"
dense
readonly
outlined
v-model="formData.lastYearVacation"
label="จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา"
/>
</div>
<div class="col-md-6 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="currentVacationRef"
for="currentVacationRef"
dense
readonly
outlined
v-model="formData.currentVacation"
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 <q-input
class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined outlined
v-model="formData.leaveNo" dense
label="เขียนที่" ref="startLeaveDateRef"
:readonly="!edit" for="startLeaveDateRef"
:rules="[val => !!val || `${'เขียนที่'}`]" hide-bottom-space
/>
<div class="col-md-6 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="lastYearVacationRef"
for="lastYearVacationRef"
dense
readonly
outlined
v-model="formData.lastYearVacation"
label="จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา"
/>
</div>
<div class="col-md-6 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="currentVacationRef"
for="currentVacationRef"
dense
readonly
outlined
v-model="formData.currentVacation"
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" :readonly="!edit"
class="full-width datepicker"
:model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null"
:label="`${'ลาตั้งแต่วันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<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-3 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-md-12 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-file v-model="formData.file" @added="fileUploadDoc" dense label="เอกสารประกอบ" outlined use-chips multiple class="q-pl-sm col-12">
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
</q-file> </q-input>
</template>
</datepicker>
<div class="col-12 row" v-if="!edit"> <datepicker
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> class="col-md-3 col-sm-12"
<div class="q-pl-sm text-weight-bold text-dark">เอกสารเพมเต</div> menu-class-name="modalfix"
</div> v-model="formData.endLeaveDate"
<q-card bordered flat class="full-width"> :locale="'th'"
<q-list separator> autoApply
<q-item v-for="(file, index) in formData.file" :key="index" class="q-my-xs"> borderless
<q-item-section> :enableTimePicker="false"
<q-item-label class="full-width ellipsis"> week-start="0"
{{ file.name }} :readonly="!edit"
</q-item-label> >
<q-item-label caption> </q-item-label> <template #year="{ year }">
</q-item-section> {{ year + 543 }}
</q-item> </template>
</q-list> <template #year-overlay-value="{ value }">
</q-card> {{ parseInt(value + 543) }}
</div> </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-3 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-md-12 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-file ref="fileRef" 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> </div>
</q-card> <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> </div>
</div> </q-card>
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">
<q-space /> <q-space />

View file

@ -9,7 +9,7 @@ const mixin = useCounterMixin()
const { date2Thai, dialogConfirm } = mixin const { date2Thai, dialogConfirm } = mixin
const edit = ref<boolean>(true) const edit = ref<boolean>(true)
const filesUpload = ref<any>(null) const filesUpload = ref<any>(null)
const isSave = ref<boolean>(true) const isSave = ref<boolean>(false)
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
@ -79,7 +79,7 @@ function onValidate() {
} }
} }
if (hasError.every(result => result === true)) { if (hasError.every(result => result === true)) {
props.onSubmit() onSubmit()
} }
} }
@ -120,99 +120,97 @@ function onSubmit() {
และเพมใหพโหหลดเอกสารกลบเขามาในระบบ และเพมใหพโหหลดเอกสารกลบเขามาในระบบ
</p> </p>
</div> --> </div> -->
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<form @submit.prevent.stop="onValidate"> <form @submit.prevent.stop="onValidate">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <q-card bordered class="q-pa-md bg-grey-1">
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-12 row q-col-gutter-md q-pa-md"> <q-input
<div class="col-xs-12 col-sm-12"> class="col-12 col-sm-12"
<q-card bordered class="q-pa-md bg-grey-1"> ref="leaveNoRef"
<div class="col-12 row q-pa-sm q-col-gutter-sm"> for="leaveNoRef"
dense
outlined
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[val => !!val || `${'เขียนที่'}`]"
/>
<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 <q-input
class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined outlined
v-model="formData.leaveNo" dense
label="เขียนที่" ref="startLeaveDateRef"
:readonly="!edit" for="startLeaveDateRef"
:rules="[val => !!val || `${'เขียนที่'}`]" hide-bottom-space
/>
<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" :readonly="!edit"
class="full-width datepicker"
:model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null"
:label="`${'ลาตั้งแต่วันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<template #year="{ year }"> <template v-slot:prepend>
{{ year + 543 }} <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
<template #year-overlay-value="{ value }"> </q-input>
{{ parseInt(value + 543) }} </template>
</template> </datepicker>
<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 <datepicker
class="col-md-3 col-sm-12" class="col-md-3 col-sm-12"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formData.endLeaveDate" v-model="formData.endLeaveDate"
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" 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" :readonly="!edit"
class="full-width datepicker"
:model-value="formData.endLeaveDate != null ? date2Thai(formData.endLeaveDate) : null"
:label="`${'ลาถึงวันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
> >
<template #year="{ year }"> <template v-slot:prepend>
{{ year + 543 }} <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
<template #year-overlay-value="{ value }"> </q-input>
{{ parseInt(value + 543) }} </template>
</template> </datepicker>
<template #trigger> <!-- <q-input
<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-3 col-sm-12" class="col-md-3 col-sm-12"
dense dense
outlined outlined
@ -225,48 +223,37 @@ function onSubmit() {
:rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]" :rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/> --> /> -->
<q-input <q-input type="textarea" class="col-md-12 col-sm-12" dense outlined ref="leaveDetailRef" for="leaveDetailRef" v-model="formData.leaveDetail" label="รายละเอียด" :readonly="!edit" />
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"> <q-file ref="fileRef" v-model="formData.file" @added="fileUploadDoc" dense label="เอกสารประกอบ" outlined use-chips multiple class="q-pl-sm col-12">
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
</q-file> </q-file>
<div class="col-12 row" v-if="!edit"> <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="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 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> </div>
</q-card> <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> </div>
</div> </q-card>
<div v-if="isSave" class="q-mt-md"> <div v-if="isSave" class="q-mt-md">
<q-icon name="mdi-numeric-4-circle" size="20px" color="primary" /> <q-icon name="mdi-numeric-4-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">ดาวนโหลด/พโหลดแบบฟอร</div> <div class="q-pl-sm text-weight-bold text-dark">ดาวนโหลด/โหลดแบบฟอร</div>
<q-card class="bg-grey-1 q-pa-sm" bordered> <q-card class="bg-grey-1 q-pa-sm" bordered>
<div class="row"> <div class="row">
<div class="col-12 col-sm-4 col-md-4 q-my-sm offset-sm-1 offset-md-2"> <div class="col-12 col-sm-4 col-md-4 q-my-sm offset-sm-1 offset-md-2">
@ -277,8 +264,8 @@ function onSubmit() {
</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="column q-mx-xs">
<div class="q-pl-sm text-weight-bold text-dark text-center">โหลด</div> <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> <q-file v-model="filesUpload" dense label="แบบฟอร์ม" outlined bg-color="white" multiple accept=".pdf">
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
@ -291,6 +278,7 @@ function onSubmit() {
</div> </div>
</q-card> </q-card>
</div> </div>
<div v-if="!isSave"> <div v-if="!isSave">
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">

View file

@ -143,287 +143,272 @@ function onValidate() {
<li>เอกสารประกอบ</li> <li>เอกสารประกอบ</li>
</ul> </ul>
</div> --> </div> -->
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
<form @submit.prevent.stop="onValidate"> <form @submit.prevent.stop="onValidate">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <q-card bordered class="q-pa-md bg-grey-1">
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-12 row q-col-gutter-md q-pa-md"> <q-input
<div class="col-xs-12 col-sm-12"> class="col-12 col-sm-12"
<q-card bordered class="q-pa-md bg-grey-1"> ref="leaveNoRef"
<div class="col-12 row q-pa-sm q-col-gutter-sm"> for="leaveNoRef"
dense
outlined
v-model="formData.leaveNo"
label="เขียนที่"
:readonly="!edit"
:rules="[val => !!val || `${'เขียนที่'}`]"
/>
<datepicker
class="col-md-4 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 <q-input
class="col-12 col-sm-12"
ref="leaveNoRef"
for="leaveNoRef"
dense
outlined outlined
v-model="formData.leaveNo" dense
label="เขียนที่" ref="startLeaveDateRef"
:readonly="!edit" for="startLeaveDateRef"
:rules="[val => !!val || `${'เขียนที่'}`]" hide-bottom-space
/>
<div class="col-md-4 col-sm-12">
<q-input class="col-12 col-sm-12" ref="salaryRef" for="salaryRef" dense outlined v-model="formattSalary" label="เงินเดือนปัจจุบัน" readonly />
</div>
<div class="col-md-4 col-sm-12">
<q-input class="col-12 col-sm-12" ref="salaryRef" for="salaryRef" dense outlined v-model="formattSalaryText" label="เงินเดือนปัจจุบัน" readonly />
</div>
<datepicker
class="col-md-2 col-sm-12"
menu-class-name="modalfix"
v-model="formData.startLeaveDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:readonly="!edit" :readonly="!edit"
class="full-width datepicker"
:model-value="formData.startLeaveDate != null ? date2Thai(formData.startLeaveDate) : null"
:label="`${'ลาตั้งแต่วันที่'}`"
:rules="[val => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<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-2 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 || `${'กรุณากรอกจำนวนวัน'}`]"
/>
<div class="col-md-4 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="spouseNameRef"
for="spouseNameRef"
dense
outlined
v-model="formData.spouseName"
label="ชื่อคู่สมรส"
:readonly="!edit"
:rules="[val => !!val || `${'ชื่อคู่สมรส'}`]"
/>
</div>
<div class="col-md-4 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="spousePositionRef"
for="spousePositionRef"
dense
outlined
v-model="formData.spousePosition"
label="ตำแหน่งคู่สมรส"
:readonly="!edit"
:rules="[val => !!val || `${'ตำแหน่งคู่สมรส'}`]"
/>
</div>
<div class="col-md-2 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="spouseLevelRef"
for="spouseLevelRef"
dense
outlined
v-model="formData.spouseLevel"
label="ระดับคู่สมรส"
:readonly="!edit"
:rules="[val => !!val || `${'ระดับคู่สมรส'}`]"
/>
</div>
<div class="col-md-3 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="dutyCountryRef"
for="dutyCountryRef"
dense
outlined
v-model="formData.dutyCountry"
label="ไปปฏิบัติราชการ ณ ประเทศ"
:readonly="!edit"
:rules="[val => !!val || `${'ปฏิบัติราชการ ณ ประเทศ'}`]"
/>
</div>
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-md-12 col-sm-12">ประวการลาตดตามคสมรสครงสดทาย</div>
<q-input class="col-md-4 col-sm-12" dense outlined ref="followHistoryRef" for="followHistoryRef" v-model="formData.followHistoryCountry" label="ประเทศ" readonly />
<q-input class="col-md-4 col-sm-12" dense outlined ref="followHistoryRef" for="followHistoryRef" v-model="formData.followHistoryTime" label="เป็นเวลา" readonly />
<datepicker
class="col-md-2 col-sm-12"
menu-class-name="modalfix"
v-model="formData.followHistoryStart"
: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="followHistoryStartRef"
for="followHistoryStartRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.followHistoryStart != null ? date2Thai(formData.followHistoryStart) : 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-2 col-sm-12"
menu-class-name="modalfix"
v-model="formData.followHistoryEnd"
: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="followHistoryEndRef"
for="followHistoryEndRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.followHistoryEnd != null ? date2Thai(formData.followHistoryEnd) : 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>
</div>
<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> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
</template> </template>
</q-file> </q-input>
</template>
</datepicker>
<div class="col-12 row" v-if="!edit"> <datepicker
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> class="col-md-4 col-sm-12"
<div class="q-pl-sm text-weight-bold text-dark">เอกสารเพมเต</div> menu-class-name="modalfix"
</div> v-model="formData.endLeaveDate"
<q-card bordered flat class="full-width"> :locale="'th'"
<q-list separator> autoApply
<q-item v-for="(file, index) in formData.file" :key="index" class="q-my-xs"> borderless
<q-item-section> :enableTimePicker="false"
<q-item-label class="full-width ellipsis"> week-start="0"
{{ file.name }} :readonly="!edit"
</q-item-label> >
<q-item-label caption> </q-item-label> <template #year="{ year }">
</q-item-section> {{ year + 543 }}
</q-item> </template>
</q-list> <template #year-overlay-value="{ value }">
</q-card> {{ parseInt(value + 543) }}
</div> </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-4 col-sm-12"
dense
outlined
ref="leaveTotalRef"
for="leaveTotalRef"
type="number"
v-model="formData.leaveTotal"
label="จำนวนวันที่ลา"
readonly
:rules="[val => !!val || `${'กรุณากรอกจำนวนวัน'}`]"
/>
<div class="col-md-3 col-sm-12">
<q-input class="col-12 col-sm-12" ref="salaryRef" for="salaryRef" dense outlined v-model="formattSalary" label="เงินเดือนปัจจุบัน" readonly />
</div>
<div class="col-md-6 col-sm-12">
<q-input class="col-12 col-sm-12" ref="salaryRef" for="salaryRef" dense outlined v-model="formattSalaryText" label="เงินเดือนปัจจุบัน" readonly />
</div>
<div class="col-md-3 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="spouseNameRef"
for="spouseNameRef"
dense
outlined
v-model="formData.spouseName"
label="ชื่อคู่สมรส"
:readonly="!edit"
:rules="[val => !!val || `${'ชื่อคู่สมรส'}`]"
/>
</div>
<div class="col-md-3 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="spousePositionRef"
for="spousePositionRef"
dense
outlined
v-model="formData.spousePosition"
label="ตำแหน่งคู่สมรส"
:readonly="!edit"
:rules="[val => !!val || `${'ตำแหน่งคู่สมรส'}`]"
/>
</div>
<div class="col-md-3 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="spouseLevelRef"
for="spouseLevelRef"
dense
outlined
v-model="formData.spouseLevel"
label="ระดับคู่สมรส"
:readonly="!edit"
:rules="[val => !!val || `${'ระดับคู่สมรส'}`]"
/>
</div>
<div class="col-md-3 col-sm-12">
<q-input
class="col-12 col-sm-12"
ref="dutyCountryRef"
for="dutyCountryRef"
dense
outlined
v-model="formData.dutyCountry"
label="ไปปฏิบัติราชการ ณ ประเทศ"
:readonly="!edit"
:rules="[val => !!val || `${'ปฏิบัติราชการ ณ ประเทศ'}`]"
/>
</div>
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-md-12 col-sm-12">ประวการลาตดตามคสมรสครงสดทาย</div>
<datepicker
class="col-md-3 col-sm-12"
menu-class-name="modalfix"
v-model="formData.followHistoryStart"
: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="followHistoryStartRef"
for="followHistoryStartRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.followHistoryStart != null ? date2Thai(formData.followHistoryStart) : 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.followHistoryEnd"
: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="followHistoryEndRef"
for="followHistoryEndRef"
hide-bottom-space
:readonly="!edit"
class="full-width datepicker"
:model-value="formData.followHistoryEnd != null ? date2Thai(formData.followHistoryEnd) : 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-3 col-sm-12" dense outlined ref="followHistoryRef" for="followHistoryRef" v-model="formData.followHistoryCountry" label="ประเทศ" />
<q-input class="col-md-3 col-sm-12" dense outlined ref="followHistoryRef" for="followHistoryRef" v-model="formData.followHistoryTime" label="เป็นเวลา" />
</div>
<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 ref="fileRef" 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> </div>
</q-card> <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> </div>
</div> </q-card>
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">
<q-space /> <q-space />