导出体检时间报表
parent
155d6605e5
commit
39294f809e
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div v-loading="loading">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item>
|
||||||
|
<el-date-picker v-model="date" value-format="YYYY-MM-DD" type="date" placeholder="选择日期" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
<el-button type="success" @click="ExportFenZhenInfo()" style="margin-left: 10px;">导出体检报表时间监控</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
onMounted
|
||||||
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
ElMessage,
|
||||||
|
ElMessageBox
|
||||||
|
} from 'element-plus'
|
||||||
|
import {
|
||||||
|
FenzhenInfoExport
|
||||||
|
} from '@/api/api.js'
|
||||||
|
let loading = ref(false)
|
||||||
|
let date = ref('');
|
||||||
|
const ExportFenZhenInfo = () => {
|
||||||
|
loading.value = true
|
||||||
|
FenzhenInfoExport({date:date.value}).then(res => {
|
||||||
|
loading.value = false
|
||||||
|
if (res.status) {
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.style.display = 'none';
|
||||||
|
a.href = res.data.url;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
// window.URL.revokeObjectURL(url);
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const GetToday = () =>{
|
||||||
|
const today = new Date();
|
||||||
|
const year = today.getFullYear();
|
||||||
|
const month = String(today.getMonth() + 1).padStart(2, '0'); // 注意月份是从0开始的
|
||||||
|
const day = String(today.getDate()).padStart(2, '0')
|
||||||
|
date.value=(`${year}-${month}-${day}`)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
GetToday()
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue