更新
This commit is contained in:
@@ -762,7 +762,7 @@ const formData = reactive<PrescriptionForm>({
|
||||
appointment_id: 0,
|
||||
prescription_name: '',
|
||||
prescription_type: '浓缩水丸',
|
||||
dosage_amount: 1,
|
||||
dosage_amount: 10,
|
||||
dosage_unit: 'g',
|
||||
need_decoction: false,
|
||||
bags_per_dose: 1,
|
||||
@@ -952,6 +952,8 @@ const open = async (data: any, options?: { templateId?: number; stationName?: st
|
||||
formData.appointment_id = appointmentId
|
||||
formData.prescription_name = ''
|
||||
formData.prescription_type = '浓缩水丸'
|
||||
formData.dosage_unit = 'g'
|
||||
formData.dosage_amount = 10
|
||||
formData.patient_name = data.patient_name || diagnosis.patient_name || ''
|
||||
formData.gender = data.patient_gender ?? diagnosis.gender ?? 0
|
||||
formData.gender_desc = formData.gender === 1 ? '男' : '女'
|
||||
@@ -969,8 +971,8 @@ const open = async (data: any, options?: { templateId?: number; stationName?: st
|
||||
formData.dose_count = 1
|
||||
formData.dose_unit = '剂'
|
||||
formData.usage_days = 7
|
||||
formData.usage_instruction = '水煎服,一日二次'
|
||||
formData.usage_time = '饭前'
|
||||
formData.usage_instruction = ''
|
||||
formData.usage_time = '饭后'
|
||||
formData.usage_way = '温水送服'
|
||||
formData.dietary_taboo = []
|
||||
formData.usage_notes = ''
|
||||
@@ -1203,7 +1205,7 @@ watch(showLibraryDialog, (newVal) => {
|
||||
watch(() => formData.prescription_type, (newType) => {
|
||||
if (newType === '浓缩水丸') {
|
||||
formData.dosage_unit = 'g'
|
||||
formData.dosage_amount = 1
|
||||
formData.dosage_amount = 10
|
||||
formData.need_decoction = false
|
||||
formData.bags_per_dose = 1
|
||||
} else if (newType === '饮片') {
|
||||
@@ -1349,6 +1351,16 @@ const handleNewPrescription = async () => {
|
||||
formData.appointment_id = saved.appointment_id ?? formData.appointment_id
|
||||
formData.prescription_name = ''
|
||||
formData.prescription_type = saved.prescription_type || '浓缩水丸'
|
||||
if (formData.prescription_type === '浓缩水丸') {
|
||||
formData.dosage_unit = 'g'
|
||||
formData.dosage_amount = 10
|
||||
} else if (formData.prescription_type === '饮片') {
|
||||
formData.dosage_unit = 'ml'
|
||||
formData.dosage_amount = 50
|
||||
} else {
|
||||
formData.dosage_unit = 'g'
|
||||
formData.dosage_amount = undefined
|
||||
}
|
||||
formData.patient_name = saved.patient_name || ''
|
||||
formData.gender = saved.gender ?? 0
|
||||
formData.gender_desc = saved.gender === 1 ? '男' : '女'
|
||||
|
||||
@@ -559,9 +559,9 @@
|
||||
</el-button>
|
||||
<el-table :data="editForm.herbs" class="mt-2" border>
|
||||
<el-table-column label="序号" type="index" width="60" />
|
||||
<el-table-column label="药材名称" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-input v-model="row.name" placeholder="请输入药材名称" />
|
||||
<el-table-column label="药材名称" min-width="220">
|
||||
<template #default="{ row }">
|
||||
<MedicineNameSelect v-model="row.name" class="w-full" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剂量(克)" min-width="120">
|
||||
@@ -795,41 +795,22 @@
|
||||
<el-form-item label="医师姓名" prop="doctor_name">
|
||||
<el-input v-model="editForm.doctor_name" placeholder="请输入医师姓名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否共享" prop="is_shared">
|
||||
<el-switch
|
||||
v-model="editForm.is_shared"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="所有人可见"
|
||||
inactive-text="仅自己可见"
|
||||
/>
|
||||
<div class="text-xs text-gray-400 mt-1">
|
||||
勾选后,所有医生都可以查看和使用此处方模板
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="指定可见角色" prop="visible_role_ids">
|
||||
<el-select
|
||||
v-model="editForm.visible_role_ids"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="不选则除创建者外仅按「是否共享」规则;可多选角色"
|
||||
class="w-full"
|
||||
>
|
||||
<el-option
|
||||
v-for="r in roleOptions"
|
||||
:key="r.id"
|
||||
:label="r.name"
|
||||
:value="r.id"
|
||||
<el-form-item label="医师签名" prop="doctor_signature" required>
|
||||
<div class="signature-pad-wrap">
|
||||
<canvas
|
||||
ref="signatureCanvasRef"
|
||||
class="signature-canvas"
|
||||
@pointerdown.prevent="onSignaturePointerDown"
|
||||
@pointermove.prevent="onSignaturePointerMove"
|
||||
@pointerup.prevent="onSignaturePointerUp"
|
||||
@pointercancel.prevent="onSignaturePointerUp"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="text-xs text-gray-400 mt-1">
|
||||
未共享时:所选角色下的账号也可在列表中查看此处方(与创建者并列)
|
||||
<div class="signature-actions">
|
||||
<el-button size="small" @click="clearSignature">清空签名</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-xs text-amber-600 mt-1">* 必填,请在框内手写医师签名</div>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
@@ -1282,6 +1263,7 @@ import useUserStore from '@/stores/modules/user'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import DaterangePicker from '@/components/daterange-picker/index.vue'
|
||||
import MedicineNameSelect from '@/components/medicine-name-select/index.vue'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { computed, onMounted, reactive, ref, watch, nextTick, defineAsyncComponent } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -1330,6 +1312,12 @@ const showEdit = ref(false)
|
||||
const editMode = ref<'add' | 'edit' | 'view'>('add')
|
||||
const submitLoading = ref(false)
|
||||
const formRef = ref<FormInstance>()
|
||||
const signatureCanvasRef = ref<HTMLCanvasElement>()
|
||||
/** 当前一笔的 pointerId(配合 setPointerCapture,移出画布仍跟手) */
|
||||
const signatureActivePointerId = ref<number | null>(null)
|
||||
/** 签名板 CSS 像素尺寸(内部分辨率按 DPR 放大,触摸更跟手) */
|
||||
const SIGNATURE_CSS_W = 560
|
||||
const SIGNATURE_CSS_H = 168
|
||||
/** 查看模式:处方笺数据源(先列表行,再详情覆盖) */
|
||||
const slipView = ref<Record<string, any> | null>(null)
|
||||
const viewDetailLoading = ref(false)
|
||||
@@ -1890,12 +1878,14 @@ const editForm = reactive({
|
||||
dose_count: 7,
|
||||
dose_unit: '剂',
|
||||
usage_days: 7,
|
||||
usage_instruction: '水煎服,一日二次',
|
||||
usage_time: '饭前',
|
||||
usage_instruction: '',
|
||||
usage_time: '饭后',
|
||||
usage_way: '温水送服',
|
||||
dietary_taboo: [] as string[],
|
||||
usage_notes: '',
|
||||
doctor_name: '',
|
||||
/** 医师电子签名 PNG data URL(与诊间处方一致) */
|
||||
doctor_signature: '',
|
||||
is_shared: 0,
|
||||
visible_role_ids: [] as number[],
|
||||
audit_status: 1,
|
||||
@@ -1973,6 +1963,19 @@ const rules: FormRules = {
|
||||
],
|
||||
doctor_name: [
|
||||
{ required: true, message: '请输入医师姓名', trigger: 'blur' }
|
||||
],
|
||||
doctor_signature: [
|
||||
{
|
||||
required: true,
|
||||
validator: (_rule, v, cb) => {
|
||||
if (!v || !String(v).trim()) {
|
||||
cb(new Error('请使用电子签名板手写医师签名'))
|
||||
} else {
|
||||
cb()
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2186,6 +2189,124 @@ function rowToSlipView(row: any) {
|
||||
|
||||
function onEditDialogClosed() {
|
||||
slipView.value = null
|
||||
signatureActivePointerId.value = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名坐标:与 initSignatureCanvas 里 ctx.scale(dpr) 后的「逻辑像素」一致(0…SIGNATURE_CSS_W/H),
|
||||
* 不能用 canvas.width/rect.width(会把 dpr 乘两次,笔画和鼠标严重错位)。
|
||||
*/
|
||||
function getSignatureLocalPoint(e: PointerEvent) {
|
||||
const canvas = signatureCanvasRef.value
|
||||
if (!canvas) return { x: 0, y: 0 }
|
||||
const rect = canvas.getBoundingClientRect()
|
||||
if (rect.width <= 0 || rect.height <= 0) return { x: 0, y: 0 }
|
||||
const x = ((e.clientX - rect.left) / rect.width) * SIGNATURE_CSS_W
|
||||
const y = ((e.clientY - rect.top) / rect.height) * SIGNATURE_CSS_H
|
||||
return {
|
||||
x: Math.max(0, Math.min(SIGNATURE_CSS_W, x)),
|
||||
y: Math.max(0, Math.min(SIGNATURE_CSS_H, y))
|
||||
}
|
||||
}
|
||||
|
||||
function commitSignatureImage() {
|
||||
const canvas = signatureCanvasRef.value
|
||||
if (canvas) {
|
||||
editForm.doctor_signature = canvas.toDataURL('image/png')
|
||||
}
|
||||
nextTick(() => {
|
||||
formRef.value?.validateField('doctor_signature').catch(() => {})
|
||||
})
|
||||
}
|
||||
|
||||
function onSignaturePointerDown(e: PointerEvent) {
|
||||
if (e.pointerType === 'mouse' && e.button !== 0) return
|
||||
const canvas = signatureCanvasRef.value
|
||||
const ctx = canvas?.getContext('2d')
|
||||
if (!canvas || !ctx) return
|
||||
canvas.setPointerCapture(e.pointerId)
|
||||
signatureActivePointerId.value = e.pointerId
|
||||
const { x, y } = getSignatureLocalPoint(e)
|
||||
ctx.beginPath()
|
||||
ctx.moveTo(x, y)
|
||||
}
|
||||
|
||||
function onSignaturePointerMove(e: PointerEvent) {
|
||||
if (signatureActivePointerId.value !== e.pointerId) return
|
||||
const ctx = signatureCanvasRef.value?.getContext('2d')
|
||||
if (!ctx) return
|
||||
const { x, y } = getSignatureLocalPoint(e)
|
||||
ctx.lineTo(x, y)
|
||||
ctx.stroke()
|
||||
ctx.beginPath()
|
||||
ctx.moveTo(x, y)
|
||||
}
|
||||
|
||||
function onSignaturePointerUp(e: PointerEvent) {
|
||||
if (signatureActivePointerId.value !== e.pointerId) return
|
||||
signatureActivePointerId.value = null
|
||||
const canvas = signatureCanvasRef.value
|
||||
if (canvas) {
|
||||
try {
|
||||
canvas.releasePointerCapture(e.pointerId)
|
||||
} catch {
|
||||
/* 已释放 */
|
||||
}
|
||||
}
|
||||
commitSignatureImage()
|
||||
}
|
||||
|
||||
function clearSignature() {
|
||||
initSignatureCanvas()
|
||||
editForm.doctor_signature = ''
|
||||
nextTick(() => {
|
||||
formRef.value?.validateField('doctor_signature').catch(() => {})
|
||||
})
|
||||
}
|
||||
|
||||
function initSignatureCanvas() {
|
||||
const canvas = signatureCanvasRef.value
|
||||
if (!canvas) return
|
||||
const dpr = Math.min(typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1, 2.5)
|
||||
canvas.style.width = `${SIGNATURE_CSS_W}px`
|
||||
canvas.style.height = `${SIGNATURE_CSS_H}px`
|
||||
canvas.width = Math.round(SIGNATURE_CSS_W * dpr)
|
||||
canvas.height = Math.round(SIGNATURE_CSS_H * dpr)
|
||||
const ctx = canvas.getContext('2d')
|
||||
if (!ctx) return
|
||||
ctx.setTransform(1, 0, 0, 1, 0, 0)
|
||||
ctx.scale(dpr, dpr)
|
||||
ctx.fillStyle = '#fff'
|
||||
ctx.fillRect(0, 0, SIGNATURE_CSS_W, SIGNATURE_CSS_H)
|
||||
ctx.strokeStyle = '#333'
|
||||
ctx.lineWidth = 2.5
|
||||
ctx.lineCap = 'round'
|
||||
ctx.lineJoin = 'round'
|
||||
}
|
||||
|
||||
/** 抽屉打开后初始化画布;编辑时若有已存签名则绘制到画布 */
|
||||
function scheduleEditSignatureInit() {
|
||||
if (editMode.value === 'view') return
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
initSignatureCanvas()
|
||||
const sig = editForm.doctor_signature
|
||||
if (sig && String(sig).trim().startsWith('data:image') && signatureCanvasRef.value) {
|
||||
const img = new Image()
|
||||
img.onload = () => {
|
||||
const canvas = signatureCanvasRef.value
|
||||
const ctx = canvas?.getContext('2d')
|
||||
if (!canvas || !ctx) return
|
||||
ctx.drawImage(img, 0, 0, SIGNATURE_CSS_W, SIGNATURE_CSS_H)
|
||||
commitSignatureImage()
|
||||
}
|
||||
img.onerror = () => {
|
||||
commitSignatureImage()
|
||||
}
|
||||
img.src = sig
|
||||
}
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
|
||||
function formatVisibleRoleNames(ids: number[] | undefined) {
|
||||
@@ -2386,6 +2507,7 @@ const resetForm = () => {
|
||||
editForm.dietary_taboo = []
|
||||
editForm.usage_notes = ''
|
||||
editForm.doctor_name = ''
|
||||
editForm.doctor_signature = ''
|
||||
editForm.is_shared = 0
|
||||
editForm.visible_role_ids = []
|
||||
editForm.audit_status = 1
|
||||
@@ -2402,6 +2524,7 @@ const resetForm = () => {
|
||||
// 新增处方
|
||||
const handleAdd = () => {
|
||||
resetForm()
|
||||
editForm.doctor_name = String(userStore.userInfo?.name || '')
|
||||
editingWasVoid.value = false
|
||||
editingWasRejected.value = false
|
||||
editMode.value = 'add'
|
||||
@@ -2410,6 +2533,7 @@ const handleAdd = () => {
|
||||
showEdit.value = true
|
||||
nextTick(() => {
|
||||
formRef.value?.clearValidate()
|
||||
scheduleEditSignatureInit()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2437,28 +2561,40 @@ const handleView = async (row: any) => {
|
||||
}
|
||||
|
||||
// 编辑处方
|
||||
const handleEdit = (row: any) => {
|
||||
const handleEdit = async (row: any) => {
|
||||
editingWasVoid.value = Number(row.void_status) === 1
|
||||
editingWasRejected.value = Number(row.audit_status) === 2
|
||||
editMode.value = 'edit'
|
||||
|
||||
// 开始加载数据,暂时禁用watch自动重置
|
||||
isLoadingData.value = true
|
||||
|
||||
let src = row
|
||||
if (row?.id && !row.doctor_signature) {
|
||||
try {
|
||||
const d = await prescriptionDetail({ id: row.id })
|
||||
if (d && typeof d === 'object') {
|
||||
src = { ...row, ...d }
|
||||
}
|
||||
} catch {
|
||||
/* 保持列表行 */
|
||||
}
|
||||
}
|
||||
|
||||
// 深拷贝数据到表单
|
||||
editForm.id = row.id
|
||||
editForm.prescription_type = row.prescription_type || '浓缩水丸'
|
||||
editForm.id = src.id
|
||||
editForm.prescription_type = src.prescription_type || '浓缩水丸'
|
||||
|
||||
// 确保 dosage_amount 是数字类型,以匹配下拉框的 :value
|
||||
if (row.dosage_amount !== null && row.dosage_amount !== undefined && row.dosage_amount !== '') {
|
||||
editForm.dosage_amount = Number(row.dosage_amount)
|
||||
if (src.dosage_amount !== null && src.dosage_amount !== undefined && src.dosage_amount !== '') {
|
||||
editForm.dosage_amount = Number(src.dosage_amount)
|
||||
} else {
|
||||
editForm.dosage_amount = undefined
|
||||
}
|
||||
|
||||
// 如果数据库中没有 dosage_unit,根据 prescription_type 设置默认值
|
||||
if (row.dosage_unit) {
|
||||
editForm.dosage_unit = row.dosage_unit
|
||||
if (src.dosage_unit) {
|
||||
editForm.dosage_unit = src.dosage_unit
|
||||
} else {
|
||||
if (editForm.prescription_type === '饮片') {
|
||||
editForm.dosage_unit = 'ml'
|
||||
@@ -2467,40 +2603,43 @@ const handleEdit = (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
editForm.need_decoction = row.need_decoction === 1 || row.need_decoction === true
|
||||
editForm.bags_per_dose = row.bags_per_dose ? Number(row.bags_per_dose) : 1
|
||||
editForm.patient_name = row.patient_name || ''
|
||||
editForm.gender = row.gender ?? 1
|
||||
editForm.age = row.age ?? 0
|
||||
editForm.visit_no = row.visit_no || ''
|
||||
editForm.prescription_date = row.prescription_date || ''
|
||||
editForm.tongue = row.tongue || ''
|
||||
editForm.tongue_image = row.tongue_image || ''
|
||||
editForm.pulse = row.pulse || ''
|
||||
editForm.pulse_condition = row.pulse_condition || ''
|
||||
editForm.clinical_diagnosis = row.clinical_diagnosis || ''
|
||||
editForm.herbs = row.herbs ? JSON.parse(JSON.stringify(row.herbs)) : []
|
||||
editForm.dose_count = row.dose_count ?? 7
|
||||
editForm.dose_unit = row.dose_unit || '剂'
|
||||
editForm.usage_days = row.usage_days ?? 7
|
||||
editForm.times_per_day = row.times_per_day ?? 2
|
||||
editForm.usage_instruction = row.usage_instruction || '水煎服,一日二次'
|
||||
editForm.usage_time = row.usage_time || '饭前'
|
||||
editForm.usage_way = row.usage_way || '温水送服'
|
||||
editForm.dietary_taboo = row.dietary_taboo ? (Array.isArray(row.dietary_taboo) ? row.dietary_taboo : row.dietary_taboo.split(',').filter((v: string) => v)) : []
|
||||
editForm.usage_notes = row.usage_notes || ''
|
||||
editForm.doctor_name = row.doctor_name || ''
|
||||
editForm.is_shared = row.is_shared ?? 0
|
||||
editForm.visible_role_ids = normalizeVisibleRoleIds(row)
|
||||
editForm.audit_status = row.audit_status ?? 1
|
||||
editForm.audit_time = row.audit_time ?? null
|
||||
editForm.audit_by_name = row.audit_by_name || ''
|
||||
editForm.audit_remark = row.audit_remark || ''
|
||||
editForm.diagnosis_id = row.diagnosis_id ?? 0
|
||||
editForm.creator_id = Number(row.creator_id) > 0 ? Number(row.creator_id) : 0
|
||||
editForm.is_system_auto = Number(row.is_system_auto) === 1 ? 1 : 0
|
||||
editForm.business_prescription_audit_rejected = Number(row.business_prescription_audit_rejected) === 1 ? 1 : 0
|
||||
editForm.business_prescription_audit_remark = String(row.business_prescription_audit_remark || '')
|
||||
editForm.need_decoction = src.need_decoction === 1 || src.need_decoction === true
|
||||
editForm.bags_per_dose = src.bags_per_dose ? Number(src.bags_per_dose) : 1
|
||||
editForm.patient_name = src.patient_name || ''
|
||||
editForm.gender = src.gender ?? 1
|
||||
editForm.age = src.age ?? 0
|
||||
editForm.visit_no = src.visit_no || ''
|
||||
editForm.prescription_date = src.prescription_date || ''
|
||||
editForm.tongue = src.tongue || ''
|
||||
editForm.tongue_image = src.tongue_image || ''
|
||||
editForm.pulse = src.pulse || ''
|
||||
editForm.pulse_condition = src.pulse_condition || ''
|
||||
editForm.clinical_diagnosis = src.clinical_diagnosis || ''
|
||||
editForm.herbs = src.herbs ? JSON.parse(JSON.stringify(src.herbs)) : []
|
||||
editForm.dose_count = src.dose_count ?? 7
|
||||
editForm.dose_unit = src.dose_unit || '剂'
|
||||
editForm.usage_days = src.usage_days ?? 7
|
||||
editForm.times_per_day = src.times_per_day ?? 2
|
||||
editForm.usage_instruction = src.usage_instruction || '水煎服,一日二次'
|
||||
editForm.usage_time = src.usage_time || '饭前'
|
||||
editForm.usage_way = src.usage_way || '温水送服'
|
||||
editForm.dietary_taboo = src.dietary_taboo
|
||||
? (Array.isArray(src.dietary_taboo) ? src.dietary_taboo : String(src.dietary_taboo).split(',').filter((v: string) => v))
|
||||
: []
|
||||
editForm.usage_notes = src.usage_notes || ''
|
||||
editForm.doctor_name = src.doctor_name || ''
|
||||
editForm.doctor_signature = String(src.doctor_signature || '')
|
||||
editForm.is_shared = src.is_shared ?? 0
|
||||
editForm.visible_role_ids = normalizeVisibleRoleIds(src)
|
||||
editForm.audit_status = src.audit_status ?? 1
|
||||
editForm.audit_time = src.audit_time ?? null
|
||||
editForm.audit_by_name = src.audit_by_name || ''
|
||||
editForm.audit_remark = src.audit_remark || ''
|
||||
editForm.diagnosis_id = src.diagnosis_id ?? 0
|
||||
editForm.creator_id = Number(src.creator_id) > 0 ? Number(src.creator_id) : 0
|
||||
editForm.is_system_auto = Number(src.is_system_auto) === 1 ? 1 : 0
|
||||
editForm.business_prescription_audit_rejected = Number(src.business_prescription_audit_rejected) === 1 ? 1 : 0
|
||||
editForm.business_prescription_audit_remark = String(src.business_prescription_audit_remark || '')
|
||||
|
||||
// 数据加载完成,重新启用watch
|
||||
// 使用 setTimeout 确保所有数据都已经渲染完成
|
||||
@@ -2511,6 +2650,7 @@ const handleEdit = (row: any) => {
|
||||
showEdit.value = true
|
||||
nextTick(() => {
|
||||
formRef.value?.clearValidate()
|
||||
scheduleEditSignatureInit()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3188,4 +3328,24 @@ onMounted(async () => {
|
||||
line-height: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.signature-pad-wrap {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
|
||||
.signature-canvas {
|
||||
display: block;
|
||||
cursor: crosshair;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.signature-actions {
|
||||
padding: 8px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1034,6 +1034,42 @@
|
||||
</el-button>
|
||||
<span class="text-xs text-gray-400">ID: {{ editForm.prescription_id || '—' }}</span>
|
||||
</div>
|
||||
<!-- 诊单创建人及所在部门(tcm_diagnosis.admin_id;接口为「全角;」多部门、每路径「父 / 子 / …」含上级) -->
|
||||
<div class="mt-2 space-y-2 text-xs sm:text-sm">
|
||||
<div class="flex flex-wrap items-baseline gap-x-2 gap-y-0.5">
|
||||
<span class="text-gray-500 shrink-0">诊单创建人</span>
|
||||
<span class="text-gray-800 font-medium">
|
||||
{{ editForm.diagnosis_creator_name || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="editDiagnosisCreatorDeptBreadcrumbs.length" class="space-y-1.5">
|
||||
<div class="text-gray-500">所在部门(含上级)</div>
|
||||
<div
|
||||
v-for="(segments, idx) in editDiagnosisCreatorDeptBreadcrumbs"
|
||||
:key="idx"
|
||||
class="pl-0 min-w-0"
|
||||
>
|
||||
<el-breadcrumb
|
||||
v-if="segments.length"
|
||||
class="po-diagnosis-creator-dept-breadcrumb text-[13px] leading-relaxed"
|
||||
separator="/"
|
||||
>
|
||||
<el-breadcrumb-item
|
||||
v-for="(name, j) in segments"
|
||||
:key="j"
|
||||
>
|
||||
<span class="text-gray-800 break-all">{{ name }}</span>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="text-gray-400"
|
||||
>
|
||||
所在部门:—
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="8">
|
||||
<el-form-item label="复诊">
|
||||
@@ -1665,7 +1701,7 @@
|
||||
<div class="cf-slip-footer-left">
|
||||
<div>
|
||||
服用{{ prescriptionViewData.medication_days ?? prescriptionViewData.usage_days ?? prescriptionViewData.dose_count }}天, {{ prescriptionViewData.prescription_type || '浓缩水丸' }}
|
||||
{{ prescriptionViewData.usage_instruction || '' }}
|
||||
|
||||
</div>
|
||||
<div>
|
||||
服用时间: {{ prescriptionViewData.usage_time ? ' ' + prescriptionViewData.usage_time : '' }}
|
||||
@@ -1673,13 +1709,14 @@
|
||||
服用方式: {{ prescriptionViewData.usage_way ? ' ' + prescriptionViewData.usage_way : '' }}
|
||||
</div>
|
||||
<div v-if="slipChuwanVisible" class="space-y-0.5">
|
||||
<div>每次用量约:{{ slipPerBagDosageText }}</div>
|
||||
<div>用量约:{{ slipPerBagDosageText }} 一天{{ prescriptionViewData.times_per_day ?? 2 }}次</div>
|
||||
<div>
|
||||
出丸:{{ slipPillGrams === null ? '—' : slipPillGrams }} 克
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="slipDietaryText" class="cf-slip-dietary">忌口:{{ slipDietaryText }}</div>
|
||||
<div v-if="prescriptionViewData.usage_notes" class="cf-slip-notes">{{ prescriptionViewData.usage_notes }}</div>
|
||||
{{ prescriptionViewData.usage_instruction || '' }}
|
||||
</div>
|
||||
<div class="cf-slip-footer-right">
|
||||
<span class="cf-slip-sign">
|
||||
@@ -1698,7 +1735,7 @@
|
||||
<div>{{ SLIP_COMPANY_LINE }}</div>
|
||||
<div>{{ SLIP_ADDRESS_LINE }}</div>
|
||||
</div>
|
||||
<div
|
||||
<!-- <div
|
||||
v-if="prescriptionViewData.audit_by_name || prescriptionViewData.audit_remark"
|
||||
class="cf-slip-audit text-sm text-gray-600 mt-4 pt-3 border-t border-dashed border-gray-200"
|
||||
>
|
||||
@@ -1709,7 +1746,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="prescriptionViewData.audit_remark" class="mt-1">审核意见:{{ prescriptionViewData.audit_remark }}</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
@@ -2694,7 +2731,38 @@ const editForm = reactive({
|
||||
amount: 0,
|
||||
remark_extra: '',
|
||||
pay_order_ids: [] as number[],
|
||||
internal_cost: undefined as number | string | undefined
|
||||
internal_cost: undefined as number | string | undefined,
|
||||
/** 关联诊单医助 id(只读,来自订单详情;列表筛选用) */
|
||||
assistant_id: 0,
|
||||
/** 诊单创建人(tcm_diagnosis.admin_id,只读) */
|
||||
diagnosis_creator_id: 0,
|
||||
diagnosis_creator_name: '',
|
||||
diagnosis_creator_dept_path: ''
|
||||
})
|
||||
|
||||
/** 诊单创建人部门:拆成面包屑。多部门为「;」分隔;路径内为「 / 」含父级(与后端 buildDeptPath 一致) */
|
||||
const editDiagnosisCreatorDeptBreadcrumbs = computed(() => {
|
||||
const raw = String(editForm.diagnosis_creator_dept_path || '').trim()
|
||||
if (!raw) {
|
||||
return [] as string[][]
|
||||
}
|
||||
return raw
|
||||
.split(';')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
.map((p) => {
|
||||
if (p.includes(' / ')) {
|
||||
return p
|
||||
.split(' / ')
|
||||
.map((x) => x.trim())
|
||||
.filter(Boolean)
|
||||
}
|
||||
return p
|
||||
.split('/')
|
||||
.map((x) => x.trim())
|
||||
.filter(Boolean)
|
||||
})
|
||||
.filter((segs) => segs.length > 0)
|
||||
})
|
||||
|
||||
const editPaidOrders = ref<Array<{ id: number; order_no?: string; amount?: number | string; order_type?: number | string; remark?: string; create_time?: string }>>([])
|
||||
@@ -2854,6 +2922,16 @@ async function openEdit(row: { id: number }) {
|
||||
editForm.id = d.id
|
||||
editForm.prescription_id = Number(d.prescription_id) || 0
|
||||
editForm.diagnosis_id = Number(d.diagnosis_id) || 0
|
||||
editForm.assistant_id = Number(d.assistant_id) || 0
|
||||
editForm.diagnosis_creator_id = Number(d.diagnosis_creator_id) || 0
|
||||
editForm.diagnosis_creator_name =
|
||||
d.diagnosis_creator_name != null && d.diagnosis_creator_name !== ''
|
||||
? String(d.diagnosis_creator_name)
|
||||
: ''
|
||||
editForm.diagnosis_creator_dept_path =
|
||||
d.diagnosis_creator_dept_path != null && d.diagnosis_creator_dept_path !== ''
|
||||
? String(d.diagnosis_creator_dept_path)
|
||||
: ''
|
||||
editForm.recipient_name = d.recipient_name || ''
|
||||
editForm.recipient_phone = d.recipient_phone || ''
|
||||
|
||||
@@ -4342,4 +4420,14 @@ async function downloadPrescriptionSlipPdf() {
|
||||
line-height: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.po-diagnosis-creator-dept-breadcrumb {
|
||||
:deep(.el-breadcrumb__item) {
|
||||
display: inline-flex;
|
||||
float: none;
|
||||
}
|
||||
:deep(.el-breadcrumb__separator) {
|
||||
margin: 0 2px 0 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user