This commit is contained in:
Your Name
2026-04-30 17:36:47 +08:00
parent 4c21ee5938
commit 7e557b1ea2
33 changed files with 8718 additions and 94 deletions
@@ -1,7 +1,7 @@
<template>
<div class="blood-record-list">
<div class="mb-4">
<el-button type="primary" @click="handleAdd">添加记录</el-button>
<el-button v-if="!readOnly" type="primary" @click="handleAdd">添加记录</el-button>
<el-select v-model="trendDays" @change="handleTrendDaysChange" class="ml-2" style="width: 150px">
<el-option label="最近7天" :value="7" />
<el-option label="最近30天" :value="30" />
@@ -62,7 +62,7 @@
<el-table-column prop="western_medicine" label="西药" show-overflow-tooltip />
<el-table-column prop="insulin" label="胰岛素" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column v-if="!readOnly" label="操作" width="150" fixed="right">
<template #default="{ row }">
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
@@ -185,6 +185,10 @@ const props = defineProps({
patientId: {
type: Number,
default: 0
},
readOnly: {
type: Boolean,
default: false
}
})
@@ -1,6 +1,6 @@
<template>
<div class="case-record-list">
<div class="mb-3 flex justify-end">
<div v-if="!readOnly" class="mb-3 flex justify-end">
<el-button type="primary" size="small" @click="handleOpenPrescription">开方</el-button>
</div>
<el-table :data="caseList" border v-loading="loading">
@@ -46,6 +46,11 @@ const props = defineProps({
diagnosisId: {
type: Number,
default: 0
},
/** 只读:隐藏开方(与诊单 openViewOnly 一致) */
readOnly: {
type: Boolean,
default: false
}
})
@@ -1,6 +1,6 @@
<template>
<div class="diet-record-list">
<div class="mb-4">
<div v-if="!readOnly" class="mb-4">
<el-button type="primary" @click="handleAdd">添加记录</el-button>
</div>
@@ -25,7 +25,7 @@
</template>
</el-table-column>
<el-table-column prop="note" label="备注" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column v-if="!readOnly" label="操作" width="150" fixed="right">
<template #default="{ row }">
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
@@ -125,6 +125,10 @@ const props = defineProps({
patientId: {
type: Number,
default: 0
},
readOnly: {
type: Boolean,
default: false
}
})
@@ -1,6 +1,6 @@
<template>
<div class="exercise-record-list">
<div class="mb-4">
<div v-if="!readOnly" class="mb-4">
<el-button type="primary" @click="handleAdd">添加记录</el-button>
</div>
@@ -18,7 +18,7 @@
</template>
</el-table-column>
<el-table-column prop="note" label="备注" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column v-if="!readOnly" label="操作" width="150" fixed="right">
<template #default="{ row }">
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
@@ -99,6 +99,10 @@ const props = defineProps({
patientId: {
type: Number,
default: 0
},
readOnly: {
type: Boolean,
default: false
}
})
+381 -28
View File
@@ -2,14 +2,57 @@
<div class="edit-drawer">
<el-drawer
v-model="visible"
:title="drawerTitle"
size="60%"
:before-close="handleClose"
:z-index="viewOnly ? 4000 : 1500"
:modal="true"
class="diagnosis-drawer"
class="diagnosis-drawer tcm-diagnosis-drawer"
>
<el-tabs v-model="activeTab" class="diagnosis-tabs">
<template #header>
<div class="tcm-dd-header">
<div class="tcm-dd-header__row">
<h2 class="tcm-dd-header__title">{{ drawerTitle }}</h2>
<el-tag
v-if="viewOnly"
type="info"
effect="plain"
round
size="small"
class="tcm-dd-header__badge"
>
只读
</el-tag>
<el-tag
v-else-if="mode === 'add'"
type="success"
effect="plain"
round
size="small"
class="tcm-dd-header__badge"
>
新建
</el-tag>
<el-tag
v-else
type="warning"
effect="plain"
round
size="small"
class="tcm-dd-header__badge"
>
编辑
</el-tag>
</div>
<p v-if="formData.patient_name || formData.id" class="tcm-dd-header__sub">
<span v-if="formData.patient_name" class="tcm-dd-header__name">{{ formData.patient_name }}</span>
<span v-if="formData.id" class="tcm-dd-header__id">
<span v-if="formData.patient_name" class="tcm-dd-header__sep">·</span>
诊单 {{ formData.patient_id || formData.id }}
</span>
</p>
</div>
</template>
<el-tabs v-model="activeTab" class="diagnosis-tabs tcm-diagnosis-tabs">
<!-- 基本信息标签页 -->
<el-tab-pane label="病历" name="basic">
<el-form
@@ -499,8 +542,8 @@
<el-form-item label="病史补充" prop="remark">
<el-input
v-mode="formData.remark"
type="ltextarea"
v-model="formData.remark"
type="textarea"
:rows="2"
placeholder="请输入病史补充"
/>
@@ -513,6 +556,7 @@
<NoteTimeline
:notes="diagNotes"
:diagnosis-id="Number(formData.id)"
:readonly="viewOnly"
@refresh="fetchDiagNotes"
/>
</div>
@@ -524,6 +568,7 @@
v-if="formData.id"
:diagnosis-id="Number(formData.id)"
:patient-id="Number(formData.patient_id)"
:read-only="viewOnly"
/>
<el-empty v-else description="请先保存诊单后再添加血糖血压记录" />
</el-tab-pane>
@@ -534,6 +579,7 @@
v-if="formData.id"
:diagnosis-id="Number(formData.id)"
:patient-id="Number(formData.patient_id)"
:read-only="viewOnly"
/>
<el-empty v-else description="请先保存诊单后再添加饮食记录" />
</el-tab-pane>
@@ -544,6 +590,7 @@
v-if="formData.id"
:diagnosis-id="Number(formData.id)"
:patient-id="Number(formData.patient_id)"
:read-only="viewOnly"
/>
<el-empty v-else description="请先保存诊单后再添加运动打卡记录" />
</el-tab-pane>
@@ -555,6 +602,7 @@
<case-record-list
ref="caseRecordListRef"
:diagnosis-id="Number(formData.id)"
:read-only="viewOnly"
@view="handleViewCase"
@openPrescription="handleOpenPrescription"
/>
@@ -625,15 +673,18 @@
<tcm-prescription ref="prescriptionRef" @success="caseRecordListRef?.refresh?.()" />
<template #footer>
<div class="flex justify-end gap-3 px-4 pb-4">
<el-button @click="handleClose">{{ viewOnly ? '关闭' : '取消' }}</el-button>
<div class="tcm-dd-footer">
<el-button class="tcm-dd-footer__btn" @click="handleClose">
{{ viewOnly ? '关闭' : '取消' }}
</el-button>
<el-button
v-if="!viewOnly && activeTab === 'basic'"
class="tcm-dd-footer__btn"
type="primary"
@click="handleSubmit"
:loading="submitting"
>
确定
保存病历
</el-button>
</div>
</template>
@@ -1139,6 +1190,7 @@ const handleViewCase = (row: any) => {
// 开方:传入当前诊单数据,包含详细病历(深拷贝避免响应式引用)
const handleOpenPrescription = () => {
if (viewOnly.value) return
const data = {
id: formData.value.id,
diagnosis_id: formData.value.id,
@@ -1245,14 +1297,24 @@ defineExpose({
}
:deep(.el-divider) {
margin: 24px 0 20px;
margin: 28px 0 22px;
border-color: transparent;
&::before,
&::after {
border-top-color: #e2e8f0;
}
.el-divider__text {
font-size: 13px;
font-size: 14px;
font-weight: 600;
color: #303133;
background: #f5f7fa;
padding: 0 16px;
color: #0f172a;
letter-spacing: -0.01em;
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
padding: 7px 16px;
border-radius: 999px;
border: 1px solid #e2e8f0;
box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}
}
@@ -1373,24 +1435,111 @@ defineExpose({
color: #909399;
}
// 输入框样式优化
:deep(.el-input__inner),
// 输入圆角:医疗表单更易扫读
:deep(.el-input__wrapper) {
border-radius: 10px;
transition:
box-shadow 0.2s ease,
border-color 0.2s ease;
}
:deep(.el-textarea__inner) {
border-radius: 4px;
border-radius: 10px;
}
// 选择器样式优化
:deep(.el-select) {
.el-input__inner {
border-radius: 4px;
}
:deep(.el-select .el-input__wrapper) {
border-radius: 10px;
}
// 日期选择器样式优化
:deep(.el-date-editor) {
.el-input__inner {
border-radius: 4px;
}
:deep(.el-date-editor .el-input__wrapper) {
border-radius: 10px;
}
:deep(.el-input-number .el-input__wrapper) {
border-radius: 10px;
}
}
.tcm-dd-header {
min-width: 0;
flex: 1;
padding-right: 8px;
}
.tcm-dd-header__row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 10px;
}
.tcm-dd-header__title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #0f172a;
line-height: 1.3;
letter-spacing: -0.02em;
}
.tcm-dd-header__badge {
flex-shrink: 0;
font-weight: 500;
}
.tcm-dd-header__sub {
margin: 6px 0 0;
font-size: 13px;
line-height: 1.45;
color: #475569;
}
.tcm-dd-header__name {
font-weight: 600;
color: #334155;
}
.tcm-dd-header__id {
font-weight: 500;
color: #64748b;
}
.tcm-dd-header__sep {
margin: 0 4px;
color: #94a3b8;
}
.tcm-dd-footer {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
align-items: center;
gap: 12px;
width: 100%;
padding: 14px 20px 18px;
box-sizing: border-box;
border-top: 1px solid rgb(226 232 240 / 90%);
background: linear-gradient(180deg, rgb(248 250 252 / 95%) 0%, #fff 40%);
}
.tcm-dd-footer__btn {
min-height: 40px;
padding: 10px 20px;
font-weight: 600;
border-radius: 10px;
transition:
transform 0.15s ease,
box-shadow 0.2s ease;
}
.tcm-dd-footer__btn:focus-visible {
outline: 2px solid var(--el-color-primary);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.tcm-dd-footer__btn {
transition: none;
}
}
</style>
@@ -1415,5 +1564,209 @@ defineExpose({
.el-select-dropdown {
z-index: 3000 !important;
}
</style>
<style lang="scss">
/**
* 诊单抽屉壳层挂到 body 时通过 .diagnosis-drawer 限定作用域
*/
.diagnosis-drawer.tcm-diagnosis-drawer {
.el-drawer__header {
align-items: flex-start !important;
border-bottom: 1px solid #e2e8f0;
background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.el-drawer__body {
background: #f8fafc;
}
.el-drawer__footer {
padding: 0 !important;
background: #fff;
box-shadow: 0 -4px 24px rgb(15 23 42 / 7%);
}
.tcm-diagnosis-tabs .el-tabs__nav-wrap {
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.tcm-diagnosis-tabs .el-tabs__nav-wrap::-webkit-scrollbar {
display: none;
height: 0;
}
.tcm-diagnosis-tabs .el-tabs__nav {
display: flex;
flex-wrap: nowrap;
float: none !important;
}
.tcm-diagnosis-tabs .el-tabs__item {
flex: 0 0 auto;
padding: 0 14px;
font-weight: 500;
color: #64748b;
transition: color 0.2s ease;
}
.tcm-diagnosis-tabs .el-tabs__item.is-active {
color: var(--el-color-primary);
font-weight: 600;
}
.tcm-diagnosis-tabs .el-tabs__active-bar {
height: 3px;
border-radius: 3px 3px 0 0;
}
.tcm-dd-footer {
box-shadow: none;
border-top: 1px solid #e2e8f0;
background: #fff;
}
}
@media (prefers-reduced-motion: reduce) {
.diagnosis-drawer.tcm-diagnosis-drawer .tcm-diagnosis-tabs .el-tabs__item {
transition: none;
}
}
/**
* 窄屏诊单抽屉drawer 通过 teleport 挂到 bodyscoped 无法作用到内部此处用抽屉 class H5 适配
*/
@media screen and (max-width: 768px) {
.diagnosis-drawer.el-drawer {
width: 100% !important;
max-width: 100vw;
}
.diagnosis-drawer .el-drawer__header {
padding: 12px 14px !important;
margin-bottom: 0 !important;
}
.diagnosis-drawer .el-drawer__body {
padding: 10px 12px 12px !important;
}
.diagnosis-drawer .el-drawer__footer {
padding: 0 !important;
}
.diagnosis-drawer .tcm-dd-footer {
flex-direction: column;
align-items: stretch;
gap: 10px;
padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}
.diagnosis-drawer .tcm-dd-footer__btn {
width: 100%;
min-height: 44px;
}
.diagnosis-drawer .tcm-dd-header__title {
font-size: 17px;
}
.diagnosis-drawer .diagnosis-tabs .el-tabs__header {
margin: 0 0 10px;
}
.diagnosis-drawer .el-tabs__item {
padding: 0 12px;
font-size: 13px;
min-height: 44px;
line-height: 44px;
}
.diagnosis-drawer .el-tabs__nav-wrap::after {
height: 1px;
}
/* 表单标签在上控件全宽避免 160px 标签 + 三列栅格把内容挤没 */
.diagnosis-drawer .el-form-item {
display: flex !important;
flex-direction: column !important;
align-items: stretch !important;
margin-bottom: 14px !important;
}
.diagnosis-drawer .el-form-item__label {
width: 100% !important;
max-width: 100% !important;
height: auto !important;
line-height: 1.4 !important;
text-align: left !important;
justify-content: flex-start !important;
margin: 0 0 6px !important;
padding: 0 !important;
box-sizing: border-box;
}
.diagnosis-drawer .el-form-item__content {
margin-left: 0 !important;
max-width: 100% !important;
flex: 1 1 auto;
}
.diagnosis-drawer .el-row {
margin-left: 0 !important;
margin-right: 0 !important;
row-gap: 0;
}
.diagnosis-drawer .el-col,
.diagnosis-drawer .el-col-12,
.diagnosis-drawer .el-col-8,
.diagnosis-drawer .el-col-20,
.diagnosis-drawer [class*='el-col-'] {
flex: 0 0 100% !important;
max-width: 100% !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
.diagnosis-drawer .el-input-number {
width: 100% !important;
}
.diagnosis-drawer .el-radio-group {
display: flex !important;
flex-wrap: wrap !important;
gap: 8px 16px;
align-items: center;
}
.diagnosis-drawer .el-radio {
margin-right: 0 !important;
margin-bottom: 0 !important;
}
.diagnosis-drawer .el-radio-button:last-child {
margin-right: 0;
}
.diagnosis-drawer .el-checkbox-group {
display: flex !important;
flex-wrap: wrap !important;
gap: 8px 10px;
}
.diagnosis-drawer .el-divider {
margin: 18px 0 14px;
}
.diagnosis-drawer .el-divider__text {
font-size: 13px;
padding: 0 10px;
}
}
</style>
+1
View File
@@ -438,6 +438,7 @@
<el-option label="尾款费用" :value="5" />
<el-option label="其他费用" :value="6" />
<el-option label="全部费用" :value="7" />
<el-option label="驼奶费用" :value="8" />
</el-select>
</el-form-item>
@@ -399,6 +399,7 @@
<el-option label="尾款费用" :value="5" />
<el-option label="其他费用" :value="6" />
<el-option label="全部费用" :value="7" />
<el-option label="驼奶费用" :value="8" />
</el-select>
</el-form-item>
<el-form-item label="订单金额" prop="amount">
+1
View File
@@ -372,6 +372,7 @@
<el-option label="尾款费用" :value="5" />
<el-option label="其他费用" :value="6" />
<el-option label="全部费用" :value="7" />
<el-option label="驼奶费用" :value="8" />
</el-select>
</el-form-item>