แก้ใหม่ วันที่เริ่มต้น

This commit is contained in:
setthawutttty 2024-03-01 10:30:04 +07:00
parent 0dc0640d2c
commit d15a24c80e
2 changed files with 25 additions and 11 deletions

View file

@ -8,6 +8,7 @@ import config from "@/app.config";
import type {
DataOption,
ObjectSalaryRef,
FormData
} from "@/modules/13_salary/interface/index/Main";
import type {
SalaryPosType,
@ -46,14 +47,14 @@ const props = defineProps({
});
const salaryId = ref<string>("");
const formData = reactive({
const formData = reactive<FormData>({
salaryType: "", //* (OFFICER->"",EMPLOYEE->"")
posTypeId: "", //*
posLevelId: "", //*
isActive: false, //*
date: new Date(), //
startDate: new Date(), //
endDate: new Date(), //
date: null, //
startDate: null, //
endDate: null, //
details: "", //
isSpecial: false,
});
@ -168,7 +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 === "edit") {
await showLoader();
if (props.data) {
@ -237,9 +242,6 @@ function createSalary() {
});
}
/** function checkEndDate*/
function checkEndDate() {
if (formData.endDate !== null && formData.startDate !== null) {
@ -286,10 +288,10 @@ async function downloadFile(url: string, type: string, fileName: string) {
<Header :tittle="title" :close="closeDialog" />
<q-separator />
<q-card-section class="scroll" style="max-height: 70vh;">
<q-card-section class="scroll" style="max-height: 70vh">
<div class="row col-12 q-col-gutter-sm">
<div class="col-md-12">
<div class="row col-12 q-col-gutter-sm ">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-md-3">
<q-select
ref="salaryTypeRef"

View file

@ -45,11 +45,23 @@ interface ObjectSalaryRateRef {
[key: string]: any;
}
interface FormData{
salaryType:string
posTypeId:string
posLevelId:string
isActive:boolean
date:Date |null
startDate:Date |null
endDate:Date |null
details:string
isSpecial:boolean
}
export type {
DataOption,
NewPagination,
ItemsMenu,
ObjectSalaryRef,
ObjectSalaryRateRef,
DataOptionShort
DataOptionShort,
FormData,
};