WXL (wul)
6 天以前 b4fe2c16274a91fee4fb26d91374f95fbe2dbcec
src/views/sfstatistics/percentage/components/SecondFollowUp.vue
@@ -154,6 +154,7 @@
                  </template>
                </el-table-column>
                <el-table-column
                  v-if="!isTargetHospital"
                  label="待随访"
                  align="center"
                  key="pendingFollowUpAgain"
@@ -177,6 +178,62 @@
                      }}</span>
                    </el-button>
                  </template>
                </el-table-column>
                <el-table-column
                  v-if="isTargetHospital"
                  label="待随访"
                  align="center"
                >
                  <el-table-column
                    label="待发送"
                    align="center"
                    key="pendingFollowUpWaitSendAgain"
                    prop="pendingFollowUpWaitSendAgain"
                  >
                    <template slot-scope="scope">
                      <el-button
                        size="medium"
                        type="text"
                        @click="
                          handleViewDetails(
                            scope.row,
                            'pendingFollowUpWaitSendAgainInfo',
                            '待发送列表',
                            '1'
                          )
                        "
                      >
                        <span class="button-zx">{{
                          scope.row.pendingFollowUpWaitSendAgain
                        }}</span>
                      </el-button>
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="已发送"
                    align="center"
                    key="pendingFollowUpSentAgain"
                    prop="pendingFollowUpSentAgain"
                  >
                    <template slot-scope="scope">
                      <el-button
                        size="medium"
                        type="text"
                        @click="
                          handleViewDetails(
                            scope.row,
                            'pendingFollowUpSentAgainInfo',
                            '已发送列表',
                            '1'
                          )
                        "
                      >
                        <span class="button-zx">{{
                          scope.row.pendingFollowUpSentAgain
                        }}</span>
                      </el-button>
                    </template>
                  </el-table-column>
                </el-table-column>
                <el-table-column
                  label="随访成功"
@@ -204,6 +261,7 @@
                  </template>
                </el-table-column>
                <el-table-column
                  v-if="!isTargetHospital"
                  label="随访失败"
                  align="center"
                  key="followUpFailAgain"
@@ -457,6 +515,7 @@
            </template>
          </el-table-column>
          <el-table-column
            v-if="!isTargetHospital"
            label="待随访"
            align="center"
            key="pendingFollowUpAgain"
@@ -479,6 +538,60 @@
                }}</span>
              </el-button>
            </template>
          </el-table-column>
          <el-table-column
            v-if="isTargetHospital"
            label="待随访"
            align="center"
          >
            <el-table-column
              label="待发送"
              align="center"
              key="pendingFollowUpWaitSendAgain"
              prop="pendingFollowUpWaitSendAgain"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'pendingFollowUpWaitSendAgainInfo',
                      '再次随访待发送列表'
                    )
                  "
                >
                  <span class="button-zx">{{
                    scope.row.pendingFollowUpWaitSendAgain
                  }}</span>
                </el-button>
              </template>
            </el-table-column>
            <el-table-column
              label="已发送"
              align="center"
              key="pendingFollowUpSentAgain"
              prop="pendingFollowUpSentAgain"
            >
              <template slot-scope="scope">
                <el-button
                  size="medium"
                  type="text"
                  @click="
                    handleViewDetails(
                      scope.row,
                      'pendingFollowUpSentAgainInfo',
                      '再次随访已发送列表'
                    )
                  "
                >
                  <span class="button-zx">{{
                    scope.row.pendingFollowUpSentAgain
                  }}</span>
                </el-button>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column
            label="随访成功"
@@ -505,6 +618,7 @@
            </template>
          </el-table-column>
          <el-table-column
            v-if="!isTargetHospital"
            label="随访失败"
            align="center"
            key="followUpFailAgain"
@@ -553,67 +667,40 @@
            prop="followUpRateAgain"
            :render-header="Tooltipsfl"
          />
          <el-table-column
            v-if="isTargetHospital"
            label="人工"
            v-if="orgname == '缙云县人民医院'"
            label="复诊复查数量"
            align="center"
            key="suggest7CountAgain"
            prop="suggest7CountAgain"
          >
            <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>
            <template slot-scope="scope">
              <el-button
                size="medium"
                type="text"
                @click="
                  handleViewDetails(
                    scope.row,
                    'suggest7CountAgainInfo',
                    '再次随访复诊复查列表'
                  )
                "
              >
                <span class="button-zx">{{
                  scope.row.suggest7CountAgain
                }}</span>
              </el-button>
            </template>
          </el-table-column>
          <el-table-column
            v-if="isTargetHospital"
            label="语音"
            align="center"
          >
            <el-table-column
              label="发送完成"
              label="发送数"
              align="center"
              key="voiceAgain"
              prop="voiceAgain"
@@ -636,7 +723,7 @@
              </template>
            </el-table-column>
            <el-table-column
              label="最终完成"
              label="成功数"
              align="center"
              key="voiceAgainSuccess"
              prop="voiceAgainSuccess"
@@ -661,13 +748,67 @@
              </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"
          >
            <el-table-column
              label="发送完成"
              label="发送数"
              align="center"
              key="smsAgain"
              prop="smsAgain"
@@ -690,7 +831,7 @@
              </template>
            </el-table-column>
            <el-table-column
              label="最终完成"
              label="成功数"
              align="center"
              key="smsAgainSuccess"
              prop="smsAgainSuccess"
@@ -715,16 +856,17 @@
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column
                    <el-table-column
            v-if="isTargetHospital"
            label="微信"
            label="人工"
            align="center"
          >
            <el-table-column
              label="发送完成"
              label="发送数"
              align="center"
              key="weChatAgain"
              prop="weChatAgain"
              key="manualAgain"
              prop="manualAgain"
              :render-header="Tooltipfswc"
            >
              <template slot-scope="scope">
@@ -734,20 +876,20 @@
                  @click="
                    handleViewDetails(
                      scope.row,
                      'weChatAgainInfo',
                      '发送完成微信随访列表'
                      'manualAgainInfo',
                      '发送完成人工随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{ scope.row.weChatAgain }}</span>
                  <span class="button-zx">{{ scope.row.manualAgain }}</span>
                </el-button>
              </template>
            </el-table-column>
            <el-table-column
              label="最终完成"
              label="成功数"
              align="center"
              key="weChatAgainSuccess"
              prop="weChatAgainSuccess"
              key="manualAgainSuccess"
              prop="manualAgainSuccess"
              :render-header="Tooltipzzwc"
            >
              <template slot-scope="scope">
@@ -757,13 +899,13 @@
                  @click="
                    handleViewDetails(
                      scope.row,
                      'wechatAgainSuccessInfo',
                      '最终完成微信随访列表'
                      'manualAgainSuccessInfo',
                      '最终完成人工随访列表'
                    )
                  "
                >
                  <span class="button-zx">{{
                    scope.row.weChatAgainSuccess
                    scope.row.manualAgainSuccess
                  }}</span>
                </el-button>
              </template>
@@ -946,7 +1088,9 @@
        "el-tooltip",
        {
          props: {
            content: "随访成功/(需随访-待随访)",
            content: this.isTargetHospital
              ? "随访成功/需随访"
              : "随访成功/(需随访-待随访)",
            placement: "top",
            effect: "dark",
          },
@@ -1103,7 +1247,7 @@
            return sum + (Number(item.pendingFollowUpAgain) || 0);
          }, 0);
          const denominator = totalNeed - totalPending;
          const denominator = this.isTargetHospital ? totalNeed : totalNeed - totalPending;
          if (denominator > 0) {
            sums[index] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";
@@ -1181,7 +1325,7 @@
            return sum + (Number(item.pendingFollowUpAgain) || 0);
          }, 0);
          const denominator = totalNeed - totalPending;
          const denominator = this.isTargetHospital ? totalNeed : totalNeed - totalPending;
          if (denominator > 0) {
            sums[index] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";
@@ -1312,8 +1456,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%";
@@ -1535,13 +1679,11 @@
        },
      };
      // 标题
      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 headers = [
        "医生姓名",
        "科室",
@@ -1549,13 +1691,25 @@
        "无需随访",
        "应随访",
        "需随访",
        "待随访",
        ...(graded ? ["待发送", "已发送"] : ["待随访"]),
        "随访成功",
        "随访失败",
        "成功率", // 新增
        "随访率", // 原来在成功率位置
        ...(graded ? [] : ["随访失败"]),
        ...(showSuccessRate ? ["成功率"] : []),
        "随访率",
        "人工",
        "语音",
        "短信",
        "微信",
      ];
      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;
@@ -1571,15 +1725,28 @@
          item.nonFollowUp,
          item.followUpNeeded,
          item.needFollowUpAgain,
          item.pendingFollowUpAgain,
          ...(graded
            ? [
                item.pendingFollowUpWaitSendAgain || 0,
                item.pendingFollowUpSentAgain || 0,
              ]
            : [item.pendingFollowUpAgain || 0]),
          item.followUpSuccessAgain,
          item.followUpFailAgain,
          this.calculateSuccessRate(
            item.followUpSuccessAgain,
            item.needFollowUpAgain,
            item.pendingFollowUpAgain
          ),
          ...(graded ? [] : [item.followUpFailAgain || 0]),
          ...(showSuccessRate
            ? [
                this.calculateSuccessRate(
                  item.followUpSuccessAgain,
                  item.needFollowUpAgain,
                  item.pendingFollowUpAgain
                ),
              ]
            : []),
          item.followUpRateAgain,
          item.manualAgain || 0,
          item.voiceAgain || 0,
          item.smsAgain || 0,
          item.weChatAgain || 0,
        ]);
        row.eachCell((cell) => {
          cell.style = cellStyle;
@@ -1599,33 +1766,28 @@
        };
      });
      // 列宽
      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 }));
    },
    /** 再次随访 - 医生子表导出小计 */
    getDoctorAgainExportSummary(data) {
      const sums = ["小计"];
      const graded = this.isTargetHospital;
      const showSuccessRate = this.orgname != "景宁畲族自治县人民医院";
      const sums = ["小计", "-"];
      const keys = [
        "dischargeCount",
        "nonFollowUp",
        "followUpNeeded",
        "needFollowUpAgain",
        "pendingFollowUpAgain",
        ...(graded
          ? ["pendingFollowUpWaitSendAgain", "pendingFollowUpSentAgain"]
          : ["pendingFollowUpAgain"]),
        "followUpSuccessAgain",
        "followUpFailAgain",
        ...(graded ? [] : ["followUpFailAgain"]),
      ];
      keys.forEach((key) => {
@@ -1633,25 +1795,28 @@
      });
      // 成功率(平均值)
      const successRates = data
        .map((item) => {
          const success = Number(item.followUpSuccessAgain) || 0;
          const need = Number(item.needFollowUpAgain) || 0;
          const pending = Number(item.pendingFollowUpAgain) || 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.followUpSuccessAgain) || 0;
            const need = Number(item.needFollowUpAgain) || 0;
            const pending = Number(item.pendingFollowUpAgain) || 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
@@ -1666,6 +1831,13 @@
              100
            ).toFixed(2) + "%"
          : "0.00%"
      );
      // 人工/语音/短信/微信
      ["manualAgain", "voiceAgain", "smsAgain", "weChatAgain"].forEach(
        (key) => {
          sums.push(data.reduce((t, r) => t + (Number(r[key]) || 0), 0));
        }
      );
      return sums;
@@ -1745,7 +1917,7 @@
        },
      };
      // 是否为目标医院(人工/语音/短信/微信 按 发送完成/最终完成 分级展示)
      // 是否为目标医院(人工/语音/短信/微信 按 发送数/成功数 分级展示)
      const graded = this.isTargetHospital;
      const baseHeaders = [
@@ -1758,9 +1930,9 @@
      ];
      const coreHeaders = [
        "需随访",
        "待随访",
        ...(this.isTargetHospital ? ["待发送", "已发送"] : ["待随访"]),
        "随访成功",
        "随访失败",
        ...(this.isTargetHospital ? [] : ["随访失败"]),
        "成功率",
        "随访率",
      ];
@@ -1799,14 +1971,37 @@
        worksheet.getCell(2, coreStartCol).value = "再次出院随访";
        worksheet.getCell(2, coreStartCol).style = headerStyle;
        // 第3行:随访核心列纵向合并 + 随访方式分组横向合并
        for (let k = 0; k < coreCount; k++) {
          const col = coreStartCol + k;
        // 第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);
          const cell = worksheet.getCell(3, col);
          cell.value = coreHeaders[k];
          cell.style = headerStyle;
        }
          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) {
@@ -1818,7 +2013,7 @@
          mc += g.fields.length;
        });
        // 第4行:随访方式子列(发送完成/最终完成)
        // 第4行:随访方式子列(发送数/成功数)
        mc = methodStartCol;
        methodGroups.forEach((g) => {
          g.fields.forEach((field, idx) => {
@@ -1875,9 +2070,14 @@
          item.nonFollowUp || 0,
          item.followUpNeeded || 0,
          item.needFollowUpAgain || 0,
          item.pendingFollowUpAgain || 0,
          ...(this.isTargetHospital
            ? [
                item.pendingFollowUpWaitSendAgain || 0,
                item.pendingFollowUpSentAgain || 0,
              ]
            : [item.pendingFollowUpAgain || 0]),
          item.followUpSuccessAgain || 0,
          item.followUpFailAgain || 0,
          ...(this.isTargetHospital ? [] : [item.followUpFailAgain || 0]),
          // 成功率 - 需要动态计算
          this.calculateSuccessRate(
            item.followUpSuccessAgain,
@@ -1918,13 +2118,13 @@
      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: ["发送完成", "最终完成"] },
          { label: "人工", fields: ["manualAgain", "manualAgainSuccess"], sub: ["发送数", "成功数"] },
          { label: "语音", fields: ["voiceAgain", "voiceAgainSuccess"], sub: ["发送数", "成功数"] },
          { label: "短信", fields: ["smsAgain", "smsAgainSuccess"], sub: ["发送数", "成功数"] },
          { label: "微信", fields: ["weChatAgain", "weChatAgainSuccess"], sub: ["发送数", "成功数"] },
        ];
      }
      return [
@@ -1936,20 +2136,35 @@
    },
    getExportSummaries() {
      const summaries = [
        "合计",
        "/",
        "/",
        0, // 3: dischargeCount
        0, // 4: nonFollowUp
        0, // 5: followUpNeeded
        0, // 6: needFollowUpAgain
        0, // 7: pendingFollowUpAgain
        0, // 8: followUpSuccessAgain
        0, // 9: followUpFailAgain
        "0%", // 10: 成功率
        "0%", // 11: 随访率
      ];
      const summaries = this.isTargetHospital
        ? [
            "合计",
            "/",
            "/",
            0, // 3: dischargeCount
            0, // 4: nonFollowUp
            0, // 5: followUpNeeded
            0, // 6: needFollowUpAgain
            0, // 7: pendingFollowUpWaitSendAgain
            0, // 8: pendingFollowUpSentAgain
            0, // 9: followUpSuccessAgain
            "0%", // 10: 成功率
            "0%", // 11: 随访率
          ]
        : [
            "合计",
            "/",
            "/",
            0, // 3: dischargeCount
            0, // 4: nonFollowUp
            0, // 5: followUpNeeded
            0, // 6: needFollowUpAgain
            0, // 7: pendingFollowUpAgain
            0, // 8: followUpSuccessAgain
            0, // 9: followUpFailAgain
            "0%", // 10: 成功率
            "0%", // 11: 随访率
          ];
      const methodFields = this.getMethodColumns().reduce(
        (arr, g) => arr.concat(g.fields),
@@ -1963,19 +2178,28 @@
        summaries[4] += Number(item.nonFollowUp) || 0;
        summaries[5] += Number(item.followUpNeeded) || 0;
        summaries[6] += Number(item.needFollowUpAgain) || 0;
        summaries[7] += Number(item.pendingFollowUpAgain) || 0;
        summaries[8] += Number(item.followUpSuccessAgain) || 0;
        summaries[9] += Number(item.followUpFailAgain) || 0;
        if (this.isTargetHospital) {
          summaries[7] += Number(item.pendingFollowUpWaitSendAgain) || 0;
          summaries[8] += Number(item.pendingFollowUpSentAgain) || 0;
          summaries[9] += Number(item.followUpSuccessAgain) || 0;
        } else {
          summaries[7] += Number(item.pendingFollowUpAgain) || 0;
          summaries[8] += Number(item.followUpSuccessAgain) || 0;
          summaries[9] += Number(item.followUpFailAgain) || 0;
        }
        methodFields.forEach((field, i) => {
          summaries[methodStartIndex + i] += Number(item[field]) || 0;
        });
      });
      // 成功率计算
      const totalSuccess = summaries[8]; // followUpSuccessAgain的总和
      const totalSuccess = this.isTargetHospital
        ? summaries[9] // followUpSuccessAgain的总和
        : summaries[8]; // followUpSuccessAgain的总和
      const totalNeed = summaries[6]; // needFollowUpAgain的总和
      const totalPending = summaries[7]; // pendingFollowUpAgain的总和
      const denominator = totalNeed - totalPending;
      const denominator = this.isTargetHospital
        ? totalNeed
        : totalNeed - summaries[7];
      if (denominator > 0) {
        summaries[10] = ((totalSuccess / denominator) * 100).toFixed(2) + "%";