修改机构统计逻辑

This commit is contained in:
Flow 2025-05-27 15:29:35 +08:00
parent 73c8d37492
commit 3747285c98
3 changed files with 21 additions and 12 deletions

View File

@ -183,8 +183,6 @@ export const PatientApi = {
},
//获取详情数据
getPatientDetails: async (params: any) => {
return await request.get({
url: `/inspect/patient/getPatientDetails?stadate=${params.dates[0]}&enddate=${params.dates[1]}&addname=${params.districtname}`
})
return await request.get({ url: `/inspect/patient/getPatientDetails`, params })
}
}

View File

@ -66,7 +66,7 @@
<el-table-column label="总人数" align="center" prop="sum" min-width="80" />
<el-table-column label="操作" align="center" width="120">
<template #default="{ row }">
<el-button v-if="row.districtname" link type="primary" @click="handleDetail(row)">
<el-button v-if="!row.children" link type="primary" @click="handleDetail(row)">
详情
</el-button>
</template>
@ -85,8 +85,8 @@
:data="detailData"
border
style="width: 100%"
height="800"
:max-height="800"
height="600"
:max-height="600"
>
<el-table-column label="体检编号" prop="medicalSn" align="center" min-width="120" />
<el-table-column label="姓名" prop="pname" align="center" min-width="100" />
@ -204,6 +204,7 @@ const changeDatePick = () => {
radioType.value = null
// getList()
}
const userInfo = ref()
/**
* 获取统计数据
*/
@ -212,8 +213,8 @@ const getList = async () => {
data1.value = []
//
const userInfo = await getUserProfile()
const deptInfo = await InspectOrgApi.getInspectOrg(userInfo.deptId)
userInfo.value = await getUserProfile()
const deptInfo = await InspectOrgApi.getInspectOrg(userInfo.value.deptId)
const params = {
dates: [dayjs(time.value[0]).format('YYYY-MM-DD'), dayjs(time.value[1]).format('YYYY-MM-DD')],
@ -382,13 +383,23 @@ const printData = () => {
*/
const handleDetail = async (row) => {
try {
if (row.districtname == null) {
row.districtname='未知'
}
//
const parentNode = data1.value.find(item =>
item.children && item.children.some(child => child.districtname === row.districtname)
)
const params = {
dates: time.value,
districtname: row.districtname,
stadate: time.value[0],
enddate: time.value[1],
addname: row.districtname,
examhosname: parentNode ? parentNode.orgname : row.orgname,
orgid: userInfo.value.deptId
}
console.log(params)
const res = await PatientApi.getPatientDetails(params)
console.log(res)
detailData.value = res
dialogVisible.value = true
} catch (error) {

View File

@ -130,7 +130,7 @@ const handleIframeLoad = async () => {
avatarImg.src = 'data:image/jpeg;base64,' + reportData.headPicUrl
}
else{
avatarImg.src = '/头像.png'
avatarImg.src = '/inspect/头像.png'
}
}
//