From 3ba847c6e63d41eab845c7162703b89685dcece9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 08 十一月 2025 11:11:26 +0800
Subject: [PATCH] 财务管理修改

---
 src/views/financialManagement/financialStatements/index.vue |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/views/financialManagement/financialStatements/index.vue b/src/views/financialManagement/financialStatements/index.vue
index 430fe6a..e5f9b23 100644
--- a/src/views/financialManagement/financialStatements/index.vue
+++ b/src/views/financialManagement/financialStatements/index.vue
@@ -1,4 +1,4 @@
-<template>
+ <template>
   <div style="padding: 20px;">
     <!-- 椤甸潰鏍囬鍜屾棩鏈熺瓫閫� -->
     <div class="w-full md:w-auto flex items-center gap-3" style="margin-bottom: 20px;">
@@ -10,7 +10,7 @@
         range-separator="鑷�"
         start-placeholder="寮�濮嬫棩鏈�"
         end-placeholder="缁撴潫鏃ユ湡"
-        :default-value="[new Date(firstDayOfMonth), new Date()]"
+        clearable
         @change="handleDateChange"
         class="w-full md:w-auto"
         style="margin-right: 30px;"
@@ -137,8 +137,7 @@
 import dayjs from "dayjs";
 
 // 鏃ユ湡鑼冨洿
-const dateRange = ref([]);
-const firstDayOfMonth = ref(null);
+const dateRange = ref(null);
 const chartStyle = {
 	width: '100%',
 	height: '100%', // 璁剧疆鍥捐〃瀹瑰櫒鐨勯珮搴�
@@ -320,6 +319,9 @@
 })
 
 const getData = async () => {
+  if (!dateRange.value || !dateRange.value.length) {
+    return;
+  }
   try {
     const {code,data} = await reportForms({entryDateStart:dateRange.value[0], entryDateEnd:dateRange.value[1]});
     if(code === 200) {
@@ -370,30 +372,22 @@
 };
 
 
-// 鍒濆鍖栨棩鏈熻寖鍥达紙榛樿褰撴湀锛�
+// 鍒濆鍖�
 onMounted(() => {
-  const today = new Date();
-  const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
-  firstDayOfMonth.value = firstDay;
-  dateRange.value = [dayjs(firstDay).format("YYYY-MM-DD"), dayjs(today).format("YYYY-MM-DD")];
-  getData()
-  
+  // 涓嶈缃粯璁ゆ棩鏈燂紝鐢辩敤鎴锋墜鍔ㄩ�夋嫨
 });
 
 // 澶勭悊鏃ユ湡鑼冨洿鍙樺寲
 const handleDateChange = (newRange) => {
+  dateRange.value = newRange;
   if (newRange && newRange.length === 2) {
-    dateRange.value = newRange;
     getData()
   }
 };
 
 // 閲嶇疆鏃ユ湡鑼冨洿
 const resetDateRange = () => {
-  const today = new Date();
-  const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
-  dateRange.value = [dayjs(firstDay).format("YYYY-MM-DD"), dayjs(today).format("YYYY-MM-DD")];
-  getData()
+  dateRange.value = null;
 };
 
 </script>

--
Gitblit v1.9.3