revert: restore develop to clean baseline 5132de36 (remove all AI changes)
This commit is contained in:
@@ -1,142 +0,0 @@
|
||||
<template>
|
||||
<div class="pending-medical-record-container">
|
||||
<el-card class="filter-card" shadow="never">
|
||||
<el-form :model="queryParams" inline label-width="80px">
|
||||
<el-form-item label="患者姓名">
|
||||
<el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<div class="record-list" v-loading="loading">
|
||||
<el-empty v-if="recordList.length === 0" description="暂无待写病历" />
|
||||
<el-card v-for="item in recordList" :key="item.id" class="record-card" shadow="hover">
|
||||
<div class="record-header">
|
||||
<span class="patient-name">{{ item.patientName }}</span>
|
||||
<el-tag size="small" type="info">{{ item.gender }}</el-tag>
|
||||
<span class="age">{{ item.age }}岁</span>
|
||||
</div>
|
||||
<div class="record-info">
|
||||
<span>病历号: {{ item.medicalRecordNo }}</span>
|
||||
<span>就诊时间: {{ item.visitTime }}</span>
|
||||
<span>诊断: {{ item.diagnosis || '未填写' }}</span>
|
||||
</div>
|
||||
<!-- Bug #590 修复:原布局依赖默认块级流或浮动,导致“查看患者”与“写病历”在不同分辨率下换行错乱。
|
||||
现改为 flex 布局,强制同行对齐,使用 justify-content: flex-end 保持右侧对齐,gap 统一间距。 -->
|
||||
<div class="record-action-bar" style="display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #ebeef5;">
|
||||
<el-button type="primary" plain size="default" data-cy="view-patient" @click="handleViewPatient(item)">查看患者</el-button>
|
||||
<el-button type="primary" size="default" data-cy="write-record" @click="handleWriteRecord(item)">写病历</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<el-pagination
|
||||
v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
class="pagination"
|
||||
@current-change="handleQuery"
|
||||
@size-change="handleQuery"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
const recordList = ref<any[]>([])
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
patientName: ''
|
||||
})
|
||||
|
||||
const handleQuery = () => {
|
||||
loading.value = true
|
||||
// 模拟后端请求
|
||||
setTimeout(() => {
|
||||
recordList.value = [
|
||||
{ id: 1, patientName: '张三', gender: '男', age: 35, medicalRecordNo: 'MR20260526001', visitTime: '2026-05-26 09:30', diagnosis: '上呼吸道感染' }
|
||||
]
|
||||
total.value = 1
|
||||
loading.value = false
|
||||
}, 300)
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
queryParams.patientName = ''
|
||||
queryParams.pageNum = 1
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const handleViewPatient = (row: any) => {
|
||||
console.log('查看患者详情', row)
|
||||
// router.push({ path: '/patient/detail', query: { id: row.id } })
|
||||
}
|
||||
|
||||
const handleWriteRecord = (row: any) => {
|
||||
console.log('进入写病历', row)
|
||||
// router.push({ path: '/emr/write', query: { encounterId: row.id } })
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pending-medical-record-container {
|
||||
padding: 16px;
|
||||
background-color: #f5f7fa;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.filter-card {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.record-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.record-card {
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.record-card:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.record-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.patient-name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
.record-info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,105 +0,0 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user