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 config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";
import { calculateFiscalYear } from "@/utils/function";
import type { DataStructureTree } from "@/interface/main";
import type { FormDataRole } from "@/modules/01_masterdata/interface/request/Main";
@ -47,7 +48,7 @@ const isView = ref<boolean>(route.name === "KPIIndicatorByRoleView");
const modalDialogSelect = ref<boolean>(false);
const form = reactive<FormDataRole>({
position: "", //
year: new Date().getFullYear(), //
year: calculateFiscalYear(new Date()), //
round: "", //
org: "", ///
including: "", //

View file

@ -8,6 +8,7 @@ import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type {
@ -63,7 +64,7 @@ const rows = ref<DataAssignment[]>([]);
const formFilter = reactive<FormFilterAssignment>({
keyword: "",
period: "",
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()),
});
/** ฟังก์ชันดึงข้อมูลรายการงานอื่นๆ ที่ได้รับมอบหมาย*/

View file

@ -9,6 +9,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { useStructureTree } from "@/stores/structureTree";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
import type {
DataOption,
@ -70,7 +71,7 @@ const roundOp = ref<DataOption[]>([
{ id: "OCT", name: "รอบตุลาคม" },
]);
const year = ref<number | null>(new Date().getFullYear());
const year = ref<number | null>(calculateFiscalYear(new Date()));
const nodeData = reactive<FormDataNodeData>({
round: "",
nodeId: null,

View file

@ -8,6 +8,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
import type { FormListMainByRole } from "@/modules/01_masterdata/interface/request/Main";
import type {
@ -65,7 +66,7 @@ const formFilter = reactive<FormListMainByRole>({
position: "",
round: "",
keyword: "",
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()),
});
const indicatorTotal = ref<IndicatorTotal[]>([

View file

@ -1,6 +1,6 @@
import { ref } from "vue";
interface Pagination {
page: number;
page?: number;
rowsPerPage: number;
sortBy?: string;
}

View file

@ -8,6 +8,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
@ -21,7 +22,7 @@ const { showLoader, hideLoader, messageError } = mixin;
const isLoadPDF = ref<boolean>(false);
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date()));
const reportSelect = ref<DataOption>({
id: "",
@ -145,7 +146,7 @@ function clearFilter() {
name: "",
};
detailReport.value = undefined;
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
pdfSrc.value = undefined;
detailReport.value = undefined;
}

View file

@ -16,7 +16,7 @@ const $q = useQuasar(); // show dialog
const router = useRouter();
const file = ref<boolean>(true);
const filter = ref<string>(""); //search data table
const initialPagination = ref<Pagination>({
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
sortBy: "year",
});

View file

@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import type {
@ -36,7 +37,7 @@ const {
const router = useRouter();
const name = ref<string>("");
const year = ref<number>(new Date().getFullYear() + 543);
const year = ref<number>(calculateFiscalYear(new Date()) + 543);
const order = ref<number>(1);
const files = ref<any>(null);

View file

@ -6,6 +6,7 @@ import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period";
import type {
@ -36,7 +37,7 @@ const isFeeNotZero = computed(() => {
return fee.value !== 0 && fee.value !== "0" && fee.value !== "";
});
const round = ref<number>(1);
const yearly = ref<number>(new Date().getFullYear());
const yearly = ref<number>(calculateFiscalYear(new Date()));
const dateRegister = ref<[Date, Date] | null>(null); //
const datePayment = ref<[Date, Date] | null>(null); //
const dateAnnouncement = ref<[Date, Date] | null>(null); //

View file

@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
import type {
ResponseRecruitPeriod,
@ -37,7 +38,7 @@ const {
} = mixin;
const name = ref<string>("");
const year = ref<number>(new Date().getFullYear() + 543);
const year = ref<number>(calculateFiscalYear(new Date()) + 543);
const round = ref<number>(1);
const files = ref<any>(null);
const files_score = ref<any>(null);

View file

@ -7,6 +7,7 @@ import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import type { RequestPeriodDisable } from "@/modules/03_recruiting/interface/request/Period";
import type {
@ -33,7 +34,7 @@ const editor = ref<string>("");
const announcementExam = ref<boolean>(true);
const fee = ref<number>(0);
const round = ref<number>(1);
const yearly = ref<number>(new Date().getFullYear());
const yearly = ref<number>(calculateFiscalYear(new Date()));
const dateRegister = ref<[Date, Date] | null>(null); //
const datePayment = ref<[Date, Date] | null>(null); //
const dateAnnouncement = ref<[Date, Date] | null>(null); //

View file

@ -8,6 +8,7 @@ import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import type {
RequestPosition,
@ -74,7 +75,7 @@ const checkDocument = ref<boolean>(false);
const checkDisability = ref<boolean>(false);
const announcementExam = ref<boolean>(true);
const round = ref<number>(1);
const yearly = ref<number>(new Date().getFullYear());
const yearly = ref<number>(calculateFiscalYear(new Date()));
const nameRaw = ref<number | null>(null);
const roundRaw = ref<number | null>(null);
const yearlyRaw = ref<number | null>(null);

View file

@ -5,6 +5,7 @@ import { checkPermission } from "@/utils/permissions";
import { useRoute, useRouter } from "vue-router";
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import { useQuasar, type QTableProps } from "quasar";
@ -44,7 +45,7 @@ const rangeAge = ref<RangeAge>({
const objMarkerLabel = computed(() => {
return { 39: `ช่วงอายุ ${rangeAge.value.min}-${rangeAge.value.max} ปี` };
});
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date()));
//
const modalHistory = ref<boolean>(false); //

View file

@ -7,6 +7,7 @@ import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { useResultsPerformDataStore } from "@/modules/04_registryPerson/stores/ResultsPerformance";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
@ -45,7 +46,7 @@ const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const year = ref<number | null>(new Date().getFullYear()); //
const year = ref<number | null>(calculateFiscalYear(new Date())); //
const id = ref<string>(""); //id
const typeIDP = ref<string>("");
const isEdit = ref<boolean>(false); //
@ -494,7 +495,7 @@ function clearData() {
resPerformForm.pointSumTotal = 0;
resPerformForm.pointSum = 0;
resPerformForm.date = null;
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
}
/**

View file

@ -6,6 +6,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
import type { MainData } from "@/modules/05_placement/interface/index/Survey";
@ -14,7 +15,7 @@ const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { pagination, params, onRequest } = usePagination("", getData);
const year = ref<number | null>(new Date().getFullYear()); //
const year = ref<number | null>(calculateFiscalYear(new Date())); //
const rows = ref<MainData[]>([]);
const filterKeyword = ref<string>("");

View file

@ -7,6 +7,7 @@ import axios from "axios";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";
import { calculateFiscalYear } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
@ -56,7 +57,7 @@ const optionReport = ref<DataTypeReport[]>([
type: "probation",
},
]);
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));
@ -188,7 +189,7 @@ function clearFilter() {
detailReport.value = undefined;
pdfSrc.value = undefined;
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
dateStart.value = new Date(year.value - 1, 9, 1);
dateEnd.value = new Date(year.value + 1, 8, 30);
}

View file

@ -7,6 +7,7 @@ import axios from "axios";
import { useRoute } from "vue-router";
import { useStructureTree } from "@/stores/structureTree";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
import genReportXLSX from "@/plugins/genreportxlsx";
@ -48,7 +49,7 @@ const filterTypeOption = ref<DataOption[]>([
{ id: "MONTH", name: "รายเดือน" },
{ id: "YEAR", name: "รายปี" },
]);
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date()));
const dateMonth = ref<DataDateMonthObject>({
month: new Date().getMonth(),
year: new Date().getFullYear(),
@ -203,7 +204,7 @@ function clearFilter() {
reportType.value = "";
filterType.value = "MONTH";
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
dateMonth.value = {
month: new Date().getMonth(),
year: new Date().getFullYear(),

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,

View file

@ -8,6 +8,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
import { calculateFiscalYear } from "@/utils/function";
import type {
FormData,
@ -106,7 +107,7 @@ const formData = reactive<FormData>({
oc: "",
file: null,
disciplineDisciplinary_DocResults: [],
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()),
});
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
@ -826,10 +827,7 @@ watch(
@update:modal="updatemodalPersonal"
/>
<DialogHistory
v-model:modal="modalHistory"
v-model:person-id="personalId"
/>
<DialogHistory v-model:modal="modalHistory" v-model:person-id="personalId" />
</template>
<style scoped>

View file

@ -9,6 +9,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useAppealComplainStore } from "@/modules/11_discipline/store/AppealComplainStore";
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
import { calculateFiscalYear } from "@/utils/function";
import type {
MyObjectAppealRef,
@ -75,7 +76,7 @@ const formData = reactive<any>({
file: null,
disciplineComplaint_Appeal_Docs: [],
historyStatus: historyStatusOb,
year: new Date().getFullYear().toString(),
year: calculateFiscalYear(new Date()).toString(),
});
/** ตัวแปร validate */

View file

@ -8,6 +8,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useAppealComplainStore } from "@/modules/11_discipline/store/AppealComplainStore";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
import type { QTableProps } from "quasar";
import type { RowList } from "@/modules/11_discipline/interface/response/appealComplain";
@ -36,7 +37,7 @@ const dataRow = ref<RowList[]>([]);
const formData = reactive<any>({
type: "ALL",
status: "NEW",
year: new Date().getFullYear().toString(),
year: calculateFiscalYear(new Date()).toString(),
});
const total = ref<number>(0);

View file

@ -8,6 +8,7 @@ import genReportXLSX from "@/plugins/genreportxlsx";
import http from "@/plugins/http";
import config from "@/app.config";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type {
@ -36,7 +37,7 @@ const organization = ref<string>("");
const organizationOpsMain = ref<DataOption[]>([]);
const organizationOps = ref<DataOption[]>([]);
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date()));
const modalReport = ref<boolean>(false); // popup report
const loadingBtn = ref<boolean>(false); // popup report
const filter = ref<string>(""); //

View file

@ -6,6 +6,7 @@ import { checkPermission } from "@/utils/permissions";
import { updateCurrentPage } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin";
import { useSalaryDataStore } from "@/modules/13_salary/store/SalaryStore";
import { calculateFiscalYear } from "@/utils/function";
import config from "@/app.config";
import http from "@/plugins/http";
@ -249,7 +250,7 @@ watch(
/** Hooklifecycle */
onMounted(async () => {
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
dataStore.visibleColumns = visibleColumns.value;
dataStore.columns = columns.value;
getData();

View file

@ -11,6 +11,7 @@ import {
} from "@/utils/permissions";
import config from "@/app.config";
import http from "@/plugins/http";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type {
@ -36,7 +37,7 @@ const { messageError, showLoader, hideLoader, success, dialogConfirm } =
useCounterMixin();
/** ตัวแปร*/
const year = ref<number>(new Date().getFullYear()); //
const year = ref<number>(calculateFiscalYear(new Date())); //
const roundFilter = ref<any>(); //
const agencyFilter = ref<string>(""); //
const snapFilter = ref<string>(""); //

View file

@ -11,6 +11,7 @@ import {
} from "@/utils/permissions";
import config from "@/app.config";
import http from "@/plugins/http";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type {
@ -35,7 +36,7 @@ const $q = useQuasar();
const { messageError, showLoader, hideLoader } = useCounterMixin();
/** ตัวแปร*/
const year = ref<number>(new Date().getFullYear()); //
const year = ref<number>(calculateFiscalYear(new Date())); //
const roundFilter = ref<any>(); //
const agencyFilter = ref<string>(""); //
const snapFilter = ref<string>(""); //

View file

@ -8,6 +8,7 @@ import http from "@/plugins/http";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import { calculateFiscalYear } from "@/utils/function";
import type {
DataOption,
@ -47,7 +48,7 @@ const typeOps = ref<typeOp[]>([
]);
const modalDialog = defineModel<boolean>("modal", { required: true });
const yearDialog = ref<number | any>(new Date().getFullYear());
const yearDialog = ref<number | any>(calculateFiscalYear(new Date())); //
const roundDialgOp = ref<DataOption[]>([]);
const isRoundClose = ref<boolean>(false);
@ -144,7 +145,7 @@ const columnsRespondent = ref<QTableProps["columns"]>([
function onCloseDialog() {
modalDialog.value = false;
formRound.kpiPeriodId = { id: "", name: "", isClosed: false };
yearDialog.value = new Date().getFullYear();
yearDialog.value = calculateFiscalYear(new Date());
rows.value = [];
formRound.evaluatorId = "";
formRound.commanderId = "";

View file

@ -7,6 +7,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type { QTableProps } from "quasar";
@ -133,7 +134,7 @@ const pagination = ref({
});
/** ตัวแปร*/
const year = ref<number | null>(new Date().getFullYear()); //
const year = ref<number | null>(calculateFiscalYear(new Date())); //
const roundOp = ref<DataOption[]>([]); //
/** function fetch รายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง*/

View file

@ -7,6 +7,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type { QTableProps } from "quasar";
@ -167,7 +168,7 @@ const pagination = ref({
});
/** ตัวแปร*/
const year = ref<number | null>(new Date().getFullYear()); //
const year = ref<number | null>(calculateFiscalYear(new Date())); //
const roundOp = ref<DataOption[]>([]); //
const resultOp = ref<DataOption[]>(store.resultsOptions);

View file

@ -6,6 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import http from "@/plugins/http";
import config from "@/app.config";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type {
@ -102,7 +103,7 @@ const visibleColumns = ref<string[]>([
const formQuery = reactive<FormQueryRound>({
page: 1, //
pageSize: 10, //
year: new Date().getFullYear(), //
year: calculateFiscalYear(new Date()), //
keyword: "",
});
const modalDialog = ref<boolean>(false); //modal

View file

@ -6,6 +6,7 @@ import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
import config from "@/app.config";
import http from "@/plugins/http";
@ -22,7 +23,7 @@ const router = useRouter();
const store = useKpiDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
const year = ref<number | null>(new Date().getFullYear()); //
const year = ref<number | null>(calculateFiscalYear(new Date())); //
const formQuery = reactive({
page: 1, //
pageSize: 10, //

View file

@ -7,6 +7,7 @@ import http from "@/plugins/http";
import axios from "axios";
import genReport from "@/plugins/genreport";
import LoadView from "@/components/LoadView.vue";
import { calculateFiscalYear } from "@/utils/function";
/**
* importType
*/
@ -45,7 +46,7 @@ const route = useRoute();
*/
const fullNameShow = ref<string>("");
const isLoadPDF = ref<boolean>(false);
const year = ref<number | null>(new Date().getFullYear());
const year = ref<number | null>(calculateFiscalYear(new Date())); //
const round = ref<string>("");
const organization = ref<string>("");
const roundOp = ref<DataOption[]>([]);
@ -487,7 +488,7 @@ watch(
function clearFilter() {
organization.value = "";
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
typeReport.value = "KPI1";
pdfSrc.value = undefined;
dataDownload.value = undefined;

View file

@ -7,6 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useStructureTree } from "@/stores/structureTree";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
/** importType*/
import type { FormBasicinfo } from "@/modules/15_development/interface/request/Main";
@ -34,7 +35,7 @@ const checkRoutePermission = ref<boolean>(
); // check route
const formData = reactive<FormBasicinfo>({
year: new Date().getFullYear(), //
year: calculateFiscalYear(new Date()), //
projectName: "", //
reason: "", //
objective: "", //
@ -47,7 +48,7 @@ const orgName = ref<string>(""); //ชื่อ หน่วยงาน/ส่
const node = ref<any[]>([]); // /
const filter = ref<string>(""); //input
const expanded = ref<string[]>([]);
const nodeDnaId = ref<string>('');
const nodeDnaId = ref<string>("");
/**
* function fetch อมลเบองต
@ -67,7 +68,7 @@ async function fetchData(id: string) {
formData.nodeId = data.nodeId;
formData.node = data.node;
formData.orgRevisionId = data.revisionId;
nodeDnaId.value = data.nodeDnaId
nodeDnaId.value = data.nodeDnaId;
const arrayExpanded = [
data.root,
@ -126,7 +127,7 @@ function updateSelected(data: DataTree) {
formData.node = data.orgLevel;
formData.nodeId = data.orgTreeId;
formData.orgRevisionId = data.orgRevisionId;
nodeDnaId.value = data.orgTreeDnaId
nodeDnaId.value = data.orgTreeDnaId;
props.onCheckChangeData();
}

View file

@ -1,6 +1,8 @@
import { defineStore } from "pinia";
import { reactive, ref } from "vue";
import { calculateFiscalYear } from "@/utils/function";
import type { QTableProps } from "quasar";
import type { FormAddProject } from "@/modules/15_development/interface/request/Main";
@ -12,7 +14,7 @@ export const useDevelopmentDataStore = defineStore(
const projectStatus = ref<string>("ONGOING");
const statusEdit = ref<boolean>(false);
const formAddProject = reactive<FormAddProject>({
year: new Date().getFullYear(), //ปีงบประมาณ*
year: calculateFiscalYear(new Date()), //ปีงบประมาณ*
projectName: "", //ชื่อโครงการ/กิจกรรม/หลักสูตร*
reason: "", //หลักการและเหตุผล
objective: "", //วัตถุประสงค์
@ -65,7 +67,7 @@ export const useDevelopmentDataStore = defineStore(
function clearFormAddProject() {
/** ข้อมูลเบื้องต้น*/
formAddProject.year = new Date().getFullYear();
formAddProject.year = calculateFiscalYear(new Date());
formAddProject.projectName = "";
formAddProject.reason = " ";
formAddProject.objective = "";

View file

@ -9,6 +9,7 @@ import { useRoute, useRouter } from "vue-router";
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
import type {
NewPagination,
@ -29,7 +30,7 @@ const formFilter = reactive({
page: 1,
pageSize: 10,
keyword: "",
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()), //
});
const pagination = ref({
@ -195,7 +196,7 @@ function onEdit(id: string) {
/** ดึงข้อมูล */
async function getData() {
showLoader();
formFilter.keyword = formFilter.keyword.trim()
formFilter.keyword = formFilter.keyword.trim();
await http
.post(config.API.developmentHistoryList("employee"), formFilter)
.then((res) => {

View file

@ -9,6 +9,7 @@ import genReportXLSX from "@/plugins/genreportxlsx";
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
/**
* importType
@ -32,7 +33,7 @@ const formFilter = reactive({
page: 1,
pageSize: 10,
keyword: "",
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()), //
});
const agencyOp = ref<DataOption[]>([]); //

View file

@ -11,6 +11,7 @@ import genReportXLSX from "@/plugins/genreportxlsx";
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
import { useCounterMixin } from "@/stores/mixin";
import { updateCurrentPage } from "@/utils/function";
import { calculateFiscalYear } from "@/utils/function";
/**importType*/
import type {
@ -107,7 +108,7 @@ const formProject = reactive<FormProject>({
/** formQuery */
const formQuery = reactive<FormQueryListProject>({
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()), //
page: 1,
pageSize: 10,
org: "1",

View file

@ -8,6 +8,7 @@ import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import genReportXLSX from "@/plugins/genreportxlsx";
import { calculateFiscalYear } from "@/utils/function";
import type {
DataOption,
@ -143,7 +144,7 @@ const scholarshipTypeOp = ref<DataOption[]>([
const formQuery = reactive({
page: 1,
pageSize: 10,
year: new Date().getFullYear(),
year: calculateFiscalYear(new Date()), //
type: "DOMESTICE",
keyword: "",
});

View file

@ -6,6 +6,7 @@ import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { useCommandListStore } from "@/modules/18_command/store/ListStore";
import { usePagination } from "@/composables/usePagination";
import { calculateFiscalYear } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
@ -36,7 +37,7 @@ const tabsManu = ref<ItemTabs[]>([
]);
//
const queryParams = reactive<FormQuery>({
year: new Date().getFullYear(), //
year: calculateFiscalYear(new Date()), //
keyword: "", //
commandTypeId: "",
});

View file

@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function";
import type {
OptionData,
@ -23,7 +24,7 @@ const route = useRoute();
const { messageError, showLoader, hideLoader } = useCounterMixin();
const loadingBtn = ref<boolean>(false);
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date())); //
const organization = ref<string>("");
const organizationOpsMain = ref<OptionData[]>([]);
@ -194,7 +195,7 @@ async function getOrg(id: string) {
}
function clearFilter() {
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
organization.value = "";
typeReport.value = "";
pdfSrc.value = undefined;
@ -323,7 +324,8 @@ onMounted(async () => {
option-value="id"
option-label="name"
@update:model-value="
(organization = ''), (year = new Date().getFullYear())
(organization = ''),
(year = calculateFiscalYear(new Date()))
"
/>
</div>

View file

@ -9,6 +9,7 @@ import config from "@/app.config";
import genReportXLSX from "@/plugins/genreportxlsx";
import { useStructureTree } from "@/stores/structureTree";
import { checkPermission } from "@/utils/permissions";
import { calculateFiscalYear } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin";
@ -39,7 +40,7 @@ const organizationName = computed(() => {
);
});
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date())); //
const detailReport = ref<any>();
@ -157,7 +158,7 @@ function nextPage() {
function clearFilter() {
pdfSrc.value = undefined;
detailReport.value = undefined;
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
// org.value = "";
nodeId.value = "";
// nodeName.value = "";

View file

@ -9,6 +9,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
import genReportXLSX from "@/plugins/genreportxlsx";
import { calculateFiscalYear } from "@/utils/function";
import config from "@/app.config";
import http from "@/plugins/http";
@ -27,7 +28,7 @@ const checkId = ref<string>("");
const isLoadStructureTree = ref<boolean>(true);
// const expandedModal = ref<boolean>(false);
// const org = ref<string>("");
const year = ref<number>(new Date().getFullYear());
const year = ref<number>(calculateFiscalYear(new Date())); //
const isLoadFilePdf = ref<boolean>(false);
const employeeClass = ref<string>("officer");
const employeeClassOption = ref<DataOption[]>([
@ -327,7 +328,7 @@ function nextPage() {
function clearFilter() {
checkId.value = "";
year.value = new Date().getFullYear();
year.value = calculateFiscalYear(new Date());
round.value = "";
group.value = "GROUP1";
report.value = null;
@ -538,7 +539,9 @@ onMounted(() => {
<q-tooltip>
<div v-if="group === 'GROUP1'">
<div>วไป: ปฏงาน, ชำนาญงาน, อาวโส</div>
<div>ชาการ: ปฏการ, ชำนาญการ, ชำนาญการพเศษ</div>
<div>
ชาการ: ปฏการ, ชำนาญการ, ชำนาญการพเศษ
</div>
<div>อำนวยการ: </div>
</div>
<div v-else>