Fix Bug #544: AI修复
This commit is contained in:
133
openhis-ui-vue3/src/views/outpatient/triage/QueueList.vue
Normal file
133
openhis-ui-vue3/src/views/outpatient/triage/QueueList.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<div class="triage-queue-container">
|
||||
<el-card class="search-card">
|
||||
<el-form :inline="true" :model="queryParams" class="demo-form-inline">
|
||||
<el-form-item label="排队状态">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="全部状态"
|
||||
clearable
|
||||
data-cy="status-select"
|
||||
>
|
||||
<el-option label="候诊" value="WAITING" />
|
||||
<el-option label="就诊中" value="IN_PROGRESS" />
|
||||
<el-option label="完诊" value="COMPLETED" />
|
||||
<el-option label="过号" value="MISSED" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="时间范围" data-cy="date-range-picker">
|
||||
<el-date-picker
|
||||
v-model="queryParams.startDate"
|
||||
type="date"
|
||||
placeholder="开始日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
data-cy="start-date"
|
||||
/>
|
||||
<span style="margin: 0 8px">至</span>
|
||||
<el-date-picker
|
||||
v-model="queryParams.endDate"
|
||||
type="date"
|
||||
placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
data-cy="end-date"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch" data-cy="search-btn">查询</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="table-card">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
border
|
||||
style="width: 100%"
|
||||
data-cy="queue-table"
|
||||
>
|
||||
<el-table-column prop="patient_name" label="患者姓名" width="120" />
|
||||
<el-table-column prop="patient_no" label="门诊号" width="150" />
|
||||
<el-table-column prop="dept_name" label="科室" width="150" />
|
||||
<el-table-column prop="queue_status" label="排队状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
class="status-tag"
|
||||
:type="getStatusType(row.queue_status)"
|
||||
>
|
||||
{{ getStatusLabel(row.queue_status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="triage_time" label="分诊时间" width="180" />
|
||||
<el-table-column prop="create_time" label="入队时间" width="180" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { getQueueList } from '@/api/outpatient/triage'
|
||||
|
||||
const loading = ref(false)
|
||||
const tableData = ref([])
|
||||
|
||||
const queryParams = reactive({
|
||||
status: '',
|
||||
startDate: '',
|
||||
endDate: ''
|
||||
})
|
||||
|
||||
// 默认初始化为当天
|
||||
const initDefaultDate = () => {
|
||||
const today = new Date().toISOString().slice(0, 10)
|
||||
queryParams.startDate = today
|
||||
queryParams.endDate = today
|
||||
}
|
||||
|
||||
const fetchQueueData = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getQueueList(queryParams)
|
||||
tableData.value = res.data || []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
fetchQueueData()
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
queryParams.status = ''
|
||||
initDefaultDate()
|
||||
fetchQueueData()
|
||||
}
|
||||
|
||||
const getStatusLabel = (status) => {
|
||||
const map = { WAITING: '候诊', IN_PROGRESS: '就诊中', COMPLETED: '完诊', MISSED: '过号' }
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
const getStatusType = (status) => {
|
||||
const map = { WAITING: 'info', IN_PROGRESS: 'warning', COMPLETED: 'success', MISSED: 'danger' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initDefaultDate()
|
||||
fetchQueueData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.triage-queue-container { padding: 16px; }
|
||||
.search-card { margin-bottom: 16px; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user