validate
This commit is contained in:
parent
c673012cfd
commit
5ab256807a
2 changed files with 10 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ const checkInRef = ref<Object | null>(null);
|
||||||
const checkOutRef = ref<Object | null>(null);
|
const checkOutRef = ref<Object | null>(null);
|
||||||
const checkInStatusRef = ref<Object | null>(null);
|
const checkInStatusRef = ref<Object | null>(null);
|
||||||
const checkOutStatusRef = ref<Object | null>(null);
|
const checkOutStatusRef = ref<Object | null>(null);
|
||||||
|
const reasonRef = ref<Object | null>(null);
|
||||||
|
|
||||||
const formData = reactive<dataRowRound>({
|
const formData = reactive<dataRowRound>({
|
||||||
checkIn: "",
|
checkIn: "",
|
||||||
|
|
@ -41,6 +42,7 @@ const objectRound: MyObjectRoundRef = {
|
||||||
checkOut: checkOutRef,
|
checkOut: checkOutRef,
|
||||||
checkInStatus: checkInStatusRef,
|
checkInStatus: checkInStatusRef,
|
||||||
checkOutStatus: checkOutStatusRef,
|
checkOutStatus: checkOutStatusRef,
|
||||||
|
note: reasonRef,
|
||||||
};
|
};
|
||||||
|
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
|
|
@ -56,6 +58,7 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
onSubmit();
|
onSubmit();
|
||||||
|
console.log(hasError)
|
||||||
} else {
|
} else {
|
||||||
console.log(hasError);
|
console.log(hasError);
|
||||||
}
|
}
|
||||||
|
|
@ -263,6 +266,8 @@ watch(
|
||||||
ref="checkInStatusRef"
|
ref="checkInStatusRef"
|
||||||
for="checkInStatus"
|
for="checkInStatus"
|
||||||
emit-value
|
emit-value
|
||||||
|
:rules="[(val) => !!val || 'กรุณาเลือกสถานะเข้างาน']"
|
||||||
|
hide-bottom-space
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
full-width
|
full-width
|
||||||
|
|
@ -293,6 +298,8 @@ watch(
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
:rules="[(val) => !!val || 'กรุณาเลือกสถานะออกงาน']"
|
||||||
|
hide-bottom-space
|
||||||
full-width
|
full-width
|
||||||
v-model="SpecialTimeStore.checkOutStatus"
|
v-model="SpecialTimeStore.checkOutStatus"
|
||||||
:options="SpecialTimeStore.optionStatus"
|
:options="SpecialTimeStore.optionStatus"
|
||||||
|
|
@ -305,9 +312,11 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-input
|
<q-input
|
||||||
|
ref="reasonRef"
|
||||||
class="col-12 bg-white q-ma-md"
|
class="col-12 bg-white q-ma-md"
|
||||||
outlined
|
outlined
|
||||||
stack-label
|
stack-label
|
||||||
|
:rules="[(val) => !!val || 'กรุณาเหตุผล']"
|
||||||
v-model="formData.note"
|
v-model="formData.note"
|
||||||
label="เหตุผล"
|
label="เหตุผล"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ interface MyObjectRoundRef {
|
||||||
checkOut: object | null;
|
checkOut: object | null;
|
||||||
checkInStatus: object | null;
|
checkInStatus: object | null;
|
||||||
checkOutStatus: object | null;
|
checkOutStatus: object | null;
|
||||||
|
note: object | null;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
export type { DataRows, dataRowRound, MyObjectRoundRef };
|
export type { DataRows, dataRowRound, MyObjectRoundRef };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue