| | |
| | | </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> |
| | |
| | | </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', '首次需随访列表')"> |
| | |
| | | }, |
| | | |
| | | // ===================== 导出 ===================== |
| | | 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 = ""; |
| | |
| | | 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; |
| | |
| | | |
| | | 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", |
| | |
| | | } |
| | | }, |
| | | |
| | | buildExportSheet(worksheet, dateRangeString) { |
| | | buildExportSheet(worksheet, dateRangeString, serviceTypeSuffix = "") { |
| | | // 定义样式 |
| | | const titleStyle = { |
| | | font: { name: "微软雅黑", size: 16, bold: true }, |
| | |
| | | |
| | | // 标题行 |
| | | 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; |
| | | |