From b0dc9ae6395f2b8ea087adba75ac1898f58c7f96 Mon Sep 17 00:00:00 2001 From: yy2205 <2238220225@qq.com> Date: Tue, 22 Apr 2025 15:07:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=87=BAexcel?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inspect/inspectpatient/index.ts | 4 ++++ src/views/sta/index.vue | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts index 4613ba4..4c98ed4 100644 --- a/src/api/inspect/inspectpatient/index.ts +++ b/src/api/inspect/inspectpatient/index.ts @@ -158,6 +158,10 @@ export const PatientApi = { getData : async (params: any) => { return await request.get({ url: `/inspect/patient/getworkload?dates=${params.dates[0]}&dates=${params.dates[1]}` }) }, + //导出工作量统计excel + exportData : async (params: any) => { + return await request.download({ url: `/inspect/patient/export-statistics-excel?dates=${params.dates[0]}&dates=${params.dates[1]}` }) + }, //更新患者补充信息 updatePatientSupplement: async (medicalSn: string,idCard: string) => { return await request.get({ url: `/inspect/patient/updatePatientSupplement?medicalSn=` + medicalSn + `&idCard=` + idCard}) diff --git a/src/views/sta/index.vue b/src/views/sta/index.vue index c98035e..aec6508 100644 --- a/src/views/sta/index.vue +++ b/src/views/sta/index.vue @@ -21,6 +21,10 @@ 查询 + + 导出excel + @@ -51,7 +55,11 @@ import {StatisticsApi} from "@/api/inspect/statistics"; import dayjs from "dayjs"; import {PatientApi} from "@/api/inspect/inspectpatient"; import {formatDate} from "@/utils/formatTime"; +import download from "@/utils/download"; +const message = useMessage() // 消息弹窗 +const { t } = useI18n() // 国际化 +const loading = ref(true) // 列表的加载中 const time = ref() // 日期 const data = ref([ {orgname: '北京', districtname:'A村',oldmanflag:1 ,htnflag :2 ,diaflag:1, smiflag:1 ,pulflag:1 ,sum : 6}, @@ -206,6 +214,21 @@ const dataProcessing = (data) => { return value; } +const exportLoading = ref(false) // 导出的加载中 +const exportExcel =async () => { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出 + try { + exportLoading.value = true + const data =await PatientApi.exportData({dates:time.value}) + download.excel(data, '统计.xls') + }catch (e) { + + }finally { + exportLoading.value = false + } +} onMounted(()=>{ changeRadio(3) // getList()