WXL (wul)
3 天以前 c70f5e1d471ddf002ef0ebd5f4c6a5ed1c865d0d
src/views/sfstatistics/percentage/components/SecondFollowUp.vue
@@ -554,6 +554,223 @@
            :render-header="Tooltipsfl"
          />
          <el-table-column
            v-if="isTargetHospital"
            label="人工"
            align="center"
          >
            <el-table-column
              label="发送完成"
              align="center"
              key="manualAgain"
              prop="manualAgain"
              :render-header="Tooltipfswc"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'manualAgainInfo',
                      '发送完成人工随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{ scope.row.manualAgain }}</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="发送完成"
              align="center"
              key="voiceAgain"
              prop="voiceAgain"
              :render-header="Tooltipfswc"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'voiceAgainInfo',
                      '发送完成语音随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{ scope.row.voiceAgain }}</span>
                </el-button>
              </template>
            </el-table-column>
            <el-table-column
              label="最终完成"
              align="center"
              key="voiceAgainSuccess"
              prop="voiceAgainSuccess"
              :render-header="Tooltipzzwc"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'voiceAgainSuccessInfo',
                      '最终完成语音随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{
                    scope.row.voiceAgainSuccess
                  }}</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="smsAgain"
              prop="smsAgain"
              :render-header="Tooltipfswc"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'smsAgainInfo',
                      '发送完成短信随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{ scope.row.smsAgain }}</span>
                </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
              label="发送完成"
              align="center"
              key="weChatAgain"
              prop="weChatAgain"
              :render-header="Tooltipfswc"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'weChatAgainInfo',
                      '发送完成微信随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{ scope.row.weChatAgain }}</span>
                </el-button>
              </template>
            </el-table-column>
            <el-table-column
              label="最终完成"
              align="center"
              key="weChatAgainSuccess"
              prop="weChatAgainSuccess"
              :render-header="Tooltipzzwc"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'wechatAgainSuccessInfo',
                      '最终完成微信随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{
                    scope.row.weChatAgainSuccess
                  }}</span>
                </el-button>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column
            v-if="!isTargetHospital"
            label="人工"
            align="center"
            key="manualAgain"
@@ -576,6 +793,7 @@
            </template>
          </el-table-column>
          <el-table-column
            v-if="!isTargetHospital"
            label="语音"
            align="center"
            key="voiceAgain"
@@ -594,6 +812,7 @@
            </template>
          </el-table-column>
          <el-table-column
            v-if="!isTargetHospital"
            label="短信"
            align="center"
            key="smsAgain"
@@ -616,6 +835,7 @@
            </template>
          </el-table-column>
          <el-table-column
            v-if="!isTargetHospital"
            label="微信"
            align="center"
            key="weChatAgain"
@@ -681,6 +901,14 @@
      ids: [],
      tasktypes: store.getters.tasktypes,
    };
  },
  computed: {
    isTargetHospital() {
      return (
        this.orgname == "第一人民医院湖滨院区" ||
        this.orgname == "第一人民医院吴山院区"
      );
    },
  },
  methods: {
    loadData() {
@@ -753,6 +981,32 @@
        [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)]
      );
    },
    getAllWardCodes() {
      return this.flatArrayhospit
        .filter((item) => item.value !== "all")
@@ -766,167 +1020,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;
    },
@@ -1125,6 +1235,67 @@
      return Number.isInteger(num) ? num.toString() : num.toFixed(0);
    },
    // ===== 病区名排序(支持 1-B10 / 2-A2 等 数字-字母数字 格式) =====
    // 解析病区名,返回排序键 { 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);
    },
@@ -1204,20 +1375,21 @@
          }
        }
        // 根据 serviceType 生成随访类型名称
        // 根据 serviceType 生成随访类型名称(兼容单选/多选)
        const serviceTypes = Array.isArray(this.queryParams.serviceType)
          ? this.queryParams.serviceType
          : this.queryParams.serviceType
          ? [this.queryParams.serviceType]
          : [];
        let serviceTypeName = "出院随访"; // 文件名使用的名称
        let sheetTypeName = "再次随访"; // 工作表使用的名称(简化版)
        console.log(this.queryParams.serviceType);
        if (
          this.queryParams.serviceType &&
          Array.isArray(this.queryParams.serviceType) &&
          this.queryParams.serviceType.length > 0
        ) {
        if (serviceTypes.length > 0) {
          if (this.tasktypes && Array.isArray(this.tasktypes)) {
            // 过滤出匹配的随访类型
            const matchedTypes = this.tasktypes.filter((task) =>
              this.queryParams.serviceType.includes(task.value)
              serviceTypes.includes(task.value)
            );
            if (matchedTypes.length === 1) {
@@ -1233,22 +1405,16 @@
              serviceTypeName = typeNames.join("/");
              // 工作表名:使用第一个类型或简化名称
              if (matchedTypes.length <= 2) {
                // 如果只有2个类型,都显示
                sheetTypeName = `${typeNames[0]}等`;
              } else {
                // 如果超过2个类型,只显示第一个
                sheetTypeName = `${typeNames[0]}等`;
              }
            } else if (this.queryParams.serviceType.length > 0) {
              sheetTypeName = `${typeNames[0]}等`;
            } else {
              // 如果没有匹配的,使用原始值
              const typeStr = this.queryParams.serviceType.join("/");
              const typeStr = serviceTypes.join("/");
              serviceTypeName = typeStr;
              sheetTypeName = "再次随访";
            }
          } else if (this.queryParams.serviceType.length > 0) {
          } else {
            // 如果没有 tasktypes,使用原始值
            const typeStr = this.queryParams.serviceType.join("/");
            const typeStr = serviceTypes.join("/");
            serviceTypeName = typeStr;
            sheetTypeName = "再次随访";
          }
@@ -1579,92 +1745,154 @@
        },
      };
      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 = [
        "需随访",
        "待随访",
        "随访成功",
        "随访失败",
        "成功率", // 成功率应该在随访失败后面
        "随访率", // 随访率在成功率后面
        "人工",
        "语音", // 修正:应该是语音,不是短信
        "短信", // 短信
        "微信", // 微信
        "成功率",
        "随访率",
      ];
      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; // 6
      const methodLeafCount = methodGroups.reduce(
        (sum, g) => sum + g.fields.length,
        0
      ); // 8 或 4
      const totalCols = baseCount + coreCount + methodLeafCount; // 20 或 16
      const coreStartCol = baseCount + 1; // 7
      const methodStartCol = baseCount + coreCount + 1; // 13
      // 更新合并单元格的范围
      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 = "再次出院随访";
        worksheet.getCell(2, coreStartCol).style = headerStyle;
        // 第3行:随访核心列纵向合并 + 随访方式分组横向合并
        for (let k = 0; k < coreCount; k++) {
          const col = coreStartCol + k;
          worksheet.mergeCells(3, col, headerEndRow, col);
          const cell = worksheet.getCell(3, col);
          cell.value = coreHeaders[k];
          cell.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 = "再次出院随访";
        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-14)
      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.needFollowUpAgain || 0,
            item.pendingFollowUpAgain || 0,
            item.followUpSuccessAgain || 0,
            item.followUpFailAgain || 0,
            // 成功率 - 需要动态计算
            this.calculateSuccessRate(
              item.followUpSuccessAgain,
              item.needFollowUpAgain,
              item.pendingFollowUpAgain
            ),
            item.followUpRateAgain || "0%", // 随访率
            item.manualAgain || 0,
            item.voiceAgain || 0,
            item.smsAgain || 0,
            item.weChatAgain || 0,
          ],
          rowIndex + 4
        );
        const rowValues = [
          "",
          item.leavehospitaldistrictname || "",
          item.deptname || "",
          item.dischargeCount || 0,
          item.nonFollowUp || 0,
          item.followUpNeeded || 0,
          item.needFollowUpAgain || 0,
          item.pendingFollowUpAgain || 0,
          item.followUpSuccessAgain || 0,
          item.followUpFailAgain || 0,
          // 成功率 - 需要动态计算
          this.calculateSuccessRate(
            item.followUpSuccessAgain,
            item.needFollowUpAgain,
            item.pendingFollowUpAgain
          ),
          item.followUpRateAgain || "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;
        });
@@ -1683,24 +1911,27 @@
      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: 8 }, // 人工
        { width: 8 }, // 语音
        { width: 8 }, // 短信
        { width: 8 }, // 微信
      const widths = [8, 20, 15, 12, 12, 12, 10, 10, 10, 10, 12, 12];
      methodGroups.forEach((g) => {
        g.fields.forEach(() => widths.push(8));
      });
      worksheet.columns = widths.map((width) => ({ width }));
    },
    getMethodColumns() {
      // 随访方式列配置:目标医院按“发送完成/最终完成”分级展示
      if (this.isTargetHospital) {
        return [
          { label: "人工", fields: ["manualAgain", "manualAgainSuccess"], sub: ["发送完成", "最终完成"] },
          { label: "语音", fields: ["voiceAgain", "voiceAgainSuccess"], sub: ["发送完成", "最终完成"] },
          { label: "短信", fields: ["smsAgain", "smsAgainSuccess"], sub: ["发送完成", "最终完成"] },
          { label: "微信", fields: ["weChatAgain", "weChatAgainSuccess"], sub: ["发送完成", "最终完成"] },
        ];
      }
      return [
        { label: "人工", fields: ["manualAgain"], sub: ["人工"] },
        { label: "语音", fields: ["voiceAgain"], sub: ["语音"] },
        { label: "短信", fields: ["smsAgain"], sub: ["短信"] },
        { label: "微信", fields: ["weChatAgain"], sub: ["微信"] },
      ];
    },
@@ -1718,11 +1949,14 @@
        0, // 9: followUpFailAgain
        "0%", // 10: 成功率
        "0%", // 11: 随访率
        0, // 12: manualAgain
        0, // 13: voiceAgain
        0, // 14: smsAgain
        0, // 15: weChatAgain
      ];
      const methodFields = this.getMethodColumns().reduce(
        (arr, g) => arr.concat(g.fields),
        []
      );
      const methodStartIndex = 12;
      methodFields.forEach(() => summaries.push(0));
      this.tableData.forEach((item) => {
        summaries[3] += Number(item.dischargeCount) || 0;
@@ -1732,10 +1966,9 @@
        summaries[7] += Number(item.pendingFollowUpAgain) || 0;
        summaries[8] += Number(item.followUpSuccessAgain) || 0;
        summaries[9] += Number(item.followUpFailAgain) || 0;
        summaries[12] += Number(item.manualAgain) || 0;
        summaries[13] += Number(item.voiceAgain) || 0;
        summaries[14] += Number(item.smsAgain) || 0;
        summaries[15] += Number(item.weChatAgain) || 0;
        methodFields.forEach((field, i) => {
          summaries[methodStartIndex + i] += Number(item[field]) || 0;
        });
      });
      // 成功率计算
@@ -1763,7 +1996,10 @@
      }
      // 格式化数字
      [3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15].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]);
      });