Fix Bug #544: AI修复
This commit is contained in:
@@ -1,35 +1,46 @@
|
||||
<template>
|
||||
<div class="triage-queue-container">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="title">智能分诊排队管理 - {{ deptName }}</span>
|
||||
<div class="query-controls">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:default-value="[today, today]"
|
||||
class="date-range-picker"
|
||||
/>
|
||||
<el-button type="primary" @click="handleQuery">查询历史队列</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table :data="queueList" border style="width: 100%" v-loading="loading">
|
||||
<el-table-column prop="queueNo" label="排队号" width="100" />
|
||||
<el-table-column prop="patientName" label="患者姓名" />
|
||||
<el-table-column prop="status" label="状态" width="120">
|
||||
<!-- 查询条件 -->
|
||||
<el-card class="search-card" shadow="never">
|
||||
<el-form :inline="true" :model="queryParams" class="search-form">
|
||||
<el-form-item label="排队状态">
|
||||
<el-select v-model="queryParams.status" placeholder="全部" clearable style="width: 120px">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="候诊" value="候诊" />
|
||||
<el-option label="就诊中" value="就诊中" />
|
||||
<el-option label="完诊" value="完诊" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期范围">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="date-range-picker"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">查询历史队列</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 队列列表 -->
|
||||
<el-card class="table-card" shadow="never" style="margin-top: 16px;">
|
||||
<el-table :data="tableData" border stripe v-loading="loading" style="width: 100%">
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="deptName" label="科室" width="120" />
|
||||
<el-table-column prop="doctorName" label="接诊医生" width="120" />
|
||||
<el-table-column prop="queueStatus" label="排队状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusType(row.status)">{{ row.status }}</el-tag>
|
||||
<el-tag :type="getStatusType(row.queueStatus)">{{ row.queueStatus }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="分诊时间" width="180" />
|
||||
<el-table-column prop="triageTime" label="分诊时间" width="180" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -37,43 +48,57 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { getQueueList } from '@/api/triage'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
|
||||
const deptName = ref('呼吸内科')
|
||||
const deptId = ref(101) // 实际应从路由或上下文获取
|
||||
const dateRange = ref([])
|
||||
const today = new Date().toISOString().split('T')[0]
|
||||
const queueList = ref([])
|
||||
const queryParams = ref({
|
||||
status: '',
|
||||
dateRange: []
|
||||
})
|
||||
const tableData = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
const getStatusType = (status) => {
|
||||
const map = { '待诊': 'info', '就诊中': 'warning', '完诊': 'success' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
const fetchQueue = async () => {
|
||||
const fetchQueueList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const [start, end] = dateRange.value || [today, today]
|
||||
const res = await getQueueList({ deptId: deptId.value, startDate: start, endDate: end })
|
||||
queueList.value = res.data || []
|
||||
const [startDate, endDate] = queryParams.value.dateRange || []
|
||||
const res = await request.get('/api/triage/queue', {
|
||||
params: {
|
||||
status: queryParams.value.status || undefined,
|
||||
startDate: startDate,
|
||||
endDate: endDate
|
||||
}
|
||||
})
|
||||
tableData.value = res.data || []
|
||||
} catch (e) {
|
||||
ElMessage.error('获取队列数据失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
fetchQueue()
|
||||
const handleSearch = () => {
|
||||
if (!queryParams.value.dateRange || queryParams.value.dateRange.length !== 2) {
|
||||
ElMessage.warning('请选择日期范围')
|
||||
return
|
||||
}
|
||||
fetchQueueList()
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
queryParams.value = { status: '', dateRange: [] }
|
||||
fetchQueueList()
|
||||
}
|
||||
|
||||
const getStatusType = (status) => {
|
||||
const map = { '候诊': 'info', '就诊中': 'warning', '完诊': 'success' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
dateRange.value = [today, today]
|
||||
fetchQueue()
|
||||
// 默认加载当天数据
|
||||
const today = new Date().toISOString().split('T')[0]
|
||||
queryParams.value.dateRange = [today, today]
|
||||
fetchQueueList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.card-header { display: flex; justify-content: space-between; align-items: center; }
|
||||
.title { font-size: 16px; font-weight: 600; }
|
||||
.query-controls { display: flex; gap: 12px; align-items: center; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user