From 851f7b5e7ad4a2069c416983f0f598dd12f14785 Mon Sep 17 00:00:00 2001 From: weizong song Date: Mon, 27 Jul 2026 14:21:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=AE=97=E9=80=89=E6=8B=A9=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=B9=B4=E4=BB=BD=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/payment/PaymentQuery.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/views/payment/PaymentQuery.vue b/src/views/payment/PaymentQuery.vue index fd00668..8e80876 100644 --- a/src/views/payment/PaymentQuery.vue +++ b/src/views/payment/PaymentQuery.vue @@ -1504,6 +1504,14 @@ const loadConfirmYearOptions = async () => { } } +const getCurrentYearOptionValue = () => { + const currentYear = new Date().getFullYear() + const matched = (confirmYearOptions.value || []).find( + (y) => String(y.year) === String(currentYear) + ) + return matched ? matched.value : null +} + const loadConfirmTree = async (yearId) => { if (!yearId) return confirmTreeLoading.value = true @@ -1734,7 +1742,11 @@ const initBudgetConfirmData = async () => { // 选择年度 if (!confirmYearId.value) { const resolved = await resolveYearIdByValue(parsed) - confirmYearId.value = resolved || (confirmYearOptions.value[0] && confirmYearOptions.value[0].value) || null + confirmYearId.value = + resolved || + getCurrentYearOptionValue() || + (confirmYearOptions.value[0] && confirmYearOptions.value[0].value) || + null } if (confirmYearId.value) { @@ -2134,4 +2146,3 @@ onMounted(async () => { -