更新
This commit is contained in:
@@ -190,8 +190,8 @@ const open = async (data: { patientId: number; patientName: string; diagnosisId?
|
||||
visible.value = true
|
||||
posX.value = 100
|
||||
posY.value = 80
|
||||
callKitX.value = Math.max(0, (window.innerWidth - 600) / 2)
|
||||
callKitY.value = Math.max(0, (window.innerHeight - 436) / 2)
|
||||
callKitX.value = Math.max(0, (window.innerWidth - 375) / 2)
|
||||
callKitY.value = Math.max(0, (window.innerHeight - 667) / 2)
|
||||
patientName.value = data.patientName
|
||||
patientId.value = data.patientId
|
||||
diagnosisId.value = data.diagnosisId || null
|
||||
@@ -549,15 +549,15 @@ defineExpose({ open })
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* TUICallKit 可拖动容器 */
|
||||
/* TUICallKit 可拖动容器 - 手机尺寸 (375x667) */
|
||||
.chat-dialog-call-kit-wrapper {
|
||||
position: fixed;
|
||||
width: 600px;
|
||||
height: 436px;
|
||||
width: 375px;
|
||||
height: 667px;
|
||||
max-width: 90vw;
|
||||
z-index: 300000;
|
||||
background: #1a1a1a;
|
||||
border-radius: 12px;
|
||||
border-radius: 24px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
@@ -565,8 +565,8 @@ defineExpose({ open })
|
||||
}
|
||||
|
||||
.call-kit-drag-handle {
|
||||
height: 36px;
|
||||
padding: 0 16px;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
background: #2a2a2a;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -576,7 +576,7 @@ defineExpose({ open })
|
||||
flex-shrink: 0;
|
||||
|
||||
.drag-handle-text {
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ defineExpose({ open })
|
||||
transform: none !important;
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
border-radius: 0 0 12px 12px;
|
||||
border-radius: 0 0 24px 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ const emit = defineEmits<{
|
||||
const editorRef = shallowRef()
|
||||
const materialPickerRef = shallowRef<InstanceType<typeof MaterialPicker>>()
|
||||
const fileType = ref('')
|
||||
const isReady = ref(false)
|
||||
|
||||
let insertFn: any
|
||||
|
||||
@@ -88,6 +89,7 @@ const valueHtml = computed({
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
if (!isReady.value) return
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
@@ -107,6 +109,9 @@ onBeforeUnmount(() => {
|
||||
|
||||
const handleCreated = (editor: any) => {
|
||||
editorRef.value = editor // 记录 editor 实例,重要!
|
||||
nextTick(() => {
|
||||
isReady.value = true
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
<div class="section-title">诊断信息</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="脉象" prop="pulse">
|
||||
<el-input v-model="formData.pulse" placeholder="脉象" />
|
||||
<el-form-item label="面象" prop="pulse">
|
||||
<el-input v-model="formData.pulse" placeholder="面象" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -109,12 +109,17 @@
|
||||
|
||||
<div class="info-section">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="剂数" prop="dose_count">
|
||||
<el-input-number v-model="formData.dose_count" :min="1" :max="30" />
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数量规格" prop="dose_count">
|
||||
<div class="flex gap-2 items-center">
|
||||
<el-input-number v-model="formData.dose_count" :min="1" :max="999" class="!w-28" />
|
||||
<el-select v-model="formData.dose_unit" placeholder="单位" class="!w-24">
|
||||
<el-option v-for="u in doseUnitOptions" :key="u" :label="u" :value="u" />
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用法" prop="usage_instruction">
|
||||
<el-input v-model="formData.usage_instruction" placeholder="如:水煎服一日二次" />
|
||||
</el-form-item>
|
||||
@@ -158,26 +163,36 @@
|
||||
<div class="prescription-header">
|
||||
<h2 class="prescription-title">{{ templateConfig.stationName }}处方笺</h2>
|
||||
<div class="prescription-type">
|
||||
<div>普通处方</div>
|
||||
<div class="text-sm">当日有效</div>
|
||||
<el-tag v-if="savedPrescription.void_status === 1" type="danger" size="small">已作废</el-tag>
|
||||
<template v-else>
|
||||
<div>普通处方</div>
|
||||
<div class="text-sm">当日有效</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prescription-meta">
|
||||
<span>日期: {{ savedPrescription.prescription_date }}</span>
|
||||
<span class="ml-4">门诊号: {{ savedPrescription.visit_no }}</span>
|
||||
<div v-if="savedPrescription.void_status === 1" class="prescription-void-info">
|
||||
作废人:{{ savedPrescription.void_by_name || '—' }},作废时间:{{ formatVoidTime(savedPrescription.void_time) }}
|
||||
</div>
|
||||
<div class="prescription-patient">
|
||||
<span>姓名: {{ savedPrescription.patient_name }}</span>
|
||||
<span>性别: {{ savedPrescription.gender_desc }}</span>
|
||||
<span>年龄: {{ savedPrescription.age }}</span>
|
||||
<span>电话: {{ savedPrescription.phone }}</span>
|
||||
</div>
|
||||
<div class="prescription-patient">
|
||||
<span>脉象: {{ savedPrescription.pulse || '—' }}</span>
|
||||
<span>舌象: {{ savedPrescription.tongue || '—' }}</span>
|
||||
</div>
|
||||
<div class="prescription-patient">
|
||||
<span>临床诊断: {{ savedPrescription.clinical_diagnosis }}</span>
|
||||
<div class="prescription-info">
|
||||
<div class="info-row">
|
||||
<span class="info-item"><em>日期</em>{{ savedPrescription.prescription_date }}</span>
|
||||
<span class="info-item"><em>电话</em>{{ savedPrescription.phone }}</span>
|
||||
<span class="info-item"><em>门诊号</em>{{ savedPrescription.visit_no }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-item"><em>姓名</em>{{ savedPrescription.patient_name }}</span>
|
||||
<span class="info-item"><em>性别</em>{{ savedPrescription.gender_desc }}</span>
|
||||
<span class="info-item"><em>年龄</em>{{ savedPrescription.age != null ? savedPrescription.age + '岁' : '—' }}</span>
|
||||
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-item" v-if="savedPrescription.pulse"><em>面象</em>{{ savedPrescription.pulse || '—' }}</span>
|
||||
<span class="info-item" v-if="savedPrescription.tongue"><em>舌象</em>{{ savedPrescription.tongue || '—' }}</span>
|
||||
|
||||
</div>
|
||||
<div class="info-row info-row-full">
|
||||
<span class="info-item"><em>临床诊断</em>{{ savedPrescription.clinical_diagnosis }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prescription-rp">
|
||||
<div class="rp-label">RP</div>
|
||||
@@ -197,7 +212,7 @@
|
||||
<div class="prescription-footer">
|
||||
<div class="footer-left">
|
||||
<div class="footer-dosage">
|
||||
共 {{ savedPrescription.dose_count }} 剂, {{ savedPrescription.usage_instruction }}
|
||||
共 {{ savedPrescription.dose_count }}{{ savedPrescription.dose_unit || '剂' }}, {{ savedPrescription.usage_instruction }}
|
||||
</div>
|
||||
<div class="footer-amount">金额 {{ savedPrescription.amount }}</div>
|
||||
</div>
|
||||
@@ -212,7 +227,7 @@
|
||||
/>
|
||||
<span v-else>{{ savedPrescription.doctor_name || '医师' }}</span>
|
||||
</span>
|
||||
<span>核对发药</span>
|
||||
<!-- <span>核对发药</span> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -226,6 +241,15 @@
|
||||
<el-icon><Document /></el-icon>
|
||||
下载PDF
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="savedPrescription.void_status !== 1"
|
||||
type="danger"
|
||||
plain
|
||||
:loading="voiding"
|
||||
@click="handleVoid"
|
||||
>
|
||||
作废处方
|
||||
</el-button>
|
||||
<el-button @click="handleNewPrescription">新建处方</el-button>
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
</div>
|
||||
@@ -242,7 +266,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import feedback from '@/utils/feedback'
|
||||
import { prescriptionAdd, prescriptionDetail, prescriptionGetByAppointment } from '@/api/tcm'
|
||||
import { prescriptionAdd, prescriptionDetail, prescriptionGetByAppointment, prescriptionVoid } from '@/api/tcm'
|
||||
import { getDictData } from '@/api/app'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { jsPDF } from 'jspdf'
|
||||
@@ -269,6 +293,7 @@ interface PrescriptionForm {
|
||||
clinical_diagnosis: string
|
||||
herbs: Herb[]
|
||||
dose_count: number
|
||||
dose_unit: string
|
||||
usage_instruction: string
|
||||
amount: number
|
||||
doctor_name: string
|
||||
@@ -280,13 +305,14 @@ const emit = defineEmits(['success'])
|
||||
const visible = ref(false)
|
||||
const formRef = ref()
|
||||
const saving = ref(false)
|
||||
const voiding = ref(false)
|
||||
const prescriptionPrintRef = ref<HTMLElement>()
|
||||
const signatureCanvasRef = ref<HTMLCanvasElement>()
|
||||
const isDrawing = ref(false)
|
||||
const savedPrescription = ref<any>(null)
|
||||
|
||||
const templateConfig = reactive({
|
||||
stationName: '卫生服务站',
|
||||
stationName: '成都双流甄养堂互联网医院',
|
||||
showDisclaimer: true,
|
||||
disclaimer: ''
|
||||
})
|
||||
@@ -306,6 +332,7 @@ const formData = reactive<PrescriptionForm>({
|
||||
clinical_diagnosis: '',
|
||||
herbs: [],
|
||||
dose_count: 1,
|
||||
dose_unit: '剂',
|
||||
usage_instruction: '水煎服一日二次',
|
||||
amount: 0,
|
||||
doctor_name: '',
|
||||
@@ -314,6 +341,8 @@ const formData = reactive<PrescriptionForm>({
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const doseUnitOptions = ['剂', '丸', '袋', '盒', '瓶', '膏', '贴', '包', '片', '粒']
|
||||
|
||||
const diagnosisTypeOptions = ref<any[]>([])
|
||||
const syndromeTypeOptions = ref<any[]>([])
|
||||
|
||||
@@ -381,6 +410,7 @@ const open = async (data: any, options?: { templateId?: number; stationName?: st
|
||||
formData.clinical_diagnosis = buildClinicalDiagnosis(diagnosis)
|
||||
formData.herbs = []
|
||||
formData.dose_count = 1
|
||||
formData.dose_unit = '剂'
|
||||
formData.usage_instruction = '水煎服一日二次'
|
||||
formData.amount = 0
|
||||
formData.doctor_name = userStore.userInfo?.name || ''
|
||||
@@ -527,6 +557,7 @@ const handleSave = async () => {
|
||||
clinical_diagnosis: formData.clinical_diagnosis,
|
||||
herbs: formData.herbs,
|
||||
dose_count: formData.dose_count,
|
||||
dose_unit: formData.dose_unit || '剂',
|
||||
usage_instruction: formData.usage_instruction,
|
||||
amount: formData.amount,
|
||||
doctor_name: formData.doctor_name,
|
||||
@@ -547,6 +578,30 @@ const handleSave = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const formatVoidTime = (ts: number | null | undefined) => {
|
||||
if (!ts) return '—'
|
||||
const d = new Date(ts * 1000)
|
||||
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
const handleVoid = async () => {
|
||||
const id = savedPrescription.value?.id
|
||||
if (!id) return
|
||||
try {
|
||||
await feedback.confirm('确定要作废该处方吗?作废后不可恢复。')
|
||||
voiding.value = true
|
||||
await prescriptionVoid({ id })
|
||||
feedback.msgSuccess('作废成功')
|
||||
const detail = await prescriptionDetail({ id })
|
||||
savedPrescription.value = detail
|
||||
emit('success')
|
||||
} catch (e: any) {
|
||||
if (e !== 'cancel' && e?.message !== 'cancel') feedback.msgError(e?.msg || '作废失败')
|
||||
} finally {
|
||||
voiding.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleNewPrescription = () => {
|
||||
const saved = savedPrescription.value
|
||||
if (saved) {
|
||||
@@ -564,6 +619,7 @@ const handleNewPrescription = () => {
|
||||
formData.tongue = saved.tongue || ''
|
||||
formData.clinical_diagnosis = saved.clinical_diagnosis || ''
|
||||
formData.dose_count = 1
|
||||
formData.dose_unit = saved.dose_unit || '剂'
|
||||
formData.usage_instruction = '水煎服一日二次'
|
||||
formData.amount = 0
|
||||
formData.doctor_name = userStore.userInfo?.name || saved.doctor_name || ''
|
||||
@@ -682,9 +738,18 @@ defineExpose({
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.prescription-void-info {
|
||||
font-size: 13px;
|
||||
color: var(--el-color-danger);
|
||||
margin-bottom: 12px;
|
||||
padding: 8px 12px;
|
||||
background: #fef0f0;
|
||||
border-radius: 4px;
|
||||
|
||||
.prescription-title {
|
||||
font-size: 20px;
|
||||
@@ -698,15 +763,43 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
|
||||
.prescription-meta {
|
||||
margin-bottom: 8px;
|
||||
.prescription-info {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.prescription-patient {
|
||||
margin-bottom: 6px;
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
|
||||
span {
|
||||
margin-right: 16px;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.info-row-full {
|
||||
.info-item {
|
||||
flex: 1;
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
color: #909399;
|
||||
min-width: 56px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user