Browse Source

fix:修改备忘录请求参数

luzhixia 1 month ago
parent
commit
f5f7cca0ef

+ 11 - 4
src/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManageMixin.js

@@ -394,7 +394,12 @@ export const memoManageMixin = {
         } else {
           _url = '/api/costProjectMemo/v1/pageIndexList'
         }
-        delete params.memoDate
+        if (this.activeTab == 'project') {
+          delete params.memoDate
+        } else if (this.activeTab == 'calendar') {
+          params.memoDate = this.searchParams.memoDate
+          delete params.year
+        }
         const res = await getMemoList(_url, params)
         if (res.value && res.value.records.length > 0) {
           this.memoList = res.value.records || []
@@ -406,6 +411,9 @@ export const memoManageMixin = {
           // 在列表数据设置完成后,只调用一次详情接口获取所有需要的详情
           await this.getTasksByDateList()
           this.listTotal = res.value.total || 0
+        } else {
+          this.memoList = []
+          this.listTotal = 0
         }
       } catch (error) {
         console.error('获取数据失败:', error)
@@ -452,9 +460,8 @@ export const memoManageMixin = {
       this.searchParams.content = ''
       this.searchParams.page = 1
       if (tab.name == 'calendar') {
-        ;(this.currentYear = new Date().getFullYear()),
-          (this.currentMonth = new Date().getMonth() + 1), // 月份从1开始
-          this.setCalendarTitle()
+        this.setCalendarTitle()
+        this.handleSearch()
       } else {
         this.handleSearch()
       }