feat: 病历模块优化

This commit is contained in:
李琦
2026-08-05 17:54:17 +08:00
parent 9c629ff8ee
commit 0331325929
3 changed files with 119 additions and 40 deletions

View File

@@ -1145,6 +1145,8 @@ const cancelSaveCommonPrescription = () => {
:register="prescriptionStore.patientInfo"
:patient="prescriptionStore.activePatient"
:category="prescriptionStore.category"
:store-name="prescriptionStore.targetStoreName || prescriptionStore.currentStoreName"
:is-online="true"
/>
<Tabs
v-model:active-key="rxMrTab"

View File

@@ -1,13 +1,15 @@
<script lang="ts" setup>
/**
* 接诊台顶部患者简要信息条
* 只展示门诊号/日期/费别/姓名/性别/年龄/手机(诊断只在处方/病历编辑区一处维护)
* 上方居中展示诊所名 + 处方类型;下方展示门诊号/日期/费别/姓名等
* 诊断只在处方/病历编辑区一处维护
*/
import { computed } from 'vue';
import { Tag } from 'ant-design-vue';
import SensitiveText from '#/components/sensitive-text/SensitiveText.vue';
import { formatStoreNameWithHu } from '#/utils/formatStoreNameWithHu';
defineOptions({ name: 'PatientBriefBar' });
@@ -19,14 +21,49 @@ const props = withDefaults(
patient?: Record<string, any> | null;
/** 当前费别1 自费 2 医保 */
category?: number;
/** 诊所名称(优先;也可从 register.store.name 兜底) */
storeName?: string;
/**
* 是否在线复诊开方
* false/0门诊普通处方笺true/1/2/3在线处方
*/
isOnline?: boolean | number;
}>(),
{
register: null,
patient: null,
category: 1,
storeName: '',
isOnline: false,
},
);
const onlineFlag = computed(() => {
if (props.isOnline === true) return 1;
if (props.isOnline === false) return 0;
const fromProp = Number(props.isOnline);
if (fromProp > 0) return fromProp;
// 挂号单上可能带 is_online
return Number(props.register?.is_online || 0);
});
/** 居中诊所名:在线渠道按既有规则追加(互) */
const displayStoreName = computed(() => {
const raw =
String(props.storeName || '').trim() ||
String(props.register?.store?.name || props.register?.store_name || '').trim();
return formatStoreNameWithHu(raw, onlineFlag.value) || '诊所';
});
/** 处方类型标题:线下普通 / 线上复诊 */
const prescriptionTypeTitle = computed(() => {
const online = onlineFlag.value;
if (online === 1 || online === 2 || online === 3) {
return '在线处方';
}
return '门诊普通处方笺';
});
const sexText = computed(() => {
const sex = Number(props.patient?.sex || 0);
if (sex === 1) return '男';
@@ -54,57 +91,87 @@ const visitDate = computed(() => {
<template>
<div class="patient-brief-bar">
<div class="brief-item">
<span class="brief-label">门诊号</span>
<span class="brief-value">{{ register?.order_no || '—' }}</span>
<!-- 居中抬头诊所名 + 处方类型 -->
<div class="brief-header">
<div class="brief-clinic">{{ displayStoreName }}</div>
<div class="brief-rx-type">{{ prescriptionTypeTitle }}</div>
</div>
<div class="brief-item">
<span class="brief-label">日期</span>
<span class="brief-value">{{ visitDate }}</span>
</div>
<div class="brief-item">
<span class="brief-label">费别</span>
<Tag :color="Number(category) === 2 ? 'blue' : 'default'" class="m-0">
{{ categoryText }}
</Tag>
</div>
<div class="brief-item">
<span class="brief-label">姓名</span>
<span class="brief-value brief-name">{{ patient?.name || '—' }}</span>
</div>
<div class="brief-item">
<span class="brief-label">性别</span>
<span class="brief-value">{{ sexText }}</span>
</div>
<div class="brief-item">
<span class="brief-label">年龄</span>
<span class="brief-value">{{ patient?.age ?? '—' }}</span>
</div>
<div class="brief-item">
<span class="brief-label">手机</span>
<span class="brief-value">
<SensitiveText
:record="patient"
field="mobile"
:show-eye="false"
/>
</span>
<div class="brief-meta">
<div class="brief-item">
<span class="brief-label">门诊号</span>
<span class="brief-value">{{ register?.order_no || '—' }}</span>
</div>
<div class="brief-item">
<span class="brief-label">日期</span>
<span class="brief-value">{{ visitDate }}</span>
</div>
<div class="brief-item">
<span class="brief-label">费别</span>
<Tag :color="Number(category) === 2 ? 'blue' : 'default'" class="m-0">
{{ categoryText }}
</Tag>
</div>
<div class="brief-item">
<span class="brief-label">姓名</span>
<span class="brief-value brief-name">{{ patient?.name || '—' }}</span>
</div>
<div class="brief-item">
<span class="brief-label">性别</span>
<span class="brief-value">{{ sexText }}</span>
</div>
<div class="brief-item">
<span class="brief-label">年龄</span>
<span class="brief-value">{{ patient?.age ?? '—' }}</span>
</div>
<div class="brief-item">
<span class="brief-label">手机</span>
<span class="brief-value">
<SensitiveText
:record="patient"
field="mobile"
:show-eye="false"
/>
</span>
</div>
</div>
</div>
</template>
<style scoped>
.patient-brief-bar {
display: flex;
flex-wrap: wrap;
gap: 8px 16px;
align-items: center;
padding: 10px 14px;
padding: 10px 14px 12px;
margin-bottom: 12px;
background: hsl(var(--muted) / 0.35);
border: 1px solid hsl(var(--border));
border-radius: 8px;
}
.brief-header {
text-align: center;
margin-bottom: 10px;
padding-bottom: 8px;
border-bottom: 1px solid hsl(var(--border) / 0.7);
}
.brief-clinic {
font-size: 15px;
font-weight: 600;
line-height: 1.4;
color: hsl(var(--foreground));
letter-spacing: 0.02em;
}
.brief-rx-type {
margin-top: 2px;
font-size: 18px;
font-weight: 700;
line-height: 1.35;
color: hsl(var(--foreground));
letter-spacing: 0.06em;
}
.brief-meta {
display: flex;
flex-wrap: wrap;
gap: 8px 16px;
align-items: center;
}
.brief-item {
display: inline-flex;
gap: 6px;

View File

@@ -269,6 +269,12 @@ function focusActiveCategoryTab() {
const userStore = useUserStore();
const myStoreId = ref(userStore.userInfo.store_id);
/** 当前选中门店名称,供开方抬头居中展示 */
const currentStoreName = computed(() => {
const list = myStoreList.value as Array<{ id: number; name?: string }>;
const hit = list.find((s) => Number(s.id) === Number(myStoreId.value));
return hit?.name || '';
});
loadPrescriptionTypeOptions();
/** 当前取价门店是否允许查看毛利率0/1 */
const seeRate = ref(0);
@@ -2828,6 +2834,8 @@ function onStoreSelectOpenChange(open: boolean) {
:register="patientInfo"
:patient="activePatient"
:category="category"
:store-name="currentStoreName"
:is-online="false"
/>
<div class="prescription-header flex flex-wrap gap-2">
<Button
@@ -2877,6 +2885,8 @@ function onStoreSelectOpenChange(open: boolean) {
:register="patientInfo"
:patient="activePatient"
:category="category"
:store-name="currentStoreName"
:is-online="false"
/>
<template v-if="prescriptionTypeAllowed">
<!-- 一级 Tab + 右侧紧凑操作吸顶 -->