Fix Bug #544: AI修复
This commit is contained in:
91
openhis-ui-vue3/src/views/triage/QueueManagement.vue
Normal file
91
openhis-ui-vue3/src/views/triage/QueueManagement.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="triage-queue-container">
|
||||
<el-card class="search-card">
|
||||
<el-form :inline="true" :model="queryParams" class="search-form">
|
||||
<el-form-item label="日期范围">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="date-range-picker"
|
||||
@change="handleDateChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="fetchQueue">查询历史队列</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-table :data="queueList" border style="margin-top: 16px" v-loading="loading">
|
||||
<el-table-column prop="queue_no" label="排队号" width="100" />
|
||||
<el-table-column prop="patient_name" label="患者姓名" />
|
||||
<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="triage_time" label="分诊时间" width="180" />
|
||||
<el-table-column prop="dept_name" label="科室" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
|
||||
const queryParams = ref({ startDate: '', endDate: '' })
|
||||
const dateRange = ref([])
|
||||
const queueList = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
const initDate = () => {
|
||||
const today = new Date().toISOString().split('T')[0]
|
||||
dateRange.value = [today, today]
|
||||
queryParams.value.startDate = today
|
||||
queryParams.value.endDate = today
|
||||
}
|
||||
|
||||
const fetchQueue = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await request.get('/api/triage/queue', {
|
||||
params: { deptId: 1, ...queryParams.value }
|
||||
})
|
||||
queueList.value = res.data || []
|
||||
} catch (e) {
|
||||
ElMessage.error('获取队列数据失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleDateChange = (val) => {
|
||||
if (val && val.length === 2) {
|
||||
queryParams.value.startDate = val[0]
|
||||
queryParams.value.endDate = val[1]
|
||||
}
|
||||
}
|
||||
|
||||
const getStatusType = (status) => {
|
||||
if (status === '完诊') return 'success'
|
||||
if (status === '就诊中') return 'primary'
|
||||
return 'warning'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initDate()
|
||||
fetchQueue()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.triage-queue-container { padding: 20px; }
|
||||
.search-card { margin-bottom: 16px; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user