更新
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
@@ -182,6 +182,14 @@
|
||||
/>
|
||||
<span v-else class="rx-bot-reviewer-name">{{ reviewerName }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="showPharmacistSample"
|
||||
class="rx-bot-cell rx-bot-reviewer rx-pharmacist-sample"
|
||||
data-html2canvas-ignore="true"
|
||||
>
|
||||
<span class="rx-bot-label rx-bot-label--inline">药师</span>
|
||||
<img :src="pharmacistImage" alt="签名预览" class="rx-bot-sign-img" />
|
||||
</div>
|
||||
<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>
|
||||
@@ -206,9 +214,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import type { PrescriptionEsignStatus } from '@/api/tcm'
|
||||
// 来源:https://gz-1349751149.cos.ap-guangzhou.myqcloud.com/uploads/images/20261203/2026120314015402c2e8093.png
|
||||
import pharmacistImage from '@/assets/images/pharmacist-signature-20261203.png'
|
||||
import {
|
||||
getAuxHerbs,
|
||||
getMainHerbs,
|
||||
getSlipHerbs,
|
||||
rxAdviceText,
|
||||
rxAppointmentFlowText,
|
||||
rxAuxUsageText,
|
||||
@@ -241,6 +252,7 @@ const props = withDefaults(
|
||||
/** 抬头(处方联) */
|
||||
title?: string
|
||||
compact?: boolean
|
||||
showPharmacistSignatureSample?: boolean
|
||||
}>(),
|
||||
{
|
||||
variant: 'internal',
|
||||
@@ -279,6 +291,18 @@ const reviewerSignature = computed(() => {
|
||||
const signature = props.data?.esign?.review_signature
|
||||
return reviewerName.value && isVerifiedSignaturePng(signature) && signature !== failedReviewerSignature.value ? signature : ''
|
||||
})
|
||||
const showPharmacistSample = computed(() => {
|
||||
const data = props.data
|
||||
const signing: PrescriptionEsignStatus | undefined = data?.esign
|
||||
if (!props.showPharmacistSignatureSample || !data || signing?.status !== 'legacy'
|
||||
|| signing.required !== false || signing.can_download !== false || !getSlipHerbs(data).length
|
||||
|| Number(data.is_system_auto) === 1 || Number(data.void_status) === 1 || Number(data.audit_status) === 2) return false
|
||||
if (signing.review_state === 'signed' || Number(signing.review_signature_time) > 0
|
||||
|| signing.review_signature || signing.review_signer_name) return false
|
||||
return Number(data.audit_status) === 1
|
||||
|| (Number(signing.review_submitted_at ?? data.review_submitted_at) > 0
|
||||
&& typeof data.doctor_signature === 'string' && data.doctor_signature.trim() !== '')
|
||||
})
|
||||
|
||||
function isVerifiedSignaturePng(signature: unknown): signature is string {
|
||||
return typeof signature === 'string' && /^data:image\/png;base64,iVBORw0KGgo[A-Za-z0-9+/]+={0,2}$/.test(signature)
|
||||
@@ -654,6 +678,7 @@ defineExpose({
|
||||
}
|
||||
|
||||
.rx-bot-row-1 {
|
||||
--rx-reviewed-columns: minmax(164px, 1.15fr) minmax(188px, 1.3fr) 1.4fr 0.75fr 0.85fr;
|
||||
/* 类型/剂数/单剂量 三个 meta 列适当加宽,
|
||||
* 避免"浓缩丸-浓缩水丸"被强制折行后把整行挤错位 */
|
||||
grid-template-columns: 1.6fr 0.6fr 0.6fr 0.6fr 0.6fr 1.7fr 0.95fr 1.25fr;
|
||||
@@ -661,15 +686,18 @@ defineExpose({
|
||||
}
|
||||
|
||||
.rx-bot-row-1--user {
|
||||
--rx-reviewed-columns: minmax(164px, 1.6fr) minmax(188px, 1.6fr) 0.6fr;
|
||||
grid-template-columns: 1.6fr 0.6fr;
|
||||
}
|
||||
|
||||
.rx-bot-row-1--reviewed {
|
||||
grid-template-columns: minmax(164px, 1.15fr) minmax(188px, 1.3fr) 1.4fr 0.75fr 0.85fr;
|
||||
grid-template-columns: var(--rx-reviewed-columns);
|
||||
}
|
||||
|
||||
.rx-bot-row-1--user.rx-bot-row-1--reviewed {
|
||||
grid-template-columns: minmax(164px, 1.6fr) minmax(188px, 1.6fr) 0.6fr;
|
||||
@media screen {
|
||||
.rx-bot-row-1:has(> .rx-pharmacist-sample) {
|
||||
grid-template-columns: var(--rx-reviewed-columns);
|
||||
}
|
||||
}
|
||||
|
||||
.rx-hospital-row {
|
||||
@@ -769,6 +797,12 @@ defineExpose({
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.rx-pharmacist-sample {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.rx-bot-meta {
|
||||
flex-wrap: nowrap;
|
||||
|
||||
|
||||
@@ -496,10 +496,21 @@
|
||||
:before-leave="() => !downloadingSlip"
|
||||
>
|
||||
<el-tab-pane label="药房联" name="internal">
|
||||
<PrescriptionSlip v-if="prescriptionTabType === 'internal'" ref="rxSlipRef" :data="slipView" />
|
||||
<PrescriptionSlip
|
||||
v-if="prescriptionTabType === 'internal'"
|
||||
ref="rxSlipRef"
|
||||
:data="slipView"
|
||||
:show-pharmacist-signature-sample="!viewDetailLoading && !viewDetailError"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="处方联" name="user">
|
||||
<PrescriptionSlip v-if="prescriptionTabType === 'user'" ref="rxSlipRef" :data="slipView" variant="user" />
|
||||
<PrescriptionSlip
|
||||
v-if="prescriptionTabType === 'user'"
|
||||
ref="rxSlipRef"
|
||||
:data="slipView"
|
||||
variant="user"
|
||||
:show-pharmacist-signature-sample="!viewDetailLoading && !viewDetailError"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
@@ -1922,6 +1922,7 @@
|
||||
:variant="prescriptionTabType"
|
||||
:aux-library-name="slipAuxLibraryName"
|
||||
:title="SLIP_TITLE"
|
||||
show-pharmacist-signature-sample
|
||||
/>
|
||||
|
||||
<!-- 审核痕迹(不进入导出) -->
|
||||
|
||||
@@ -2559,6 +2559,7 @@
|
||||
:data="prescriptionViewData"
|
||||
:variant="prescriptionTabType"
|
||||
:title="SLIP_TITLE"
|
||||
show-pharmacist-signature-sample
|
||||
/>
|
||||
|
||||
<!-- 审核痕迹(不进入导出) -->
|
||||
|
||||
@@ -1305,6 +1305,48 @@ test('both slips use verified physician and pharmacist PNGs and fall back to the
|
||||
assert.equal(reviewerName.value, '测试药师')
|
||||
})
|
||||
|
||||
test('only issued prescriptions without physician CA or a pharmacist signature display the sample', () => {
|
||||
const legacy = status({ status: 'legacy', required: false })
|
||||
const signed = status({ status: 'signed', can_download: true, review_required: true, review_state: 'pending' })
|
||||
const base = { audit_status: 1, void_status: 0, is_system_auto: 0, herbs: [{ name: '测试药材', dosage: 1 }], esign: legacy }
|
||||
const props = vue.reactive({ data: base, showPharmacistSignatureSample: true })
|
||||
const { getSlipHerbs } = loadModule('components/prescription-slip/utils.ts', {})
|
||||
const { showPharmacistSample } = pageDeclarations('components/prescription-slip/index.vue', ['showPharmacistSample'],
|
||||
{ computed: vue.computed, props, getSlipHerbs })
|
||||
|
||||
assert.equal(showPharmacistSample.value, true)
|
||||
props.showPharmacistSignatureSample = false
|
||||
assert.equal(showPharmacistSample.value, false)
|
||||
props.showPharmacistSignatureSample = true
|
||||
props.data = { ...base, audit_status: 0, esign: signed }
|
||||
assert.equal(showPharmacistSample.value, false)
|
||||
props.data = { ...base, audit_status: 0, doctor_signature: 'signature.png', review_submitted_at: 123 }
|
||||
assert.equal(showPharmacistSample.value, true)
|
||||
|
||||
for (const update of [
|
||||
{ audit_status: 0 }, { void_status: 1 }, { audit_status: 2 }, { herbs: [] }, { is_system_auto: 1 },
|
||||
{ esign: status({ awaiting_upload: true }) }, { esign: signed },
|
||||
{ esign: { ...signed, review_required: false, review_state: undefined } },
|
||||
{ esign: { ...legacy, required: true } }, { esign: { ...legacy, can_download: true } },
|
||||
{ esign: { ...legacy, review_state: 'signed' } }, { esign: { ...legacy, review_signature_time: 123 } },
|
||||
{ esign: { ...legacy, review_signer_name: '已签署药师' } }, { esign: { ...legacy, review_signature: 'seal' } }
|
||||
]) {
|
||||
props.data = { ...base, ...update }
|
||||
assert.equal(showPharmacistSample.value, false, JSON.stringify(update))
|
||||
}
|
||||
})
|
||||
|
||||
test('issued and order previews opt into the sample and the slip excludes it from exports', () => {
|
||||
const source = (file) => fs.readFileSync(path.join(__dirname, '../src', file), 'utf8')
|
||||
const paths = ['index.vue', 'order_list.vue', 'order_list_h5.vue']
|
||||
for (const filename of paths) {
|
||||
assert.match(source(`views/consumer/prescription/${filename}`), /<PrescriptionSlip[^>]+show-pharmacist-signature-sample/)
|
||||
}
|
||||
const slip = source('components/prescription-slip/index.vue')
|
||||
assert.match(slip, /rx-bot-doctor[\s\S]*v-else-if="showPharmacistSample"[^>]*data-html2canvas-ignore="true"[\s\S]*rx-bot-meta/)
|
||||
assert.match(slip, /@media print\s*\{\s*\.rx-pharmacist-sample\s*\{\s*display: none;/)
|
||||
})
|
||||
|
||||
test('the slip reloads a newly verified physician seal once from prescription detail', async () => {
|
||||
const requests = []
|
||||
const { updatePrescriptionSlipEsign } = loadModule('utils/prescription-esign.ts', { '@/api/tcm': {
|
||||
|
||||
Reference in New Issue
Block a user