validate
This commit is contained in:
parent
4f9f8ecc65
commit
874685954c
2 changed files with 9 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ const effectiveDate = ref<Date | null>(null);
|
|||
/** ตัวแปร validate */
|
||||
const periodRef = ref<Object | null>(null);
|
||||
const effectiveDateRef = ref<Object | null>(null);
|
||||
const yearRef = ref<Object | null>(null);
|
||||
const typeOptions = ref<DataOption[]>([
|
||||
{ id: "SPECIAL", name: "รอบพิเศษ" },
|
||||
{ id: "APR", name: "รอบเมษายน" },
|
||||
|
|
@ -32,6 +33,7 @@ const typeOptions = ref<DataOption[]>([
|
|||
const objectForm: ObjectRef = {
|
||||
period: periodRef,
|
||||
effectiveDate: effectiveDateRef,
|
||||
year: yearRef,
|
||||
};
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -161,6 +163,7 @@ watch(
|
|||
<div class="q-gutter-y-sm">
|
||||
|
||||
<datepicker
|
||||
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
class="col-2"
|
||||
|
|
@ -175,11 +178,16 @@ watch(
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
ref="yearRef"
|
||||
dense
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
outlined
|
||||
:model-value="year === 0 ? null : Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกเลือกปีงบประมาณ'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ interface Row {
|
|||
interface ObjectRef {
|
||||
period: object | null;
|
||||
effectiveDate: object | null;
|
||||
year: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue