From 2736806c9fbccb6e3fdf981a6f48a9343e21fa4a Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 19 八月 2026 15:33:10 +0800
Subject: [PATCH] 提交

---
 src/views/sfstatistics/percentage/components/SecondFollowUp.vue |  541 +++++++++++++++++++++++++----------------------------
 1 files changed, 253 insertions(+), 288 deletions(-)

diff --git a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
index 2a6b8e7..88fe70e 100644
--- a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
@@ -229,11 +229,13 @@
                   </template>
                 </el-table-column>
                 <el-table-column
+                  v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
                   label="鎴愬姛鐜�"
                   align="center"
                   width="120"
                   key="successRateAgain"
                   prop="successRateAgain"
+                  :render-header="Tooltipcgl"
                 >
                   <template slot-scope="scope">
                     <span class="success-rate">{{
@@ -251,6 +253,7 @@
                   width="120"
                   key="followUpRateAgain"
                   prop="followUpRateAgain"
+                  :render-header="Tooltipsfl"
                 />
                 <el-table-column
                   label="浜哄伐"
@@ -524,11 +527,13 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
             label="鎴愬姛鐜�"
             align="center"
             width="120"
             key="successRateAgain"
             prop="successRateAgain"
+            :render-header="Tooltipcgl"
           >
             <template slot-scope="scope">
               <span class="success-rate">{{
@@ -546,6 +551,7 @@
             width="120"
             key="followUpRateAgain"
             prop="followUpRateAgain"
+            :render-header="Tooltipsfl"
           />
           <el-table-column
             label="浜哄伐"
@@ -693,7 +699,7 @@
 
       delete params.leavehospitaldistrictcodes.all;
       delete params.deptcodes.all;
-      params.rateDay = 7;
+      params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
       getSfStatistics(params)
         .then((response) => {
@@ -707,7 +713,46 @@
           this.loading = false;
         });
     },
-
+    Tooltipcgl(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: "闅忚鎴愬姛/(闇�闅忚-寰呴殢璁�)",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
+    Tooltipjsl(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content:
+              "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
+    Tooltipsfl(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: "(闅忚鎴愬姛+棣栨闅忚澶辫触)/棣栨搴旈殢璁�",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
     getAllWardCodes() {
       return this.flatArrayhospit
         .filter((item) => item.value !== "all")
@@ -721,163 +766,19 @@
     },
 
     customSort(data) {
-      const order = [
-        "涓�",
-        "浜�",
-        "涓�",
-        "鍥�",
-        "浜�",
-        "鍏�",
-        "涓�",
-        "鍏�",
-        "涔�",
-        "鍗�",
-        "鍗佷竴",
-        "鍗佷簩",
-        "鍗佷笁",
-        "鍗佸洓",
-        "鍗佷簲",
-        "鍗佸叚",
-        "鍗佷竷",
-        "鍗佸叓",
-        "鍗佷節",
-        "浜屽崄",
-        "浜屽崄涓�",
-        "浜屽崄浜�",
-        "浜屽崄涓�",
-        "浜屽崄鍥�",
-        "浜屽崄浜�",
-        "浜屽崄鍏�",
-        "浜屽崄涓�",
-        "浜屽崄鍏�",
-        "浜屽崄涔�",
-        "涓夊崄",
-        "涓夊崄涓�",
-        "涓夊崄浜�",
-        "涓夊崄涓�",
-        "涓夊崄鍥�",
-        "涓夊崄浜�",
-        "涓夊崄鍏�",
-        "涓夊崄涓�",
-        "涓夊崄鍏�",
-        "涓夊崄涔�",
-        "鍥涘崄",
-        "鍥涘崄涓�",
-        "鍥涘崄浜�",
-        "鍥涘崄涓�",
-        "鍥涘崄鍥�",
-        "鍥涘崄浜�",
-      ];
-
-      return data.sort((a, b) => {
-        const getIndex = (name) => {
-          if (!name || typeof name !== "string") return -1;
-          const chineseMatch = name.match(/^([涓�浜屼笁鍥涗簲鍏竷鍏節鍗乚+)/);
-          if (chineseMatch && chineseMatch[1]) {
-            return order.indexOf(chineseMatch[1]);
-          }
-          const arabicMatch = name.match(/^(\d+)/);
-          if (arabicMatch && arabicMatch[1]) {
-            const num = parseInt(arabicMatch[1], 10);
-            if (num >= 1 && num <= 45) {
-              return num - 1;
-            }
-          }
-          return -1;
-        };
-
-        const indexA = getIndex(a.leavehospitaldistrictname);
-        const indexB = getIndex(b.leavehospitaldistrictname);
-
-        if (indexA === -1 && indexB === -1) {
-          return (a.leavehospitaldistrictname || "").localeCompare(
-            b.leavehospitaldistrictname || ""
-          );
-        }
-        if (indexA === -1) return 1;
-        if (indexB === -1) return -1;
-        return indexA - indexB;
-      });
+      return data.sort((a, b) =>
+        this.compareWardName(
+          a.leavehospitaldistrictname,
+          b.leavehospitaldistrictname
+        )
+      );
     },
 
     sortChineseNumber(aRow, bRow) {
-      const a = aRow.leavehospitaldistrictname;
-      const b = bRow.leavehospitaldistrictname;
-
-      const chineseNumMap = {
-        涓�: 1,
-        浜�: 2,
-        涓�: 3,
-        鍥�: 4,
-        浜�: 5,
-        鍏�: 6,
-        涓�: 7,
-        鍏�: 8,
-        涔�: 9,
-        鍗�: 10,
-        鍗佷竴: 11,
-        鍗佷簩: 12,
-        鍗佷笁: 13,
-        鍗佸洓: 14,
-        鍗佷簲: 15,
-        鍗佸叚: 16,
-        鍗佷竷: 17,
-        鍗佸叓: 18,
-        鍗佷節: 19,
-        浜屽崄: 20,
-        浜屽崄涓�: 21,
-        浜屽崄浜�: 22,
-        浜屽崄涓�: 23,
-        浜屽崄鍥�: 24,
-        浜屽崄浜�: 25,
-        浜屽崄鍏�: 26,
-        浜屽崄涓�: 27,
-        浜屽崄鍏�: 28,
-        浜屽崄涔�: 29,
-        涓夊崄: 30,
-        涓夊崄涓�: 31,
-        涓夊崄浜�: 32,
-        涓夊崄涓�: 33,
-        涓夊崄鍥�: 34,
-        涓夊崄浜�: 35,
-        涓夊崄鍏�: 36,
-        涓夊崄涓�: 37,
-        涓夊崄鍏�: 38,
-        涓夊崄涔�: 39,
-        鍥涘崄: 40,
-        鍥涘崄涓�: 41,
-        鍥涘崄浜�: 42,
-        鍥涘崄涓�: 43,
-        鍥涘崄鍥�: 44,
-        鍥涘崄浜�: 45,
-      };
-
-      const getNumberFromText = (text) => {
-        if (!text || typeof text !== "string") return -1;
-        const match = text.match(/^([涓�浜屼笁鍥涗簲鍏竷鍏節鍗乚+)/);
-        if (match && match[1]) {
-          const chineseNum = match[1];
-          return chineseNumMap[chineseNum] !== undefined
-            ? chineseNumMap[chineseNum]
-            : -1;
-        }
-        const arabicMatch = text.match(/^(\d+)/);
-        if (arabicMatch && arabicMatch[1]) {
-          const num = parseInt(arabicMatch[1], 10);
-          return num >= 1 && num <= 45 ? num : -1;
-        }
-        return -1;
-      };
-
-      const numA = getNumberFromText(a);
-      const numB = getNumberFromText(b);
-
-      if (numA === -1 && numB === -1) {
-        return (a || "").localeCompare(b || "");
-      }
-      if (numA === -1) return 1;
-      if (numB === -1) return -1;
-      return numA - numB;
+      return this.compareWardName(
+        aRow.leavehospitaldistrictname,
+        bRow.leavehospitaldistrictname
+      );
     },
 
     getRowKey(row) {
@@ -907,7 +808,7 @@
 
       if (!row.doctorStats) {
         this.loading = true;
-        params.rateDay = 7;
+        params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
         getSfStatistics(params).then((res) => {
           this.$set(row, "doctorStats", res.data);
@@ -1080,6 +981,67 @@
       return Number.isInteger(num) ? num.toString() : num.toFixed(0);
     },
 
+    // ===== 鐥呭尯鍚嶆帓搴忥紙鏀寔 1-B10 / 2-A2 绛� 鏁板瓧-瀛楁瘝鏁板瓧 鏍煎紡锛� =====
+    // 瑙f瀽鐥呭尯鍚嶏紝杩斿洖鎺掑簭閿� { group, letter, number }
+    parseWardKey(name) {
+      if (!name || typeof name !== "string") return null;
+      const trimmed = name.trim();
+
+      // 鏍煎紡1锛氭暟瀛�-瀛楁瘝鏁板瓧锛屽 1-B10銆�2-A2銆�1-A11
+      const dashMatch = trimmed.match(/^(\d+)-([A-Za-z]+)(\d+)/);
+      if (dashMatch) {
+        return {
+          group: parseInt(dashMatch[1], 10),
+          letter: dashMatch[2].toUpperCase(),
+          number: parseInt(dashMatch[3], 10),
+        };
+      }
+
+      // 鏍煎紡2锛氫腑鏂囨暟瀛楀紑澶达紝濡� 涓�鐥呭尯銆佸崄涓�鐥呭尯銆佷簩鍗佷竴鐥呭尯
+      const cnMatch = trimmed.match(/^([涓�浜屼笁鍥涗簲鍏竷鍏節鍗乚+)/);
+      if (cnMatch && cnMatch[1]) {
+        const num = this.chineseToNumber(cnMatch[1]);
+        if (num > 0) return { group: num, letter: "", number: 0 };
+      }
+
+      // 鏍煎紡3锛氶樋鎷変集鏁板瓧寮�澶达紝濡� 1鐥呭尯銆�12鐥呭尯
+      const numMatch = trimmed.match(/^(\d+)/);
+      if (numMatch && numMatch[1]) {
+        return { group: parseInt(numMatch[1], 10), letter: "", number: 0 };
+      }
+
+      return null;
+    },
+
+    // 涓枃鏁板瓧杞樋鎷変集鏁板瓧锛堟敮鎸� 涓� ~ 涔濆崄涔濓級
+    chineseToNumber(str) {
+      const digits = { 涓�: 1, 浜�: 2, 涓�: 3, 鍥�: 4, 浜�: 5, 鍏�: 6, 涓�: 7, 鍏�: 8, 涔�: 9 };
+      if (!str) return -1;
+      if (str === "鍗�") return 10;
+      if (str.startsWith("鍗�")) return 10 + (digits[str[1]] || 0);
+      if (str.includes("鍗�")) {
+        const parts = str.split("鍗�");
+        const tens = digits[parts[0]] || 0;
+        const ones = digits[parts[1]] || 0;
+        return tens * 10 + ones;
+      }
+      return digits[str] !== undefined ? digits[str] : -1;
+    },
+
+    // 鐥呭尯鍚嶆瘮杈冨櫒锛氭暟瀛楁 鈫� 瀛楁瘝娈� 鈫� 鏁板瓧娈�
+    compareWardName(nameA, nameB) {
+      const ka = this.parseWardKey(nameA);
+      const kb = this.parseWardKey(nameB);
+
+      if (!ka && !kb) return (nameA || "").localeCompare(nameB || "", "zh-CN");
+      if (!ka) return 1;
+      if (!kb) return -1;
+
+      if (ka.group !== kb.group) return ka.group - kb.group;
+      if (ka.letter !== kb.letter) return ka.letter.localeCompare(kb.letter);
+      return ka.number - kb.number;
+    },
+
     handleSelectionChange(selection) {
       this.ids = selection.map((item) => item.tagid);
     },
@@ -1107,143 +1069,145 @@
       return rate.toFixed(2) + "%";
     },
     async exportTable() {
-  try {
-    let dateRangeString = "";
-    let sheetNameSuffix = "";
+      try {
+        let dateRangeString = "";
+        let sheetNameSuffix = "";
 
-    // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
-    const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
+        // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
+        const isLishuiHospital = this.orgname == "涓芥按甯備腑鍖婚櫌";
 
-    if (
-      this.queryParams.dateRange &&
-      this.queryParams.dateRange.length === 2
-    ) {
-      const startDateStr = this.queryParams.dateRange[0];
-      const endDateStr = this.queryParams.dateRange[1];
+        if (
+          this.queryParams.dateRange &&
+          this.queryParams.dateRange.length === 2
+        ) {
+          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}鏈坄;
+          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;
+          const currentYear = now.getFullYear();
+
+          if (isLishuiHospital) {
+            // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
+            dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
+            sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
+          } else {
+            // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
+            dateRangeString = `${currentMonth}鏈坄;
+            sheetNameSuffix = `${currentMonth}鏈坄;
+          }
+        }
+
+        // 鏍规嵁 serviceType 鐢熸垚闅忚绫诲瀷鍚嶇О
+        let serviceTypeName = "鍑洪櫌闅忚"; // 鏂囦欢鍚嶄娇鐢ㄧ殑鍚嶇О
+        let sheetTypeName = "鍐嶆闅忚"; // 宸ヤ綔琛ㄤ娇鐢ㄧ殑鍚嶇О锛堢畝鍖栫増锛�
+        console.log(this.queryParams.serviceType);
+
+        if (
+          this.queryParams.serviceType &&
+          Array.isArray(this.queryParams.serviceType) &&
+          this.queryParams.serviceType.length > 0
+        ) {
+          if (this.tasktypes && Array.isArray(this.tasktypes)) {
+            // 杩囨护鍑哄尮閰嶇殑闅忚绫诲瀷
+            const matchedTypes = this.tasktypes.filter((task) =>
+              this.queryParams.serviceType.includes(task.value)
+            );
+
+            if (matchedTypes.length === 1) {
+              // 鍗曚釜绫诲瀷
+              const label = matchedTypes[0].label;
+              serviceTypeName = label;
+              sheetTypeName = label;
+            } else if (matchedTypes.length > 1) {
+              // 澶氫釜绫诲瀷
+              const typeNames = matchedTypes.map((task) => task.label);
+
+              // 鏂囦欢鍚嶏細鐢ㄦ枩鏉犲垎闅�
+              serviceTypeName = typeNames.join("/");
+
+              // 宸ヤ綔琛ㄥ悕锛氫娇鐢ㄧ涓�涓被鍨嬫垨绠�鍖栧悕绉�
+              if (matchedTypes.length <= 2) {
+                // 濡傛灉鍙湁2涓被鍨嬶紝閮芥樉绀�
+                sheetTypeName = `${typeNames[0]}绛塦;
+              } else {
+                // 濡傛灉瓒呰繃2涓被鍨嬶紝鍙樉绀虹涓�涓�
+                sheetTypeName = `${typeNames[0]}绛塦;
+              }
+            } else if (this.queryParams.serviceType.length > 0) {
+              // 濡傛灉娌℃湁鍖归厤鐨勶紝浣跨敤鍘熷鍊�
+              const typeStr = this.queryParams.serviceType.join("/");
+              serviceTypeName = typeStr;
+              sheetTypeName = "鍐嶆闅忚";
+            }
+          } else if (this.queryParams.serviceType.length > 0) {
+            // 濡傛灉娌℃湁 tasktypes锛屼娇鐢ㄥ師濮嬪��
+            const typeStr = this.queryParams.serviceType.join("/");
+            serviceTypeName = typeStr;
+            sheetTypeName = "鍐嶆闅忚";
+          }
+        }
+
+        const excelName = `鍐嶆${serviceTypeName}缁熻琛╛${dateRangeString}.xlsx`;
+
+        // 娓呯悊宸ヤ綔琛ㄥ悕绉帮紝绉婚櫎闈炴硶瀛楃
+        const cleanSheetName = (name) => {
+          // Excel宸ヤ綔琛ㄥ悕涓嶈兘鍖呭惈鐨勫瓧绗�: * ? : \ / [ ]
+          return name.replace(/[*?:\\/[\]]/g, " ");
         };
-        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;
-      const currentYear = now.getFullYear();
 
-      if (isLishuiHospital) {
-        // 涓芥按甯備腑鍖婚櫌锛氭樉绀哄勾鏈�
-        dateRangeString = `${currentYear}骞�${currentMonth}鏈坄;
-        sheetNameSuffix = `${currentYear}骞�${currentMonth}鏈坄;
-      } else {
-        // 鍏朵粬鍖婚櫌锛氭樉绀烘湀浠�
-        dateRangeString = `${currentMonth}鏈坄;
-        sheetNameSuffix = `${currentMonth}鏈坄;
-      }
-    }
-
-    // 鏍规嵁 serviceType 鐢熸垚闅忚绫诲瀷鍚嶇О
-    let serviceTypeName = "鍑洪櫌闅忚"; // 鏂囦欢鍚嶄娇鐢ㄧ殑鍚嶇О
-    let sheetTypeName = "鍐嶆闅忚"; // 宸ヤ綔琛ㄤ娇鐢ㄧ殑鍚嶇О锛堢畝鍖栫増锛�
-    console.log(this.queryParams.serviceType);
-
-    if (
-      this.queryParams.serviceType &&
-      Array.isArray(this.queryParams.serviceType) &&
-      this.queryParams.serviceType.length > 0
-    ) {
-      if (this.tasktypes && Array.isArray(this.tasktypes)) {
-        // 杩囨护鍑哄尮閰嶇殑闅忚绫诲瀷
-        const matchedTypes = this.tasktypes.filter((task) =>
-          this.queryParams.serviceType.includes(task.value)
+        const worksheetName = cleanSheetName(
+          `鍐嶆${sheetTypeName}缁熻_${sheetNameSuffix}`
         );
 
-        if (matchedTypes.length === 1) {
-          // 鍗曚釜绫诲瀷
-          const label = matchedTypes[0].label;
-          serviceTypeName = label;
-          sheetTypeName = label;
-        } else if (matchedTypes.length > 1) {
-          // 澶氫釜绫诲瀷
-          const typeNames = matchedTypes.map((task) => task.label);
-
-          // 鏂囦欢鍚嶏細鐢ㄦ枩鏉犲垎闅�
-          serviceTypeName = typeNames.join("/");
-
-          // 宸ヤ綔琛ㄥ悕锛氫娇鐢ㄧ涓�涓被鍨嬫垨绠�鍖栧悕绉�
-          if (matchedTypes.length <= 2) {
-            // 濡傛灉鍙湁2涓被鍨嬶紝閮芥樉绀�
-            sheetTypeName = `${typeNames[0]}绛塦;
-          } else {
-            // 濡傛灉瓒呰繃2涓被鍨嬶紝鍙樉绀虹涓�涓�
-            sheetTypeName = `${typeNames[0]}绛塦;
-          }
-        } else if (this.queryParams.serviceType.length > 0) {
-          // 濡傛灉娌℃湁鍖归厤鐨勶紝浣跨敤鍘熷鍊�
-          const typeStr = this.queryParams.serviceType.join("/");
-          serviceTypeName = typeStr;
-          sheetTypeName = "鍐嶆闅忚";
+        if (!this.tableData || this.tableData.length === 0) {
+          this.$message.warning(`鏆傛棤鍐嶆${serviceTypeName}鏁版嵁鍙鍑篳);
+          return false;
         }
-      } else if (this.queryParams.serviceType.length > 0) {
-        // 濡傛灉娌℃湁 tasktypes锛屼娇鐢ㄥ師濮嬪��
-        const typeStr = this.queryParams.serviceType.join("/");
-        serviceTypeName = typeStr;
-        sheetTypeName = "鍐嶆闅忚";
+
+        const workbook = new ExcelJS.Workbook();
+        const worksheet = workbook.addWorksheet(worksheetName);
+
+        // 鏋勫缓琛ㄦ牸
+        this.buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName);
+
+        const buffer = await workbook.xlsx.writeBuffer();
+        const blob = new Blob([buffer], {
+          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+        });
+        saveAs(blob, excelName);
+
+        this.$message.success("瀵煎嚭鎴愬姛");
+        return true;
+      } catch (error) {
+        console.error("瀵煎嚭澶辫触:", error);
+        this.$message.error(`瀵煎嚭澶辫触: ${error.message}`);
+        return false;
       }
-    }
-
-    const excelName = `鍐嶆${serviceTypeName}缁熻琛╛${dateRangeString}.xlsx`;
-
-    // 娓呯悊宸ヤ綔琛ㄥ悕绉帮紝绉婚櫎闈炴硶瀛楃
-    const cleanSheetName = (name) => {
-      // Excel宸ヤ綔琛ㄥ悕涓嶈兘鍖呭惈鐨勫瓧绗�: * ? : \ / [ ]
-      return name.replace(/[*?:\\/[\]]/g, ' ');
-    };
-
-    const worksheetName = cleanSheetName(`鍐嶆${sheetTypeName}缁熻_${sheetNameSuffix}`);
-
-    if (!this.tableData || this.tableData.length === 0) {
-      this.$message.warning(`鏆傛棤鍐嶆${serviceTypeName}鏁版嵁鍙鍑篳);
-      return false;
-    }
-
-    const workbook = new ExcelJS.Workbook();
-    const worksheet = workbook.addWorksheet(worksheetName);
-
-    // 鏋勫缓琛ㄦ牸
-    this.buildExportSheet(worksheet, sheetNameSuffix);
-
-    const buffer = await workbook.xlsx.writeBuffer();
-    const blob = new Blob([buffer], {
-      type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
-    });
-    saveAs(blob, excelName);
-
-    this.$message.success("瀵煎嚭鎴愬姛");
-    return true;
-  } catch (error) {
-    console.error("瀵煎嚭澶辫触:", error);
-    this.$message.error(`瀵煎嚭澶辫触: ${error.message}`);
-    return false;
-  }
-},
+    },
     /** 瀵煎嚭鍖荤敓瀛愯〃锛堝啀娆¢殢璁匡級 */
     async exportDoctorTable(row) {
       try {
@@ -1457,7 +1421,7 @@
 
       return sums;
     },
-    buildExportSheet(worksheet, sheetNameSuffix) {
+    buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName) {
       const titleStyle = {
         font: {
           name: "寰蒋闆呴粦",
@@ -1532,10 +1496,11 @@
         },
       };
 
+      const titleText = `鍐嶆${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
       // 娣诲姞鏍囬琛�
-      worksheet.mergeCells(1, 1, 1, 15);
+      worksheet.mergeCells(1, 1, 1, 16);
       const titleCell = worksheet.getCell(1, 1);
-      titleCell.value = `鍐嶆鍑洪櫌闅忚缁熻琛╛${sheetNameSuffix}`;
+      titleCell.value = titleText; // 浣跨敤鍔ㄦ�佹爣棰�
       titleCell.style = titleStyle;
       worksheet.getRow(1).height = 35;
 

--
Gitblit v1.9.3