工作量导出界面 增加权限控制

This commit is contained in:
lxd 2024-12-11 17:11:18 +08:00
parent 18191334e5
commit 2fc512a8dd

View File

@ -17,14 +17,15 @@
<el-button style="margin-left: 20px" @click="getdata()">查询</el-button> <el-button style="margin-left: 20px" @click="getdata()">查询</el-button>
<el-button style="margin-left: 20px" @click="exportData()">导出</el-button> <el-button style="margin-left: 20px" @click="exportData()">导出</el-button>
<el-button style="margin-left: 20px" @click="exportnowData()" <el-button style="margin-left: 20px" @click="exportnowData()"
>导出{{ Profilevo.doctorname }}工作量</el-button >导出{{ Profilevo.doctorname }}全部工作量</el-button
> >
<el-button style="margin-left: 20px" @click="exportAllData()">导出全部</el-button> <el-button style="margin-left: 20px" @click="exportAllData()" v-if="power">导出全部</el-button>
<el-select <el-select
v-model="doctorvalue" v-model="doctorvalue"
clearable clearable
placeholder="请选择医生" placeholder="请选择医生"
style="margin-left: 20px; width: 180px" style="margin-left: 20px; width: 180px"
v-if="power"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -51,10 +52,14 @@ import { EcganalysisparasApi } from '@/api/tblist/ecganalysisparas'
import { getUserProfile, ProfileVO } from '@/api/system/user/profile' import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
import { DiagnosisTemplateApi } from '@/api/applyregistration/diagnosisTemplate' import { DiagnosisTemplateApi } from '@/api/applyregistration/diagnosisTemplate'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import * as ConfigApi from '@/api/infra/config' //
const Profilevo = ref<ProfileVO>({} as ProfileVO) // const Profilevo = ref<ProfileVO>({} as ProfileVO) //
const endDate = new Date() const endDate = new Date()
const startDate = new Date(endDate.getTime() - 7 * 24 * 3600 * 1000) const startDate = new Date(endDate.getTime() - 7 * 24 * 3600 * 1000)
const Date_value = ref<[Date, Date]>([startDate, endDate]) const Date_value = ref<[Date, Date]>([startDate, endDate])
const power = ref(false)
const getlogininfo = async () => { const getlogininfo = async () => {
Profilevo.value = await getUserProfile() Profilevo.value = await getUserProfile()
} }
@ -260,15 +265,29 @@ const calculateDailyDiagnosisCounts = (data: any[], dateArray: string[]) => {
} }
// onMounted // onMounted
onMounted(() => { onMounted(async () => {
getlogininfo() await getlogininfo()
getDoctorList() getDoctorList()
// 7 // 7
const endDate = new Date() const endDate = new Date()
const startDate = new Date(endDate.getTime() - 6 * 24 * 3600 * 1000) const startDate = new Date(endDate.getTime() - 6 * 24 * 3600 * 1000)
Date_value.value = [startDate, endDate] Date_value.value = [startDate, endDate]
exportpower()
}) })
//p
async function exportpower() {
const data = await ConfigApi.getConfigKey('power.export')
console.log(data)
if (data) {
console.log(Profilevo.value.doctorname)
if (data.includes(Profilevo.value.doctorname)) {
power.value = true
} else {
power.value = false
}
}
}
// //
async function exportAllData() { async function exportAllData() {
try { try {