Fix Bug #562: AI修复

This commit is contained in:
2026-05-27 02:44:11 +08:00
parent 0b6ad55b5a
commit a7639fa9b1
3 changed files with 172 additions and 1 deletions

View File

@@ -0,0 +1,92 @@
<template>
<div class="pending-records-page">
<el-card shadow="never">
<template #header>
<div class="card-header">
<span>待写病历</span>
<el-button type="primary" @click="fetchData" :loading="loading">刷新</el-button>
</div>
</template>
<el-table
v-loading="loading"
:data="tableData"
class="pending-records-table"
style="width: 100%"
@row-click="handleRowClick"
>
<el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="visitNo" label="就诊号" width="150" />
<el-table-column prop="visitDate" label="就诊日期" width="150" />
<el-table-column prop="diagnosis" label="初步诊断" min-width="200" show-overflow-tooltip />
<el-table-column label="操作" width="100" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click.stop="handleWrite(row)">书写</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination-wrapper">
<el-pagination
v-model:current-page="pagination.pageNum"
v-model:page-size="pagination.pageSize"
:page-sizes="[10, 20, 50]"
layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
@size-change="fetchData"
@current-change="fetchData"
/>
</div>
</el-card>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { getPendingRecords } from '@/api/outpatient/medicalRecord'
const router = useRouter()
const loading = ref(false)
const tableData = ref([])
const pagination = reactive({
pageNum: 1,
pageSize: 20,
total: 0
})
const fetchData = async () => {
loading.value = true
try {
const res = await getPendingRecords({
doctorId: 1, // 实际应从用户上下文/Store获取
pageNum: pagination.pageNum,
pageSize: pagination.pageSize
})
tableData.value = res.data.list
pagination.total = res.data.total
} catch (error) {
console.error('加载待写病历失败:', error)
} finally {
loading.value = false
}
}
const handleRowClick = (row) => {
router.push({ name: 'WriteMedicalRecord', params: { id: row.id } })
}
const handleWrite = (row) => {
router.push({ name: 'WriteMedicalRecord', params: { id: row.id } })
}
onMounted(() => {
fetchData()
})
</script>
<style scoped>
.pending-records-page { padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; }
.pagination-wrapper { margin-top: 20px; display: flex; justify-content: flex-end; }
</style>