WXL (wul)
16 小时以前 a9d2b856e0f6be6475319c2dc36bf405c2f908fc
src/views/sfstatistics/percentage/components/CombinedFollowUp.vue
@@ -173,10 +173,7 @@
            </el-button>
          </template>
        </el-table-column>
        <!-- ===== 首次随访 ===== -->
        <el-table-column align="center" label="首次随访">
          <el-table-column label="无需随访" align="center" prop="nonFollowUp">
             <el-table-column label="无需随访" align="center" prop="nonFollowUp">
            <template slot-scope="scope">
              <el-button type="text" @click="handleViewDetails(scope.row, 'nonFollowUpInfo', '首次无需随访列表')">
                <span class="button-zx">{{ scope.row.nonFollowUp }}</span>
@@ -190,6 +187,10 @@
              </el-button>
            </template>
          </el-table-column>
        <!-- ===== 首次随访 ===== -->
        <el-table-column align="center" label="首次随访">
          <el-table-column label="需随访" align="center" prop="needFollowUp">
            <template slot-scope="scope">
              <el-button type="text" @click="handleViewDetails(scope.row, 'needFollowUpInfo', '首次需随访列表')">
@@ -581,6 +582,18 @@
    },
    // ===================== 导出 =====================
    getServiceTypeLabel() {
      const val = this.queryParams.serviceType;
      if (val == null) return "";
      const values = Array.isArray(val) ? val : [val];
      const list =
        this.options && this.options.length ? this.options : this.tasktypes;
      const labels = values
        .map((v) => (list.find((o) => o.value === v) || {}).label)
        .filter(Boolean);
      return labels.join("/");
    },
    async exportTable() {
      try {
        let dateRangeString = "";
@@ -602,7 +615,9 @@
          dateRangeString = isLishuiHospital ? `${now.getFullYear()}年${now.getMonth() + 1}月` : `${now.getMonth() + 1}月`;
        }
        const excelName = `综合随访统计表_${dateRangeString}.xlsx`;
        const serviceTypeLabel = this.getServiceTypeLabel();
        const serviceTypeSuffix = serviceTypeLabel ? `_${serviceTypeLabel}` : "";
        const excelName = `综合随访统计表${serviceTypeSuffix}_${dateRangeString}.xlsx`;
        if (!this.tableData || this.tableData.length === 0) {
          this.$message.warning("暂无数据可导出");
          return false;
@@ -610,7 +625,7 @@
        const workbook = new ExcelJS.Workbook();
        const worksheet = workbook.addWorksheet("综合统计");
        this.buildExportSheet(worksheet, dateRangeString);
        this.buildExportSheet(worksheet, dateRangeString, serviceTypeSuffix);
        const buffer = await workbook.xlsx.writeBuffer();
        const blob = new Blob([buffer], {
          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -625,7 +640,7 @@
      }
    },
    buildExportSheet(worksheet, dateRangeString) {
    buildExportSheet(worksheet, dateRangeString, serviceTypeSuffix = "") {
      // 定义样式
      const titleStyle = {
        font: { name: "微软雅黑", size: 16, bold: true },
@@ -652,7 +667,7 @@
      // 标题行
      worksheet.mergeCells(1, 1, 1, 20);
      worksheet.getCell(1, 1).value = `综合随访统计表_${dateRangeString}`;
      worksheet.getCell(1, 1).value = `综合随访统计表${serviceTypeSuffix}_${dateRangeString}`;
      worksheet.getCell(1, 1).style = titleStyle;
      worksheet.getRow(1).height = 35;