From b4fe2c16274a91fee4fb26d91374f95fbe2dbcec Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 09 十一月 2026 15:28:21 +0800
Subject: [PATCH] 测试完成

---
 src/views/sfstatistics/percentage/components/FirstFollowUp.vue | 1063 +++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 746 insertions(+), 317 deletions(-)

diff --git a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
index e2167f6..ff4f3c8 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"
@@ -272,9 +330,9 @@
                       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>
@@ -476,6 +534,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="!isTargetHospital"
             label="寰呴殢璁�"
             align="center"
             key="pendingFollowUp"
@@ -496,6 +555,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 +633,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="!isTargetHospital"
             label="闅忚澶辫触"
             align="center"
             key="followUpFail"
@@ -583,22 +697,42 @@
                 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="isTargetHospital"
-            label="浜哄伐"
+            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="鍙戦�佸畬鎴�"
+              label="鍙戦�佹暟"
               align="center"
-              key="manualSuccess"
-              prop="manualSuccess"
+              key="voice"
+              prop="voice"
               :render-header="Tooltipfswc"
             >
               <template slot-scope="scope">
@@ -608,52 +742,21 @@
                   @click="
                     handleViewDetails(
                       scope.row,
-                      'manualSuccessInfo',
-                      '鍙戦�佸畬鎴愪汉宸ラ殢璁垮垪琛�'
+                      'voiceInfo',
+                      '鍙戦�佸畬鎴愯闊抽殢璁垮垪琛�'
                     )
                   "
                 >
-                  <span class="button-zx">{{ scope.row.manualSuccess }}</span>
+                  <span class="button-zx">{{ scope.row.voice }}</span>
                 </el-button>
               </template>
             </el-table-column>
             <el-table-column
-              label="鏈�缁堝畬鎴�"
-              align="center"
-              key="manualAgainSuccess"
-              prop="manualAgainSuccess"
-              :render-header="Tooltipzzwc"
-            >
-              <template slot-scope="scope">
-                <el-button
-                  size="medium"
-                  type="text"
-                  @click="
-                    handleViewDetails(
-                      scope.row,
-                      'manualAgainSuccessInfo',
-                      '鏈�缁堝畬鎴愪汉宸ラ殢璁垮垪琛�'
-                    )
-                  "
-                >
-                  <span class="button-zx">{{
-                    scope.row.manualAgainSuccess
-                  }}</span>
-                </el-button>
-              </template>
-            </el-table-column>
-          </el-table-column>
-          <el-table-column
-            v-if="isTargetHospital"
-            label="璇煶"
-            align="center"
-          >
-            <el-table-column
-              label="鍙戦�佸畬鎴�"
+              label="鎴愬姛鏁�"
               align="center"
               key="voiceSuccess"
               prop="voiceSuccess"
-              :render-header="Tooltipfswc"
+              :render-header="Tooltipzzwc"
             >
               <template slot-scope="scope">
                 <el-button
@@ -663,7 +766,7 @@
                     handleViewDetails(
                       scope.row,
                       'voiceSuccessInfo',
-                      '鍙戦�佸畬鎴愯闊抽殢璁垮垪琛�'
+                      '鏈�缁堝畬鎴愯闊抽殢璁垮垪琛�'
                     )
                   "
                 >
@@ -671,11 +774,36 @@
                 </el-button>
               </template>
             </el-table-column>
+          </el-table-column>
+          <el-table-column v-if="isTargetHospital" label="寰俊" align="center">
             <el-table-column
-              label="鏈�缁堝畬鎴�"
+              label="鍙戦�佹暟"
               align="center"
-              key="voiceAgainSuccess"
-              prop="voiceAgainSuccess"
+              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">
@@ -685,29 +813,46 @@
                   @click="
                     handleViewDetails(
                       scope.row,
-                      'voiceAgainSuccessInfo',
-                      '鏈�缁堝畬鎴愯闊抽殢璁垮垪琛�'
+                      'weChatSuccessInfo',
+                      '鏈�缁堝畬鎴愬井淇¢殢璁垮垪琛�'
                     )
                   "
                 >
-                  <span class="button-zx">{{
-                    scope.row.voiceAgainSuccess
-                  }}</span>
+                  <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 v-if="isTargetHospital" label="鐭俊" align="center">
             <el-table-column
-              label="鍙戦�佸畬鎴�"
+              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="Tooltipfswc"
+              :render-header="Tooltipzzwc"
             >
               <template slot-scope="scope">
                 <el-button
@@ -717,7 +862,7 @@
                     handleViewDetails(
                       scope.row,
                       'smsSuccessInfo',
-                      '鍙戦�佸畬鎴愮煭淇¢殢璁垮垪琛�'
+                      '鏈�缁堝畬鎴愮煭淇¢殢璁垮垪琛�'
                     )
                   "
                 >
@@ -725,42 +870,13 @@
                 </el-button>
               </template>
             </el-table-column>
-            <el-table-column
-              label="鏈�缁堝畬鎴�"
-              align="center"
-              key="smsAgainSuccess"
-              prop="smsAgainSuccess"
-              :render-header="Tooltipzzwc"
-            >
-              <template slot-scope="scope">
-                <el-button
-                  size="medium"
-                  type="text"
-                  @click="
-                    handleViewDetails(
-                      scope.row,
-                      'smsAgainSuccessInfo',
-                      '鏈�缁堝畬鎴愮煭淇¢殢璁垮垪琛�'
-                    )
-                  "
-                >
-                  <span class="button-zx">{{
-                    scope.row.smsAgainSuccess
-                  }}</span>
-                </el-button>
-              </template>
-            </el-table-column>
           </el-table-column>
-          <el-table-column
-            v-if="isTargetHospital"
-            label="寰俊"
-            align="center"
-          >
+          <el-table-column v-if="isTargetHospital" label="浜哄伐" align="center">
             <el-table-column
-              label="鍙戦�佸畬鎴�"
+              label="鍙戦�佹暟"
               align="center"
-              key="weChatSuccess"
-              prop="weChatSuccess"
+              key="manual"
+              prop="manual"
               :render-header="Tooltipfswc"
             >
               <template slot-scope="scope">
@@ -770,20 +886,20 @@
                   @click="
                     handleViewDetails(
                       scope.row,
-                      'wechatSuccessInfo',
-                      '鍙戦�佸畬鎴愬井淇¢殢璁垮垪琛�'
+                      'manualInfo',
+                      '鍙戦�佸畬鎴愪汉宸ラ殢璁垮垪琛�'
                     )
                   "
                 >
-                  <span class="button-zx">{{ scope.row.weChatSuccess }}</span>
+                  <span class="button-zx">{{ scope.row.manual }}</span>
                 </el-button>
               </template>
             </el-table-column>
             <el-table-column
-              label="鏈�缁堝畬鎴�"
+              label="鎴愬姛鏁�"
               align="center"
-              key="weChatAgainSuccess"
-              prop="weChatAgainSuccess"
+              key="manualSuccess"
+              prop="manualSuccess"
               :render-header="Tooltipzzwc"
             >
               <template slot-scope="scope">
@@ -793,18 +909,17 @@
                   @click="
                     handleViewDetails(
                       scope.row,
-                      'wechatAgainSuccessInfo',
-                      '鏈�缁堝畬鎴愬井淇¢殢璁垮垪琛�'
+                      'manualSuccessInfo',
+                      '鏈�缁堝畬鎴愪汉宸ラ殢璁垮垪琛�'
                     )
                   "
                 >
-                  <span class="button-zx">{{
-                    scope.row.weChatAgainSuccess
-                  }}</span>
+                  <span class="button-zx">{{ scope.row.manualSuccess }}</span>
                 </el-button>
               </template>
             </el-table-column>
           </el-table-column>
+
           <el-table-column
             v-if="!isTargetHospital"
             label="浜哄伐"
@@ -881,11 +996,9 @@
           </el-table-column>
         </el-table-column>
 
-        <!-- 闅忚鎯呭喌鍒楋紙浠呬附姘村競涓尰闄㈡樉绀猴級 -->
+        <!-- 闅忚鎯呭喌鍒楋紙涓芥按甯備腑鍖婚櫌宸茬Щ鍒扮患鍚堢粺璁★紝姝ゅ浠呮櫙瀹佺暡鏃忚嚜娌诲幙浜烘皯鍖婚櫌鏄剧ず锛� -->
         <el-table-column
-          v-if="
-            orgname == '涓芥按甯備腑鍖婚櫌' || orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'
-          "
+          v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
           align="center"
           label="闅忚鎯呭喌"
         >
@@ -1047,7 +1160,7 @@
     },
 
     getRowKey(row) {
-      return row.statisticaltype === 1
+      return this.queryParams.statisticaltype === 1
         ? row.leavehospitaldistrictcode
         : row.deptcode;
     },
@@ -1090,8 +1203,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%";
@@ -1099,6 +1212,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) {
@@ -1129,17 +1262,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];
@@ -1185,7 +1352,9 @@
         "el-tooltip",
         {
           props: {
-            content: "闅忚鎴愬姛/(闇�闅忚-寰呴殢璁�)",
+            content: this.isTargetHospital
+              ? "闅忚鎴愬姛/闇�闅忚"
+              : "闅忚鎴愬姛/(闇�闅忚-寰呴殢璁�)",
             placement: "top",
             effect: "dark",
           },
@@ -1198,8 +1367,9 @@
         "el-tooltip",
         {
           props: {
-            content:
-              "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
+            content: this.isTargetHospital
+              ? "鍙婃椂鐜�=(闇�闅忚-浜哄伐瑙勫畾鏃堕棿鍐呮病鎵撹繃鐢佃瘽)/闇�闅忚"
+              : "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
             placement: "top",
             effect: "dark",
           },
@@ -1275,17 +1445,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];
@@ -1629,13 +1833,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 = [
         "鍖荤敓濮撳悕",
         "绉戝",
@@ -1643,13 +1846,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;
@@ -1665,15 +1881,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;
@@ -1691,58 +1918,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
@@ -1758,6 +1993,38 @@
             ).toFixed(2) + "%"
           : "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;
     },
@@ -1835,91 +2102,193 @@
           right: { style: "thin", color: { argb: "FFD0D0D0" } },
         },
       };
-      const titleText = `${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
-      // 娣诲姞鏍囬琛�
-      worksheet.mergeCells(1, 1, 1, 16);
-      const titleCell = worksheet.getCell(1, 1);
-      titleCell.value = titleText; // 浣跨敤鍔ㄦ�佹爣棰�
-      titleCell.style = titleStyle;
-      worksheet.getRow(1).height = 35;
+      // 鏄惁涓虹洰鏍囧尰闄紙浜哄伐/璇煶/鐭俊/寰俊 鎸� 鍙戦�佹暟/鎴愬姛鏁� 鍒嗙骇灞曠ず锛�
+      const graded = this.isTargetHospital;
 
-      // 琛ㄥご
-      const secondRowHeaders = [
+      const baseHeaders = [
         "",
         "鍑洪櫌鐥呭尯",
         "绉戝",
         "鍑洪櫌浜烘",
         "鏃犻渶闅忚浜烘",
         "搴旈殢璁夸汉娆�",
-        "闇�闅忚",
-        "寰呴殢璁�",
-        "闅忚鎴愬姛",
-        "闅忚澶辫触",
-        "鎴愬姛鐜�", // 鏂板
-        "闅忚鐜�", // 鍘熶綅缃悗绉�
-        "鍙婃椂鐜�", // 鍙婃椂鐜囧悗绉�
-        "浜哄伐",
-        "璇煶", // 淇锛氬簲璇ユ槸璇煶
-        "鐭俊", // 鐭俊
-        "寰俊", // 寰俊
       ];
+      const coreHeaders = this.isTargetHospital
+        ? [
+            "闇�闅忚",
+            "寰呭彂閫�",
+            "宸插彂閫�",
+            "闅忚鎴愬姛",
+            "鎴愬姛鐜�",
+            "闅忚鐜�",
+            "鍙婃椂鐜�",
+          ]
+        : [
+            "闇�闅忚",
+            "寰呴殢璁�",
+            "闅忚鎴愬姛",
+            "闅忚澶辫触",
+            "鎴愬姛鐜�",
+            "闅忚鐜�",
+            "鍙婃椂鐜�",
+          ];
+      const methodGroups = this.getMethodColumns();
 
-      secondRowHeaders.forEach((header, index) => {
-        const cell = worksheet.getCell(3, index + 1);
-        cell.value = header;
-        cell.style = headerStyle;
-      });
+      const baseCount = baseHeaders.length; // 6
+      const coreCount = coreHeaders.length; // 7
+      const methodLeafCount = methodGroups.reduce(
+        (sum, g) => sum + g.fields.length,
+        0
+      ); // 8 鎴� 4
+      const totalCols = baseCount + coreCount + methodLeafCount; // 21 鎴� 17
+      const coreStartCol = baseCount + 1; // 7
+      const methodStartCol = baseCount + coreCount + 1; // 14
 
-      // 鍚堝苟鍗曞厓鏍�
-      for (let i = 1; i <= 6; i++) {
-        worksheet.mergeCells(2, i, 3, i);
-        const cell = worksheet.getCell(2, i);
-        cell.style = headerStyle;
+      const titleText = `${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
+      // 娣诲姞鏍囬琛�
+      worksheet.mergeCells(1, 1, 1, totalCols);
+      const titleCell = worksheet.getCell(1, 1);
+      titleCell.value = titleText;
+      titleCell.style = titleStyle;
+      worksheet.getRow(1).height = 35;
+
+      if (graded) {
+        // 琛ㄥご鍗� 3 琛岋紙绗�2/3/4琛岋級锛屾暟鎹粠绗�5琛屽紑濮�
+        const headerEndRow = 4;
+
+        // 绗�2琛岋細鍩虹鍒楃旱鍚戝悎骞� + 闅忚鍒嗙粍妯悜鍚堝苟
+        for (let i = 1; i <= baseCount; i++) {
+          worksheet.mergeCells(2, i, headerEndRow, i);
+          const cell = worksheet.getCell(2, i);
+          cell.value = baseHeaders[i - 1];
+          cell.style = headerStyle;
+        }
+        worksheet.mergeCells(2, coreStartCol, 2, totalCols);
+        worksheet.getCell(2, coreStartCol).value = serviceTypeName;
+        worksheet.getCell(2, coreStartCol).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 <= baseCount; i++) {
+          worksheet.mergeCells(2, i, headerEndRow, i);
+          const cell = worksheet.getCell(2, i);
+          cell.value = baseHeaders[i - 1];
+          cell.style = headerStyle;
+        }
+        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 = serviceTypeName; // 鎴栭�傚綋鎴彇
-      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 || "",
+          item.dischargeCount || 0,
+          item.nonFollowUp || 0,
+          item.followUpNeeded || 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), // 鍙婃椂鐜�
+        ];
+        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;
         });
@@ -1938,24 +2307,43 @@
       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, 12, 12, 12, 10, 10, 10, 10, 12, 12, 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: ["寰俊"] },
       ];
     },
 
@@ -1968,37 +2356,47 @@
         0, // 4: nonFollowUp
         0, // 5: followUpNeeded
         0, // 6: needFollowUp
-        0, // 7: pendingFollowUp
-        0, // 8: followUpSuccess
-        0, // 9: followUpFail
+        0, // 7: 寰呭彂閫�/寰呴殢璁�
+        0, // 8: 宸插彂閫�/闅忚鎴愬姛
+        0, // 9: 闅忚鎴愬姛/闅忚澶辫触
         "0%", // 10: 鎴愬姛鐜�
         "0%", // 11: 闅忚鐜�
         "0%", // 12: 鍙婃椂鐜�
-        0, // 13: manual
-        0, // 14: voice
-        0, // 15: sms
-        0, // 16: weChat
       ];
+
+      const methodFields = this.getMethodColumns().reduce(
+        (arr, g) => arr.concat(g.fields),
+        []
+      );
+      const methodStartIndex = 13;
+      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;
+        if (this.isTargetHospital) {
+          summaries[7] += Number(item.pendingFollowUpWaitSend) || 0;
+          summaries[8] += Number(item.pendingFollowUpSent) || 0;
+          summaries[9] += Number(item.followUpSuccess) || 0;
+        } else {
+          summaries[7] += Number(item.pendingFollowUp) || 0;
+          summaries[8] += Number(item.followUpSuccess) || 0;
+          summaries[9] += Number(item.followUpFail) || 0;
+        }
+        methodFields.forEach((field, i) => {
+          summaries[methodStartIndex + i] += Number(item[field]) || 0;
+        });
       });
 
-      // 鎴愬姛鐜囪绠�
-      const totalSuccess = summaries[8]; // followUpSuccess鐨勬�诲拰
+      // 鎴愬姛鐜囪绠楋細闅忚鎴愬姛 / 闇�闅忚锛堢洰鏍囧尰闄級锛屽惁鍒� 闅忚鎴愬姛 / (闇�闅忚-寰呴殢璁�)
+      const totalSuccess = this.isTargetHospital ? summaries[9] : summaries[8];
       const totalNeed = summaries[6]; // needFollowUp鐨勬�诲拰
-      const totalPending = summaries[7]; // pendingFollowUp鐨勬�诲拰
-      const denominator = totalNeed - totalPending;
+      const totalPending = summaries[7]; // 寰呭彂閫�/寰呴殢璁跨殑鎬诲拰
+      const denominator = this.isTargetHospital
+        ? totalNeed
+        : totalNeed - totalPending;
 
       if (denominator > 0) {
         summaries[10] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";
@@ -2018,19 +2416,30 @@
         summaries[11] = (avgFollowUpRate * 100).toFixed(2) + "%";
       }
 
-      // 鍙婃椂鐜囪绠�
-      const rateValues = this.tableData
-        .map((item) => this.extractPercentageValue(item.rate))
-        .filter((value) => value !== null);
+      // 鍙婃椂鐜囪绠楋細鐩爣鍖婚櫌 (闇�闅忚-浜哄伐瓒呮椂)/闇�闅忚锛屽叾浠栧彇鍚庣 rate 骞冲潎
+      if (this.isTargetHospital) {
+        const totalTimeout = this.tableData.reduce(
+          (sum, item) => sum + (Number(item.manualCallTimeout) || 0),
+          0
+        );
+        summaries[12] = 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[12] = (avgRate * 100).toFixed(2) + "%";
+        }
       }
 
       // 鏍煎紡鍖栨暟瀛�
-      [3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16].forEach((index) => {
+      const numericIndices = [3, 4, 5, 6, 7, 8, 9].concat(
+        methodFields.map((_, i) => methodStartIndex + i)
+      );
+      numericIndices.forEach((index) => {
         summaries[index] = this.formatNumber(summaries[index]);
       });
 
@@ -2050,20 +2459,40 @@
     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
         ? Array.isArray(queryParams.serviceType)

--
Gitblit v1.9.3