fix:add function calculateFiscalYear

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-10-01 15:20:45 +07:00
parent 70be19b5c4
commit 7877f26ac6
47 changed files with 131 additions and 68 deletions

View file

@ -7,6 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useLeaveHistoryDataStore } from "@/modules/09_leave/stores/LeaveHistoryStore";
import { calculateFiscalYear } from "@/utils/function";
import type { QTableColumn } from "quasar";
import type {
@ -78,7 +79,7 @@ const profileId = ref<string>("");
const rowId = ref<string>("");
const formData = reactive({
leaveTypeId: "", //
leaveYear: findYear(new Date()), //
leaveYear: calculateFiscalYear(new Date()), //
leaveDays: "", //
leaveDaysUsed: "", //
});
@ -191,7 +192,7 @@ function onClose() {
formFilter.page = 1;
formFilter.pageSize = 10;
formData.leaveTypeId = "";
formData.leaveYear = new Date().getFullYear();
formData.leaveYear = calculateFiscalYear(new Date());
formData.leaveDays = "";
formData.leaveDaysUsed = "";
rows.value = [];

View file

@ -5,6 +5,7 @@ import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type { DataProfilePosition } from "@/interface/response/main";
@ -28,7 +29,7 @@ export const useLeavelistDataStore = defineStore("leave", () => {
const tabView = ref<string>("list");
/** filter*/
const filter = reactive<DateFilter>({
year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
year: calculateFiscalYear(new Date()), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
status: "ALL", //*สถานะการของลา
keyword: "", //keyword ค้นหา

View file

@ -8,6 +8,7 @@ import { useRoute } from "vue-router";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";
import { calculateFiscalYear } from "@/utils/function";
import genReportXLSX from "@/plugins/genreportxlsx";
import http from "@/plugins/http";
@ -39,7 +40,7 @@ const {
hideLoader,
} = useCounterMixin();
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date()));
const dateStart = ref<Date>(new Date(year.value - 1, 9, 1));
const dateEnd = ref<Date>(new Date(year.value + 1, 8, 30));
@ -354,7 +355,7 @@ function clearData() {
pdfSrc.value = undefined;
detailReport.value = undefined;
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
dateMonth.value = {
month: new Date().getMonth(),
year: new Date().getFullYear(),

View file

@ -9,6 +9,7 @@ import { checkPermission } from "@/utils/permissions";
import { updateCurrentPage } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin";
import { useLeaveHistoryDataStore } from "@/modules/09_leave/stores/LeaveHistoryStore";
import { calculateFiscalYear } from "@/utils/function";
import type { QTableColumn } from "quasar";
import type { DataPagination } from "@/modules/09_leave/interface/index/Main";
@ -26,7 +27,7 @@ const { showLoader, hideLoader, messageError, dialogRemove, success } =
useCounterMixin();
const formFilter = reactive({
year: findYear(new Date()),
year: calculateFiscalYear(new Date()),
type: "00000000-0000-0000-0000-000000000000",
page: 1,
pageSize: 10,