提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -1,19 +1,29 @@
<template>
<<<<<<< HEAD
<!-- 门诊病历表单主容器 -->
<div class="medical-form">
<!-- 患者基本信息展示区域 -->
=======
<div class="medical-form">
>>>>>>> v1.3
<div class="patient-name">
患者姓名{{ patient?.patientName || '未知' }} &nbsp;&nbsp; 病历号{{
patient?.busNo || '未知'
}}
</div>
<<<<<<< HEAD
<!-- 医院名称和标题 -->
=======
>>>>>>> v1.3
<h2 style="text-align: center">{{ userStore.hospitalName }}</h2>
<h2 style="text-align: center">门诊病历</h2>
<!-- 滚动内容区域 -->
<div class="form-scroll-container">
<<<<<<< HEAD
<!-- Element Plus表单组件 -->
=======
>>>>>>> v1.3
<el-form
ref="formRef"
:model="formData"
@@ -22,40 +32,58 @@
label-align="left"
class="medical-full-form"
>
<<<<<<< HEAD
<!-- 基础信息区域标题 -->
=======
>>>>>>> v1.3
<h4 class="section-title">基础信息</h4>
<!-- 1. 基础信息单行自适应排列 -->
<el-form-item class="form-section">
<div class="single-row-layout">
<<<<<<< HEAD
<!-- 身高输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="身高" prop="height" class="row-item">
<div class="input-with-unit">
<el-input v-model="formData.height" type="text" placeholder="请输入" />
<span class="unit">cm</span>
</div>
</el-form-item>
<<<<<<< HEAD
<!-- 体重输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="体重" prop="weight" class="row-item">
<div class="input-with-unit">
<el-input v-model="formData.weight" type="text" placeholder="请输入" />
<span class="unit">kg</span>
</div>
</el-form-item>
<<<<<<< HEAD
<!-- 体温输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="体温" prop="temperature" class="row-item">
<div class="input-with-unit">
<el-input v-model="formData.temperature" type="text" placeholder="请输入" />
<span class="unit"></span>
</div>
</el-form-item>
<<<<<<< HEAD
<!-- 脉搏输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="脉搏" prop="pulse" class="row-item">
<div class="input-with-unit">
<el-input v-model="formData.pulse" type="text" placeholder="请输入" />
<span class="unit">/</span>
</div>
</el-form-item>
<<<<<<< HEAD
<!-- 发病日期选择项 -->
=======
>>>>>>> v1.3
<el-form-item label="发病日期" prop="onsetDate" class="row-item">
<el-date-picker
v-model="formData.onsetDate"
@@ -68,13 +96,19 @@
</el-form-item>
</div>
</el-form-item>
<<<<<<< HEAD
<!-- 病史信息区域标题 -->
=======
>>>>>>> v1.3
<h4 class="section-title">病史信息</h4>
<!-- 2. 病史信息单行自适应排列新增调整 -->
<el-form-item class="form-section">
<div class="single-row-layout">
<<<<<<< HEAD
<!-- 现病史输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="现病史" prop="presentIllness" class="row-item history-item">
<el-input
v-model="formData.presentIllness"
@@ -83,11 +117,17 @@
autosize
/>
</el-form-item>
<<<<<<< HEAD
<!-- 既往史输入项 -->
<el-form-item label="既往史" prop="pastIllness" class="row-item history-item">
<el-input v-model="formData.pastIllness" type="textarea" placeholder="无" autosize />
</el-form-item>
<!-- 个人史输入项 -->
=======
<el-form-item label="既往史" prop="pastIllness" class="row-item history-item">
<el-input v-model="formData.pastIllness" type="textarea" placeholder="无" autosize />
</el-form-item>
>>>>>>> v1.3
<el-form-item label="个人史" prop="personalHistory" class="row-item history-item">
<el-input
v-model="formData.personalHistory"
@@ -96,7 +136,10 @@
autosize
/>
</el-form-item>
<<<<<<< HEAD
<!-- 过敏史输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="过敏史" prop="allergyHistory" class="row-item history-item">
<el-input
v-model="formData.allergyHistory"
@@ -105,7 +148,10 @@
autosize
/>
</el-form-item>
<<<<<<< HEAD
<!-- 家族史输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="家族史" prop="familyHistory" class="row-item history-item">
<el-input
v-model="formData.familyHistory"
@@ -116,8 +162,11 @@
</el-form-item>
</div>
</el-form-item>
<<<<<<< HEAD
<!-- 主诉查体(治疗)处置辅助检查区域标题 -->
=======
>>>>>>> v1.3
<h4 class="section-title">主诉查体(治疗)处置辅助检查</h4>
<!-- 3. 主诉必填 -->
<el-form-item label="主诉" prop="complaint" class="required form-item-single">
@@ -130,7 +179,10 @@
/>
</el-form-item>
<!-- 4. 查体处理辅助检查 -->
<<<<<<< HEAD
<!-- 查体(治疗)输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="查体(治疗)" prop="physicalExam" class="form-item-single">
<el-input
v-model="formData.physicalExam"
@@ -141,7 +193,10 @@
/>
</el-form-item>
<<<<<<< HEAD
<!-- 处置输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="处置" prop="treatment" class="form-item-single">
<el-input
v-model="formData.treatment"
@@ -152,7 +207,10 @@
/>
</el-form-item>
<<<<<<< HEAD
<!-- 辅助检查输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="辅助检查" prop="auxiliaryExam" class="form-item-single">
<el-input
v-model="formData.auxiliaryExam"
@@ -168,26 +226,37 @@
</template>
<script setup>
<<<<<<< HEAD
// 导入Vue相关功能和组件
=======
>>>>>>> v1.3
import { reactive, ref, onBeforeMount, onMounted, watch } from 'vue';
import useUserStore from '../store/modules/user';
import { ElInput, ElMessage, ElForm, ElFormItem } from 'element-plus';
import { patientInfo } from '../views/doctorstation/components/store/patient';
import { pa } from 'element-plus/es/locales.mjs';
<<<<<<< HEAD
// 定义组件选项
=======
>>>>>>> v1.3
defineOptions({
name: 'OutpatientMedicalRecord',
components: { ElInput, ElMessage, ElForm, ElFormItem },
});
<<<<<<< HEAD
// // Props与事件,去掉props.patientInfo改为直接从store获取
=======
// // Props与事件, 去掉props.patientInfo改为直接从store获取
>>>>>>> v1.3
// const props = defineProps({
// patientInfo: {
// type: Object,
// required: true,
// },
// });
<<<<<<< HEAD
// 定义组件接收的属性(目前为空)
const props = defineProps({});
@@ -212,18 +281,45 @@ const formData = reactive({
pulse: '', // 脉搏(次/分)
onsetDate: '', // 发病日期
complaint: '', // 主诉(必填项)
=======
const props = defineProps({});
const emits = defineEmits(['submitOk']);
// 数据初始化
const userStore = useUserStore();
const patient = ref(null);
const formRef = ref(null);
// 表单数据(全部字符类型)
const formData = reactive({
height: '', // 身高
weight: '', // 体重
temperature: '', // 体温
pulse: '', // 脉搏
onsetDate: '', // 发病日期
complaint: '', // 主诉(必填)
>>>>>>> v1.3
presentIllness: '', // 现病史
pastIllness: '', // 既往史
personalHistory: '', // 个人史
allergyHistory: '', // 过敏史
<<<<<<< HEAD
physicalExam: '', // 查体结果
treatment: '', // 处理方案
auxiliaryExam: '', // 辅助检查结果
=======
physicalExam: '', // 查体
treatment: '', // 处理
auxiliaryExam: '', // 辅助检查
>>>>>>> v1.3
familyHistory: '', // 家族史
});
// 表单校验规则
<<<<<<< HEAD
// 定义表单字段的验证规则,目前仅主诉为必填项
=======
>>>>>>> v1.3
const rules = reactive({
complaint: [
{
@@ -235,6 +331,7 @@ const rules = reactive({
});
// 提交函数
<<<<<<< HEAD
// 用于触发表单验证并提交数据到父组件
const submit = () => {
// 表单验证
@@ -250,6 +347,16 @@ const submit = () => {
// 日期格式化工具函数
// 将Date对象格式化为 YYYY-MM-DD HH:mm 格式的字符串
=======
const submit = () => {
formRef.value.validate((isValid) => {
if (isValid) {
emits('submitOk', formData);
}
});
};
// 日期格式化工具
>>>>>>> v1.3
const formatDateTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
@@ -258,16 +365,23 @@ const formatDateTime = (date) => {
const minute = String(date.getMinutes()).padStart(2, '0');
return `${year}-${month}-${day} ${hour}:${minute}`;
};
<<<<<<< HEAD
// 表单数据赋值函数
// 用于外部组件向表单填充已有数据
const setFormData = (data) => {
if (data) {
// 将传入的数据合并到表单数据中
=======
// 表单数据赋值
const setFormData = (data) => {
if (data) {
>>>>>>> v1.3
Object.assign(formData, data);
}
};
<<<<<<< HEAD
// 生命周期钩子 - 组件挂载前
onBeforeMount(() => {});
@@ -275,6 +389,12 @@ onBeforeMount(() => {});
onMounted(() => {
console.log('当前患者信息:', patientInfo);
// 从store获取患者信息
=======
// 生命周期
onBeforeMount(() => {});
onMounted(() => {
console.log('当前患者信息:', patientInfo);
>>>>>>> v1.3
patient.value = patientInfo.value;
// 初始化发病日期为当前时间
if (!formData.onsetDate) {
@@ -283,7 +403,10 @@ onMounted(() => {
});
// 监听患者信息变化,实现联动显示
<<<<<<< HEAD
// 当patientInfo发生变化时更新本地patient引用
=======
>>>>>>> v1.3
watch(
() => patientInfo.value,
(newPatientInfo) => {
@@ -292,8 +415,12 @@ watch(
{ deep: true }
);
<<<<<<< HEAD
// 暴露接口供父组件调用
// 将formData、submit方法和setFormData方法暴露给父组件使用
=======
// 暴露接口
>>>>>>> v1.3
defineExpose({ formData, submit, setFormData });
</script>
@@ -303,14 +430,23 @@ defineExpose({ formData, submit, setFormData });
max-width: 1200px;
width: 100%;
min-height: 800px;
<<<<<<< HEAD
height: 900px;
=======
height: auto;
>>>>>>> v1.3
margin: 15px auto;
padding: 15px;
border: 1px solid #ddd;
border-radius: 8px;
font-family: Arial, sans-serif;
box-sizing: border-box;
<<<<<<< HEAD
overflow: visible;
=======
overflow: hidden; /* 防止内部内容溢出 */
position: relative;
>>>>>>> v1.3
}
/* 顶部姓名样式 */
@@ -325,11 +461,19 @@ defineExpose({ formData, submit, setFormData });
/* 滚动内容容器 */
.form-scroll-container {
width: 100%;
<<<<<<< HEAD
max-height: 80vh;
=======
max-height: 55vh;
>>>>>>> v1.3
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: #ccc #f5f5f5;
<<<<<<< HEAD
=======
position: relative;
>>>>>>> v1.3
}
.form-scroll-container::-webkit-scrollbar {
width: 6px;
@@ -345,6 +489,11 @@ defineExpose({ formData, submit, setFormData });
/* 完整表单容器 */
.medical-full-form {
width: 100%;
<<<<<<< HEAD
=======
min-width: 0; /* 防止内容强制拉伸容器 */
box-sizing: border-box;
>>>>>>> v1.3
}
/* 区域通用样式 */
@@ -366,6 +515,11 @@ defineExpose({ formData, submit, setFormData });
flex-wrap: wrap; /* 自动换行 */
align-items: flex-start; /* 顶部对齐,适配文本域高度 */
gap: 15px; /* 统一元素间距 */
<<<<<<< HEAD
=======
width: 100%;
box-sizing: border-box;
>>>>>>> v1.3
}
.row-item {
margin-bottom: 0; /* 取消底部间距,避免换行重叠 */
@@ -436,9 +590,17 @@ defineExpose({ formData, submit, setFormData });
.medical-form {
height: 80vh;
padding: 10px;
<<<<<<< HEAD
}
.form-scroll-container {
height: calc(100% - 35px);
=======
overflow: hidden;
}
.form-scroll-container {
height: calc(100% - 35px);
max-height: none;
>>>>>>> v1.3
}
.el-form {
label-width: 70px !important;
@@ -457,4 +619,8 @@ defineExpose({ formData, submit, setFormData });
--el-input-textarea-min-height: 80px;
}
}
</style>
<<<<<<< HEAD
</style>
=======
</style>
>>>>>>> v1.3