Fix Bug #544: AI修复

This commit is contained in:
2026-05-27 07:35:05 +08:00
parent a76cfb9b99
commit 60b044912b
4 changed files with 163 additions and 116 deletions

View File

@@ -1,59 +1,92 @@
<template>
<div class="queue-list">
<el-tabs v-model="activeTab">
<el-tab-pane label="当前排队" name="current">
<el-table :data="currentQueue" style="width: 100%" data-cy="current-queue-table">
<el-table-column prop="patientName" label="患者" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="queueNo" label="排号" />
</el-table>
</el-tab-pane>
<el-tab-pane label="历史排队" name="history">
<el-table :data="historyQueue" style="width: 100%" data-cy="history-queue-table">
<el-table-column prop="patientName" label="患者" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="queueNo" label="排号" />
</el-table>
<el-pagination
@current-change="loadHistory"
:current-page="historyPage"
:page-size="pageSize"
layout="prev, pager, next"
:total="historyTotal"
data-cy="history-pagination"/>
</el-tab-pane>
</el-tabs>
<div class="triage-queue-container">
<el-card shadow="never">
<template #header>
<div class="card-header">
<span class="title">智能分诊排队管理 - {{ deptName }}</span>
<div class="actions">
<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]"
@change="handleQuery"
/>
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
</div>
</template>
<el-table :data="queueList" border stripe v-loading="loading">
<el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="status" label="排队状态" width="100">
<template #default="{ row }">
<el-tag :type="getStatusType(row.status)">{{ row.status }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="queueTime" label="入队时间" width="180" />
<el-table-column label="操作" width="100">
<template #default="{ row }">
<el-button link type="primary" @click="viewDetail(row)">详情</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { getCurrentQueue, getHistoryQueue } from '@/api/triage';
<script setup>
import { ref, onMounted } from 'vue'
import { getQueueList } from '@/api/triage'
const activeTab = ref('current');
const pageSize = 20;
const deptName = ref('呼吸内科')
const queueList = ref([])
const loading = ref(false)
const dateRange = ref([])
const today = new Date().toISOString().split('T')[0]
const currentQueue = ref([]);
const historyQueue = ref([]);
const historyPage = ref(1);
const historyTotal = ref(0);
const fetchQueue = async () => {
loading.value = true
try {
const [start, end] = dateRange.value || [today, today]
// 修复:不再在前端过滤完诊状态,完整透传查询参数
const res = await getQueueList({
deptId: 1,
status: null, // 传 null 查询全量状态(含完诊)
startDate: start,
endDate: end
})
queueList.value = res.data || []
} finally {
loading.value = false
}
}
const loadCurrent = async () => {
const res = await getCurrentQueue({ pageNum: 1, pageSize });
currentQueue.value = res.data;
};
const handleQuery = () => fetchQueue()
const loadHistory = async (page = 1) => {
const res = await getHistoryQueue({ pageNum: page, pageSize });
historyQueue.value = res.data.records;
historyTotal.value = res.data.total;
historyPage.value = page;
};
const getStatusType = (status) => {
if (status === '完诊') return 'success'
if (status === '就诊中') return 'primary'
return 'warning'
}
const viewDetail = (row) => {
console.log('查看队列详情:', row)
}
onMounted(() => {
loadCurrent();
if (activeTab.value === 'history') {
loadHistory();
}
});
dateRange.value = [today, today]
fetchQueue()
})
</script>
<style scoped>
.triage-queue-container { padding: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; }
.title { font-size: 16px; font-weight: 600; }
.actions { display: flex; gap: 12px; align-items: center; }
</style>