From 9251f709dc2a0d278ef2c0cdd76a244bfefc5784 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 12 Sep 2024 13:15:53 +0800
Subject: [PATCH] fix: 责任单位修改

---
 src/views/toCarryOutLegislativeReforms/summaryPage/index.vue |   53 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/src/views/toCarryOutLegislativeReforms/summaryPage/index.vue b/src/views/toCarryOutLegislativeReforms/summaryPage/index.vue
index 8cbb583..b5f8c3d 100644
--- a/src/views/toCarryOutLegislativeReforms/summaryPage/index.vue
+++ b/src/views/toCarryOutLegislativeReforms/summaryPage/index.vue
@@ -42,19 +42,31 @@
       />
     </div>
     <div class="agentSummary">
-      <div class="circle">
+      <div
+        class="circle"
+        @click="toOtherPage('total')"
+      >
         <div>������������</div>
         <div>{{ responeForm.total }}</div>
       </div>
-      <div class="circle">
+      <div
+        class="circle"
+        @click="toOtherPage('unComplete')"
+      >
         <div>���������</div>
         <div>{{ responeForm.unComplete }}</div>
       </div>
-      <div class="circle">
+      <div
+        class="circle"
+        @click="toOtherPage('complete')"
+      >
         <div>���������</div>
         <div>{{ responeForm.complete }}</div>
       </div>
-      <div class="circle">
+      <div
+        class="circle"
+        @click="toOtherPage('overdue')"
+      >
         <div>������</div>
         <div>{{ responeForm.overdue }}</div>
       </div>
@@ -364,6 +376,38 @@
     this.handleSearch()
   },
   methods: {
+    toOtherPage (val) {
+      console.log('val', val)
+      let startTime = ''
+      let endTime = ''
+
+      if (this.searchForm.number) {
+        startTime = this.getPeriods(Number(this.searchForm.number))[0]
+        endTime = this.getPeriods(Number(this.searchForm.number))[1]
+      } else {
+        startTime = this.timeInterval[0]
+        endTime = this.timeInterval[1]
+      }
+      this.$router.push({ path: '/toCarryOutLegislativeReforms/toCarryOutLegislativeReforms/reform',
+        query: {
+          type: val,
+          startTime: startTime,
+          endTime: endTime
+        }
+      })
+    },
+    getPeriods (month) {
+      const now = new Date()
+      const end = new Date(new Date())
+      const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())
+      // ������������������������������
+      const oneMonthAgo = new Date(today)
+      oneMonthAgo.setMonth(oneMonthAgo.getMonth() - month)
+      const startTime = oneMonthAgo.toISOString().split('T')[0]
+      const endTime = end.toISOString().substring(0, 10)
+      console.log('startTime', startTime, 'endTime', endTime)
+      return [startTime, endTime]
+    },
     changeUid (val) {
       this.unitIdlist = this.uniqueArrayReduce(val)
       this.handleSearch()
@@ -596,6 +640,7 @@
       justify-content: center;
       flex-wrap: wrap;
       flex-direction: column;
+      cursor: pointer;
     }
   }
 

--
Gitblit v1.8.0