Fix Bug #562: fallback修复

This commit is contained in:
2026-05-27 02:57:18 +08:00
parent 028986a187
commit f91c709d72
5 changed files with 173 additions and 58 deletions

View File

@@ -0,0 +1,13 @@
import request from '@/utils/request';
/**
* 获取待写病历(分页)
* @param {Object} params { pageNum, pageSize }
*/
export function getPendingMedicalRecordsApi(params) {
return request({
url: '/outpatient/medical-records/pending',
method: 'get',
params,
});
}

View File

@@ -0,0 +1,73 @@
<template>
<div class="medical-record-pending">
<el-table :data="recordList" style="width: 100%" v-loading="loading">
<el-table-column prop="patientName" label="患者" min-width="120" />
<el-table-column prop="doctorName" label="医生" min-width="120" />
<el-table-column prop="createTime" label="创建时间" width="180" />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button type="primary" size="small" @click="openRecord(row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination-wrapper" style="margin-top: 20px; text-align: right;">
<el-pagination
background
layout="total, prev, pager, next, sizes, jumper"
:total="total"
:page-size="pageSize"
:current-page="pageNum"
@size-change="handleSizeChange"
@current-change="handlePageChange"
/>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { getPendingMedicalRecordsApi } from '@/api/outpatient/medicalRecord';
const recordList = ref([]);
const total = ref(0);
const loading = ref(false);
const pageNum = ref(1);
const pageSize = ref(20);
const loadData = async () => {
loading.value = true;
try {
const res = await getPendingMedicalRecordsApi({ pageNum: pageNum.value, pageSize: pageSize.value });
recordList.value = res.data || [];
total.value = res.total || 0;
} catch (e) {
ElMessage.error('加载待写病历失败');
} finally {
loading.value = false;
}
};
const handlePageChange = (newPage) => {
pageNum.value = newPage;
loadData();
};
const handleSizeChange = (newSize) => {
pageSize.value = newSize;
pageNum.value = 1;
loadData();
};
onMounted(() => {
loadData();
});
</script>
<style scoped>
.pagination-wrapper {
display: flex;
justify-content: flex-end;
}
</style>