feat: 健康档案大屏功能新增。

This commit is contained in:
tianyongbao
2026-06-20 22:10:42 +08:00
parent 90e923f490
commit 9132824c61
10 changed files with 5386 additions and 30 deletions

View File

@@ -0,0 +1,88 @@
import request from '@/utils/request'
// 查询慢病指标记录列表
export function listIndicator(query) {
return request({
url: '/health/chronicDiseaseManage/indicator/list',
method: 'get',
params: query
})
}
// 查询慢病指标记录详细
export function getIndicator(id) {
return request({
url: '/health/chronicDiseaseManage/indicator/' + id,
method: 'get'
})
}
// 新增慢病指标记录
export function addIndicator(data) {
return request({
url: '/health/chronicDiseaseManage/indicator',
method: 'post',
data
})
}
// 修改慢病指标记录
export function updateIndicator(data) {
return request({
url: '/health/chronicDiseaseManage/indicator',
method: 'put',
data
})
}
// 删除慢病指标记录
export function delIndicator(id) {
return request({
url: '/health/chronicDiseaseManage/indicator/' + id,
method: 'delete'
})
}
// 查询复诊随访记录列表
export function listFollowUp(query) {
return request({
url: '/health/chronicDiseaseManage/followUp/list',
method: 'get',
params: query
})
}
// 新增复诊随访记录
export function addFollowUp(data) {
return request({
url: '/health/chronicDiseaseManage/followUp',
method: 'post',
data
})
}
// 修改复诊随访记录
export function updateFollowUp(data) {
return request({
url: '/health/chronicDiseaseManage/followUp',
method: 'put',
data
})
}
// 删除复诊随访记录
export function delFollowUp(id) {
return request({
url: '/health/chronicDiseaseManage/followUp/' + id,
method: 'delete'
})
}
// 查询状态变更历史
export function listStatusHistory(query) {
return request({
url: '/health/chronicDiseaseManage/statusHistory/list',
method: 'get',
params: query
})
}

View File

@@ -24,6 +24,22 @@ export function getHealthAnalysis(query) {
})
}
export function getActivityAnalysis(query) {
return request({
url: '/health/analysis/activityAnalysis',
method: 'get',
params: query
})
}
export function getHealthScreen(query) {
return request({
url: '/health/analysis/healthScreen',
method: 'get',
params: query
})
}
export function getRecordAnalysis(query) {
return request({
url: '/health/analysis/recordAnalysis',
@@ -32,6 +48,14 @@ export function getRecordAnalysis(query) {
})
}
export function getRecordScreen(query) {
return request({
url: '/health/analysis/recordScreen',
method: 'get',
params: query
})
}
export function getDoctorAnalysis(query) {
return request({
url: '/health/analysis/doctorAnalysis',

View File

@@ -65,28 +65,19 @@ export const constantRoutes = [
{
path: '',
component: Layout,
redirect: '/accountCalendar'
// children: [
// {
// path: '/index',
// component: () => import('@/views/index'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
redirect: '/index'
},
{
path: '/index',
component: Layout,
redirect: '/statisticanalysis/accountAnalysis'
// children: [
// {
// path: '/index',
// component: () => import('@/views/index'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
children: [
{
path: '',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
{
path: '/user',

View File

@@ -0,0 +1,582 @@
<template>
<div class="app-container">
<div class="search-con">
<div class="title">查询条件</div>
<el-form :model="queryParams" ref="queryRef" :inline="true" :rules="rules" label-width="100px">
<el-form-item label="活动名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="活动类型" prop="activityType">
<el-select v-model="queryParams.activityType" placeholder="请选择活动类型" clearable>
<el-option v-for="dict in activity_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="活动量" prop="activityVolume">
<el-select v-model="queryParams.activityVolume" placeholder="请选择活动量" clearable>
<el-option v-for="dict in activity_exercise" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="活动地点" prop="place">
<el-input v-model="queryParams.place" placeholder="请输入活动地点" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="统计粒度" prop="type">
<el-radio-group v-model="queryParams.type" @change="handleTimeChange">
<el-radio-button :label="1"></el-radio-button>
<el-radio-button :label="2"></el-radio-button>
<el-radio-button :label="3"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="活动日期" prop="time" v-if="queryParams.type === 1">
<el-date-picker
v-model="queryParams.time"
type="daterange"
range-separator="~"
start-placeholder="开始时间"
end-placeholder="结束时间"
format="YYYY-MM-DD"
@calendar-change="calendarChange"
/>
</el-form-item>
<el-form-item label="活动月份" prop="time" v-if="queryParams.type === 2">
<el-date-picker
v-model="queryParams.time"
type="monthrange"
range-separator="~"
format="YYYY-MM"
start-placeholder="开始时间"
end-placeholder="结束时间"
:disabled-date="disabledDateFun"
@calendar-change="calendarChange"
/>
</el-form-item>
<el-form-item label="活动年份" prop="time" v-if="queryParams.type === 3">
<yearPicker
v-model="queryParams.time"
ref="statisticPicker"
labelText="选择年份"
:initYear="dateValue"
:showYear="showYearValue"
:maxLength="5"
sp="~"
@updateTimeRange="updateStatisticYear"
/>
</el-form-item>
</el-form>
<div class="search-btn-con">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
</div>
</div>
<div class="main-con activity-stat-main" style="height: calc(100% - 1.45rem)">
<div class="summary-con" style="height: 115px">
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#409EFF"><Histogram /></el-icon>
</div>
<div class="item-wrap">
<div class="title">活动次数</div>
<div>
<span class="num">{{ activity.activityCount || 0 }}</span
><span class="unit"></span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#67C23A"><Calendar /></el-icon>
</div>
<div class="item-wrap">
<div class="title">活动天数</div>
<div>
<span class="num">{{ activity.activityDays || 0 }}</span
><span class="unit"></span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#E6A23C"><Timer /></el-icon>
</div>
<div class="item-wrap">
<div class="title">总时长</div>
<div>
<span class="num">{{ activity.totalHours || 0 }}</span
><span class="unit">小时</span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#F56C6C"><Money /></el-icon>
</div>
<div class="item-wrap">
<div class="title">活动费用</div>
<div>
<span class="num">{{ activity.totalCost || 0 }}</span
><span class="unit"></span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#67C23A"><DataLine /></el-icon>
</div>
<div class="item-wrap">
<div class="title">平均时长</div>
<div>
<span class="num">{{ activity.avgHours || 0 }}</span
><span class="unit">小时/</span>
</div>
</div>
</div>
</div>
<div class="summary-con" style="height: 115px">
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#E6A23C"><Coin /></el-icon>
</div>
<div class="item-wrap">
<div class="title">平均费用</div>
<div>
<span class="num">{{ activity.avgCost || 0 }}</span
><span class="unit">/</span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#F56C6C"><Medal /></el-icon>
</div>
<div class="item-wrap highlight-item">
<div class="title">最高费用活动</div>
<div class="summary-detail">
<span class="num text-name">{{ activity.maxCostName || '--' }}</span>
<span class="unit">{{ activity.maxCost || 0 }}</span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#409EFF"><Stopwatch /></el-icon>
</div>
<div class="item-wrap highlight-item">
<div class="title">最长活动</div>
<div class="summary-detail">
<span class="num text-name">{{ activity.longestName || '--' }}</span>
<span class="unit">{{ activity.longestHours || 0 }}小时</span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#67C23A"><Location /></el-icon>
</div>
<div class="item-wrap highlight-item">
<div class="title">常去地点</div>
<div class="summary-detail">
<span class="num text-name">{{ topPlace.name }}</span>
<span class="unit">{{ topPlace.count }}</span>
</div>
</div>
</div>
<div class="right-con">
<div class="icon-box">
<el-icon :size="40" color="#409EFF"><User /></el-icon>
</div>
<div class="item-wrap highlight-item">
<div class="title">常参与成员</div>
<div class="summary-detail">
<span class="num text-name">{{ topPartner.name }}</span>
<span class="unit">{{ topPartner.count }}</span>
</div>
</div>
</div>
</div>
<div class="title-con" style="margin-top: 18px">
<div class="title">活动统计</div>
<div class="operate-btn-con">
<el-radio-group v-model="radioVal" @change="handleRadioChange">
<el-radio-button label="活动明细" />
<el-radio-button label="次数趋势" />
<el-radio-button label="费用趋势" />
<el-radio-button label="时长趋势" />
<el-radio-button label="类型分布" />
<el-radio-button label="地点排行" />
<el-radio-button label="成员排行" />
</el-radio-group>
</div>
</div>
<div class="content-con">
<div v-show="radioVal === '次数趋势'" class="chart" id="activityCountChart" style="height: calc(100% - 245px); margin-top: -10px"></div>
<div v-show="radioVal === '费用趋势'" class="chart" id="activityCostChart" style="height: calc(100% - 245px); margin-top: -10px"></div>
<div v-show="radioVal === '时长趋势'" class="chart" id="activityDurationChart" style="height: calc(100% - 245px); margin-top: -10px"></div>
<div v-show="radioVal === '类型分布'" class="chart-grid" style="height: calc(100% - 245px)">
<div class="chart" id="activityTypeChart"></div>
<div class="chart" id="activityVolumeChart"></div>
</div>
<el-table v-show="radioVal === '地点排行'" v-loading="loading" :data="activity.placeList || []" height="calc(100% - 245px)" class="wrap-table">
<el-table-column label="序号" width="70" type="index" align="center" />
<el-table-column label="活动地点" align="center" prop="name" min-width="220" class-name="wrap-cell" />
<el-table-column label="活动次数" align="center" prop="count" />
<el-table-column label="累计时长(小时)" align="center" prop="hours" />
<el-table-column label="累计费用(元)" align="center" prop="cost" />
</el-table>
<el-table v-show="radioVal === '成员排行'" v-loading="loading" :data="activity.partnerList || []" height="calc(100% - 245px)" class="wrap-table">
<el-table-column label="序号" width="70" type="index" align="center" />
<el-table-column label="成员" align="center" prop="name" min-width="220" class-name="wrap-cell" />
<el-table-column label="参与次数" align="center" prop="count" />
<el-table-column label="累计时长(小时)" align="center" prop="hours" />
<el-table-column label="关联费用(元)" align="center" prop="cost" />
</el-table>
<el-table v-show="radioVal === '活动明细'" v-loading="loading" :data="activity.tableList || []" height="calc(100% - 245px)" class="wrap-table">
<el-table-column label="序号" width="60" type="index" align="center" />
<el-table-column label="活动名称" align="center" prop="name" min-width="180" class-name="wrap-cell" />
<el-table-column label="活动类型" align="center" prop="typeName" width="120" />
<el-table-column label="活动量" align="center" prop="activityVolumeName" width="110" />
<el-table-column label="活动地点" align="center" prop="place" min-width="160" class-name="wrap-cell" />
<el-table-column label="成员" align="center" prop="partner" min-width="180" class-name="wrap-cell" />
<el-table-column label="开始时间" align="center" prop="startTime" width="170" />
<el-table-column label="结束时间" align="center" prop="endTime" width="170" />
<el-table-column label="活动时长" align="center" prop="duration" width="130" />
<el-table-column label="费用(元)" align="center" prop="totalCost" width="110" />
<el-table-column label="饮食" align="center" prop="foods" min-width="220" class-name="wrap-cell" />
<el-table-column label="收获" align="center" prop="harvest" min-width="220" class-name="wrap-cell" />
<el-table-column label="备注" align="center" prop="remark" min-width="220" class-name="wrap-cell" />
</el-table>
</div>
</div>
</div>
</template>
<script setup name="ActivityStatistic">
import dayjs from 'dayjs'
import * as echarts from 'echarts'
import { ElMessage } from 'element-plus'
import { Calendar, Coin, DataLine, Histogram, Location, Medal, Money, Stopwatch, Timer, User } from '@element-plus/icons-vue'
import yearPicker from '@/components/YearPicker/index.vue'
import { getActivityAnalysis } from '@/api/health/statisticAnalysis'
const { proxy } = getCurrentInstance()
const { activity_type, activity_exercise } = proxy.useDict('activity_type', 'activity_exercise')
const loading = ref(false)
const radioVal = ref('活动明细')
const currentType = ref('活动明细')
const firstChooseDate = ref('')
const dateValue = ref({ startYear: 2000, endYear: new Date().getFullYear() })
const showYearValue = ref({ startShowYear: '', endShowYear: '' })
const activity = ref({})
const chartData = ref({
name: [],
count: [],
cost: [],
duration: []
})
const dateValidate = (rules, value, callback) => {
const dateType = rules.dateType || 'months'
const num = rules.num || 23
const message = rules.message || `时间跨度不能超过${num}个月`
if (value && value.length === 2) {
const start = value[0]
const end = value[1]
if (dayjs(end).diff(dayjs(start), dateType) > num) {
queryParams.value.time = [start, dayjs(start).add(num, dateType)]
ElMessage.warning(message)
}
}
}
const data = reactive({
queryParams: {
type: 1,
time: null,
name: null,
activityType: null,
activityVolume: null,
place: null
},
rules: {
time: [{ validator: dateValidate, dateType: 'months', num: 23, message: '时间跨度不能大于24个月默认选择开始日期的24个月' }]
}
})
const { queryParams, rules } = toRefs(data)
const topPlace = computed(() => {
const item = (activity.value.placeList || [])[0] || {}
return { name: item.name || '--', count: item.count || 0 }
})
const topPartner = computed(() => {
const item = (activity.value.partnerList || [])[0] || {}
return { name: item.name || '--', count: item.count || 0 }
})
const updateStatisticYear = (startYear, endYear) => {
queryParams.value.time = [new Date(startYear, 0, 1), new Date(endYear, 0, 1)]
if (endYear - startYear > 5) {
ElMessage.warning('时间跨度不能大于5年默认选择开始日期的5年')
queryParams.value.time = [new Date(startYear, 0, 1), new Date(startYear + 5, 0, 1)]
}
}
const disabledDateFun = (time) => {
const arr = [0, 30, 365, 365 * 5]
const days = arr[queryParams.value.type]
if (firstChooseDate.value) {
const one = days * 24 * 3600 * 1000
const minTime = firstChooseDate.value - one
const maxTime = firstChooseDate.value + one
const endTime = maxTime > Date.now() ? Date.now() : maxTime
return time.getTime() > endTime || time.getTime() < minTime
}
return time.getTime() > Date.now()
}
const calendarChange = (val) => {
firstChooseDate.value = val[0].getTime()
if (val[1]) firstChooseDate.value = ''
}
function handleTimeChange(type) {
queryParams.value.time = null
if (type === 1) {
const end = dayjs().format('YYYY-MM-DD')
queryParams.value.time = [dayjs(end).add(-60, 'day'), end]
} else if (type === 2) {
const end = dayjs().format('YYYY-MM')
queryParams.value.time = [dayjs(end).add(-11, 'months'), end]
} else if (type === 3) {
const endYear = new Date().getFullYear()
queryParams.value.time = [new Date(endYear - 2, 0, 1), new Date(endYear, 0, 1)]
showYearValue.value = { startShowYear: endYear - 2, endShowYear: endYear }
}
getList()
}
function getList() {
loading.value = true
chartData.value = { name: [], count: [], cost: [], duration: [] }
const { type, time, name, activityType, activityVolume, place } = queryParams.value
let formatValue = 'YYYY-MM-DD'
if (type === 2) formatValue = 'YYYY-MM'
if (type === 3) formatValue = 'YYYY'
const params = {
type,
startTime: time && time.length > 0 ? dayjs(time[0]).format(formatValue) : '',
endTime: time && time.length > 0 ? dayjs(time[1]).format(formatValue) : '',
name,
activityType,
activityVolume,
place
}
getActivityAnalysis(params)
.then((response) => {
activity.value = response.data || {}
const countMap = new Map((activity.value.countTrend || []).map((item) => [item.time, Number(item.value || 0)]))
const costMap = new Map((activity.value.costTrend || []).map((item) => [item.time, Number(item.value || 0)]))
const durationMap = new Map((activity.value.durationTrend || []).map((item) => [item.time, Number(item.value || 0)]))
const names = [
...new Set(
[...(activity.value.countTrend || []), ...(activity.value.costTrend || []), ...(activity.value.durationTrend || [])].map((item) => item.time)
)
].sort()
chartData.value = {
name: names,
count: names.map((time) => countMap.get(time) || 0),
cost: names.map((time) => costMap.get(time) || 0),
duration: names.map((time) => durationMap.get(time) || 0)
}
handleRadioChange(currentType.value)
})
.finally(() => {
loading.value = false
})
}
function handleQuery() {
getList()
}
function resetQuery() {
proxy.resetForm('queryRef')
queryParams.value.name = null
queryParams.value.activityType = null
queryParams.value.activityVolume = null
queryParams.value.place = null
handleTimeChange(1)
}
function chartBaseOption(data, seriesName, unit, color) {
return {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
formatter: (params) => `${params[0].name}<br/>${seriesName}${params[0].value}${unit}`
},
grid: { left: '5%', right: '5%', bottom: '5%', containLabel: true },
xAxis: {
type: 'category',
data: data.name,
axisTick: { alignWithLabel: true },
axisLine: { lineStyle: { width: 1, color: '#999' } }
},
yAxis: {
type: 'value',
axisTick: { show: true },
axisLine: { show: true, lineStyle: { width: 1, color: '#999' } }
},
series: [
{
name: seriesName,
data: data.value,
type: data.type,
barWidth: 12,
smooth: true,
lineStyle: { color },
itemStyle: { color },
areaStyle:
data.type === 'line'
? {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: `${color}99` },
{ offset: 1, color: `${color}16` }
])
}
: undefined
}
]
}
}
function renderTrendChart(id, value, name, unit, color, type = 'bar') {
if (document.getElementById(id) === null) return
echarts.dispose(document.getElementById(id))
const myChart = echarts.init(document.getElementById(id))
myChart.setOption(chartBaseOption({ name: chartData.value.name, value, type }, name, unit, color))
setTimeout(() => myChart.resize(), 100)
}
function renderPieChart(id, data, title) {
if (document.getElementById(id) === null) return
echarts.dispose(document.getElementById(id))
const myChart = echarts.init(document.getElementById(id))
myChart.setOption({
title: { text: title, left: 'center', top: 16 },
tooltip: { trigger: 'item' },
legend: { bottom: 10 },
series: [
{
type: 'pie',
radius: ['42%', '70%'],
center: ['50%', '48%'],
data,
label: { formatter: '{b}\n{c}次' }
}
]
})
setTimeout(() => myChart.resize(), 100)
}
function handleRadioChange(type) {
currentType.value = type
nextTick(() => {
switch (type) {
case '次数趋势':
renderTrendChart('activityCountChart', chartData.value.count, '活动次数', '次', '#409EFF', 'bar')
break
case '费用趋势':
renderTrendChart('activityCostChart', chartData.value.cost, '活动费用', '元', '#E6A23C', 'line')
break
case '时长趋势':
renderTrendChart('activityDurationChart', chartData.value.duration, '活动时长', '小时', '#67C23A', 'line')
break
case '类型分布':
renderPieChart('activityTypeChart', activity.value.typeList || [], '活动类型分布')
renderPieChart('activityVolumeChart', activity.value.volumeList || [], '活动量分布')
break
default:
break
}
})
}
handleTimeChange(1)
</script>
<style lang="scss" scoped>
.activity-stat-main {
.summary-con {
.right-con,
.icon-box,
.item-wrap,
.num,
.title {
list-style: none !important;
&::before,
&::after {
display: none !important;
content: none !important;
}
}
}
}
.text-name {
display: block;
max-width: 100%;
overflow: visible;
font-size: 22px !important;
line-height: 1.2;
text-overflow: initial;
white-space: normal;
word-break: break-all;
}
.highlight-item {
min-width: 0;
}
.summary-detail {
display: flex;
min-width: 0;
flex-direction: column;
align-items: flex-start;
gap: 4px;
.unit {
display: block;
margin-left: 0;
line-height: 1.2;
}
}
.wrap-table {
:deep(.el-table__cell) {
vertical-align: top;
}
:deep(.wrap-cell .cell) {
overflow: visible;
line-height: 20px;
text-overflow: initial;
white-space: normal;
word-break: break-all;
}
}
.chart-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 16px;
}
.chart-grid .chart {
min-height: 320px;
}
</style>

View File

@@ -138,21 +138,275 @@
</div>
</template>
</el-dialog>
<el-drawer v-model="detailOpen" size="760px" append-to-body>
<template #header>
<div class="detail-title">慢性疾病详情</div>
</template>
<div v-loading="detailLoading" class="disease-detail">
<el-descriptions :column="2" border>
<el-descriptions-item label="成员">{{ detailRecord.personName || '--' }}</el-descriptions-item>
<el-descriptions-item label="疾病名称">{{ detailRecord.diseaseName || '--' }}</el-descriptions-item>
<el-descriptions-item label="疾病编码">{{ detailRecord.diseaseCode || '--' }}</el-descriptions-item>
<el-descriptions-item label="确诊日期">{{ parseTime(detailRecord.diagnosisDate, '{y}-{m}-{d}') || '--' }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag :type="getStatusType(detailRecord.diseaseStatus)">
{{ getStatusLabel(detailRecord.diseaseStatus) }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="启用状态">{{ detailRecord.isActive === 1 ? '已启用' : '已停用' }}</el-descriptions-item>
<el-descriptions-item label="主治医生">{{ detailRecord.mainDoctor || '--' }}</el-descriptions-item>
<el-descriptions-item label="就诊医院">{{ detailRecord.hospital || '--' }}</el-descriptions-item>
<el-descriptions-item label="科室">{{ detailRecord.department || '--' }}</el-descriptions-item>
<el-descriptions-item label="诊断结果">{{ detailRecord.notes || '--' }}</el-descriptions-item>
<el-descriptions-item label="备注" :span="2">{{ detailRecord.remark || '--' }}</el-descriptions-item>
</el-descriptions>
<div class="detail-section">
<div class="detail-section-title">
<span>关联用药计划</span>
<el-button type="primary" icon="Plus" size="small" @click="handleCreateMedicationPlan(detailRecord)" v-hasPermi="['health:medicationPlan:add']"
>创建用药计划</el-button
>
</div>
<el-table :data="detailPlanList" empty-text="暂无关联用药计划" border>
<el-table-column label="计划名称" prop="planName" min-width="140" show-overflow-tooltip />
<el-table-column label="药品" prop="medicineName" min-width="160" show-overflow-tooltip />
<el-table-column label="剂量" width="110">
<template #default="scope">{{ scope.row.dosagePerTime || '--' }} {{ scope.row.dosageUnit || '' }}</template>
</el-table-column>
<el-table-column label="开始日期" width="110">
<template #default="scope">{{ formatDate(scope.row.startDate) || '--' }}</template>
</el-table-column>
<el-table-column label="结束日期" width="110">
<template #default="scope">{{ scope.row.endDate ? formatDate(scope.row.endDate) : '长期' }}</template>
</el-table-column>
<el-table-column label="状态" width="90">
<template #default="scope">
<dict-tag :options="medication_plan_status" :value="scope.row.status" />
</template>
</el-table-column>
</el-table>
</div>
<div class="detail-section">
<div class="detail-section-title">
<span>指标监测</span>
<el-button type="primary" icon="Plus" size="small" @click="handleAddIndicator" v-hasPermi="['health:chronicDisease:add']">新增指标</el-button>
</div>
<div v-if="latestIndicatorList.length" class="indicator-summary">
<div v-for="item in latestIndicatorList" :key="item.id" class="indicator-summary-item">
<div class="indicator-name">{{ item.indicatorName || '--' }}</div>
<div class="indicator-value">
{{ item.indicatorValue ?? '--' }}
<span>{{ item.indicatorUnit || '' }}</span>
</div>
<el-tag size="small" :type="getIndicatorStatusType(item.status)">{{ getIndicatorStatusLabel(item.status) }}</el-tag>
</div>
</div>
<el-table :data="detailIndicatorList" empty-text="暂无指标监测记录" border>
<el-table-column label="指标" prop="indicatorName" min-width="110" show-overflow-tooltip />
<el-table-column label="数值" width="110">
<template #default="scope">{{ scope.row.indicatorValue ?? '--' }} {{ scope.row.indicatorUnit || '' }}</template>
</el-table-column>
<el-table-column label="目标范围" width="130">
<template #default="scope"> {{ scope.row.targetMin ?? '--' }} - {{ scope.row.targetMax ?? '--' }} </template>
</el-table-column>
<el-table-column label="状态" width="90">
<template #default="scope">
<el-tag :type="getIndicatorStatusType(scope.row.status)">{{ getIndicatorStatusLabel(scope.row.status) }}</el-tag>
</template>
</el-table-column>
<el-table-column label="测量时间" width="160">
<template #default="scope">{{ parseTime(scope.row.measureTime, '{y}-{m}-{d} {h}:{i}') || '--' }}</template>
</el-table-column>
<el-table-column label="说明" prop="notes" min-width="120" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="scope">
<el-button link type="primary" @click="handleUpdateIndicator(scope.row)" v-hasPermi="['health:chronicDisease:edit']">编辑</el-button>
<el-button link type="danger" @click="handleDeleteIndicator(scope.row)" v-hasPermi="['health:chronicDisease:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="detail-section">
<div class="detail-section-title">
<span>复诊随访</span>
<el-button type="primary" icon="Plus" size="small" @click="handleAddFollowUp" v-hasPermi="['health:chronicDisease:add']">新增随访</el-button>
</div>
<el-table :data="detailFollowUpList" empty-text="暂无复诊随访记录" border>
<el-table-column label="类型" width="80">
<template #default="scope">{{ getFollowUpTypeLabel(scope.row.followUpType) }}</template>
</el-table-column>
<el-table-column label="日期" width="110">
<template #default="scope">{{ formatDate(scope.row.followUpDate) || '--' }}</template>
</el-table-column>
<el-table-column label="医院/科室" min-width="150" show-overflow-tooltip>
<template #default="scope">{{ scope.row.hospital || '--' }} / {{ scope.row.department || '--' }}</template>
</el-table-column>
<el-table-column label="医生" prop="doctor" width="90" show-overflow-tooltip />
<el-table-column label="状态" width="90">
<template #default="scope">
<el-tag :type="getFollowUpStatusType(scope.row.status)">{{ getFollowUpStatusLabel(scope.row.status) }}</el-tag>
</template>
</el-table-column>
<el-table-column label="下次日期" width="110">
<template #default="scope">{{ formatDate(scope.row.nextFollowUpDate) || '--' }}</template>
</el-table-column>
<el-table-column label="结果" prop="result" min-width="120" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="scope">
<el-button link type="primary" @click="handleUpdateFollowUp(scope.row)" v-hasPermi="['health:chronicDisease:edit']">编辑</el-button>
<el-button link type="danger" @click="handleDeleteFollowUp(scope.row)" v-hasPermi="['health:chronicDisease:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="detail-section">
<div class="detail-section-title">
<span>状态历史</span>
</div>
<el-timeline v-if="detailStatusHistoryList.length">
<el-timeline-item v-for="item in detailStatusHistoryList" :key="item.id" :timestamp="parseTime(item.changeTime, '{y}-{m}-{d} {h}:{i}')">
<div class="status-history-row">
<el-tag :type="getStatusType(item.oldStatus)">{{ getStatusLabel(item.oldStatus) }}</el-tag>
<span>调整为</span>
<el-tag :type="getStatusType(item.newStatus)">{{ getStatusLabel(item.newStatus) }}</el-tag>
</div>
<div class="status-history-text">{{ item.reason || '档案状态调整' }}</div>
<div v-if="item.treatmentAdvice" class="status-history-text">建议{{ item.treatmentAdvice }}</div>
</el-timeline-item>
</el-timeline>
<el-empty v-else description="暂无状态变更历史" />
</div>
</div>
</el-drawer>
<el-dialog :title="indicatorTitle" v-model="indicatorOpen" width="560px" append-to-body>
<el-form ref="indicatorRef" :model="indicatorForm" :rules="indicatorRules" label-width="100px">
<el-form-item label="指标类型" prop="indicatorType">
<el-select v-model="indicatorForm.indicatorType" placeholder="请选择指标类型" filterable @change="handleIndicatorTypeChange">
<el-option v-for="item in indicatorOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="指标名称" prop="indicatorName">
<el-input v-model="indicatorForm.indicatorName" placeholder="请输入指标名称" />
</el-form-item>
<el-form-item label="测量时间" prop="measureTime">
<el-date-picker
v-model="indicatorForm.measureTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择测量时间"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="指标值" prop="indicatorValue">
<el-input-number v-model="indicatorForm.indicatorValue" :precision="2" :step="1" controls-position="right" style="width: 180px" />
<el-input v-model="indicatorForm.indicatorUnit" placeholder="单位" style="width: 120px; margin-left: 12px" />
</el-form-item>
<el-form-item label="目标范围">
<el-input-number v-model="indicatorForm.targetMin" :precision="2" controls-position="right" placeholder="下限" style="width: 160px" />
<span class="range-separator"></span>
<el-input-number v-model="indicatorForm.targetMax" :precision="2" controls-position="right" placeholder="上限" style="width: 160px" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="indicatorForm.status" placeholder="请选择状态">
<el-option v-for="item in indicatorStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="说明" prop="notes">
<el-input v-model="indicatorForm.notes" type="textarea" :rows="3" placeholder="请输入说明" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitIndicatorForm"> </el-button>
<el-button @click="indicatorOpen = false"> </el-button>
</div>
</template>
</el-dialog>
<el-dialog :title="followUpTitle" v-model="followUpOpen" width="640px" append-to-body>
<el-form ref="followUpRef" :model="followUpForm" :rules="followUpRules" label-width="110px">
<el-form-item label="类型" prop="followUpType">
<el-select v-model="followUpForm.followUpType" placeholder="请选择类型">
<el-option v-for="item in followUpTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="日期" prop="followUpDate">
<el-date-picker v-model="followUpForm.followUpDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择日期" style="width: 100%" />
</el-form-item>
<el-form-item label="医院" prop="hospital">
<el-input v-model="followUpForm.hospital" placeholder="请输入医院" />
</el-form-item>
<el-form-item label="科室/医生">
<el-input v-model="followUpForm.department" placeholder="科室" style="width: 220px" />
<el-input v-model="followUpForm.doctor" placeholder="医生" style="width: 220px; margin-left: 12px" />
</el-form-item>
<el-form-item label="复查项目" prop="checkItems">
<el-input v-model="followUpForm.checkItems" type="textarea" :rows="2" placeholder="请输入复查项目" />
</el-form-item>
<el-form-item label="结果" prop="result">
<el-input v-model="followUpForm.result" type="textarea" :rows="3" placeholder="请输入结果" />
</el-form-item>
<el-form-item label="下次日期" prop="nextFollowUpDate">
<el-date-picker v-model="followUpForm.nextFollowUpDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择下次日期" style="width: 100%" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="followUpForm.status" placeholder="请选择状态">
<el-option v-for="item in followUpStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="说明" prop="notes">
<el-input v-model="followUpForm.notes" type="textarea" :rows="2" placeholder="请输入说明" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitFollowUpForm"> </el-button>
<el-button @click="followUpOpen = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ChronicDisease">
import { listChronicDisease, getChronicDisease, delChronicDisease, addChronicDisease, updateChronicDisease } from '@/api/health/chronicDisease'
import { listHealthDiseases } from '@/api/health/healthDiseases'
import { listMedicationPlan } from '@/api/health/medicationPlan'
import {
listIndicator,
addIndicator,
updateIndicator,
delIndicator,
listFollowUp,
addFollowUp,
updateFollowUp,
delFollowUp,
listStatusHistory
} from '@/api/health/chronicDiseaseManage'
import { listPerson } from '@/api/health/person'
const { proxy } = getCurrentInstance()
const { disease_status, is_active } = proxy.useDict('disease_status', 'is_active')
const router = useRouter()
const { disease_status, is_active, medication_plan_status } = proxy.useDict('disease_status', 'is_active', 'medication_plan_status')
const chronicDiseaseList = ref([])
const memberList = ref([])
const diseaseList = ref([])
const detailOpen = ref(false)
const detailLoading = ref(false)
const detailRecord = ref({})
const detailPlanList = ref([])
const detailIndicatorList = ref([])
const detailFollowUpList = ref([])
const detailStatusHistoryList = ref([])
const open = ref(false)
const indicatorOpen = ref(false)
const followUpOpen = ref(false)
const loading = ref(true)
const showSearch = ref(true)
const ids = ref([])
@@ -160,12 +414,53 @@ const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref('')
const indicatorTitle = ref('')
const followUpTitle = ref('')
const operateList = ref([
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:chronicDisease:query'] },
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:chronicDisease:edit'] },
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:chronicDisease:remove'] }
])
const indicatorOptions = [
{ value: 'blood_pressure_systolic', label: '收缩压', unit: 'mmHg' },
{ value: 'blood_pressure_diastolic', label: '舒张压', unit: 'mmHg' },
{ value: 'heart_rate', label: '心率', unit: '次/分' },
{ value: 'fasting_glucose', label: '空腹血糖', unit: 'mmol/L' },
{ value: 'postprandial_glucose', label: '餐后血糖', unit: 'mmol/L' },
{ value: 'weight', label: '体重', unit: 'kg' },
{ value: 'uric_acid', label: '尿酸', unit: 'umol/L' },
{ value: 'custom', label: '自定义', unit: '' }
]
const indicatorStatusOptions = [
{ value: 1, label: '正常', type: 'success' },
{ value: 2, label: '偏高', type: 'warning' },
{ value: 3, label: '偏低', type: 'info' },
{ value: 4, label: '需关注', type: 'danger' }
]
const followUpTypeOptions = [
{ value: 1, label: '复诊' },
{ value: 2, label: '复查' },
{ value: 3, label: '随访' }
]
const followUpStatusOptions = [
{ value: 1, label: '待完成', type: 'warning' },
{ value: 2, label: '已完成', type: 'success' },
{ value: 3, label: '已过期', type: 'danger' }
]
const indicatorForm = ref({})
const followUpForm = ref({})
const latestIndicatorList = computed(() => {
const latest = new Map()
detailIndicatorList.value.forEach((item) => {
if (!latest.has(item.indicatorType || item.indicatorName)) {
latest.set(item.indicatorType || item.indicatorName, item)
}
})
return Array.from(latest.values()).slice(0, 6)
})
const data = reactive({
form: {},
queryParams: {
@@ -180,10 +475,22 @@ const data = reactive({
personId: [{ required: true, message: '成员不能为空', trigger: 'change' }],
diseaseName: [{ required: true, message: '疾病名称不能为空', trigger: 'blur' }],
diseaseStatus: [{ required: true, message: '状态不能为空', trigger: 'change' }]
},
indicatorRules: {
indicatorType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }],
indicatorName: [{ required: true, message: '指标名称不能为空', trigger: 'blur' }],
measureTime: [{ required: true, message: '测量时间不能为空', trigger: 'change' }],
indicatorValue: [{ required: true, message: '指标值不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
},
followUpRules: {
followUpType: [{ required: true, message: '类型不能为空', trigger: 'change' }],
followUpDate: [{ required: true, message: '日期不能为空', trigger: 'change' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
}
})
const { queryParams, form, rules } = toRefs(data)
const { queryParams, form, rules, indicatorRules, followUpRules } = toRefs(data)
/** 获取状态类型 */
function getStatusType(status) {
@@ -197,6 +504,36 @@ function getStatusLabel(status) {
return labels[status] || '未知'
}
function getOptionLabel(options, value) {
const item = options.find((option) => option.value === Number(value))
return item ? item.label : '未知'
}
function getOptionType(options, value) {
const item = options.find((option) => option.value === Number(value))
return item ? item.type : 'info'
}
function getIndicatorStatusLabel(status) {
return getOptionLabel(indicatorStatusOptions, status)
}
function getIndicatorStatusType(status) {
return getOptionType(indicatorStatusOptions, status)
}
function getFollowUpTypeLabel(type) {
return getOptionLabel(followUpTypeOptions, type)
}
function getFollowUpStatusLabel(status) {
return getOptionLabel(followUpStatusOptions, status)
}
function getFollowUpStatusType(status) {
return getOptionType(followUpStatusOptions, status)
}
/** 操作按钮 */
const handleOperate = (operate, row) => {
switch (operate) {
@@ -304,9 +641,45 @@ function handleSelectionChange(selection) {
// 查看
const handleView = (row) => {
title.value = '查看慢性疾病档案'
form.value = { ...row }
open.value = true
detailOpen.value = true
detailLoading.value = true
detailRecord.value = { ...row }
detailPlanList.value = []
detailIndicatorList.value = []
detailFollowUpList.value = []
detailStatusHistoryList.value = []
Promise.all([
getChronicDisease(row.id),
listMedicationPlan({ pageNum: 1, pageSize: 1000, chronicDiseaseId: row.id }),
listIndicator({ pageNum: 1, pageSize: 1000, chronicDiseaseId: row.id }),
listFollowUp({ pageNum: 1, pageSize: 1000, chronicDiseaseId: row.id }),
listStatusHistory({ pageNum: 1, pageSize: 1000, chronicDiseaseId: row.id })
])
.then(([detailRes, planRes, indicatorRes, followUpRes, historyRes]) => {
detailRecord.value = detailRes.data || row
detailPlanList.value = planRes.rows || []
detailIndicatorList.value = indicatorRes.rows || []
detailFollowUpList.value = followUpRes.rows || []
detailStatusHistoryList.value = historyRes.rows || []
})
.finally(() => {
detailLoading.value = false
})
}
function reloadDiseaseManageData() {
if (!detailRecord.value.id) {
return
}
Promise.all([
listIndicator({ pageNum: 1, pageSize: 1000, chronicDiseaseId: detailRecord.value.id }),
listFollowUp({ pageNum: 1, pageSize: 1000, chronicDiseaseId: detailRecord.value.id }),
listStatusHistory({ pageNum: 1, pageSize: 1000, chronicDiseaseId: detailRecord.value.id })
]).then(([indicatorRes, followUpRes, historyRes]) => {
detailIndicatorList.value = indicatorRes.rows || []
detailFollowUpList.value = followUpRes.rows || []
detailStatusHistoryList.value = historyRes.rows || []
})
}
/** 新增按钮操作 */
@@ -349,6 +722,7 @@ function handleDiseaseChange(diseaseId) {
const disease = diseaseList.value.find((item) => item.id === diseaseId)
if (disease) {
form.value.diseaseName = disease.name
form.value.diseaseCode = disease.code || form.value.diseaseCode
}
}
}
@@ -394,10 +768,243 @@ function handleDelete(row) {
.catch(() => {})
}
function formatDate(date) {
if (!date) return ''
if (Array.isArray(date)) {
return `${date[0]}-${String(date[1]).padStart(2, '0')}-${String(date[2]).padStart(2, '0')}`
}
if (typeof date === 'string') {
return date.substring(0, 10)
}
return ''
}
function padDate(value) {
return String(value).padStart(2, '0')
}
function nowDateTime() {
const date = new Date()
return `${date.getFullYear()}-${padDate(date.getMonth() + 1)}-${padDate(date.getDate())} ${padDate(date.getHours())}:${padDate(date.getMinutes())}:${padDate(
date.getSeconds()
)}`
}
function nowDate() {
return nowDateTime().substring(0, 10)
}
function handleCreateMedicationPlan(row) {
if (!row || !row.id) {
return
}
router.push({
path: '/health/medicationPlan',
query: {
personId: row.personId,
chronicDiseaseId: row.id,
diseaseName: row.diseaseName || ''
}
})
}
function resetIndicatorForm(row = detailRecord.value) {
indicatorForm.value = {
id: null,
chronicDiseaseId: row.id,
personId: row.personId,
indicatorType: 'blood_pressure_systolic',
indicatorName: '收缩压',
measureTime: nowDateTime(),
indicatorValue: null,
indicatorUnit: 'mmHg',
targetMin: null,
targetMax: null,
status: 1,
notes: null
}
proxy.resetForm('indicatorRef')
}
function handleIndicatorTypeChange(value) {
const option = indicatorOptions.find((item) => item.value === value)
if (option && value !== 'custom') {
indicatorForm.value.indicatorName = option.label
indicatorForm.value.indicatorUnit = option.unit
}
}
function handleAddIndicator() {
resetIndicatorForm()
indicatorTitle.value = '新增指标监测'
indicatorOpen.value = true
}
function handleUpdateIndicator(row) {
indicatorForm.value = { ...row }
indicatorTitle.value = '编辑指标监测'
indicatorOpen.value = true
}
function submitIndicatorForm() {
proxy.$refs.indicatorRef.validate((valid) => {
if (!valid) return
const request = indicatorForm.value.id ? updateIndicator : addIndicator
request(indicatorForm.value).then(() => {
proxy.$modal.msgSuccess(indicatorForm.value.id ? '修改成功' : '新增成功')
indicatorOpen.value = false
reloadDiseaseManageData()
})
})
}
function handleDeleteIndicator(row) {
proxy.$modal
.confirm('是否确认删除该指标记录?')
.then(() => {
return delIndicator(row.id)
})
.then(() => {
proxy.$modal.msgSuccess('删除成功')
reloadDiseaseManageData()
})
.catch(() => {})
}
function resetFollowUpForm(row = detailRecord.value) {
followUpForm.value = {
id: null,
chronicDiseaseId: row.id,
personId: row.personId,
followUpType: 1,
followUpDate: nowDate(),
hospital: row.hospital || null,
department: row.department || null,
doctor: row.mainDoctor || null,
checkItems: null,
result: null,
nextFollowUpDate: null,
status: 1,
notes: null
}
proxy.resetForm('followUpRef')
}
function handleAddFollowUp() {
resetFollowUpForm()
followUpTitle.value = '新增复诊随访'
followUpOpen.value = true
}
function handleUpdateFollowUp(row) {
followUpForm.value = { ...row }
followUpTitle.value = '编辑复诊随访'
followUpOpen.value = true
}
function submitFollowUpForm() {
proxy.$refs.followUpRef.validate((valid) => {
if (!valid) return
const request = followUpForm.value.id ? updateFollowUp : addFollowUp
request(followUpForm.value).then(() => {
proxy.$modal.msgSuccess(followUpForm.value.id ? '修改成功' : '新增成功')
followUpOpen.value = false
reloadDiseaseManageData()
})
})
}
function handleDeleteFollowUp(row) {
proxy.$modal
.confirm('是否确认删除该复诊随访记录?')
.then(() => {
return delFollowUp(row.id)
})
.then(() => {
proxy.$modal.msgSuccess('删除成功')
reloadDiseaseManageData()
})
.catch(() => {})
}
// 初始化
getMemberList()
getDiseaseList()
getList()
</script>
<style scoped></style>
<style scoped>
.detail-title {
font-size: 18px;
font-weight: 600;
color: #303133;
}
.disease-detail {
padding: 0 4px 24px;
}
.detail-section {
margin-top: 20px;
}
.detail-section-title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
font-size: 16px;
font-weight: 600;
color: #303133;
}
.indicator-summary {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
margin-bottom: 12px;
}
.indicator-summary-item {
padding: 12px;
border: 1px solid #ebeef5;
border-radius: 6px;
background: #fafafa;
}
.indicator-name {
font-size: 13px;
color: #606266;
}
.indicator-value {
margin: 8px 0;
font-size: 22px;
font-weight: 600;
color: #303133;
}
.indicator-value span {
margin-left: 4px;
font-size: 12px;
font-weight: 400;
color: #909399;
}
.range-separator {
margin: 0 10px;
color: #909399;
}
.status-history-row {
display: flex;
align-items: center;
gap: 8px;
}
.status-history-text {
margin-top: 6px;
color: #606266;
line-height: 1.5;
}
</style>

View File

@@ -41,6 +41,7 @@
<div class="operate-btn-con">
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:healthRecord:add']">新增</el-button>
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:healthRecord:remove']">删除</el-button>
<el-button :disabled="single" icon="Download" @click="handleFullExport()" v-hasPermi="['health:healthRecord:export']">完整导出</el-button>
<!-- <el-button @click="handleExport" icon="Download" v-hasPermi="['health:healthRecord:export']">导出</el-button> -->
</div>
</div>
@@ -323,6 +324,7 @@ const processRecordList = ref([])
const operateList = ref([
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:healthRecord:query'] },
{ id: 'fullExport', icon: 'Download', title: '完整导出', hasPermi: ['health:healthRecord:export'] },
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:healthRecord:edit'] },
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:healthRecord:remove'] }
])
@@ -381,6 +383,9 @@ const handleOperate = (operate, row) => {
case 'edit':
handleUpdate(row)
break
case 'fullExport':
handleFullExport(row)
break
case 'delete':
handleDelete(row)
break
@@ -623,6 +628,22 @@ function handleExport() {
)
}
function handleFullExport(row) {
const recordId = row && row.id ? row.id : ids.value[0]
const recordName = row && row.name ? row.name : '健康档案'
if (!recordId) {
proxy.$modal.msgWarning('请选择要导出的健康档案')
return
}
proxy.download(
'health/analysis/recordFullExport',
{
recordId
},
`${recordName}_完整信息_${new Date().getTime()}.xlsx`
)
}
getList()
getPersonList()
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -104,10 +104,10 @@
<el-tooltip v-if="scope.row.status === 1" class="item" effect="dark" content="暂停" placement="top">
<el-button icon="VideoPause" v-hasPermi="['health:medicationPlan:edit']" circle @click="handlePause(scope.row)"></el-button>
</el-tooltip>
<el-tooltip v-if="scope.row.status === 2 || scope.row.status === 3" class="item" effect="dark" content="恢复" placement="top">
<el-tooltip v-if="scope.row.status === 2" class="item" effect="dark" content="恢复" placement="top">
<el-button icon="VideoPlay" v-hasPermi="['health:medicationPlan:edit']" circle @click="handleResume(scope.row)"></el-button>
</el-tooltip>
<el-tooltip v-if="scope.row.status !== 2" class="item" effect="dark" content="结束" placement="top">
<el-tooltip v-if="scope.row.status !== 3" class="item" effect="dark" content="结束" placement="top">
<el-button icon="Finished" v-hasPermi="['health:medicationPlan:edit']" circle @click="handleEnd(scope.row)"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="修改" placement="top">
@@ -234,6 +234,7 @@ import { listChronicDiseaseByMember } from '@/api/health/chronicDisease'
import { Close } from '@element-plus/icons-vue'
const { proxy } = getCurrentInstance()
const route = useRoute()
const { medication_frequency_type, medication_plan_status, medical_unit } = proxy.useDict('medication_frequency_type', 'medication_plan_status', 'medical_unit')
const planList = ref([])
@@ -257,9 +258,11 @@ const data = reactive({
pageSize: 10,
planName: null,
personId: null,
chronicDiseaseId: null,
frequencyType: null,
status: null,
keys: null
keys: null,
keyword: null
},
rules: {
personId: [{ required: true, message: '请选择人员', trigger: 'change' }],
@@ -274,7 +277,8 @@ const { queryParams, form, rules } = toRefs(data)
/** 查询用药计划列表 */
function getList() {
loading.value = true
listMedicationPlan(queryParams.value).then((response) => {
const params = { ...queryParams.value, keyword: queryParams.value.keys }
listMedicationPlan(params).then((response) => {
planList.value = response.rows
total.value = response.total
loading.value = false
@@ -340,6 +344,7 @@ function handleQuery() {
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef')
queryParams.value.chronicDiseaseId = null
handleQuery()
}
@@ -449,6 +454,26 @@ function handleAdd() {
title.value = '添加用药计划'
}
function handleAddFromChronicDisease() {
const personId = route.query.personId ? Number(route.query.personId) : null
const chronicDiseaseId = route.query.chronicDiseaseId ? Number(route.query.chronicDiseaseId) : null
if (!personId || !chronicDiseaseId) {
return
}
reset()
form.value.personId = personId
form.value.chronicDiseaseId = chronicDiseaseId
form.value.planName = route.query.diseaseName ? `${route.query.diseaseName}用药计划` : null
queryParams.value.personId = personId
queryParams.value.chronicDiseaseId = chronicDiseaseId
listChronicDiseaseByMember(personId).then((res) => {
chronicDiseaseList.value = res.data || []
})
open.value = true
title.value = '添加用药计划'
getList()
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset()
@@ -616,6 +641,7 @@ function handlePersonChange(personId) {
getPersonList()
getMedicineList()
getList()
handleAddFromChronicDisease()
</script>
<style scoped>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,121 @@
<template>
<h1>首页</h1>
<section class="welcome-page">
<div class="welcome-content">
<p class="eyebrow">WELCOME</p>
<h1>欢迎使用智聪综合管理平台</h1>
<p class="subtitle">让数据管理更清晰让日常协作更高效</p>
<div class="welcome-notes">
<span>统一入口</span>
<span>高效管理</span>
<span>稳定运行</span>
</div>
</div>
</section>
</template>
<script setup name="Index"></script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.welcome-page {
position: relative;
min-height: calc(100vh - 84px);
padding: 64px;
overflow: hidden;
background: linear-gradient(90deg, rgba(8, 24, 54, 0.94), rgba(10, 47, 92, 0.82) 46%, rgba(15, 82, 128, 0.54)),
linear-gradient(135deg, rgba(41, 171, 226, 0.28) 0 1px, transparent 1px 42px), linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 58px),
radial-gradient(circle at 82% 18%, rgba(81, 198, 255, 0.42), transparent 28%), radial-gradient(circle at 72% 72%, rgba(76, 220, 178, 0.22), transparent 34%),
#071832;
color: #fff;
}
.welcome-page::before {
content: '';
position: absolute;
right: 8%;
top: 18%;
width: 420px;
height: 420px;
border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 50%;
box-shadow: inset 0 0 0 42px rgba(255, 255, 255, 0.03), inset 0 0 0 108px rgba(255, 255, 255, 0.025), 0 0 48px rgba(44, 180, 255, 0.18);
}
.welcome-page::after {
content: '';
position: absolute;
right: 12%;
bottom: 14%;
width: 34%;
max-width: 520px;
height: 2px;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
transform: rotate(-18deg);
}
.welcome-content {
position: relative;
z-index: 1;
max-width: 720px;
padding-top: 9vh;
}
.eyebrow {
margin: 0 0 18px;
color: rgba(255, 255, 255, 0.72);
font-size: 14px;
font-weight: 700;
letter-spacing: 0.18em;
}
h1 {
margin: 0;
font-size: 44px;
font-weight: 800;
line-height: 1.22;
letter-spacing: 0;
}
.subtitle {
max-width: 520px;
margin: 22px 0 0;
color: rgba(255, 255, 255, 0.78);
font-size: 18px;
line-height: 1.8;
}
.welcome-notes {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 34px;
span {
padding: 10px 18px;
color: rgba(255, 255, 255, 0.88);
background: rgba(255, 255, 255, 0.12);
border: 1px solid rgba(255, 255, 255, 0.22);
border-radius: 6px;
backdrop-filter: blur(8px);
font-size: 14px;
}
}
@media (max-width: 768px) {
.welcome-page {
min-height: calc(100vh - 50px);
padding: 36px 22px;
}
.welcome-content {
padding-top: 7vh;
}
h1 {
font-size: 30px;
}
.subtitle {
font-size: 15px;
}
}
</style>