From dfd32b299236e015fe80e10fae01548288d91000 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 02 十一月 2026 09:56:32 +0800
Subject: [PATCH] Merge branch 'subtask' of http://116.62.18.175:6699/r/~yxh/smartor-web into subtask

---
 src/views/Satisfaction/sfstatistics/components/visitStatistics.vue |  115 ++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 76 insertions(+), 39 deletions(-)

diff --git a/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue b/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue
index 60a1c59..f2439a7 100644
--- a/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/components/visitStatistics.vue
@@ -199,13 +199,14 @@
                 scope.row.followUpRate !== undefined
               "
             >
-              {{ formatPercent(scope.row.followUpRate) }}
+              {{ scope.row.followUpRate }}
             </span>
             <span v-else>-</span>
           </template>
         </el-table-column>
 
         <el-table-column
+        v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
           label="鍙婃椂鐜�"
           align="center"
           key="rate"
@@ -322,6 +323,7 @@
         :row-data="currentRow"
         :topicList="topiclist"
         :query-params="queryParams"
+        :topType="1"
         @close="topicVisible = false"
       />
     </el-dialog>
@@ -446,7 +448,7 @@
     // 鍒濆鍖栨暟鎹�
     async initData() {
       await this.getDeptTree();
-      await this.getList();
+      // await this.getList();
     },
 
     // 鑾峰彇绉戝鏍�
@@ -836,22 +838,54 @@
         let dateRangeString = "";
         let sheetNameSuffix = "";
 
+        const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
+
         if (
           this.queryParams.dateRange &&
           this.queryParams.dateRange.length === 2
         ) {
-          const startDateFormatted = this.queryParams.dateRange[0];
-          const endDateFormatted = this.queryParams.dateRange[1];
-          dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
-          sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+          const startDateStr = this.queryParams.dateRange[0];
+          const endDateStr = this.queryParams.dateRange[1];
+
+          if (isLishuiHospital) {
+            // 涓芥按甯備腑鍖婚櫌锛氬彧鏄剧ず骞存湀
+            const formatMonthOnly = (dateTimeStr) => {
+              const date = new Date(dateTimeStr);
+              const year = date.getFullYear();
+              const month = date.getMonth() + 1;
+              return `${year}骞�${month}鏈坄;
+            };
+            const startDateFormatted = formatMonthOnly(startDateStr);
+            const endDateFormatted = formatMonthOnly(endDateStr);
+            dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
+            sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+          } else {
+            // 鍏朵粬鍖婚櫌锛氭樉绀哄勾鏈堟棩
+            const formatDateForDisplay = (dateTimeStr) => {
+              return dateTimeStr.split(" ")[0];
+            };
+            const startDateFormatted = formatDateForDisplay(startDateStr);
+            const endDateFormatted = formatDateForDisplay(endDateStr);
+            dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
+            sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+          }
         } else {
           const now = new Date();
           const currentMonth = now.getMonth() + 1;
-          dateRangeString = `${currentMonth}鏈坄;
-          sheetNameSuffix = `${currentMonth}鏈坄;
+          const currentYear = now.getFullYear();
+
+          if (isLishuiHospital) {
+            // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
+            dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
+            sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
+          } else {
+            // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
+            dateRangeString = `${currentMonth}鏈坄;
+            sheetNameSuffix = `${currentMonth}鏈坄;
+          }
         }
 
-        const excelName = `闅忚缁熻琛╛${dateRangeString}.xlsx`;
+        const excelName = `澶嶈瘖閫氱煡缁熻琛╛${dateRangeString}.xlsx`;
         const worksheetName = `闅忚缁熻_${sheetNameSuffix}`;
 
         // 鍒涘缓Excel宸ヤ綔绨�
@@ -902,25 +936,27 @@
           },
         };
 
-        // 娣诲姞鎬绘爣棰�
-        worksheet.mergeCells(1, 1, 1, 10);
-        const titleCell = worksheet.getCell(1, 1);
-        titleCell.value = `闅忚缁熻琛紙${sheetNameSuffix}锛塦;
-        titleCell.style = titleStyle;
-        worksheet.getRow(1).height = 35;
-
-        // 娣诲姞琛ㄥご
+        // 琛ㄥご鎸夐〉闈㈠垪鍔ㄦ�佺敓鎴愶細銆屽強鏃剁巼銆嶅彧鏈夋櫙瀹侀櫌鍖洪〉闈㈡墠鏄剧ず
+        const showTimelyRate = this.orgname === "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�";
         const headers = [
           this.queryParams.statisticaltype == 1 ? "鍑洪櫌鐥呭尯" : "绉戝",
           "鍑洪櫌浜烘",
           "鏃犻渶闅忚浜烘",
           "搴旈殢璁夸汉娆�",
           "闅忚鐜�",
-          "鍙婃椂鐜�",
-          "澶嶈瘖閫氱煡棰樼洰鎬婚噺",
-          "澶嶈瘖閫氱煡濉姤閲�",
-          "瀹屾垚姣旂巼",
         ];
+        if (showTimelyRate) {
+          headers.push("鍙婃椂鐜�");
+        }
+        headers.push("澶嶈瘖閫氱煡棰樼洰鎬婚噺", "澶嶈瘖閫氱煡濉姤閲�", "瀹屾垚姣旂巼");
+        const colCount = headers.length;
+
+        // 娣诲姞鎬绘爣棰�
+        worksheet.mergeCells(1, 1, 1, colCount);
+        const titleCell = worksheet.getCell(1, 1);
+        titleCell.value = `澶嶈瘖閫氱煡缁熻琛紙${sheetNameSuffix}锛塦;
+        titleCell.style = titleStyle;
+        worksheet.getRow(1).height = 35;
 
         const headerRow = worksheet.addRow(headers);
         headerRow.eachCell((cell) => {
@@ -928,21 +964,30 @@
         });
         headerRow.height = 25;
 
-        // 娣诲姞鏁版嵁琛�
+        // 娣诲姞鏁版嵁琛岋紙绌哄�肩粺涓�鏄剧ず鈥�-鈥濓紝涓庨〉闈繚鎸佷竴鑷达級
+        const dash = (v, formatter) => {
+          if (v === null || v === undefined || v === "") return "-";
+          return formatter ? formatter(v) : v;
+        };
         this.userList.forEach((item) => {
-          const dataRow = worksheet.addRow([
+          const rowData = [
             this.queryParams.statisticaltype == 1
               ? item.leavehospitaldistrictname
               : item.deptname,
             item.dischargeCount || 0,
             item.nonFollowUp || 0,
             item.followUpNeeded || 0,
-            item.followUpRate || "0%",
-            item.rate ? this.formatPercent(item.rate) : "0%",
+            dash(item.followUpRate),
+          ];
+          if (showTimelyRate) {
+            rowData.push(dash(item.rate, (v) => this.formatPercent(v)));
+          }
+          rowData.push(
             item.joyAllCount || 0,
             item.joyCount || 0,
-            item.joyTotal ? this.formatPercent(item.joyTotal) : "0%",
-          ]);
+            dash(item.joyTotal, (v) => this.formatPercent(v))
+          );
+          const dataRow = worksheet.addRow(rowData);
 
           dataRow.eachCell((cell) => {
             cell.style = cellStyle;
@@ -950,18 +995,10 @@
           dataRow.height = 22;
         });
 
-        // 璁剧疆鍒楀
-        worksheet.columns = [
-          { width: 20 },
-          { width: 12 },
-          { width: 12 },
-          { width: 12 },
-          { width: 12 },
-          { width: 12 },
-          { width: 15 },
-          { width: 15 },
-          { width: 12 },
-        ];
+        // 璁剧疆鍒楀锛堣窡鍒楁暟涓�鑷达級
+        worksheet.columns = headers.map((h, i) => ({
+          width: i === 0 ? 20 : h.length > 6 ? 15 : 12,
+        }));
 
         // 鐢熸垚骞朵笅杞芥枃浠�
         const buffer = await workbook.xlsx.writeBuffer();

--
Gitblit v1.9.3