| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="orgname != '景宁畲族自治县人民医院'" |
| | | label="成功率" |
| | | align="center" |
| | | width="120" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="orgname != '景宁畲族自治县人民医院'" |
| | | label="成功率" |
| | | align="center" |
| | | width="120" |
| | |
| | | |
| | | delete params.leavehospitaldistrictcodes.all; |
| | | delete params.deptcodes.all; |
| | | params.rateDay = 7; |
| | | params.rateDay = this.orgname == "龙泉市人民医院" ? 21 : 7; |
| | | getSfStatistics(params) |
| | | .then((response) => { |
| | | this.tableData = this.customSort(response.data); |
| | |
| | | "el-tooltip", |
| | | { |
| | | props: { |
| | | content: "(应随访时间+任务周期)小于完成时间即为超时;(需随访-超时)/需随访", |
| | | content: |
| | | "(出院时间+任务周期)小于完成时间即为超时;(需随访-超时)/需随访", |
| | | placement: "top", |
| | | effect: "dark", |
| | | }, |
| | |
| | | |
| | | if (!row.doctorStats) { |
| | | this.loading = true; |
| | | params.rateDay = 7; |
| | | params.rateDay = this.orgname == "龙泉市人民医院" ? 21 : 7; |
| | | |
| | | getSfStatistics(params).then((res) => { |
| | | this.$set(row, "doctorStats", res.data); |
| | |
| | | Array.isArray(this.queryParams.serviceType) && |
| | | this.queryParams.serviceType.length > 0 |
| | | ) { |
| | | if (this.tasktypes && Array.isArray(this.tasktypes)) { |
| | | // 过滤出匹配的随访类型 |
| | | const matchedTypes = this.tasktypes.filter((task) => |
| | | // 使用 props 中的 options(即 tasktypes) |
| | | if (this.options && Array.isArray(this.options)) { |
| | | const matchedTypes = this.options.filter((task) => |
| | | this.queryParams.serviceType.includes(task.value) |
| | | ); |
| | | console.log(matchedTypes, "matchedTypes"); |
| | | |
| | | if (matchedTypes.length === 1) { |
| | | // 单个类型 |
| | | const label = matchedTypes[0].label; |
| | | serviceTypeName = `首次${label}`; |
| | | sheetTypeName = `首次${label}`; |
| | | } else if (matchedTypes.length > 1) { |
| | | // 多个类型 |
| | | const typeNames = matchedTypes.map((task) => task.label); |
| | | |
| | | // 文件名:用斜杠分隔 |
| | | serviceTypeName = `首次${typeNames.join("/")}`; |
| | | |
| | | // 工作表名:使用第一个类型或简化名称 |
| | | if (matchedTypes.length <= 2) { |
| | | // 如果只有2个类型,都显示 |
| | | // 工作表名简化(取第一个+“等”) |
| | | sheetTypeName = `首次${typeNames[0]}等`; |
| | | } else { |
| | | // 如果超过2个类型,只显示第一个 |
| | | sheetTypeName = `首次${typeNames[0]}等`; |
| | | } |
| | | } else if (this.queryParams.serviceType.length > 0) { |
| | | // 如果没有匹配的,使用原始值 |
| | | // 无匹配时使用原始值 |
| | | const typeStr = this.queryParams.serviceType.join("/"); |
| | | serviceTypeName = `首次${typeStr}`; |
| | | sheetTypeName = "首次随访"; |
| | | } |
| | | } else if (this.queryParams.serviceType.length > 0) { |
| | | // 如果没有 tasktypes,使用原始值 |
| | | const typeStr = this.queryParams.serviceType.join("/"); |
| | | serviceTypeName = `首次${typeStr}`; |
| | | sheetTypeName = "首次随访"; |
| | |
| | | const worksheet = workbook.addWorksheet(worksheetName); |
| | | |
| | | // 构建表格 |
| | | this.buildExportSheet(worksheet, sheetNameSuffix); |
| | | this.buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName); |
| | | |
| | | const buffer = await workbook.xlsx.writeBuffer(); |
| | | const blob = new Blob([buffer], { |
| | |
| | | |
| | | return sums; |
| | | }, |
| | | buildExportSheet(worksheet, sheetNameSuffix) { |
| | | buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName) { |
| | | const titleStyle = { |
| | | font: { |
| | | name: "微软雅黑", |
| | |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | }, |
| | | }; |
| | | |
| | | const titleText = `${serviceTypeName}统计表_${sheetNameSuffix}`; |
| | | // 添加标题行 |
| | | worksheet.mergeCells(1, 1, 1, 16); |
| | | const titleCell = worksheet.getCell(1, 1); |
| | | titleCell.value = `首次出院随访统计表_${sheetNameSuffix}`; |
| | | titleCell.value = titleText; // 使用动态标题 |
| | | titleCell.style = titleStyle; |
| | | worksheet.getRow(1).height = 35; |
| | | |
| | |
| | | worksheet.getCell(2, 6).value = "应随访人次"; |
| | | |
| | | worksheet.mergeCells(2, 7, 2, 16); // 从7合并到16(原来是7-15) |
| | | worksheet.getCell(2, 7).value = "首次出院随访"; |
| | | worksheet.getCell(2, 7).value = serviceTypeName; // 或适当截取 |
| | | worksheet.getCell(2, 7).style = headerStyle; |
| | | |
| | | worksheet.getRow(2).height = 28; |