From d90b45d7e9e38e34c044b772006004f2a4cb8b8e Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 26 六月 2026 13:51:50 +0800
Subject: [PATCH] 测试完成

---
 src/views/sfstatistics/percentage/index.vue |   83 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index dd731d8..ca39454 100644
--- a/src/views/sfstatistics/percentage/index.vue
+++ b/src/views/sfstatistics/percentage/index.vue
@@ -75,10 +75,25 @@
             v-model="queryParams.dateRange"
             value-format="yyyy-MM-dd HH:mm:ss"
             type="daterange"
+            unlink-panels
             range-separator="鑷�"
             start-placeholder="寮�濮嬫棩鏈�"
             end-placeholder="缁撴潫鏃ユ湡"
             :default-time="['00:00:00', '23:59:59']"
+            :picker-options="pickerOptions"
+          />
+        </el-form-item>
+        <el-form-item label-width="200" label="鍑洪櫌鏃堕棿鑼冨洿" prop="userName">
+          <el-date-picker
+            v-model="queryParams.dateRangecy"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="daterange"
+            unlink-panels
+            range-separator="鑷�"
+            start-placeholder="寮�濮嬫棩鏈�"
+            end-placeholder="缁撴潫鏃ユ湡"
+            :default-time="['00:00:00', '23:59:59']"
+            :picker-options="pickerOptions"
           />
         </el-form-item>
 
@@ -202,7 +217,7 @@
 import { getSfStatisticsHyperlink } from "@/api/AiCentre/index";
 
 export default {
-  name: "FollowUpStatistics",
+  name: "Percentage",
   components: {
     FirstFollowUp,
     SecondFollowUp,
@@ -222,10 +237,42 @@
       options: this.$store.getters.tasktypes,
       queryParams: {
         serviceType: [2],
-        dateRange: [],
+        dateRange: this.getLastMonthRange(),
+        dateRangecy: [],
         statisticaltype: 1,
         leavehospitaldistrictcodes: ["all"],
         deptcodes: [],
+      },
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "鏈�杩戜竴鍛�",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "鏈�杩戜竴涓湀",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "鏈�杩戜笁涓湀",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
       },
       flatArrayhospit: [],
       flatArraydept: [],
@@ -281,7 +328,29 @@
       this.flatArraydept.push({ label: "鍏ㄩ儴", value: "all" });
       this.flatArrayhospit.push({ label: "鍏ㄩ儴", value: "all" });
     },
+    // 娣诲姞鑾峰彇鏈�杩戜竴涓湀鏃堕棿鑼冨洿鐨勬柟娉�
+    getLastMonthRange() {
+      const end = new Date();
+      const start = new Date();
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
 
+      // 鏍煎紡鍖栦负 yyyy-MM-dd HH:mm:ss
+      const formatDate = (date) => {
+        const year = date.getFullYear();
+        const month = String(date.getMonth() + 1).padStart(2, "0");
+        const day = String(date.getDate()).padStart(2, "0");
+        return `${year}-${month}-${day} 00:00:00`;
+      };
+
+      const formatEndDate = (date) => {
+        const year = date.getFullYear();
+        const month = String(date.getMonth() + 1).padStart(2, "0");
+        const day = String(date.getDate()).padStart(2, "0");
+        return `${year}-${month}-${day} 23:59:59`;
+      };
+
+      return [formatDate(start), formatEndDate(end)];
+    },
     handleTabClick(tab) {
       this.activeTab = tab.name;
       this.loadCurrentTabData();
@@ -306,7 +375,12 @@
         this.queryParams.dateRange[0]
       );
       this.queryParams.endTime = this.parseTime(this.queryParams.dateRange[1]);
-
+      this.queryParams.hospitalStartTime = this.parseTime(
+        this.queryParams.dateRangecy[0]
+      );
+      this.queryParams.hospitalEndTime = this.parseTime(
+        this.queryParams.dateRangecy[1]
+      );
       if (this.queryParams.statisticaltype == 1) {
         this.queryParams.deptcodes = [];
       } else if (this.queryParams.statisticaltype == 2) {
@@ -372,6 +446,9 @@
         obj.deptcodes = [row.deptcode];
         obj.leavehospitaldistrictcodes = [];
       }
+      obj.endTime = this.queryParams.endTime;
+      obj.startTime = this.queryParams.startTime;
+      obj.statisticaltype = this.queryParams.statisticaltype;
 
       getSfStatisticsHyperlink(obj).then((response) => {
         this.infotitlelist = response.data;

--
Gitblit v1.9.3