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

@ -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>