2023-11-14 17:47:43 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from 'vue'
|
2023-11-24 16:39:55 +07:00
|
|
|
|
2023-11-14 17:47:43 +07:00
|
|
|
import Popup from '@/components/PopUp.vue'
|
|
|
|
|
// import HeaderPopup from "@/components/HeaderPopup.vue";
|
|
|
|
|
// import FormTime from "@/components/FormTime.vue";
|
|
|
|
|
|
2023-11-24 16:39:55 +07:00
|
|
|
const props = defineProps({
|
|
|
|
|
fetchData: {
|
|
|
|
|
type: Function,
|
|
|
|
|
require: true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
const emit = defineEmits(['update:year'])
|
|
|
|
|
|
2023-11-23 13:40:16 +07:00
|
|
|
const filterYear = ref<number>(new Date().getFullYear())
|
|
|
|
|
// const yearOption = ref<DataOption[]>([{ id: '2566', name: '2566' }])
|
2023-11-14 17:47:43 +07:00
|
|
|
const titleName = ref<string>('เพิ่มรายการลงเวลากรณีพิเศษ')
|
|
|
|
|
|
2023-11-23 13:40:16 +07:00
|
|
|
function filterYearFn() {
|
2023-11-24 16:39:55 +07:00
|
|
|
emit('update:year', filterYear.value)
|
2023-11-23 13:40:16 +07:00
|
|
|
}
|
|
|
|
|
|
2023-11-14 17:47:43 +07:00
|
|
|
const modalPopup = ref<boolean>(false)
|
|
|
|
|
function onClickopen() {
|
|
|
|
|
modalPopup.value = true
|
|
|
|
|
}
|
|
|
|
|
function onClickClose() {
|
|
|
|
|
modalPopup.value = false
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="q-pb-sm row">
|
|
|
|
|
<div class="items-center col-12 row q-gutter-sm">
|
2023-11-23 13:40:16 +07:00
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="filterYear"
|
2023-11-27 12:16:25 +07:00
|
|
|
class="col-xs-5 col-sm-3 col-md-2"
|
2023-11-23 13:40:16 +07:00
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
year-picker
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
@update:modelValue="filterYearFn"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
outlined
|
|
|
|
|
:model-value="filterYear + 543"
|
|
|
|
|
:label="`${'ปีงบประมาณ'}`"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
style="color: var(--q-primary)"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
2023-11-24 16:39:55 +07:00
|
|
|
|
2023-11-14 17:47:43 +07:00
|
|
|
<q-space />
|
|
|
|
|
<q-btn
|
|
|
|
|
unelevated
|
|
|
|
|
outline
|
|
|
|
|
icon="add"
|
|
|
|
|
color="light-blue"
|
|
|
|
|
:class="$q.screen.gt.xs ? 'q-px-sm bg-blue-1' : ''"
|
|
|
|
|
:label="$q.screen.gt.xs ? 'เพิ่มรายการลงเวลากรณีพิเศษ' : ''"
|
|
|
|
|
@click="onClickopen"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-11-27 09:23:43 +07:00
|
|
|
<Popup
|
|
|
|
|
:modal="modalPopup"
|
|
|
|
|
:title="titleName"
|
|
|
|
|
:clickClose="onClickClose"
|
|
|
|
|
:fetchData="props.fetchData"
|
|
|
|
|
/>
|
2023-11-14 17:47:43 +07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|