ผังบัญชีเงินเดือน => validate
This commit is contained in:
parent
d7c164ac9b
commit
e4835425c0
1 changed files with 36 additions and 9 deletions
|
|
@ -8,7 +8,7 @@ import config from "@/app.config";
|
|||
import type {
|
||||
DataOption,
|
||||
ObjectSalaryRef,
|
||||
FormData
|
||||
FormData,
|
||||
} from "@/modules/13_salary/interface/index/Main";
|
||||
import type {
|
||||
SalaryPosType,
|
||||
|
|
@ -63,9 +63,9 @@ const formData = reactive<FormData>({
|
|||
const salaryTypeRef = ref<Object | null>(null);
|
||||
const posTypeRef = ref<Object | null>(null);
|
||||
const posLevelRef = ref<Object | null>(null);
|
||||
const dateRef = ref<Object | null>(null);
|
||||
const startDateRef = ref<Object | null>(null);
|
||||
const endDateRef = ref<Object | null>(null);
|
||||
const dateRef = ref<any>(null);
|
||||
const startDateRef = ref<any>();
|
||||
const endDateRef = ref<any>();
|
||||
|
||||
const ObjectRef: ObjectSalaryRef = {
|
||||
salaryType: salaryTypeRef,
|
||||
|
|
@ -169,11 +169,11 @@ watch(
|
|||
if (salaryPosTypeOption.value.length === 0) {
|
||||
await fetchPosType();
|
||||
}
|
||||
if (props.typeAction === "add") {
|
||||
formData.date = new Date()
|
||||
formData.startDate = new Date()
|
||||
formData.endDate = new Date()
|
||||
}
|
||||
// if (props.typeAction === "add") {
|
||||
// formData.date = new Date();
|
||||
// formData.startDate = new Date();
|
||||
// formData.endDate = new Date();
|
||||
// }
|
||||
if (props.typeAction === "edit") {
|
||||
await showLoader();
|
||||
if (props.data) {
|
||||
|
|
@ -251,6 +251,33 @@ function checkEndDate() {
|
|||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => formData.date,
|
||||
() => {
|
||||
if (formData.date) {
|
||||
dateRef.value.resetValidation();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => formData.startDate,
|
||||
() => {
|
||||
if (formData.startDate) {
|
||||
startDateRef.value.resetValidation();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => formData.endDate,
|
||||
() => {
|
||||
if (formData.endDate) {
|
||||
endDateRef.value.resetValidation();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* function เรียกไฟล์ PDF
|
||||
* @param url link PDF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue