Fix Bug #544: AI修复
This commit is contained in:
127
openhis-ui-vue3/src/views/triage/queue/index.vue
Normal file
127
openhis-ui-vue3/src/views/triage/queue/index.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="triage-queue-container">
|
||||
<el-card class="box-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>智能分诊排队管理 - {{ deptName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Bug #544 Fix: 增加状态筛选与历史时间范围查询 -->
|
||||
<el-form :inline="true" :model="queryParams" class="search-form">
|
||||
<el-form-item label="状态筛选" class="status-filter">
|
||||
<el-select v-model="queryParams.status" placeholder="全部状态" clearable @change="handleSearch">
|
||||
<el-option label="待分诊" :value="1" />
|
||||
<el-option label="待就诊" :value="2" />
|
||||
<el-option label="就诊中" :value="3" />
|
||||
<el-option label="完诊" :value="4" />
|
||||
<el-option label="过号" :value="5" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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"
|
||||
@change="handleDateChange"
|
||||
class="date-range-picker"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table :data="tableData" border style="width: 100%" v-loading="loading" class="queue-table">
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="queueTime" label="排队时间" width="160" />
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusType(row.status)">{{ getStatusLabel(row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" label="科室" width="120" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { getQueueRecordsApi } from '@/api/triage/queue'
|
||||
|
||||
const loading = ref(false)
|
||||
const tableData = ref([])
|
||||
const deptName = ref('呼吸内科')
|
||||
const dateRange = ref([])
|
||||
const queryParams = reactive({
|
||||
deptId: 101,
|
||||
status: null,
|
||||
startDate: null,
|
||||
endDate: null
|
||||
})
|
||||
|
||||
// Bug #544 Fix: 初始化默认当天时间
|
||||
const initDateRange = () => {
|
||||
const today = new Date().toISOString().split('T')[0]
|
||||
dateRange.value = [today, today]
|
||||
queryParams.startDate = today
|
||||
queryParams.endDate = today
|
||||
}
|
||||
|
||||
const getStatusLabel = (status) => {
|
||||
const map = { 1: '待分诊', 2: '待就诊', 3: '就诊中', 4: '完诊', 5: '过号' }
|
||||
return map[status] || '未知'
|
||||
}
|
||||
|
||||
const getStatusType = (status) => {
|
||||
const map = { 1: 'info', 2: 'warning', 3: 'primary', 4: 'success', 5: 'danger' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
const fetchData = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
tableData.value = await getQueueRecordsApi(queryParams)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
const handleDateChange = (val) => {
|
||||
if (val && val.length === 2) {
|
||||
queryParams.startDate = val[0]
|
||||
queryParams.endDate = val[1]
|
||||
} else {
|
||||
queryParams.startDate = null
|
||||
queryParams.endDate = null
|
||||
}
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
queryParams.status = null
|
||||
initDateRange()
|
||||
fetchData()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initDateRange()
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.triage-queue-container { padding: 20px; }
|
||||
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
||||
.search-form { margin-bottom: 20px; }
|
||||
.queue-table { margin-top: 10px; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user