更新
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
<template>
|
||||
<div ref="paperRef" class="rx-paper">
|
||||
<div class="rx-title">{{ isInternal ? '药房联' : slipTitle }}</div>
|
||||
<div class="rx-notice">
|
||||
<span class="rx-notice-text">
|
||||
服药前请核对姓名、电话、医生等信息以及服法、医嘱等要点
|
||||
{{
|
||||
isInternal
|
||||
? '服药前请核对姓名、电话、医生等信息以及服法、医嘱等要点'
|
||||
: '服药前请核对姓名、电话、医生等信息以及医嘱等要点'
|
||||
}}
|
||||
</span>
|
||||
<span class="rx-notice-meta">
|
||||
<span>日期:{{ dateText }}</span>
|
||||
@@ -44,63 +49,98 @@
|
||||
</div>
|
||||
|
||||
<div class="rx-rp">
|
||||
<div class="rx-watermark">药房联</div>
|
||||
<div class="rx-watermark">{{ isInternal ? '药房联' : '处方联' }}</div>
|
||||
<div class="rx-rp-head">
|
||||
<div class="rx-rp-label">Rp.</div>
|
||||
<div class="rx-rp-cols-head">
|
||||
<div class="rx-rp-col-head">
|
||||
<span>用药 (单剂)</span>
|
||||
<span>总量</span>
|
||||
<span>{{ isInternal ? '总量' : '用量' }}</span>
|
||||
</div>
|
||||
<div class="rx-rp-col-head">
|
||||
<span>用药 (单剂)</span>
|
||||
<span>总量</span>
|
||||
<span>{{ isInternal ? '总量' : '用量' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rx-herbs">
|
||||
<template v-if="mainHerbs.length">
|
||||
<div class="rx-herb-section-label">主方</div>
|
||||
<div
|
||||
v-for="(h, i) in mainHerbs"
|
||||
:key="'main-' + i"
|
||||
class="rx-herb-cell"
|
||||
>
|
||||
<span class="rx-herb-name">{{ h.name }} ({{ h.dosage }}克)</span>
|
||||
<span class="rx-herb-total">{{ herbTotal(h.dosage) }}克</span>
|
||||
</div>
|
||||
<template v-if="isInternal">
|
||||
<template v-if="mainHerbs.length">
|
||||
<div class="rx-herb-section-label">主方</div>
|
||||
<div
|
||||
v-for="(h, i) in mainHerbs"
|
||||
:key="'main-' + i"
|
||||
class="rx-herb-cell"
|
||||
>
|
||||
<span class="rx-herb-name">{{ h.name }} ({{ h.dosage }}克)</span>
|
||||
<span class="rx-herb-total">{{ herbTotal(h.dosage) }}克</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="auxHerbs.length">
|
||||
<div class="rx-herb-section-label rx-herb-section-label--aux">
|
||||
辅方
|
||||
<span v-if="auxLibraryName" class="rx-herb-library-name">({{ auxLibraryName }})</span>
|
||||
</div>
|
||||
<div
|
||||
v-for="(h, i) in auxHerbs"
|
||||
:key="'aux-' + i"
|
||||
class="rx-herb-cell"
|
||||
>
|
||||
<span class="rx-herb-name">{{ h.name }} ({{ h.dosage }}克)</span>
|
||||
<span class="rx-herb-total">{{ herbTotal(h.dosage) }}克</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="auxHerbs.length">
|
||||
<div class="rx-herb-section-label rx-herb-section-label--aux">辅方</div>
|
||||
<div
|
||||
v-for="(h, i) in auxHerbs"
|
||||
:key="'aux-' + i"
|
||||
class="rx-herb-cell"
|
||||
>
|
||||
<span class="rx-herb-name">{{ h.name }} ({{ h.dosage }}克)</span>
|
||||
<span class="rx-herb-total">{{ herbTotal(h.dosage) }}克</span>
|
||||
</div>
|
||||
<template v-else>
|
||||
<template v-if="mainHerbs.length">
|
||||
<div class="rx-herb-section-label">主方</div>
|
||||
<div
|
||||
v-for="(h, i) in mainHerbs"
|
||||
:key="'user-main-' + i"
|
||||
class="rx-herb-cell"
|
||||
>
|
||||
<span class="rx-herb-name">{{ h.name }}</span>
|
||||
<span class="rx-herb-total">{{ h.dosage }}克</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="auxHerbs.length">
|
||||
<div class="rx-herb-section-label rx-herb-section-label--aux">辅方</div>
|
||||
<div
|
||||
v-for="(h, i) in auxHerbs"
|
||||
:key="'user-aux-' + i"
|
||||
class="rx-herb-cell"
|
||||
>
|
||||
<span class="rx-herb-name">{{ h.name }}</span>
|
||||
<span class="rx-herb-total">{{ h.dosage }}克</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rx-text">
|
||||
<p>主方服法:{{ usageText }}</p>
|
||||
<p v-if="auxUsageText">辅方服法:{{ auxUsageText }}</p>
|
||||
<template v-if="isInternal">
|
||||
<p v-if="auxUsageText">主服法:{{ usageText }}</p>
|
||||
<p v-else>服法:{{ usageText }}</p>
|
||||
<p v-if="auxUsageText">辅服法:{{ auxUsageText }}</p>
|
||||
</template>
|
||||
<p v-if="adviceText">医嘱:{{ adviceText }}</p>
|
||||
<p v-if="dietaryText">忌口:{{ dietaryText }}</p>
|
||||
<p v-if="remarkText">备注:{{ remarkText }}</p>
|
||||
<p v-if="isInternal && remarkText">备注:{{ remarkText }}</p>
|
||||
<p v-if="pharmacyRemarkText" class="rx-text-warn">
|
||||
药房备注:{{ pharmacyRemarkText }}
|
||||
</p>
|
||||
<p v-if="outPelletText" class="rx-text-warn">
|
||||
<p
|
||||
v-if="isInternal && outPelletText && data?.prescription_type !== '饮片'"
|
||||
class="rx-text-warn"
|
||||
>
|
||||
出丸:{{ outPelletText }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="rx-bottom">
|
||||
<div class="rx-bot-row rx-bot-row-1">
|
||||
<div class="rx-bot-row rx-bot-row-1" :class="{ 'rx-bot-row-1--user': !isInternal }">
|
||||
<div class="rx-bot-cell rx-bot-stack rx-bot-doctor">
|
||||
<div class="rx-bot-label">医师</div>
|
||||
<div class="rx-bot-doctor-body">
|
||||
@@ -115,19 +155,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rx-bot-cell rx-bot-meta">
|
||||
<div v-if="isInternal" class="rx-bot-cell rx-bot-meta">
|
||||
<span class="rx-bot-meta-key">类型:</span>
|
||||
<span class="rx-bot-meta-val">{{ typeText }}</span>
|
||||
</div>
|
||||
<div class="rx-bot-cell rx-bot-meta">
|
||||
<span class="rx-bot-meta-key">天数:</span>
|
||||
<span class="rx-bot-meta-val">{{ data?.dose_count || '—' }}剂</span>
|
||||
<span class="rx-bot-meta-val">{{ daysText }}</span>
|
||||
</div>
|
||||
<div class="rx-bot-cell rx-bot-meta">
|
||||
<span class="rx-bot-meta-key">单剂量:</span>
|
||||
<div v-if="isInternal" class="rx-bot-cell rx-bot-meta">
|
||||
<span class="rx-bot-meta-key">剂量:</span>
|
||||
<span class="rx-bot-meta-val">{{ perDoseAmount }}克</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rx-bot-row rx-hospital-row">
|
||||
<div class="rx-hospital-line">成都双流甄养堂互联网医院有限公司 联系方式:4001667339</div>
|
||||
<div class="rx-hospital-line">地址:四川省成都市双流区黄甲街道黄龙大道二段280号</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -156,12 +200,27 @@ import {
|
||||
|
||||
defineOptions({ name: 'PrescriptionSlip' })
|
||||
|
||||
const props = defineProps<{
|
||||
/** 处方详情 / 列表行(字段与 tcm.prescription/detail 对齐) */
|
||||
data: Record<string, any> | null | undefined
|
||||
}>()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
/** 处方详情 / 列表行(字段与 tcm.prescription/detail 对齐) */
|
||||
data: Record<string, any> | null | undefined
|
||||
/** 药房联 internal / 处方联 user */
|
||||
variant?: 'internal' | 'user'
|
||||
/** 药房联辅方处方库名称 */
|
||||
auxLibraryName?: string
|
||||
/** 抬头(处方联) */
|
||||
title?: string
|
||||
}>(),
|
||||
{
|
||||
variant: 'internal',
|
||||
auxLibraryName: '',
|
||||
title: '成都双流甄养堂互联网医院 处方笺'
|
||||
}
|
||||
)
|
||||
|
||||
const paperRef = ref<HTMLElement | null>(null)
|
||||
const isInternal = computed(() => props.variant !== 'user')
|
||||
const slipTitle = computed(() => props.title || '成都双流甄养堂互联网医院 处方笺')
|
||||
|
||||
const dateText = computed(() => rxDateText(props.data))
|
||||
const serialText = computed(() => rxSerialText(props.data))
|
||||
@@ -179,6 +238,17 @@ const pharmacyRemarkText = computed(() => rxPharmacyRemarkText(props.data))
|
||||
const outPelletText = computed(() => rxOutPelletText(props.data))
|
||||
const typeText = computed(() => rxTypeText(props.data))
|
||||
const perDoseAmount = computed(() => rxPerDoseAmount(props.data))
|
||||
const daysText = computed(() => {
|
||||
const md = props.data?.medication_days
|
||||
if (md != null && String(md).trim() !== '') {
|
||||
return `${md} 天`
|
||||
}
|
||||
const dose = props.data?.dose_count
|
||||
if (dose != null && String(dose).trim() !== '') {
|
||||
return `${dose}剂`
|
||||
}
|
||||
return '—'
|
||||
})
|
||||
|
||||
function herbTotal(dosage: number | string) {
|
||||
return rxHerbTotal(props.data, dosage)
|
||||
@@ -194,9 +264,8 @@ defineExpose({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* ============================================================
|
||||
* 处方笺(A4 药房联)样式
|
||||
* 处方笺(A4 药房联 / 处方联)样式
|
||||
* 严格按 A4:210mm × 297mm,padding 8mm 10mm
|
||||
* 唯一视觉基准:consumer/prescription/index.vue
|
||||
* ============================================================ */
|
||||
.rx-paper {
|
||||
width: 210mm;
|
||||
@@ -214,6 +283,15 @@ defineExpose({
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.rx-title {
|
||||
text-align: center;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.12em;
|
||||
margin: 0 0 8px;
|
||||
color: #1f1f1f;
|
||||
}
|
||||
|
||||
.rx-notice {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -374,6 +452,11 @@ defineExpose({
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.rx-herb-library-name {
|
||||
font-weight: 500;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.rx-herb-cell {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 64px;
|
||||
@@ -430,10 +513,14 @@ defineExpose({
|
||||
}
|
||||
|
||||
.rx-bot-row-1 {
|
||||
grid-template-columns: 1.4fr 0.6fr 0.6fr 0.6fr 0.6fr 1.7fr 0.95fr 1.25fr;
|
||||
grid-template-columns: 1.6fr 0.9fr 0.9fr 0.9fr;
|
||||
min-height: 70px;
|
||||
}
|
||||
|
||||
.rx-bot-row-1--user {
|
||||
grid-template-columns: 2fr 1fr;
|
||||
}
|
||||
|
||||
.rx-bot-cell {
|
||||
border-right: 1px solid #c8c8c8;
|
||||
padding: 6px 10px;
|
||||
@@ -504,6 +591,18 @@ defineExpose({
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
.rx-hospital-row {
|
||||
display: block;
|
||||
padding: 8px 10px;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.rx-hospital-line {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
line-height: 1.7;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- 全局打印样式:body * 选择器不能放进 scoped -->
|
||||
|
||||
Reference in New Issue
Block a user