ปรับวินัย
This commit is contained in:
parent
f24c737c0b
commit
f27c14e7bf
5 changed files with 87 additions and 49 deletions
|
|
@ -181,6 +181,17 @@ function updatemodalPersonal(modal: boolean) {
|
|||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/** เช็ควันที่สิ้นสุดต้องมากกว่า หรือเท่ากับวันเริ่ม */
|
||||
function changeFormDataDate() {
|
||||
const startDate = new Date(data.startDateSuspend as Date);
|
||||
const endDate = new Date(data.endDateSuspend as Date);
|
||||
|
||||
if (startDate > endDate) {
|
||||
data.endDateSuspend = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
|
|
@ -386,6 +397,7 @@ onMounted(async () => {
|
|||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormDataDate()"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -429,12 +441,14 @@ onMounted(async () => {
|
|||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
:readonly="!edit || data.startDateSuspend === null"
|
||||
v-model="data.endDateSuspend"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:min-date="data.startDateSuspend"
|
||||
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -446,7 +460,7 @@ onMounted(async () => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:readonly="!edit || data.startDateSuspend === null"
|
||||
:borderless="!edit"
|
||||
:model-value="
|
||||
data.endDateSuspend !== null
|
||||
|
|
@ -456,6 +470,7 @@ onMounted(async () => {
|
|||
:rules="[(val) => !!val || `${'กรุณาเลือกถึงวันที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ถึงวันที่'}`"
|
||||
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue