แก้ไขเหตุผลตอนลงเวลา

This commit is contained in:
Warunee Tamkoo 2025-12-02 12:23:15 +07:00
parent 499c0d40b2
commit c424c6c744
3 changed files with 49 additions and 16 deletions

View file

@ -1,3 +1,7 @@
interface OptionReason {
value: string
text: string
}
interface FormRef { interface FormRef {
model: object | null model: object | null
useLocation: object | null useLocation: object | null
@ -43,4 +47,4 @@ interface FormTimeStemp {
longitude: string longitude: string
POI: string POI: string
} }
export type { FormRef, FormData, Datalist, FormTimeStemp } export type { OptionReason, FormRef, FormData, Datalist, FormTimeStemp }

View file

@ -8,7 +8,7 @@ import config from '@/app.config'
import http from '@/plugins/http' import http from '@/plugins/http'
import { useCounterMixin } from '@/stores/mixin' import { useCounterMixin } from '@/stores/mixin'
import type { FormRef } from '@/interface/response/checkin' import type { FormRef, OptionReason } from '@/interface/response/checkin'
import MapCheck from '@/components/AscGISMap.vue' import MapCheck from '@/components/AscGISMap.vue'
@ -110,12 +110,23 @@ async function updateLocation(
const location = ref<string>('') // const location = ref<string>('') //
const model = ref<string>('') // const model = ref<string>('') //
// //
const options = ref<string[]>([ const options = ref<OptionReason[]>([
'ปฏิบัติงานที่บ้าน', { value: 'ปฏิบัติงานที่บ้าน', text: 'ปฏิบัติงานที่บ้าน (WFH)' },
// '', { value: 'ปฏิบัติงานนอกสถานที่', text: 'ปฏิบัติงานนอกสถานที่ (WFA)' },
'ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่', { value: 'ลืมลงเวลาเริ่มปฏิบัติราชการ', text: 'ลืมลงเวลาเริ่มปฏิบัติราชการ' },
'ขออนุญาตออกนอกสถานที่', { value: 'ลืมลงเวลาเลิกปฏิบัติราชการ', text: 'ลืมลงเวลาเลิกปฏิบัติราชการ' },
'อื่นๆ', {
value: 'ไปประชุม / อบรม / สัมมนา',
text: 'ไปประชุม / อบรม / สัมมนา',
},
{ value: 'ลางานครึ่งวัน (เช้า)', text: 'ลางานครึ่งวัน (เช้า)' },
{ value: 'ลางานครึ่งวัน (บ่าย)', text: 'ลางานครึ่งวัน (บ่าย)' },
{ value: 'ขออนุญาตออกนอกสถานที่', text: 'ขออนุญาตออกนอกสถานที่' },
{
value: 'ประสบภัย เช่น น้ำท่วม มีพายุ ประสบอุบัติเหตุ',
text: 'ประสบภัย เช่น น้ำท่วม มีพายุ ประสบอุบัติเหตุ',
},
{ value: 'อื่นๆ', text: 'อื่นๆ' },
]) ])
/** function เลือกสถานที่*/ /** function เลือกสถานที่*/
@ -753,6 +764,10 @@ onMounted(async () => {
lazy-rules lazy-rules
@update:model-value="selectLocation()" @update:model-value="selectLocation()"
hide-bottom-space hide-bottom-space
option-value="value"
option-label="text"
emit-value
map-options
/> />
</div> </div>
<div <div

View file

@ -9,8 +9,7 @@ import config from '@/app.config'
import { tokenParsed } from '@/plugins/auth' import { tokenParsed } from '@/plugins/auth'
// import Type // import Type
import type { FormRef } from '@/interface/response/checkin' import type { FormRef, OptionReason } from '@/interface/response/checkin'
import type { notiType } from '@/interface/index/Main'
// import components // import components
import MapCheck from '@/components/MapCheckin.vue' import MapCheck from '@/components/MapCheckin.vue'
@ -97,12 +96,23 @@ async function updateLocation(location: any, namePOI: string) {
const location = ref<string>('') const location = ref<string>('')
// const coordinates = ref<string>('') // const coordinates = ref<string>('')
const model = ref<string>('') const model = ref<string>('')
const options = ref<string[]>([ const options = ref<OptionReason[]>([
'ปฏิบัติงานที่บ้าน', { value: 'ปฏิบัติงานที่บ้าน', text: 'ปฏิบัติงานที่บ้าน (WFH)' },
// '', { value: 'ปฏิบัติงานนอกสถานที่', text: 'ปฏิบัติงานนอกสถานที่ (WFA)' },
'ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่', { value: 'ลืมลงเวลาเริ่มปฏิบัติราชการ', text: 'ลืมลงเวลาเริ่มปฏิบัติราชการ' },
'ขออนุญาตออกนอกสถานที่', { value: 'ลืมลงเวลาเลิกปฏิบัติราชการ', text: 'ลืมลงเวลาเลิกปฏิบัติราชการ' },
'อื่นๆ', {
value: 'ไปประชุม / อบรม / สัมมนา',
text: 'ไปประชุม / อบรม / สัมมนา',
},
{ value: 'ลางานครึ่งวัน (เช้า)', text: 'ลางานครึ่งวัน (เช้า)' },
{ value: 'ลางานครึ่งวัน (บ่าย)', text: 'ลางานครึ่งวัน (บ่าย)' },
{ value: 'ขออนุญาตออกนอกสถานที่', text: 'ขออนุญาตออกนอกสถานที่' },
{
value: 'ประสบภัย เช่น น้ำท่วม มีพายุ ประสบอุบัติเหตุ',
text: 'ประสบภัย เช่น น้ำท่วม มีพายุ ประสบอุบัติเหตุ',
},
{ value: 'อื่นๆ', text: 'อื่นๆ' },
]) ])
/** function เลือกสถานที่*/ /** function เลือกสถานที่*/
@ -411,6 +421,10 @@ onMounted(async () => {
:rules="[(val:string) => !!val || 'กรุณาระบุสถานที่']" :rules="[(val:string) => !!val || 'กรุณาระบุสถานที่']"
lazy-rules lazy-rules
@update:model-value="selectLocation()" @update:model-value="selectLocation()"
option-value="value"
option-label="text"
emit-value
map-options
/> />
</div> </div>
<div <div