Fix Bug #562: AI修复

This commit is contained in:
2026-05-26 22:47:00 +08:00
parent aed6c7f9ac
commit 6d9fda0000
4 changed files with 217 additions and 27 deletions

View File

@@ -0,0 +1,105 @@
<template>
<div class="pending-medical-record-container">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>待写病历</span>
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDateChange"
style="margin-left: auto;"
/>
</div>
</template>
<el-table
:data="tableData"
border
style="width: 100%"
v-loading="loading"
class="medical-record-table"
>
<el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="gender" label="性别" width="80" />
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="visitDate" label="就诊日期" width="120" />
<el-table-column prop="deptName" label="科室" width="120" />
<el-table-column label="操作" width="120">
<template #default="{ row }">
<el-button link type="primary" @click="handleWrite(row)">书写病历</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:current-page="queryParams.pageNum"
v-model:page-size="queryParams.pageSize"
:total="total"
layout="total, prev, pager, next"
@current-change="fetchData"
class="pagination"
/>
</el-card>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { getPendingMedicalRecordsApi } from '@/api/doctorstation/medicalRecord'
import { useUserStore } from '@/store/modules/user'
import { useRouter } from 'vue-router'
const userStore = useUserStore()
const router = useRouter()
const loading = ref(false)
const tableData = ref([])
const total = ref(0)
const dateRange = ref([])
const queryParams = reactive({
pageNum: 1,
pageSize: 20,
doctorId: userStore.userId,
startDate: '',
endDate: ''
})
const fetchData = async () => {
loading.value = true
try {
const res = await getPendingMedicalRecordsApi(queryParams)
tableData.value = res.data.list
total.value = res.data.total
} catch (error) {
console.error('加载待写病历失败:', error)
} finally {
loading.value = false
}
}
const handleDateChange = (val) => {
queryParams.startDate = val ? val[0] : ''
queryParams.endDate = val ? val[1] : ''
queryParams.pageNum = 1
fetchData()
}
const handleWrite = (row) => {
router.push({ path: '/doctorstation/write-medical-record', query: { encounterId: row.encounterId } })
}
onMounted(() => {
fetchData()
})
</script>
<style scoped>
.pending-medical-record-container { padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; }
.pagination { margin-top: 20px; display: flex; justify-content: flex-end; }
</style>