From 574b449a39019a59dc90ecc19dda9f63d3aa9636 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 18 十一月 2026 15:35:47 +0800
Subject: [PATCH] 测试完成

---
 src/views/sfstatistics/percentage/components/FirstFollowUp.vue | 1823 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 1,404 insertions(+), 419 deletions(-)

diff --git a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
index b463732..18b247a 100644
--- a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
@@ -156,6 +156,7 @@
                   </template>
                 </el-table-column>
                 <el-table-column
+                  v-if="!isTargetHospital"
                   label="寰呴殢璁�"
                   align="center"
                   key="pendingFollowUp"
@@ -179,6 +180,62 @@
                       }}</span>
                     </el-button>
                   </template>
+                </el-table-column>
+                <el-table-column
+                  v-if="isTargetHospital"
+                  label="寰呴殢璁�"
+                  align="center"
+                >
+                  <el-table-column
+                    label="寰呭彂閫�"
+                    align="center"
+                    key="pendingFollowUpWaitSend"
+                    prop="pendingFollowUpWaitSend"
+                  >
+                    <template slot-scope="scope">
+                      <el-button
+                        size="medium"
+                        type="text"
+                        @click="
+                          handleViewDetails(
+                            scope.row,
+                            'pendingFollowUpWaitSendInfo',
+                            '寰呭彂閫佸垪琛�',
+                            '1'
+                          )
+                        "
+                      >
+                        <span class="button-zx">{{
+                          scope.row.pendingFollowUpWaitSend
+                        }}</span>
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="宸插彂閫�"
+                    align="center"
+                    key="pendingFollowUpSent"
+                    prop="pendingFollowUpSent"
+                  >
+                    <template slot-scope="scope">
+                      <el-button
+                        size="medium"
+                        type="text"
+                        @click="
+                          handleViewDetails(
+                            scope.row,
+                            'pendingFollowUpSentInfo',
+                            '宸插彂閫佸垪琛�',
+                            '1'
+                          )
+                        "
+                      >
+                        <span class="button-zx">{{
+                          scope.row.pendingFollowUpSent
+                        }}</span>
+                      </el-button>
+                    </template>
+                  </el-table-column>
                 </el-table-column>
                 <el-table-column
                   label="闅忚鎴愬姛"
@@ -206,6 +263,7 @@
                   </template>
                 </el-table-column>
                 <el-table-column
+                  v-if="!isTargetHospital"
                   label="闅忚澶辫触"
                   align="center"
                   key="followUpFail"
@@ -231,11 +289,13 @@
                   </template>
                 </el-table-column>
                 <el-table-column
+                  v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
                   label="鎴愬姛鐜�"
                   align="center"
                   width="120"
                   key="successRate"
                   prop="successRate"
+                  :render-header="Tooltipcgl"
                 >
                   <template slot-scope="scope">
                     <span class="success-rate">{{
@@ -253,6 +313,7 @@
                   width="120"
                   key="followUpRate"
                   prop="followUpRate"
+                  :render-header="Tooltipsfl"
                 />
                 <el-table-column
                   v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
@@ -261,6 +322,7 @@
                   width="120"
                   key="rate"
                   prop="rate"
+                  :render-header="Tooltipjsl"
                 >
                   <template slot-scope="scope">
                     <el-button
@@ -268,14 +330,13 @@
                       type="text"
                       @click="handleSeeDetails(scope.row)"
                     >
-                      <span class="button-zx"
-                        >{{ (Number(scope.row.rate) * 100).toFixed(2) }}%</span
-                      >
+                      <span class="button-zx">{{
+                        getTimelyRateText(scope.row)
+                      }}</span>
                     </el-button>
                   </template>
                 </el-table-column>
                 <el-table-column
-                  v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
                   label="浜哄伐"
                   align="center"
                   key="manual"
@@ -299,7 +360,6 @@
                   </template>
                 </el-table-column>
                 <el-table-column
-                  v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
                   label="璇煶"
                   align="center"
                   key="voice"
@@ -323,7 +383,6 @@
                   </template>
                 </el-table-column>
                 <el-table-column
-                  v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
                   label="鐭俊"
                   align="center"
                   key="sms"
@@ -347,7 +406,6 @@
                   </template>
                 </el-table-column>
                 <el-table-column
-                  v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
                   label="寰俊"
                   align="center"
                   key="weChat"
@@ -396,6 +454,7 @@
           :show-overflow-tooltip="true"
         />
         <el-table-column
+          v-if="!isTongdeOrg"
           label="鍑洪櫌浜烘"
           align="center"
           key="dischargeCount"
@@ -417,7 +476,60 @@
             </el-button>
           </template>
         </el-table-column>
+        <el-table-column v-if="isTongdeOrg" label="鍑洪櫌浜烘" align="center">
+          <el-table-column
+            label="鏅��"
+            align="center"
+            width="80"
+            key="dischargeCountNormal"
+            prop="dischargeCountNormal"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'dischargeCountNormalInfo',
+                    '鍑洪櫌鎮h�呭垪琛�-鏅��'
+                  )
+                "
+              >
+                <span class="button-zx">{{
+                  scope.row.dischargeCountNormal
+                }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鏃ラ棿"
+            align="center"
+            width="80"
+            key="dischargeCountDaytime"
+            prop="dischargeCountDaytime"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'dischargeCountDaytimeInfo',
+                    '鍑洪櫌鎮h�呭垪琛�-鏃ラ棿'
+                  )
+                "
+              >
+                <span class="button-zx">{{
+                  scope.row.dischargeCountDaytime
+                }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table-column>
         <el-table-column
+          v-if="!isTongdeOrg"
           label="鏃犻渶闅忚浜烘"
           align="center"
           width="100"
@@ -436,7 +548,58 @@
             </el-button>
           </template>
         </el-table-column>
+        <el-table-column v-if="isTongdeOrg" label="鏃犻渶闅忚浜烘" align="center">
+          <el-table-column
+            label="鏅��"
+            align="center"
+            width="80"
+            key="nonFollowUpNormal"
+            prop="nonFollowUpNormal"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'nonFollowUpNormalInfo',
+                    '鏃犻渶闅忚鍒楄〃-鏅��'
+                  )
+                "
+              >
+                <span class="button-zx">{{ scope.row.nonFollowUpNormal }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鏃ラ棿"
+            align="center"
+            width="80"
+            key="nonFollowUpDaytime"
+            prop="nonFollowUpDaytime"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'nonFollowUpDaytimeInfo',
+                    '鏃犻渶闅忚鍒楄〃-鏃ラ棿'
+                  )
+                "
+              >
+                <span class="button-zx">{{
+                  scope.row.nonFollowUpDaytime
+                }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table-column>
         <el-table-column
+          v-if="!isTongdeOrg"
           label="搴旈殢璁夸汉娆�"
           align="center"
           width="100"
@@ -454,6 +617,58 @@
               <span class="button-zx">{{ scope.row.followUpNeeded }}</span>
             </el-button>
           </template>
+        </el-table-column>
+        <el-table-column v-if="isTongdeOrg" label="搴旈殢璁夸汉娆�" align="center">
+          <el-table-column
+            label="鏅��"
+            align="center"
+            width="80"
+            key="followUpNeededNormal"
+            prop="followUpNeededNormal"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'followUpNeededNormalInfo',
+                    '搴旈殢璁垮垪琛�-鏅��'
+                  )
+                "
+              >
+                <span class="button-zx">{{
+                  scope.row.followUpNeededNormal
+                }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鏃ラ棿"
+            align="center"
+            width="80"
+            key="followUpNeededDaytime"
+            prop="followUpNeededDaytime"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'followUpNeededDaytimeInfo',
+                    '搴旈殢璁垮垪琛�-鏃ラ棿'
+                  )
+                "
+              >
+                <span class="button-zx">{{
+                  scope.row.followUpNeededDaytime
+                }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
         </el-table-column>
 
         <el-table-column align="center" label="棣栨鍑洪櫌闅忚">
@@ -476,6 +691,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="!isTargetHospital"
             label="寰呴殢璁�"
             align="center"
             key="pendingFollowUp"
@@ -496,6 +712,60 @@
                 <span class="button-zx">{{ scope.row.pendingFollowUp }}</span>
               </el-button>
             </template>
+          </el-table-column>
+          <el-table-column
+            v-if="isTargetHospital"
+            label="寰呴殢璁�"
+            align="center"
+          >
+            <el-table-column
+              label="寰呭彂閫�"
+              align="center"
+              key="pendingFollowUpWaitSend"
+              prop="pendingFollowUpWaitSend"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'pendingFollowUpWaitSendInfo',
+                      '寰呭彂閫佸垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{
+                    scope.row.pendingFollowUpWaitSend
+                  }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="宸插彂閫�"
+              align="center"
+              key="pendingFollowUpSent"
+              prop="pendingFollowUpSent"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'pendingFollowUpSentInfo',
+                      '宸插彂閫佸垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{
+                    scope.row.pendingFollowUpSent
+                  }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
           </el-table-column>
           <el-table-column
             label="闅忚鎴愬姛"
@@ -520,6 +790,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="!isTargetHospital"
             label="闅忚澶辫触"
             align="center"
             key="followUpFail"
@@ -542,11 +813,13 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
             label="鎴愬姛鐜�"
             align="center"
             width="120"
             key="successRate"
             prop="successRate"
+            :render-header="Tooltipcgl"
           >
             <template slot-scope="scope">
               <span class="success-rate">{{
@@ -564,6 +837,7 @@
             width="120"
             key="followUpRate"
             prop="followUpRate"
+            :render-header="Tooltipsfl"
           />
           <el-table-column
             v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
@@ -572,6 +846,7 @@
             width="120"
             key="rate"
             prop="rate"
+            :render-header="Tooltipjsl"
           >
             <template slot-scope="scope">
               <el-button
@@ -579,14 +854,231 @@
                 type="text"
                 @click="handleSeeDetails(scope.row)"
               >
-                <span class="button-zx"
-                  >{{ (Number(scope.row.rate) * 100).toFixed(2) }}%</span
-                >
+                <span class="button-zx">{{
+                  getTimelyRateText(scope.row)
+                }}</span>
               </el-button>
             </template>
           </el-table-column>
           <el-table-column
-            v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
+            v-if="orgname == '缂欎簯鍘夸汉姘戝尰闄�'"
+            label="鍙婃椂闅忚浜烘"
+            align="center"
+            key="timelyFollowUp"
+            prop="timelyFollowUp"
+            width="138"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  handleViewDetails(
+                    scope.row,
+                    'timelyFollowUpInfo',
+                    '鍙婃椂闅忚鍒楄〃'
+                  )
+                "
+              >
+                <span class="button-zx">{{ scope.row.timelyFollowUp }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="isTargetHospital" label="璇煶" align="center">
+            <el-table-column
+              label="鍙戦�佹暟"
+              align="center"
+              key="voice"
+              prop="voice"
+              :render-header="Tooltipfswc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'voiceInfo',
+                      '鍙戦�佸畬鎴愯闊抽殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.voice }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="鎴愬姛鏁�"
+              align="center"
+              key="voiceSuccess"
+              prop="voiceSuccess"
+              :render-header="Tooltipzzwc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'voiceSuccessInfo',
+                      '鏈�缁堝畬鎴愯闊抽殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.voiceSuccess }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table-column>
+          <el-table-column v-if="isTargetHospital" label="寰俊" align="center">
+            <el-table-column
+              label="鍙戦�佹暟"
+              align="center"
+              key="weChat"
+              prop="weChat"
+              :render-header="Tooltipfswc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'weChatInfo',
+                      '鍙戦�佸畬鎴愬井淇¢殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.weChat }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="鎴愬姛鏁�"
+              align="center"
+              key="weChatSuccess"
+              prop="weChatSuccess"
+              :render-header="Tooltipzzwc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'weChatSuccessInfo',
+                      '鏈�缁堝畬鎴愬井淇¢殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.weChatSuccess }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table-column>
+          <el-table-column v-if="isTargetHospital" label="鐭俊" align="center">
+            <el-table-column
+              label="鍙戦�佹暟"
+              align="center"
+              key="sms"
+              prop="sms"
+              :render-header="Tooltipfswc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'smsInfo',
+                      '鍙戦�佸畬鎴愮煭淇¢殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.sms }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="鎴愬姛鏁�"
+              align="center"
+              key="smsSuccess"
+              prop="smsSuccess"
+              :render-header="Tooltipzzwc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'smsSuccessInfo',
+                      '鏈�缁堝畬鎴愮煭淇¢殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.smsSuccess }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table-column>
+          <el-table-column v-if="isTargetHospital" label="浜哄伐" align="center">
+            <el-table-column
+              label="鍙戦�佹暟"
+              align="center"
+              key="manual"
+              prop="manual"
+              :render-header="Tooltipfswc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'manualInfo',
+                      '鍙戦�佸畬鎴愪汉宸ラ殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.manual }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="鎴愬姛鏁�"
+              align="center"
+              key="manualSuccess"
+              prop="manualSuccess"
+              :render-header="Tooltipzzwc"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  size="medium"
+                  type="text"
+                  @click="
+                    handleViewDetails(
+                      scope.row,
+                      'manualSuccessInfo',
+                      '鏈�缁堝畬鎴愪汉宸ラ殢璁垮垪琛�'
+                    )
+                  "
+                >
+                  <span class="button-zx">{{ scope.row.manualSuccess }}</span>
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table-column>
+
+          <el-table-column
+            v-if="!isTargetHospital"
             label="浜哄伐"
             align="center"
             key="manual"
@@ -605,7 +1097,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
+            v-if="!isTargetHospital"
             label="璇煶"
             align="center"
             key="voice"
@@ -624,7 +1116,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
+            v-if="!isTargetHospital"
             label="鐭俊"
             align="center"
             key="sms"
@@ -641,7 +1133,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
+            v-if="!isTargetHospital"
             label="寰俊"
             align="center"
             key="weChat"
@@ -661,11 +1153,9 @@
           </el-table-column>
         </el-table-column>
 
-        <!-- 闅忚鎯呭喌鍒楋紙浠呬附姘村競涓尰闄㈡樉绀猴級 -->
+        <!-- 闅忚鎯呭喌鍒楋紙涓芥按甯備腑鍖婚櫌宸茬Щ鍒扮患鍚堢粺璁★紝姝ゅ浠呮櫙瀹佺暡鏃忚嚜娌诲幙浜烘皯鍖婚櫌鏄剧ず锛� -->
         <el-table-column
-          v-if="
-            orgname == '涓芥按甯備腑鍖婚櫌' || orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'
-          "
+          v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
           align="center"
           label="闅忚鎯呭喌"
         >
@@ -719,6 +1209,7 @@
 
 <script>
 import { getSfStatisticsHyperlink } from "@/api/AiCentre/index";
+import store from "@/store";
 
 import { getSfStatistics, selectTimelyRate } from "@/api/system/user";
 import ExcelJS from "exceljs";
@@ -755,7 +1246,16 @@
       expands: [],
       ids: [],
       patientqueryParams: { pn: 1, ps: 10 },
+      tasktypes: store.getters.tasktypes,
     };
+  },
+  computed: {
+    isTargetHospital() {
+      return (
+        this.orgname == "绗竴浜烘皯鍖婚櫌婀栨花闄㈠尯" ||
+        this.orgname == "绗竴浜烘皯鍖婚櫌鍚村北闄㈠尯"
+      );
+    },
   },
   methods: {
     loadData() {
@@ -774,8 +1274,8 @@
 
       delete params.leavehospitaldistrictcodes.all;
       delete params.deptcodes.all;
-      params.rateDay = 7;
-      getSfStatistics(params)
+      params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
+      return getSfStatistics(params)
         .then((response) => {
           this.tableData = this.customSort(response.data);
         })
@@ -801,167 +1301,23 @@
     },
 
     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) {
-      return row.statisticaltype === 1
+      return this.queryParams.statisticaltype === 1
         ? row.leavehospitaldistrictcode
         : row.deptcode;
     },
@@ -987,7 +1343,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);
@@ -1004,8 +1360,8 @@
       const need = Number(needFollowUp) || 0;
       const pending = Number(pendingFollowUp) || 0;
 
-      // 鍒嗘瘝 = 闇�闅忚 - 寰呴殢璁�
-      const denominator = need - pending;
+      // 鐩爣鍖婚櫌锛氭垚鍔熺巼 = 闅忚鎴愬姛 / 闇�闅忚锛涘叾浠栵細闅忚鎴愬姛 / (闇�闅忚 - 寰呴殢璁�)
+      const denominator = this.isTargetHospital ? need : need - pending;
 
       if (denominator <= 0) {
         return "0.00%";
@@ -1013,6 +1369,26 @@
 
       const rate = (success / denominator) * 100;
       return rate.toFixed(2) + "%";
+    },
+    // 璁$畻鍙婃椂鐜囷紙鐩爣鍖婚櫌锛夛細(闇�闅忚 - 浜哄伐瑙勫畾鏃堕棿鍐呮病鎵撹繃鐢佃瘽) / 闇�闅忚
+    calculateTimelyRate(needFollowUp, manualCallTimeout) {
+      const need = Number(needFollowUp) || 0;
+      const timeout = Number(manualCallTimeout) || 0;
+      if (need <= 0) {
+        return "0.00%";
+      }
+      const rate = ((need - timeout) / need) * 100;
+      return (rate < 0 ? 0 : rate).toFixed(2) + "%";
+    },
+    // 鍙婃椂鐜囧睍绀烘枃妗堬細鐩爣鍖婚櫌鍓嶇璁$畻锛屽叾浠栫敤鍚庣 rate 瀛楁
+    getTimelyRateText(row) {
+      if (this.isTargetHospital) {
+        return this.calculateTimelyRate(
+          row.needFollowUp,
+          row.manualCallTimeout
+        );
+      }
+      return (Number(row.rate) * 100).toFixed(2) + "%";
     },
     // 鍦ㄧ粺璁℃眹鎬绘柟娉曚腑澶勭悊鎴愬姛鐜�
     getSummaries(param) {
@@ -1043,17 +1419,51 @@
             return sum + (Number(item.pendingFollowUp) || 0);
           }, 0);
 
-          const denominator = totalNeed - totalPending;
+          const denominator = this.isTargetHospital
+            ? totalNeed
+            : totalNeed - totalPending;
 
           if (denominator > 0) {
             sums[index] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";
           } else {
             sums[index] = "0.00%";
           }
-        } else if (
-          column.property === "followUpRate" ||
-          column.property === "rate"
-        ) {
+        } else if (column.property === "rate") {
+          if (this.isTargetHospital) {
+            const totalNeed = data.reduce(
+              (sum, item) => sum + (Number(item.needFollowUp) || 0),
+              0
+            );
+            const totalTimeout = data.reduce(
+              (sum, item) => sum + (Number(item.manualCallTimeout) || 0),
+              0
+            );
+            sums[index] = this.calculateTimelyRate(totalNeed, totalTimeout);
+          } else {
+            const percentageValues = data
+              .map((item) => {
+                const value = item[column.property];
+                if (!value || value === "-" || value === "0%") return null;
+                if (typeof value === "string" && value.includes("%")) {
+                  const numValue = parseFloat(value.replace("%", "")) / 100;
+                  return isNaN(numValue) ? null : numValue;
+                } else {
+                  const numValue = parseFloat(value);
+                  return isNaN(numValue) ? null : numValue;
+                }
+              })
+              .filter((value) => value !== null && value !== 0);
+
+            if (percentageValues.length > 0) {
+              const average =
+                percentageValues.reduce((sum, value) => sum + value, 0) /
+                percentageValues.length;
+              sums[index] = (average * 100).toFixed(2) + "%";
+            } else {
+              sums[index] = "0.00%";
+            }
+          }
+        } else if (column.property === "followUpRate") {
           const percentageValues = data
             .map((item) => {
               const value = item[column.property];
@@ -1094,7 +1504,75 @@
 
       return sums;
     },
-
+    Tooltipcgl(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: this.isTargetHospital
+              ? "闅忚鎴愬姛/闇�闅忚"
+              : "闅忚鎴愬姛/(闇�闅忚-寰呴殢璁�)",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
+    Tooltipjsl(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: this.isTargetHospital
+              ? "鍙婃椂鐜�=(闇�闅忚-浜哄伐瑙勫畾鏃堕棿鍐呮病鎵撹繃鐢佃瘽)/闇�闅忚"
+              : "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
+            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)]
+      );
+    },
+    Tooltipfswc(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: "棣栨鍙戦�佹偅鑰呭嵆濉姤鎴愬姛鐨勬暟閲�",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
+    Tooltipzzwc(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: "棣栨鏈畬鎴愪簩娆℃垨涓夋琛ュ伩鎺ㄩ�佹湰鏂瑰紡鐨勫畬鎴愭鏁�",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
     getInnerSummaries(param) {
       const { columns, data } = param;
       const sums = [];
@@ -1124,17 +1602,51 @@
             return sum + (Number(item.pendingFollowUp) || 0);
           }, 0);
 
-          const denominator = totalNeed - totalPending;
+          const denominator = this.isTargetHospital
+            ? totalNeed
+            : totalNeed - totalPending;
 
           if (denominator > 0) {
             sums[index] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";
           } else {
             sums[index] = "0.00%";
           }
-        } else if (
-          column.property === "followUpRate" ||
-          column.property === "rate"
-        ) {
+        } else if (column.property === "rate") {
+          if (this.isTargetHospital) {
+            const totalNeed = data.reduce(
+              (sum, item) => sum + (Number(item.needFollowUp) || 0),
+              0
+            );
+            const totalTimeout = data.reduce(
+              (sum, item) => sum + (Number(item.manualCallTimeout) || 0),
+              0
+            );
+            sums[index] = this.calculateTimelyRate(totalNeed, totalTimeout);
+          } else {
+            const percentageValues = data
+              .map((item) => {
+                const value = item[column.property];
+                if (!value || value === "-" || value === "0%") return null;
+                if (typeof value === "string" && value.includes("%")) {
+                  const numValue = parseFloat(value.replace("%", "")) / 100;
+                  return isNaN(numValue) ? null : numValue;
+                } else {
+                  const numValue = parseFloat(value);
+                  return isNaN(numValue) ? null : numValue;
+                }
+              })
+              .filter((value) => value !== null && value !== 0);
+
+            if (percentageValues.length > 0) {
+              const average =
+                percentageValues.reduce((sum, value) => sum + value, 0) /
+                percentageValues.length;
+              sums[index] = (average * 100).toFixed(2) + "%";
+            } else {
+              sums[index] = "0.00%";
+            }
+          }
+        } else if (column.property === "followUpRate") {
           const percentageValues = data
             .map((item) => {
               const value = item[column.property];
@@ -1181,6 +1693,77 @@
       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);
     },
@@ -1201,31 +1784,98 @@
         let dateRangeString = "";
         let sheetNameSuffix = "";
 
+        // 鍒ゆ柇鏄惁鏄附姘村競涓尰闄�
+        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];
-          const formatDateForDisplay = (dateTimeStr) => {
-            return dateTimeStr.split(" ")[0];
-          };
-          const startDateFormatted = formatDateForDisplay(startDateStr);
-          const endDateFormatted = formatDateForDisplay(endDateStr);
-          dateRangeString = `${startDateFormatted}鑷�${endDateFormatted}`;
-          sheetNameSuffix = `${startDateFormatted}鑷�${endDateFormatted}`;
+
+          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}鏈坄;
+          // 鏈�夋嫨鏃堕棿锛氭暟鎹湭鍋氭椂闂寸瓫閫夛紝涓哄叏閮ㄦ暟鎹紝鏂囦欢鍚嶆爣娉ㄢ�滃叏閮ㄢ��
+          dateRangeString = "鍏ㄩ儴";
+          sheetNameSuffix = "鍏ㄩ儴";
         }
 
-        const excelName = `棣栨鍑洪櫌闅忚缁熻琛╛${dateRangeString}.xlsx`;
-        const worksheetName = `棣栨闅忚缁熻_${sheetNameSuffix}`;
+        // 鏍规嵁 serviceType 鐢熸垚闅忚绫诲瀷鍚嶇О锛堝吋瀹瑰崟閫�/澶氶�夛級
+        const serviceTypes = Array.isArray(this.queryParams.serviceType)
+          ? this.queryParams.serviceType
+          : this.queryParams.serviceType
+          ? [this.queryParams.serviceType]
+          : [];
+
+        let serviceTypeName = "棣栨鍑洪櫌闅忚"; // 鏂囦欢鍚嶄娇鐢ㄧ殑鍚嶇О
+        let sheetTypeName = "棣栨闅忚"; // 宸ヤ綔琛ㄤ娇鐢ㄧ殑鍚嶇О锛堢畝鍖栫増锛�
+
+        if (serviceTypes.length > 0) {
+          // 浣跨敤 props 涓殑 options锛堝嵆 tasktypes锛�
+          if (this.options && Array.isArray(this.options)) {
+            const matchedTypes = this.options.filter((task) =>
+              serviceTypes.includes(task.value)
+            );
+            console.log(matchedTypes, "matchedTypes");
+
+            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("/")}`;
+              // 宸ヤ綔琛ㄥ悕绠�鍖栵紙鍙栫涓�涓�+鈥滅瓑鈥濓級
+              sheetTypeName = `棣栨${typeNames[0]}绛塦;
+            } else {
+              // 鏃犲尮閰嶆椂浣跨敤鍘熷鍊�
+              const typeStr = serviceTypes.join("/");
+              serviceTypeName = `棣栨${typeStr}`;
+              sheetTypeName = "棣栨闅忚";
+            }
+          } else {
+            const typeStr = serviceTypes.join("/");
+            serviceTypeName = `棣栨${typeStr}`;
+            sheetTypeName = "棣栨闅忚";
+          }
+        }
+
+        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("鏆傛棤棣栨闅忚鏁版嵁鍙鍑�");
+          this.$message.warning(`鏆傛棤${serviceTypeName}鏁版嵁鍙鍑篳);
           return false;
         }
 
@@ -1233,7 +1883,7 @@
         const worksheet = workbook.addWorksheet(worksheetName);
 
         // 鏋勫缓琛ㄦ牸
-        this.buildExportSheet(worksheet, sheetNameSuffix);
+        this.buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName);
 
         const buffer = await workbook.xlsx.writeBuffer();
         const blob = new Blob([buffer], {
@@ -1265,7 +1915,8 @@
           const end = this.queryParams.dateRange[1].split(" ")[0];
           dateRangeString = `${start}鑷�${end}`;
         } else {
-          dateRangeString = `${new Date().getMonth() + 1}鏈坄;
+          // 鏈�夋嫨鏃堕棿锛氭暟鎹负鍏ㄩ儴
+          dateRangeString = "鍏ㄩ儴";
         }
 
         const fileName = `${areaName}鍖荤敓闅忚鍒楄〃_${dateRangeString}.xlsx`;
@@ -1330,13 +1981,12 @@
         },
       };
 
-      // 鏍囬
-      worksheet.mergeCells(1, 1, 1, 10);
-      worksheet.getCell(1, 1).value = `${areaName}鍖荤敓闅忚鍒楄〃`;
-      worksheet.getCell(1, 1).style = titleStyle;
-      worksheet.getRow(1).height = 30;
+      const graded = this.isTargetHospital;
+      // 鎴愬姛鐜囷細鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄笉灞曠ず锛涘強鏃剁巼锛氫附姘村競涓尰闄笉灞曠ず
+      const showSuccessRate = this.orgname != "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�";
+      const showTimelyRate = this.orgname != "涓芥按甯備腑鍖婚櫌";
 
-      // 琛ㄥご
+      // 鍒楀畾涔夛紙涓庡睍寮�鐨勫尰鐢熷瓙琛ㄤ繚鎸佷竴鑷达級
       const headers = [
         "鍖荤敓濮撳悕",
         "绉戝",
@@ -1344,13 +1994,26 @@
         "鏃犻渶闅忚",
         "搴旈殢璁�",
         "闇�闅忚",
-        "寰呴殢璁�",
+        ...(graded ? ["寰呭彂閫�", "宸插彂閫�"] : ["寰呴殢璁�"]),
         "闅忚鎴愬姛",
-        "闅忚澶辫触",
-        "鎴愬姛鐜�", // 鏂板
-        "闅忚鐜�", // 鍘熸潵鍦ㄦ垚鍔熺巼浣嶇疆
+        ...(graded ? [] : ["闅忚澶辫触"]),
+        ...(showSuccessRate ? ["鎴愬姛鐜�"] : []),
+        "闅忚鐜�",
+        ...(showTimelyRate ? ["鍙婃椂鐜�"] : []),
+        "浜哄伐",
+        "璇煶",
+        "鐭俊",
+        "寰俊",
       ];
+      const totalCols = headers.length;
 
+      // 鏍囬
+      worksheet.mergeCells(1, 1, 1, totalCols);
+      worksheet.getCell(1, 1).value = `${areaName}鍖荤敓闅忚鍒楄〃`;
+      worksheet.getCell(1, 1).style = titleStyle;
+      worksheet.getRow(1).height = 30;
+
+      // 琛ㄥご
       const headerRow = worksheet.addRow(headers);
       headerRow.eachCell((cell) => {
         cell.style = headerStyle;
@@ -1366,15 +2029,26 @@
           item.nonFollowUp,
           item.followUpNeeded,
           item.needFollowUp,
-          item.pendingFollowUp,
+          ...(graded
+            ? [item.pendingFollowUpWaitSend || 0, item.pendingFollowUpSent || 0]
+            : [item.pendingFollowUp || 0]),
           item.followUpSuccess,
-          item.followUpFail,
-          this.calculateSuccessRate(
-            item.followUpSuccess,
-            item.needFollowUp,
-            item.pendingFollowUp
-          ),
+          ...(graded ? [] : [item.followUpFail || 0]),
+          ...(showSuccessRate
+            ? [
+                this.calculateSuccessRate(
+                  item.followUpSuccess,
+                  item.needFollowUp,
+                  item.pendingFollowUp
+                ),
+              ]
+            : []),
           item.followUpRate,
+          ...(showTimelyRate ? [this.getTimelyRateText(item)] : []),
+          item.manual || 0,
+          item.voice || 0,
+          item.sms || 0,
+          item.weChat || 0,
         ]);
         row.eachCell((cell) => {
           cell.style = cellStyle;
@@ -1392,58 +2066,66 @@
         };
       });
 
-      // 鍒楀
-      worksheet.columns = [
-        { width: 15 },
-        { width: 15 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 }, // 鎴愬姛鐜�
-        { width: 12 }, // 闅忚鐜�
-      ];
+      // 鍒楀锛堝墠涓ゅ垪濮撳悕/绉戝杈冨锛屽叾浣欑粺涓�锛�
+      const widths = [15, 15];
+      headers.slice(2).forEach(() => widths.push(12));
+      worksheet.columns = widths.map((width) => ({ width }));
     },
     getDoctorExportSummary(data) {
-      const sums = ["灏忚"];
+      const graded = this.isTargetHospital;
+      const showSuccessRate = this.orgname != "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�";
+      const showTimelyRate = this.orgname != "涓芥按甯備腑鍖婚櫌";
 
-      const keys = [
-        "dischargeCount",
-        "nonFollowUp",
-        "followUpNeeded",
-        "needFollowUp",
-        "pendingFollowUp",
-        "followUpSuccess",
-        "followUpFail",
-      ];
+      const sums = ["灏忚", "-"];
+
+      // 鏁板�煎垪姹傚拰
+      const keys = graded
+        ? [
+            "dischargeCount",
+            "nonFollowUp",
+            "followUpNeeded",
+            "needFollowUp",
+            "pendingFollowUpWaitSend",
+            "pendingFollowUpSent",
+            "followUpSuccess",
+          ]
+        : [
+            "dischargeCount",
+            "nonFollowUp",
+            "followUpNeeded",
+            "needFollowUp",
+            "pendingFollowUp",
+            "followUpSuccess",
+            "followUpFail",
+          ];
 
       keys.forEach((key) => {
         sums.push(data.reduce((t, r) => t + (Number(r[key]) || 0), 0));
       });
 
       // 鎴愬姛鐜囷紙骞冲潎鍊硷級
-      const successRates = data
-        .map((item) => {
-          const success = Number(item.followUpSuccess) || 0;
-          const need = Number(item.needFollowUp) || 0;
-          const pending = Number(item.pendingFollowUp) || 0;
-          const denominator = need - pending;
-          if (denominator <= 0) return 0;
-          return success / denominator;
-        })
-        .filter((rate) => !isNaN(rate));
+      if (showSuccessRate) {
+        const successRates = data
+          .map((item) => {
+            const success = Number(item.followUpSuccess) || 0;
+            const need = Number(item.needFollowUp) || 0;
+            const pending = Number(item.pendingFollowUp) || 0;
+            const denominator = graded ? need : need - pending;
+            if (denominator <= 0) return 0;
+            return success / denominator;
+          })
+          .filter((rate) => !isNaN(rate));
 
-      sums.push(
-        successRates.length
-          ? (
-              (successRates.reduce((a, b) => a + b, 0) / successRates.length) *
-              100
-            ).toFixed(2) + "%"
-          : "0.00%"
-      );
+        sums.push(
+          successRates.length
+            ? (
+                (successRates.reduce((a, b) => a + b, 0) /
+                  successRates.length) *
+                100
+              ).toFixed(2) + "%"
+            : "0.00%"
+        );
+      }
 
       // 闅忚鐜囷紙骞冲潎鍊硷級
       const followUpRates = data
@@ -1460,9 +2142,41 @@
           : "0.00%"
       );
 
+      // 鍙婃椂鐜囷紙鐩爣鍖婚櫌璁$畻锛屽叾浠栧彇 rate 骞冲潎锛�
+      if (showTimelyRate) {
+        if (graded) {
+          const totalNeed = data.reduce(
+            (s, r) => s + (Number(r.needFollowUp) || 0),
+            0
+          );
+          const totalTimeout = data.reduce(
+            (s, r) => s + (Number(r.manualCallTimeout) || 0),
+            0
+          );
+          sums.push(this.calculateTimelyRate(totalNeed, totalTimeout));
+        } else {
+          const rateValues = data
+            .map((i) => this.extractPercentageValue(i.rate))
+            .filter(Boolean);
+          sums.push(
+            rateValues.length
+              ? (
+                  (rateValues.reduce((a, b) => a + b, 0) / rateValues.length) *
+                  100
+                ).toFixed(2) + "%"
+              : "0.00%"
+          );
+        }
+      }
+
+      // 浜哄伐/璇煶/鐭俊/寰俊
+      ["manual", "voice", "sms", "weChat"].forEach((key) => {
+        sums.push(data.reduce((t, r) => t + (Number(r[key]) || 0), 0));
+      });
+
       return sums;
     },
-    buildExportSheet(worksheet, sheetNameSuffix) {
+    buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName) {
       const titleStyle = {
         font: {
           name: "寰蒋闆呴粦",
@@ -1536,91 +2250,257 @@
           right: { style: "thin", color: { argb: "FFD0D0D0" } },
         },
       };
+      // 鏄惁涓虹洰鏍囧尰闄紙浜哄伐/璇煶/鐭俊/寰俊 鎸� 鍙戦�佹暟/鎴愬姛鏁� 鍒嗙骇灞曠ず锛�
+      const graded = this.isTargetHospital;
+      // 缂欎簯鍘夸汉姘戝尰闄㈤澶栧睍绀衡�滃強鏃堕殢璁夸汉娆♀�濆垪
+      const showTimelyFollowUp = this.orgname == "缂欎簯鍘夸汉姘戝尰闄�";
+      // 鍚屽痉绯诲垪锛氬嚭闄汉娆�/鏃犻渶闅忚浜烘/搴旈殢璁夸汉娆� 涓嬪垎鈥滄櫘閫�/鏃ラ棿鈥�
+      const showTongdeBreakdown = this.isTongdeOrg;
 
+      // 鍩虹鍒楋細鍥哄畾鍒楋紙绌�/鍑洪櫌鐥呭尯/绉戝锛�+ 浜烘鍒嗙粍鍒楋紙鍚屽痉绯诲垪涓嬪垎鏅��/鏃ラ棿锛�
+      const baseFixedHeaders = ["", "鍑洪櫌鐥呭尯", "绉戝"];
+      const baseCountGroups = showTongdeBreakdown
+        ? [
+            {
+              label: "鍑洪櫌浜烘",
+              fields: ["dischargeCountNormal", "dischargeCountDaytime"],
+              sub: ["鏅��", "鏃ラ棿"],
+            },
+            {
+              label: "鏃犻渶闅忚浜烘",
+              fields: ["nonFollowUpNormal", "nonFollowUpDaytime"],
+              sub: ["鏅��", "鏃ラ棿"],
+            },
+            {
+              label: "搴旈殢璁夸汉娆�",
+              fields: ["followUpNeededNormal", "followUpNeededDaytime"],
+              sub: ["鏅��", "鏃ラ棿"],
+            },
+          ]
+        : [
+            { label: "鍑洪櫌浜烘", fields: ["dischargeCount"], sub: ["鍑洪櫌浜烘"] },
+            {
+              label: "鏃犻渶闅忚浜烘",
+              fields: ["nonFollowUp"],
+              sub: ["鏃犻渶闅忚浜烘"],
+            },
+            {
+              label: "搴旈殢璁夸汉娆�",
+              fields: ["followUpNeeded"],
+              sub: ["搴旈殢璁夸汉娆�"],
+            },
+          ];
+      const baseFields = baseCountGroups.reduce(
+        (arr, g) => arr.concat(g.fields),
+        []
+      );
+      const coreHeaders = this.isTargetHospital
+        ? [
+            "闇�闅忚",
+            "寰呭彂閫�",
+            "宸插彂閫�",
+            "闅忚鎴愬姛",
+            "鎴愬姛鐜�",
+            "闅忚鐜�",
+            "鍙婃椂鐜�",
+          ]
+        : [
+            "闇�闅忚",
+            "寰呴殢璁�",
+            "闅忚鎴愬姛",
+            "闅忚澶辫触",
+            "鎴愬姛鐜�",
+            "闅忚鐜�",
+            "鍙婃椂鐜�",
+            ...(showTimelyFollowUp ? ["鍙婃椂闅忚浜烘"] : []),
+          ];
+      const methodGroups = this.getMethodColumns();
+
+      const baseCount = baseFixedHeaders.length + baseFields.length; // 6 鎴� 9
+      const coreCount = coreHeaders.length; // 7 鎴� 8
+      const methodLeafCount = methodGroups.reduce(
+        (sum, g) => sum + g.fields.length,
+        0
+      ); // 8 鎴� 4
+      const totalCols = baseCount + coreCount + methodLeafCount;
+      const coreStartCol = baseCount + 1;
+      const methodStartCol = baseCount + coreCount + 1;
+
+      const titleText = `${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
       // 娣诲姞鏍囬琛�
-      worksheet.mergeCells(1, 1, 1, 16);
+      worksheet.mergeCells(1, 1, 1, totalCols);
       const titleCell = worksheet.getCell(1, 1);
-      titleCell.value = `棣栨鍑洪櫌闅忚缁熻琛╛${sheetNameSuffix}`;
+      titleCell.value = titleText;
       titleCell.style = titleStyle;
       worksheet.getRow(1).height = 35;
 
-      // 琛ㄥご
-      const secondRowHeaders = [
-        "",
-        "鍑洪櫌鐥呭尯",
-        "绉戝",
-        "鍑洪櫌浜烘",
-        "鏃犻渶闅忚浜烘",
-        "搴旈殢璁夸汉娆�",
-        "闇�闅忚",
-        "寰呴殢璁�",
-        "闅忚鎴愬姛",
-        "闅忚澶辫触",
-        "鎴愬姛鐜�", // 鏂板
-        "闅忚鐜�", // 鍘熶綅缃悗绉�
-        "鍙婃椂鐜�", // 鍙婃椂鐜囧悗绉�
-        "浜哄伐",
-        "璇煶", // 淇锛氬簲璇ユ槸璇煶
-        "鐭俊", // 鐭俊
-        "寰俊", // 寰俊
-      ];
+      if (graded) {
+        // 琛ㄥご鍗� 3 琛岋紙绗�2/3/4琛岋級锛屾暟鎹粠绗�5琛屽紑濮�
+        const headerEndRow = 4;
 
-      secondRowHeaders.forEach((header, index) => {
-        const cell = worksheet.getCell(3, index + 1);
-        cell.value = header;
-        cell.style = headerStyle;
-      });
+        // 绗�2琛岋細鍩虹鍒楃旱鍚戝悎骞� + 闅忚鍒嗙粍妯悜鍚堝苟
+        for (let i = 1; i <= baseFixedHeaders.length; i++) {
+          worksheet.mergeCells(2, i, headerEndRow, i);
+          const cell = worksheet.getCell(2, i);
+          cell.value = baseFixedHeaders[i - 1];
+          cell.style = headerStyle;
+        }
+        let bCol = baseFixedHeaders.length + 1;
+        baseCountGroups.forEach((g) => {
+          worksheet.mergeCells(2, bCol, headerEndRow, bCol);
+          const cell = worksheet.getCell(2, bCol);
+          cell.value = g.label;
+          cell.style = headerStyle;
+          bCol += g.fields.length;
+        });
+        worksheet.mergeCells(2, coreStartCol, 2, totalCols);
+        worksheet.getCell(2, coreStartCol).value = serviceTypeName;
+        worksheet.getCell(2, coreStartCol).style = headerStyle;
 
-      // 鍚堝苟鍗曞厓鏍�
-      for (let i = 1; i <= 6; i++) {
-        worksheet.mergeCells(2, i, 3, i);
-        const cell = worksheet.getCell(2, i);
-        cell.style = headerStyle;
+        // 绗�3琛岋細闅忚鏍稿績鍒楋紙鐩爣鍖婚櫌鈥滃緟闅忚鈥濅笅宓屽鈥滃緟鍙戦��/宸插彂閫佲�濓級
+        worksheet.mergeCells(3, coreStartCol, headerEndRow, coreStartCol);
+        worksheet.getCell(3, coreStartCol).value = "闇�闅忚";
+        worksheet.getCell(3, coreStartCol).style = headerStyle;
+
+        worksheet.mergeCells(3, coreStartCol + 1, 3, coreStartCol + 2);
+        worksheet.getCell(3, coreStartCol + 1).value = "寰呴殢璁�";
+        worksheet.getCell(3, coreStartCol + 1).style = headerStyle;
+
+        worksheet.mergeCells(
+          3,
+          coreStartCol + 3,
+          headerEndRow,
+          coreStartCol + 3
+        );
+        worksheet.getCell(3, coreStartCol + 3).value = "闅忚鎴愬姛";
+        worksheet.getCell(3, coreStartCol + 3).style = headerStyle;
+
+        ["鎴愬姛鐜�", "闅忚鐜�", "鍙婃椂鐜�"].forEach((label, i) => {
+          const col = coreStartCol + 4 + i;
+          worksheet.mergeCells(3, col, headerEndRow, col);
+          worksheet.getCell(3, col).value = label;
+          worksheet.getCell(3, col).style = headerStyle;
+        });
+
+        // 绗�4琛岋細寰呭彂閫�/宸插彂閫� 瀛愬垪
+        worksheet.getCell(4, coreStartCol + 1).value = "寰呭彂閫�";
+        worksheet.getCell(4, coreStartCol + 1).style = headerStyle;
+        worksheet.getCell(4, coreStartCol + 2).value = "宸插彂閫�";
+        worksheet.getCell(4, coreStartCol + 2).style = headerStyle;
+
+        let mc = methodStartCol;
+        methodGroups.forEach((g) => {
+          if (g.fields.length > 1) {
+            worksheet.mergeCells(3, mc, 3, mc + g.fields.length - 1);
+          }
+          const cell = worksheet.getCell(3, mc);
+          cell.value = g.label;
+          cell.style = headerStyle;
+          mc += g.fields.length;
+        });
+
+        // 绗�4琛岋細闅忚鏂瑰紡瀛愬垪锛堝彂閫佹暟/鎴愬姛鏁帮級
+        mc = methodStartCol;
+        methodGroups.forEach((g) => {
+          g.fields.forEach((field, idx) => {
+            const cell = worksheet.getCell(4, mc + idx);
+            cell.value = g.sub[idx];
+            cell.style = headerStyle;
+          });
+          mc += g.fields.length;
+        });
+
+        worksheet.getRow(2).height = 28;
+        worksheet.getRow(3).height = 24;
+        worksheet.getRow(4).height = 24;
+      } else {
+        // 琛ㄥご鍗� 2 琛岋紙绗�2/3琛岋級锛屾暟鎹粠绗�4琛屽紑濮�
+        const headerEndRow = 3;
+
+        // 鍥哄畾鍒楋紙绌�/鍑洪櫌鐥呭尯/绉戝锛夛細绾靛悜鍚堝苟
+        for (let i = 1; i <= baseFixedHeaders.length; i++) {
+          worksheet.mergeCells(2, i, headerEndRow, i);
+          const cell = worksheet.getCell(2, i);
+          cell.value = baseFixedHeaders[i - 1];
+          cell.style = headerStyle;
+        }
+        // 浜烘鍒嗙粍鍒楋細鍗曠骇绾靛悜鍚堝苟锛涘绾э紙鏅��/鏃ラ棿锛夌埗鏍囩妯悎銆佸瓙鏍囩鍐欑3琛�
+        let bCol = baseFixedHeaders.length + 1;
+        baseCountGroups.forEach((g) => {
+          if (g.sub.length > 1) {
+            worksheet.mergeCells(2, bCol, 2, bCol + g.sub.length - 1);
+            const cell = worksheet.getCell(2, bCol);
+            cell.value = g.label;
+            cell.style = headerStyle;
+            g.sub.forEach((sub, idx) => {
+              const subCell = worksheet.getCell(3, bCol + idx);
+              subCell.value = sub;
+              subCell.style = headerStyle;
+            });
+            bCol += g.sub.length;
+          } else {
+            worksheet.mergeCells(2, bCol, headerEndRow, bCol);
+            const cell = worksheet.getCell(2, bCol);
+            cell.value = g.label;
+            cell.style = headerStyle;
+            bCol += 1;
+          }
+        });
+        worksheet.mergeCells(2, coreStartCol, 2, totalCols);
+        worksheet.getCell(2, coreStartCol).value = serviceTypeName;
+        worksheet.getCell(2, coreStartCol).style = headerStyle;
+
+        // 绗�3琛岋細闅忚鏍稿績鍒� + 闅忚鏂瑰紡鍒�
+        for (let k = 0; k < coreCount; k++) {
+          const cell = worksheet.getCell(3, coreStartCol + k);
+          cell.value = coreHeaders[k];
+          cell.style = headerStyle;
+        }
+        let mc = methodStartCol;
+        methodGroups.forEach((g) => {
+          const cell = worksheet.getCell(3, mc);
+          cell.value = g.label;
+          cell.style = headerStyle;
+          mc += 1;
+        });
+
+        worksheet.getRow(2).height = 28;
+        worksheet.getRow(3).height = 25;
       }
 
-      worksheet.getCell(2, 1).value = "";
-      worksheet.getCell(2, 2).value = "鍑洪櫌鐥呭尯";
-      worksheet.getCell(2, 3).value = "绉戝";
-      worksheet.getCell(2, 4).value = "鍑洪櫌浜烘";
-      worksheet.getCell(2, 5).value = "鏃犻渶闅忚浜烘";
-      worksheet.getCell(2, 6).value = "搴旈殢璁夸汉娆�";
-
-      worksheet.mergeCells(2, 7, 2, 16); // 浠�7鍚堝苟鍒�16锛堝師鏉ユ槸7-15锛�
-      worksheet.getCell(2, 7).value = "棣栨鍑洪櫌闅忚";
-      worksheet.getCell(2, 7).style = headerStyle;
-
-      worksheet.getRow(2).height = 28;
-      worksheet.getRow(3).height = 25;
-
       // 鏁版嵁琛�
+      const dataStartRow = graded ? 5 : 4;
       this.tableData.forEach((item, rowIndex) => {
-        const dataRow = worksheet.addRow(
-          [
-            "",
-            item.leavehospitaldistrictname || "",
-            item.deptname || "",
-            item.dischargeCount || 0,
-            item.nonFollowUp || 0,
-            item.followUpNeeded || 0,
-            item.needFollowUp || 0,
-            item.pendingFollowUp || 0,
-            item.followUpSuccess || 0,
-            item.followUpFail || 0,
-            // 鎴愬姛鐜� - 闇�瑕佸姩鎬佽绠�
-            this.calculateSuccessRate(
-              item.followUpSuccess,
-              item.needFollowUp,
-              item.pendingFollowUp
-            ),
-            item.followUpRate || "0%", // 闅忚鐜�
-            item.rate ? (Number(item.rate) * 100).toFixed(2) + "%" : "0%", // 鍙婃椂鐜�
-            item.manual || 0,
-            item.voice || 0, // 璇煶
-            item.sms || 0, // 鐭俊
-            item.weChat || 0, // 寰俊
-          ],
-          rowIndex + 4
-        );
+        const rowValues = [
+          "",
+          item.leavehospitaldistrictname || "",
+          item.deptname || "",
+          ...baseFields.map((field) => item[field] || 0),
+          item.needFollowUp || 0,
+          // 寰呴殢璁匡細鐩爣鍖婚櫌鎷嗕负寰呭彂閫�/宸插彂閫侊紝鍏朵粬鐢ㄥ緟闅忚
+          ...(this.isTargetHospital
+            ? [item.pendingFollowUpWaitSend || 0, item.pendingFollowUpSent || 0]
+            : [item.pendingFollowUp || 0]),
+          item.followUpSuccess || 0,
+          // 闅忚澶辫触锛氱洰鏍囧尰闄笉鏄剧ず
+          ...(this.isTargetHospital ? [] : [item.followUpFail || 0]),
+          // 鎴愬姛鐜� - 闇�瑕佸姩鎬佽绠�
+          this.calculateSuccessRate(
+            item.followUpSuccess,
+            item.needFollowUp,
+            item.pendingFollowUp
+          ),
+          item.followUpRate || "0%", // 闅忚鐜�
+          this.getTimelyRateText(item), // 鍙婃椂鐜�
+          ...(showTimelyFollowUp ? [item.timelyFollowUp || 0] : []), // 鍙婃椂闅忚浜烘
+        ];
+        methodGroups.forEach((g) => {
+          g.fields.forEach((field) => {
+            rowValues.push(item[field] || 0);
+          });
+        });
+
+        const dataRow = worksheet.addRow(rowValues, rowIndex + dataStartRow);
         dataRow.eachCell((cell) => {
           cell.style = cellStyle;
         });
@@ -1639,72 +2519,134 @@
       summaryRow.height = 28;
 
       // 鍒楀
-      worksheet.columns = [
-        { width: 8 },
-        { width: 20 },
-        { width: 15 },
-        { width: 12 },
-        { width: 12 },
-        { width: 12 },
-        { width: 10 },
-        { width: 10 },
-        { width: 10 },
-        { width: 10 },
-        { width: 12 }, // 鎴愬姛鐜�
-        { width: 12 }, // 闅忚鐜�
-        { width: 12 }, // 鍙婃椂鐜�
-        { width: 8 }, // 浜哄伐
-        { width: 8 }, // 璇煶
-        { width: 8 }, // 鐭俊
-        { width: 8 }, // 寰俊
+      const widths = [8, 20, 15];
+      baseCountGroups.forEach((g) => {
+        g.sub.forEach(() => widths.push(10));
+      });
+      widths.push(10, 10, 10, 10, 12, 12, 12);
+      if (showTimelyFollowUp) {
+        widths.push(12);
+      }
+      methodGroups.forEach((g) => {
+        g.fields.forEach(() => widths.push(8));
+      });
+      worksheet.columns = widths.map((width) => ({ width }));
+    },
+    getMethodColumns() {
+      // 闅忚鏂瑰紡鍒楅厤缃細鐩爣鍖婚櫌鎸夆�滃彂閫佹暟/鎴愬姛鏁扳�濆垎绾у睍绀�
+      if (this.isTargetHospital) {
+        return [
+          {
+            label: "浜哄伐",
+            fields: ["manual", "manualSuccess"],
+            sub: ["鍙戦�佹暟", "鎴愬姛鏁�"],
+          },
+          {
+            label: "璇煶",
+            fields: ["voice", "voiceSuccess"],
+            sub: ["鍙戦�佹暟", "鎴愬姛鏁�"],
+          },
+          {
+            label: "鐭俊",
+            fields: ["sms", "smsSuccess"],
+            sub: ["鍙戦�佹暟", "鎴愬姛鏁�"],
+          },
+          {
+            label: "寰俊",
+            fields: ["weChat", "weChatSuccess"],
+            sub: ["鍙戦�佹暟", "鎴愬姛鏁�"],
+          },
+        ];
+      }
+      return [
+        { label: "浜哄伐", fields: ["manual"], sub: ["浜哄伐"] },
+        { label: "璇煶", fields: ["voice"], sub: ["璇煶"] },
+        { label: "鐭俊", fields: ["sms"], sub: ["鐭俊"] },
+        { label: "寰俊", fields: ["weChat"], sub: ["寰俊"] },
       ];
     },
 
     getExportSummaries() {
-      const summaries = [
-        "鍚堣",
-        "/",
-        "/",
-        0, // 3: dischargeCount
-        0, // 4: nonFollowUp
-        0, // 5: followUpNeeded
-        0, // 6: needFollowUp
-        0, // 7: pendingFollowUp
-        0, // 8: followUpSuccess
-        0, // 9: followUpFail
-        "0%", // 10: 鎴愬姛鐜�
-        "0%", // 11: 闅忚鐜�
-        "0%", // 12: 鍙婃椂鐜�
-        0, // 13: manual
-        0, // 14: voice
-        0, // 15: sms
-        0, // 16: weChat
-      ];
+      const graded = this.isTargetHospital;
+      const showTimelyFollowUp = this.orgname == "缂欎簯鍘夸汉姘戝尰闄�";
+      const showTongdeBreakdown = this.isTongdeOrg;
+
+      const baseFields = showTongdeBreakdown
+        ? [
+            "dischargeCountNormal",
+            "dischargeCountDaytime",
+            "nonFollowUpNormal",
+            "nonFollowUpDaytime",
+            "followUpNeededNormal",
+            "followUpNeededDaytime",
+          ]
+        : ["dischargeCount", "nonFollowUp", "followUpNeeded"];
+
+      const methodFields = this.getMethodColumns().reduce(
+        (arr, g) => arr.concat(g.fields),
+        []
+      );
+
+      // 鍒椾綅缃細0=鍚堣 1=/ 2=/锛岄殢鍚庝负鍩虹浜烘鍒椼�佹牳蹇冨垪銆佸強鏃堕殢璁夸汉娆★紙鍙�夛級銆侀殢璁挎柟寮忓垪
+      const baseStart = 3;
+      const needIdx = baseStart + baseFields.length; // 闇�闅忚
+      const pendingIdx = needIdx + 1; // 寰呴殢璁� / 寰呭彂閫�
+      const pending2Idx = graded ? pendingIdx + 1 : -1; // 宸插彂閫侊紙浠呯洰鏍囧尰闄級
+      const successIdx = pending2Idx >= 0 ? pending2Idx + 1 : pendingIdx + 1; // 闅忚鎴愬姛
+      const failIdx = graded ? -1 : successIdx + 1; // 闅忚澶辫触锛堥潪鐩爣鍖婚櫌锛�
+      const successRateIdx = (failIdx >= 0 ? failIdx : successIdx) + 1; // 鎴愬姛鐜�
+      const followUpRateIdx = successRateIdx + 1; // 闅忚鐜�
+      const timelyRateIdx = followUpRateIdx + 1; // 鍙婃椂鐜�
+      const timelyFollowUpIdx = showTimelyFollowUp ? timelyRateIdx + 1 : -1; // 鍙婃椂闅忚浜烘
+      const methodStartIndex =
+        (timelyFollowUpIdx >= 0 ? timelyFollowUpIdx : timelyRateIdx) + 1;
+
+      const summaries = ["鍚堣", "/", "/"];
+      baseFields.forEach(() => summaries.push(0));
+      summaries.push(0); // 闇�闅忚
+      summaries.push(0); // 寰呴殢璁� / 寰呭彂閫�
+      if (graded) summaries.push(0); // 宸插彂閫�
+      summaries.push(0); // 闅忚鎴愬姛
+      if (!graded) summaries.push(0); // 闅忚澶辫触
+      summaries.push("0%"); // 鎴愬姛鐜�
+      summaries.push("0%"); // 闅忚鐜�
+      summaries.push("0%"); // 鍙婃椂鐜�
+      if (showTimelyFollowUp) summaries.push(0); // 鍙婃椂闅忚浜烘
+      methodFields.forEach(() => summaries.push(0));
 
       this.tableData.forEach((item) => {
-        summaries[3] += Number(item.dischargeCount) || 0;
-        summaries[4] += Number(item.nonFollowUp) || 0;
-        summaries[5] += Number(item.followUpNeeded) || 0;
-        summaries[6] += Number(item.needFollowUp) || 0;
-        summaries[7] += Number(item.pendingFollowUp) || 0;
-        summaries[8] += Number(item.followUpSuccess) || 0;
-        summaries[9] += Number(item.followUpFail) || 0;
-        summaries[13] += Number(item.manual) || 0;
-        summaries[14] += Number(item.voice) || 0;
-        summaries[15] += Number(item.sms) || 0;
-        summaries[16] += Number(item.weChat) || 0;
+        baseFields.forEach((field, i) => {
+          summaries[baseStart + i] += Number(item[field]) || 0;
+        });
+        summaries[needIdx] += Number(item.needFollowUp) || 0;
+        if (graded) {
+          summaries[pendingIdx] += Number(item.pendingFollowUpWaitSend) || 0;
+          summaries[pending2Idx] += Number(item.pendingFollowUpSent) || 0;
+          summaries[successIdx] += Number(item.followUpSuccess) || 0;
+        } else {
+          summaries[pendingIdx] += Number(item.pendingFollowUp) || 0;
+          summaries[successIdx] += Number(item.followUpSuccess) || 0;
+          summaries[failIdx] += Number(item.followUpFail) || 0;
+        }
+        if (showTimelyFollowUp) {
+          summaries[timelyFollowUpIdx] += Number(item.timelyFollowUp) || 0;
+        }
+        methodFields.forEach((field, i) => {
+          summaries[methodStartIndex + i] += Number(item[field]) || 0;
+        });
       });
 
-      // 鎴愬姛鐜囪绠�
-      const totalSuccess = summaries[8]; // followUpSuccess鐨勬�诲拰
-      const totalNeed = summaries[6]; // needFollowUp鐨勬�诲拰
-      const totalPending = summaries[7]; // pendingFollowUp鐨勬�诲拰
-      const denominator = totalNeed - totalPending;
+      // 鎴愬姛鐜囪绠楋細闅忚鎴愬姛 / 闇�闅忚锛堢洰鏍囧尰闄級锛屽惁鍒� 闅忚鎴愬姛 / (闇�闅忚-寰呴殢璁�)
+      const totalSuccess = summaries[successIdx];
+      const totalNeed = summaries[needIdx];
+      const totalPending = summaries[pendingIdx];
+      const denominator = graded ? totalNeed : totalNeed - totalPending;
 
       if (denominator > 0) {
-        summaries[10] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";
+        summaries[successRateIdx] =
+          ((totalSuccess / denominator) * 100).toFixed(2) + "%";
       } else {
-        summaries[10] = "0.00%";
+        summaries[successRateIdx] = "0.00%";
       }
 
       // 闅忚鐜囪绠�
@@ -1716,22 +2658,44 @@
         const avgFollowUpRate =
           followUpRateValues.reduce((sum, val) => sum + val, 0) /
           followUpRateValues.length;
-        summaries[11] = (avgFollowUpRate * 100).toFixed(2) + "%";
+        summaries[followUpRateIdx] = (avgFollowUpRate * 100).toFixed(2) + "%";
       }
 
-      // 鍙婃椂鐜囪绠�
-      const rateValues = this.tableData
-        .map((item) => this.extractPercentageValue(item.rate))
-        .filter((value) => value !== null);
+      // 鍙婃椂鐜囪绠楋細鐩爣鍖婚櫌 (闇�闅忚-浜哄伐瓒呮椂)/闇�闅忚锛屽叾浠栧彇鍚庣 rate 骞冲潎
+      if (graded) {
+        const totalTimeout = this.tableData.reduce(
+          (sum, item) => sum + (Number(item.manualCallTimeout) || 0),
+          0
+        );
+        summaries[timelyRateIdx] = this.calculateTimelyRate(
+          totalNeed,
+          totalTimeout
+        );
+      } else {
+        const rateValues = this.tableData
+          .map((item) => this.extractPercentageValue(item.rate))
+          .filter((value) => value !== null);
 
-      if (rateValues.length > 0) {
-        const avgRate =
-          rateValues.reduce((sum, val) => sum + val, 0) / rateValues.length;
-        summaries[12] = (avgRate * 100).toFixed(2) + "%";
+        if (rateValues.length > 0) {
+          const avgRate =
+            rateValues.reduce((sum, val) => sum + val, 0) / rateValues.length;
+          summaries[timelyRateIdx] = (avgRate * 100).toFixed(2) + "%";
+        }
       }
 
       // 鏍煎紡鍖栨暟瀛�
-      [3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16].forEach((index) => {
+      const numericIndices = [];
+      for (let i = baseStart; i < baseStart + baseFields.length; i++) {
+        numericIndices.push(i);
+      }
+      numericIndices.push(needIdx, pendingIdx);
+      if (graded) numericIndices.push(pending2Idx);
+      numericIndices.push(successIdx);
+      if (!graded) numericIndices.push(failIdx);
+      if (showTimelyFollowUp) numericIndices.push(timelyFollowUpIdx);
+      methodFields.forEach((_, i) => numericIndices.push(methodStartIndex + i));
+
+      numericIndices.forEach((index) => {
         summaries[index] = this.formatNumber(summaries[index]);
       });
 
@@ -1751,25 +2715,46 @@
     selectTimelyRate(row, queryParams) {
       console.log(row, queryParams, 88);
 
-      // const params = {
-      //   ...this.patientqueryParams,
-      //   starttime: this.parseTime(dateRange[0]),
-      //   endtime: this.parseTime(dateRange[1]),
-      //   deptcode: row.deptcode,
-      // };
-      this.patientqueryParams.starttime = this.parseTime(
-        queryParams.dateRange[0]
-      );
-      this.patientqueryParams.endtime = this.parseTime(
-        queryParams.dateRange[1]
-      );
-      this.patientqueryParams.deptcode = row.deptcode;
-      console.log(1);
+      // 搴旈殢璁挎椂闂磋寖鍥�
+      if (queryParams.endTime) {
+        this.patientqueryParams.starttime = queryParams.startTime;
+        this.patientqueryParams.endtime = queryParams.endTime;
+      } else {
+        this.patientqueryParams.starttime = this.parseTime(
+          queryParams.dateRange[0]
+        );
+        this.patientqueryParams.endtime = this.parseTime(
+          queryParams.dateRange[1]
+        );
+      }
+      // 鍑洪櫌鏃堕棿鑼冨洿
+      if (queryParams.hospitalEndTime) {
+        this.patientqueryParams.startOutHospTime =
+          queryParams.hospitalStartTime;
+        this.patientqueryParams.endOutHospTime = queryParams.hospitalEndTime;
+      } else {
+        this.patientqueryParams.startOutHospTime = this.parseTime(
+          queryParams.dateRangecy[0]
+        );
+        this.patientqueryParams.endOutHospTime = this.parseTime(
+          queryParams.dateRangecy[1]
+        );
+      }
+      // 缁熻绫诲瀷锛氱梾鍖虹粺璁�(1)浼犵梾鍖篶ode锛岀瀹ょ粺璁�(2)浼犵瀹ode
+      if (queryParams.statisticaltype == 1) {
+        this.patientqueryParams.leavehospitaldistrictcode =
+          row.leavehospitaldistrictcode;
+        this.patientqueryParams.deptcode = null;
+      } else {
+        this.patientqueryParams.deptcode = row.deptcode;
+        this.patientqueryParams.leavehospitaldistrictcode = null;
+      }
 
       this.patientqueryParams.serviceTypes = queryParams.serviceType
-        ? queryParams.serviceType.join(",")
+        ? Array.isArray(queryParams.serviceType)
+          ? queryParams.serviceType.join(",")
+          : String(queryParams.serviceType)
         : null;
-      console.log(2);
 
       return selectTimelyRate(this.patientqueryParams);
     },

--
Gitblit v1.9.3