Fix Bug #544: AI修复
This commit is contained in:
@@ -1,157 +1,122 @@
|
||||
<template>
|
||||
<div class="triage-queue-container">
|
||||
<el-card shadow="never">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>智能分诊队列</span>
|
||||
<!-- 日期范围选择器 -->
|
||||
<span>智能分诊排队管理</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :inline="true" :model="queryParams" class="query-form">
|
||||
<el-form-item label="排队日期">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
value-format="YYYY-MM-DD"
|
||||
@change="handleQuery"
|
||||
style="margin-left: 12px;"
|
||||
/>
|
||||
<!-- 状态下拉框 -->
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
style="margin-left: 12px; width: 150px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryParams.status" placeholder="全部" clearable @change="handleQuery">
|
||||
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-button type="primary" @click="handleQuery" :loading="loading" style="margin-left: 12px;">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
:data="queueList"
|
||||
v-loading="loading"
|
||||
border
|
||||
style="width: 100%"
|
||||
empty-text="暂无分诊队列"
|
||||
>
|
||||
<el-table-column prop="queueNo" label="排队号" width="120" />
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="deptName" label="科室" />
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="queueList" v-loading="loading" border style="margin-top: 16px;">
|
||||
<el-table-column prop="patientName" label="患者姓名" />
|
||||
<el-table-column prop="queueNo" label="排队号" />
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusType(row.status)">{{ getStatusLabel(row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="triageTime" label="分诊时间" width="180" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handleDetail(row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="排队时间" />
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="handleQuery"
|
||||
@current-change="handleQuery"
|
||||
@size-change="handleQuery"
|
||||
style="margin-top: 16px; justify-content: flex-end;"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
// import { getTriageQueueList } from '@/api/triage' // 实际项目中替换为真实API
|
||||
import { getQueueList } from '@/api/triage/queue'
|
||||
|
||||
const loading = ref(false)
|
||||
const queueList = ref([])
|
||||
const queueList = ref<any[]>([])
|
||||
const total = ref(0)
|
||||
|
||||
const today = new Date().toISOString().split('T')[0]
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dateRange: [],
|
||||
pageSize: 20,
|
||||
dateRange: [today, today],
|
||||
status: ''
|
||||
})
|
||||
|
||||
const statusOptions = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '候诊', value: 'WAITING' },
|
||||
{ label: '就诊中', value: 'IN_PROGRESS' },
|
||||
{ label: '完诊', value: 'COMPLETED' },
|
||||
{ label: '已取消', value: 'CANCELLED' }
|
||||
{ label: '过号', value: 'MISSED' }
|
||||
]
|
||||
|
||||
const getStatusLabel = (status) => {
|
||||
const map = {
|
||||
'WAITING': '候诊',
|
||||
'IN_PROGRESS': '就诊中',
|
||||
'COMPLETED': '完诊',
|
||||
'CANCELLED': '已取消'
|
||||
}
|
||||
const getStatusLabel = (status: string) => {
|
||||
const map: Record<string, string> = { WAITING: '候诊', IN_PROGRESS: '就诊中', COMPLETED: '完诊', MISSED: '过号' }
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
const getStatusType = (status) => {
|
||||
const map = {
|
||||
'WAITING': 'warning',
|
||||
'IN_PROGRESS': 'primary',
|
||||
'COMPLETED': 'success',
|
||||
'CANCELLED': 'info'
|
||||
}
|
||||
const getStatusType = (status: string) => {
|
||||
const map: Record<string, string> = { WAITING: 'info', IN_PROGRESS: 'warning', COMPLETED: 'success', MISSED: 'danger' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
const handleQuery = async () => {
|
||||
loading.value = true
|
||||
queryParams.pageNum = 1
|
||||
// 实际调用后端接口时,确保 status 参数透传,不默认过滤 COMPLETED
|
||||
// getTriageQueueList(queryParams).then(res => { ... })
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const params = {
|
||||
pageNum: queryParams.pageNum,
|
||||
pageSize: queryParams.pageSize,
|
||||
startDate: queryParams.dateRange?.[0] || today,
|
||||
endDate: queryParams.dateRange?.[1] || today,
|
||||
status: queryParams.status || undefined
|
||||
}
|
||||
const res = await getQueueList(params)
|
||||
queueList.value = res.data.rows
|
||||
total.value = res.data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
|
||||
const handleDetail = (row) => {
|
||||
console.log('查看队列详情:', row.queueNo)
|
||||
}
|
||||
|
||||
const initDefaultDate = () => {
|
||||
const now = new Date()
|
||||
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate())
|
||||
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59)
|
||||
queryParams.dateRange = [start, end]
|
||||
const resetQuery = () => {
|
||||
queryParams.dateRange = [today, today]
|
||||
queryParams.status = ''
|
||||
queryParams.pageNum = 1
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initDefaultDate()
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
defineExpose({ queryParams, statusOptions, getStatusLabel, getStatusType, handleQuery, resetQuery })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.triage-queue-container {
|
||||
padding: 16px;
|
||||
background-color: #f5f7fa;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.triage-queue-container { padding: 16px; }
|
||||
.query-form { margin-bottom: 16px; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user