fix(mobile): 修复业务逻辑联动 - encounterId正确传递+患者详情数据展示
This commit is contained in:
@@ -59,7 +59,8 @@ const riskLevelText = computed(() => ({ HIGH: '高风险', MEDIUM: '中风险',
|
||||
const submit = async () => {
|
||||
submitting.value = true
|
||||
try {
|
||||
await nursingApi.submitAssessment({ patientId: route.params.patientId, assessmentType: selectedType.value, totalScore: totalScore.value, riskLevel: riskLevel.value, detail: JSON.stringify(formData.value) })
|
||||
const encounterId = route.query.encounterId
|
||||
await nursingApi.submitAssessment({ patientId: route.params.patientId, encounterId: encounterId || undefined, assessmentType: selectedType.value, totalScore: totalScore.value, riskLevel: riskLevel.value, detail: JSON.stringify(formData.value) })
|
||||
ElMessage.success('评估提交成功')
|
||||
} catch (e) { ElMessage.error('提交失败') } finally { submitting.value = false }
|
||||
}
|
||||
|
||||
@@ -81,12 +81,13 @@ const formatTime = (t) => { if (!t) return ''; const d = new Date(t); return `${
|
||||
|
||||
onMounted(async () => {
|
||||
const id = route.params.id
|
||||
const encounterId = route.query.encounterId
|
||||
try {
|
||||
const [pRes, oRes, vRes, aRes] = await Promise.allSettled([
|
||||
nursingApi.getPatientInfo(id),
|
||||
nursingApi.getOrders(id),
|
||||
encounterId ? nursingApi.getOrders(encounterId) : Promise.resolve({ data: [] }),
|
||||
nursingApi.getVitalSigns(id),
|
||||
nursingApi.getAssessments(id)
|
||||
encounterId ? nursingApi.getAssessments(encounterId) : Promise.resolve({ data: [] })
|
||||
])
|
||||
if (pRes.status === 'fulfilled') patient.value = pRes.value?.data || {}
|
||||
if (oRes.status === 'fulfilled') orders.value = oRes.value?.data?.records || oRes.value?.data || []
|
||||
@@ -98,8 +99,8 @@ onMounted(async () => {
|
||||
const executeOrder = async (order) => {
|
||||
try { await nursingApi.completeTask(order.id || order.adviceId, { result: '执行完成' }); ElMessage.success('医嘱已执行'); order.executeStatus = '已执行' } catch (e) { ElMessage.error('执行失败') }
|
||||
}
|
||||
const goVitalEntry = () => router.push(`/mobile/vital-entry/${route.params.id}`)
|
||||
const goAssessment = () => router.push(`/mobile/assessment/${route.params.id}`)
|
||||
const goVitalEntry = () => router.push(`/mobile/vital-entry/${route.params.id}?encounterId=${route.query.encounterId || ''}`)
|
||||
const goAssessment = () => router.push(`/mobile/assessment/${route.params.id}?encounterId=${route.query.encounterId || ''}`)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -53,7 +53,7 @@ const loadPatients = async (reset = false) => {
|
||||
|
||||
const onSearch = () => { loadPatients(true) }
|
||||
const loadMore = () => { pageNo.value++; loadPatients(false) }
|
||||
const goDetail = (p) => { router.push(`/mobile/patient-detail/${p.patientId || p.id}`) }
|
||||
const goDetail = (p) => { router.push(`/mobile/patient-detail/${p.patientId || p.id}?encounterId=${p.encounterId || ''}`) }
|
||||
|
||||
onMounted(() => loadPatients(true))
|
||||
</script>
|
||||
|
||||
@@ -50,7 +50,8 @@ const painLabel = computed(() => { const s = formData.value.painScore; return s
|
||||
const submit = async () => {
|
||||
submitting.value = true
|
||||
try {
|
||||
await nursingApi.submitVitalSign({ ...formData.value, patientId: route.params.patientId })
|
||||
const encounterId = route.query.encounterId
|
||||
await nursingApi.submitVitalSign({ ...formData.value, patientId: route.params.patientId, encounterId: encounterId || undefined })
|
||||
ElMessage.success('体征录入成功')
|
||||
} catch (e) { ElMessage.error('提交失败') } finally { submitting.value = false }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user