添加导出excel功能
This commit is contained in:
parent
c1f9c8f908
commit
b0dc9ae639
@ -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})
|
||||
|
@ -21,6 +21,10 @@
|
||||
<el-button type="primary" @click="getList" style="margin-left: 20px;">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 查询
|
||||
</el-button>
|
||||
<el-button type="primary" @click="exportExcel" style="margin-left: 20px;"
|
||||
:loading="exportLoading">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 导出excel
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</ContentWrap>
|
||||
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user