fix(mobile): 修复患者列表API使用正确的patient-home-manage/init接口

This commit is contained in:
2026-06-20 12:18:58 +08:00
parent 2d58b05fdc
commit 58993d51e3
8 changed files with 349 additions and 6 deletions

View File

@@ -46,13 +46,20 @@ export const nursingApi = {
getTasks: (params) => service.get('/nurse-station/advice-process/page', { params }),
completeTask: (id, data) => service.post(`/nurse-station/advice-process/execute`, data),
getPatientInfo: (id) => service.get('/inpatientmanage/inhospitalregister/' + id),
getPatientList: (params) => service.get('/administration/practitioner-patient/list', { params }),
getPatientsByPractitioner: (practitionerId) => service.get('/administration/practitioner-patient/practitioner/' + practitionerId + '/patients'),
getPatientList: (params) => service.get('/patient-home-manage/init', { params: { ...params, pageSize: params?.pageSize || 100 } }),
getOrders: (encounterId) => service.get('/nurse-station/advice-process/page', { params: { encounterId } }),
getVitalSigns: (patientId) => service.get('/nursing/vital-signs/' + patientId),
submitVitalSign: (data) => service.post('/nursing/vital-sign', data),
getAssessments: (encounterId) => service.get('/nursing/assessment/encounter/' + encounterId),
submitAssessment: (data) => service.post('/nursing/assessment', data)
submitAssessment: (data) => service.post('/nursing/assessment', data),
getDrugDistribution: (params) => service.get('/nursing/drug-distribution/list', { params }),
submitDrugDistribution: (data) => service.post('/nursing/drug-distribution/execute', data),
getNursingRecords: (params) => service.get('/nursing/record/list', { params }),
submitNursingRecord: (data) => service.post('/nursing/record', data),
getInfusionPatrol: (params) => service.get('/nursing/infusion-patrol/list', { params }),
submitInfusionPatrol: (data) => service.post('/nursing/infusion-patrol/patrol', data),
getHandoffRecords: (params) => service.get('/nursing/handoff/list', { params }),
submitHandoffRecord: (data) => service.post('/nursing/handoff', data)
}
export default service

View File

@@ -10,6 +10,10 @@ const routes = [
{ path: 'patient-detail/:id', component: () => import('../views/PatientDetail.vue'), meta: { title: '患者详情' } },
{ path: 'vital-entry/:patientId', component: () => import('../views/VitalSignEntry.vue'), meta: { title: '生命体征录入' } },
{ path: 'assessment/:patientId', component: () => import('../views/AssessmentForm.vue'), meta: { title: '护理评估' } },
{ path: 'drug-distribution', component: () => import('../views/DrugDistribution.vue'), meta: { title: '药品发放' } },
{ path: 'nursing-record', component: () => import('../views/NursingRecord.vue'), meta: { title: '护理记录' } },
{ path: 'infusion-patrol', component: () => import('../views/InfusionPatrol.vue'), meta: { title: '输液巡视' } },
{ path: 'handoff-record', component: () => import('../views/HandoffRecord.vue'), meta: { title: '交接班记录' } },
{ path: 'mine', component: () => import('../views/Mine.vue'), meta: { title: '我的' } }
]}
]

View File

@@ -0,0 +1,74 @@
<template>
<div class="drug-dist">
<div class="search-bar"><input v-model="searchText" placeholder="搜索药品名称/患者..." class="search-input" /></div>
<div v-if="loading" class="loading">加载中...</div>
<div v-for="item in filteredList" :key="item.id" class="drug-card">
<div class="drug-header"><span class="drug-name">{{ item.drugName }}</span><span class="status-tag" :class="'s-' + item.status">{{ item.statusText }}</span></div>
<div class="drug-info"><div>患者: {{ item.patientName }} {{ item.bedNo }}</div><div>剂量: {{ item.dosage }}</div><div>用法: {{ item.usage }}</div></div>
<div class="drug-actions">
<button v-if="item.status === 'PENDING'" class="action-btn primary" @click="handleDistribute(item)">发放</button>
<button v-if="item.status === 'PENDING'" class="action-btn" @click="handleReject(item)">拒发</button>
<span v-if="item.status === 'DISTRIBUTED'" class="done-text">已发放</span>
</div>
</div>
<div v-if="!loading && filteredList.length === 0" class="empty">暂无待发放药品</div>
</div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { nursingApi } from '../api'
const searchText = ref('')
const list = ref([])
const loading = ref(false)
const filteredList = computed(() => searchText.value ? list.value.filter(d => d.drugName?.includes(searchText.value) || d.patientName?.includes(searchText.value)) : list.value)
const loadList = async () => {
loading.value = true
try {
const res = await nursingApi.getDrugDistribution({ pageSize: 100 })
list.value = (res.data?.records || res.data?.rows || res.data || []).map(d => ({ ...d, statusText: d.status === 'DISTRIBUTED' ? '已发放' : d.status === 'REJECTED' ? '已拒发' : '待发放' }))
} catch { ElMessage.error('加载失败') } finally { loading.value = false }
}
const handleDistribute = async (item) => {
try {
await ElMessageBox.confirm('确认发放该药品?', '确认')
await nursingApi.submitDrugDistribution({ id: item.id, action: 'DISTRIBUTE' })
item.status = 'DISTRIBUTED'; item.statusText = '已发放'
ElMessage.success('发放成功')
} catch (e) { if (e !== 'cancel') ElMessage.error('操作失败') }
}
const handleReject = async (item) => {
try {
await ElMessageBox.confirm('确认拒发该药品?', '确认')
await nursingApi.submitDrugDistribution({ id: item.id, action: 'REJECT' })
item.status = 'REJECTED'; item.statusText = '已拒发'
ElMessage.success('已拒发')
} catch (e) { if (e !== 'cancel') ElMessage.error('操作失败') }
}
onMounted(loadList)
</script>
<style scoped>
.search-bar { padding: 8px 0; }
.search-input { width: 100%; padding: 10px 16px; border: 1px solid #ddd; border-radius: 20px; font-size: 15px; outline: none; background: #fff; }
.drug-card { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.drug-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.drug-name { font-weight: 600; font-size: 15px; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.s-PENDING { background: #fff7e6; color: #fa8c16; }
.s-DISTRIBUTED { background: #f6ffed; color: #52c41a; }
.s-REJECTED { background: #fff1f0; color: #f5222d; }
.drug-info { font-size: 13px; color: #666; line-height: 1.8; }
.drug-actions { display: flex; gap: 8px; margin-top: 10px; }
.action-btn { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 6px; background: #fff; font-size: 13px; }
.action-btn.primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.done-text { color: #52c41a; font-size: 13px; line-height: 36px; }
.loading { text-align: center; padding: 20px; color: #999; }
.empty { text-align: center; padding: 40px; color: #999; }
</style>

View File

@@ -0,0 +1,82 @@
<template>
<div class="handoff-record">
<div class="shift-tabs">
<div v-for="s in shifts" :key="s.key" class="tab" :class="{ active: form.shift === s.key }" @click="form.shift = s.key">{{ s.label }}</div>
</div>
<div class="form-section">
<div class="form-item"><div class="label">交接班护士</div><input v-model="form.handoffNurse" placeholder="交班护士" class="input" /></div>
<div class="form-item"><div class="label">接班护士</div><input v-model="form.onDutyNurse" placeholder="接班护士" class="input" /></div>
<div class="form-item"><div class="label">科室</div><input v-model="form.department" placeholder="科室名称" class="input" /></div>
<div class="form-item"><div class="label">在院患者数</div><input v-model="form.patientCount" type="number" placeholder="0" class="input" /></div>
<div class="form-item"><div class="label">病情变化</div><textarea v-model="form.patientChanges" placeholder="交接患者病情变化..." class="textarea" rows="3"></textarea></div>
<div class="form-item"><div class="label">特殊治疗</div><textarea v-model="form.specialTreatment" placeholder="特殊治疗及注意事项..." class="textarea" rows="3"></textarea></div>
<div class="form-item"><div class="label">待办事项</div><textarea v-model="form.pendingItems" placeholder="未完成事项及待跟进..." class="textarea" rows="3"></textarea></div>
<div class="form-item"><div class="label">物品交接</div><textarea v-model="form.materialHandoff" placeholder="交接的物品..." class="textarea" rows="2"></textarea></div>
</div>
<button class="submit-btn" @click="submit" :disabled="submitting">{{ submitting ? '提交中...' : '保存交接记录' }}</button>
<div class="history-section">
<div class="section-title">历史交接记录</div>
<div v-for="h in history" :key="h.id" class="history-card">
<div class="h-header"><span class="h-shift">{{ h.shift }}</span><span class="h-time">{{ h.createTime }}</span></div>
<div class="h-nurses">{{ h.handoffNurse }} {{ h.onDutyNurse }}</div>
<div class="h-changes">{{ h.patientChanges }}</div>
</div>
<div v-if="history.length === 0" class="empty">暂无历史记录</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { nursingApi } from '../api'
const shifts = [{ key: 'DAY', label: '白班' }, { key: 'NIGHT', label: '夜班' }]
const form = ref({ shift: 'DAY', handoffNurse: '', onDutyNurse: '', department: '', patientCount: 0, patientChanges: '', specialTreatment: '', pendingItems: '', materialHandoff: '' })
const history = ref([])
const submitting = ref(false)
const loadHistory = async () => {
try {
const res = await nursingApi.getHandoffRecords({ pageSize: 20 })
history.value = res.data?.records || res.data?.rows || res.data || []
} catch {}
}
const submit = async () => {
if (!form.value.handoffNurse || !form.value.onDutyNurse) { ElMessage.warning('请填写交接班护士'); return }
submitting.value = true
try {
await nursingApi.submitHandoffRecord({ ...form.value })
ElMessage.success('交接记录已保存')
form.value = { shift: form.value.shift, handoffNurse: '', onDutyNurse: '', department: form.value.department, patientCount: 0, patientChanges: '', specialTreatment: '', pendingItems: '', materialHandoff: '' }
loadHistory()
} catch { ElMessage.error('保存失败') } finally { submitting.value = false }
}
onMounted(loadHistory)
</script>
<style scoped>
.shift-tabs { display: flex; background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.tab { flex: 1; text-align: center; padding: 12px; font-size: 14px; color: #666; background: #f5f5f5; }
.tab.active { background: #1890ff; color: #fff; }
.form-section { background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.form-item { margin-bottom: 12px; }
.label { font-size: 13px; color: #666; margin-bottom: 6px; }
.input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; resize: none; font-family: inherit; }
.input:focus, .textarea:focus { border-color: #1890ff; outline: none; }
.submit-btn { width: 100%; padding: 14px; background: #1890ff; color: #fff; border: none; border-radius: 8px; font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.submit-btn:disabled { background: #91d5ff; }
.history-section { background: #fff; border-radius: 8px; padding: 14px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.history-card { border-bottom: 1px solid #f0f0f0; padding: 10px 0; }
.h-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.h-shift { font-weight: 600; font-size: 14px; color: #1890ff; }
.h-time { font-size: 12px; color: #999; }
.h-nurses { font-size: 13px; color: #666; margin-bottom: 4px; }
.h-changes { font-size: 13px; color: #333; }
.empty { text-align: center; padding: 20px; color: #999; }
</style>

View File

@@ -41,7 +41,11 @@ const stats = ref([{ label: '待执行医嘱', value: 0 }, { label: '今日体
const recentTasks = ref([])
const actions = [
{ icon: '📋', label: '任务列表', path: '/mobile/tasks', color: '#1890ff' },
{ icon: '👥', label: '患者列表', path: '/mobile/patients', color: '#52c41a' }
{ icon: '👥', label: '患者列表', path: '/mobile/patients', color: '#52c41a' },
{ icon: '💊', label: '药品发放', path: '/mobile/drug-distribution', color: '#fa8c16' },
{ icon: '📝', label: '护理记录', path: '/mobile/nursing-record', color: '#722ed1' },
{ icon: '💉', label: '输液巡视', path: '/mobile/infusion-patrol', color: '#13c2c2' },
{ icon: '🔄', label: '交接班', path: '/mobile/handoff-record', color: '#f5222d' }
]
onMounted(async () => {

View File

@@ -0,0 +1,91 @@
<template>
<div class="infusion-patrol">
<div class="filter-bar">
<div v-for="f in filters" :key="f.key" class="filter-btn" :class="{ active: activeFilter === f.key }" @click="activeFilter = f.key">{{ f.label }}</div>
</div>
<div v-if="loading" class="loading">加载中...</div>
<div v-for="item in filteredList" :key="item.id" class="infusion-card">
<div class="inf-header">
<div class="inf-patient">{{ item.patientName }} {{ item.bedNo }}</div>
<div class="inf-status" :class="'s-' + item.status">{{ item.status === 'INFUSING' ? '输液中' : item.status === 'COMPLETED' ? '已完成' : '暂停中' }}</div>
</div>
<div class="drug-list">
<div v-for="drug in item.drugs" :key="drug.id" class="drug-row">
<span class="drug-name">{{ drug.name }}</span>
<span class="drug-spec">{{ drug.spec }}</span>
<span class="drug-flow">{{ drug.flowRate }}</span>
</div>
</div>
<div class="patrol-info" v-if="item.lastPatrolTime"><span class="label">上次巡视:</span> {{ item.lastPatrolTime }}</div>
<div class="inf-actions">
<button v-if="item.status === 'INFUSING'" class="patrol-btn" @click="handlePatrol(item)">巡视</button>
<button v-if="item.status === 'INFUSING'" class="stop-btn" @click="handleComplete(item)">结束输液</button>
</div>
</div>
<div v-if="!loading && filteredList.length === 0" class="empty">暂无输液记录</div>
</div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { nursingApi } from '../api'
const activeFilter = ref('INFUSING')
const filters = [{ key: 'INFUSING', label: '输液中' }, { key: 'COMPLETED', label: '已完成' }, { key: 'ALL', label: '全部' }]
const list = ref([])
const loading = ref(false)
const filteredList = computed(() => activeFilter.value === 'ALL' ? list.value : list.value.filter(i => i.status === activeFilter.value))
const loadList = async () => {
loading.value = true
try {
const res = await nursingApi.getInfusionPatrol({ pageSize: 100 })
list.value = res.data?.records || res.data?.rows || res.data || []
} catch { ElMessage.error('加载失败') } finally { loading.value = false }
}
const handlePatrol = async (item) => {
try {
await nursingApi.submitInfusionPatrol({ infusionId: item.id, action: 'PATROL' })
item.lastPatrolTime = new Date().toLocaleString()
ElMessage.success('巡视完成')
} catch { ElMessage.error('巡视失败') }
}
const handleComplete = async (item) => {
try {
await ElMessageBox.confirm('确认结束输液?', '确认')
await nursingApi.submitInfusionPatrol({ infusionId: item.id, action: 'COMPLETE' })
item.status = 'COMPLETED'
ElMessage.success('输液已结束')
} catch (e) { if (e !== 'cancel') ElMessage.error('操作失败') }
}
onMounted(loadList)
</script>
<style scoped>
.filter-bar { display: flex; gap: 8px; padding: 8px 0; }
.filter-btn { padding: 6px 16px; border-radius: 20px; background: #f0f0f0; font-size: 13px; cursor: pointer; }
.filter-btn.active { background: #1890ff; color: #fff; }
.infusion-card { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.inf-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.inf-patient { font-weight: 600; font-size: 15px; }
.inf-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.s-INFUSING { background: #e6f7ff; color: #1890ff; }
.s-COMPLETED { background: #f6ffed; color: #52c41a; }
.s-PAUSED { background: #fff7e6; color: #fa8c16; }
.drug-list { background: #fafafa; border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.drug-row { display: flex; gap: 10px; font-size: 13px; padding: 4px 0; }
.drug-name { flex: 1; font-weight: 500; }
.drug-spec { color: #999; }
.drug-flow { color: #1890ff; }
.patrol-info { font-size: 12px; color: #999; margin-bottom: 8px; }
.label { color: #666; }
.inf-actions { display: flex; gap: 8px; }
.patrol-btn { flex: 1; padding: 8px; background: #52c41a; color: #fff; border: none; border-radius: 6px; font-size: 13px; }
.stop-btn { flex: 1; padding: 8px; background: #fff; color: #666; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.loading { text-align: center; padding: 20px; color: #999; }
.empty { text-align: center; padding: 40px; color: #999; }
</style>

View File

@@ -0,0 +1,81 @@
<template>
<div class="nursing-record">
<div class="type-tabs">
<div v-for="t in recordTypes" :key="t.key" class="tab" :class="{ active: form.recordType === t.key }" @click="form.recordType = t.key">{{ t.label }}</div>
</div>
<div class="form-section">
<div class="form-item"><div class="label">患者</div><input v-model="form.patientName" placeholder="选择患者" class="input" readonly @click="showPatientPicker = true" /></div>
<div class="form-item"><div class="label">记录内容</div><textarea v-model="form.content" placeholder="请输入护理记录内容..." class="textarea" rows="4"></textarea></div>
<div class="form-item"><div class="label">护理评估</div><textarea v-model="form.assessment" placeholder="评估情况..." class="textarea" rows="3"></textarea></div>
<div class="form-item"><div class="label">护理措施</div><textarea v-model="form.measures" placeholder="采取的护理措施..." class="textarea" rows="3"></textarea></div>
<div class="form-item"><div class="label">签名</div><input v-model="form.signer" placeholder="护士签名" class="input" /></div>
</div>
<button class="submit-btn" @click="submit" :disabled="submitting">{{ submitting ? '提交中...' : '保存记录' }}</button>
<div v-if="showPatientPicker" class="picker-mask" @click.self="showPatientPicker = false">
<div class="picker-panel">
<div class="picker-header">选择患者</div>
<div v-for="p in patients" :key="p.id" class="picker-item" @click="selectPatient(p)">{{ p.name }} {{ p.bedNo }}</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { nursingApi } from '../api'
const recordTypes = [
{ key: 'DAILY', label: '日常记录' },
{ key: 'SPECIAL', label: '特殊记录' },
{ key: 'TRANSFER', label: '转科记录' }
]
const form = ref({ recordType: 'DAILY', patientId: '', patientName: '', content: '', assessment: '', measures: '', signer: '' })
const patients = ref([])
const showPatientPicker = ref(false)
const submitting = ref(false)
const loadPatients = async () => {
try {
const res = await nursingApi.getPatientList({ pageSize: 100 })
patients.value = res.data?.records || res.data?.rows || res.data || []
} catch {}
}
const selectPatient = (p) => {
form.value.patientId = p.id; form.value.patientName = p.name
showPatientPicker.value = false
}
const submit = async () => {
if (!form.value.patientId || !form.value.content) { ElMessage.warning('请选择患者并填写记录内容'); return }
submitting.value = true
try {
await nursingApi.submitNursingRecord({ ...form.value })
ElMessage.success('记录保存成功')
form.value = { recordType: form.value.recordType, patientId: '', patientName: '', content: '', assessment: '', measures: '', signer: '' }
} catch { ElMessage.error('保存失败') } finally { submitting.value = false }
}
onMounted(loadPatients)
</script>
<style scoped>
.type-tabs { display: flex; background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.tab { flex: 1; text-align: center; padding: 12px; font-size: 14px; color: #666; background: #f5f5f5; }
.tab.active { background: #1890ff; color: #fff; }
.form-section { background: #fff; border-radius: 8px; padding: 14px; }
.form-item { margin-bottom: 14px; }
.label { font-size: 13px; color: #666; margin-bottom: 6px; }
.input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; resize: none; font-family: inherit; }
.input:focus, .textarea:focus { border-color: #1890ff; outline: none; }
.submit-btn { width: 100%; padding: 14px; background: #1890ff; color: #fff; border: none; border-radius: 8px; font-size: 16px; margin-top: 12px; font-weight: 600; }
.submit-btn:disabled { background: #91d5ff; }
.picker-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; align-items: flex-end; }
.picker-panel { background: #fff; width: 100%; max-height: 60vh; border-radius: 12px 12px 0 0; padding: 16px; overflow-y: auto; }
.picker-header { font-size: 16px; font-weight: 600; margin-bottom: 12px; text-align: center; }
.picker-item { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 15px; cursor: pointer; }
.picker-item:active { background: #f5f5f5; }
</style>

View File

@@ -27,8 +27,8 @@ const displayPatients = computed(() => searchText.value ? patients.value.filter(
const loadPatients = async () => {
loading.value = true
try {
const res = await nursingApi.getPatientList({ pageSize: 100 })
patients.value = res.data?.records || res.data?.rows || res.data || []
const res = await nursingApi.getPatientList({})
patients.value = res.data?.list || res.data?.records || res.data?.rows || res.data || []
} catch (e) { ElMessage.error('加载患者列表失败') } finally { loading.value = false }
}