提交merge1.3

This commit is contained in:
2025-12-27 15:30:40 +08:00
parent 088861f66e
commit 3c497417dc
167 changed files with 0 additions and 17577 deletions

View File

@@ -1,29 +1,15 @@
<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"
@@ -32,58 +18,34 @@
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"
@@ -96,19 +58,10 @@
</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"
@@ -117,17 +70,9 @@
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"
@@ -136,10 +81,6 @@
autosize
/>
</el-form-item>
<<<<<<< HEAD
<!-- 过敏史输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="过敏史" prop="allergyHistory" class="row-item history-item">
<el-input
v-model="formData.allergyHistory"
@@ -148,10 +89,6 @@
autosize
/>
</el-form-item>
<<<<<<< HEAD
<!-- 家族史输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="家族史" prop="familyHistory" class="row-item history-item">
<el-input
v-model="formData.familyHistory"
@@ -162,11 +99,6 @@
</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">
@@ -179,10 +111,6 @@
/>
</el-form-item>
<!-- 4. 查体处理辅助检查 -->
<<<<<<< HEAD
<!-- 查体(治疗)输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="查体(治疗)" prop="physicalExam" class="form-item-single">
<el-input
v-model="formData.physicalExam"
@@ -193,10 +121,6 @@
/>
</el-form-item>
<<<<<<< HEAD
<!-- 处置输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="处置" prop="treatment" class="form-item-single">
<el-input
v-model="formData.treatment"
@@ -207,10 +131,6 @@
/>
</el-form-item>
<<<<<<< HEAD
<!-- 辅助检查输入项 -->
=======
>>>>>>> v1.3
<el-form-item label="辅助检查" prop="auxiliaryExam" class="form-item-single">
<el-input
v-model="formData.auxiliaryExam"
@@ -226,62 +146,24 @@
</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({});
// 定义组件触发的事件
const emits = defineEmits(['submitOk']);
// 数据初始化
// 获取用户store实例用于获取医院名称等全局信息
const userStore = useUserStore();
// 患者信息引用,存储当前就诊患者的基本信息
const patient = ref(null);
// 表单引用,用于访问表单实例进行验证等操作
const formRef = ref(null);
// 表单数据(全部字符类型)
// 存储门诊病历表单的所有字段数据
const formData = reactive({
height: '', // 身高(cm)
weight: '', // 体重(kg)
temperature: '', // 体温(℃)
pulse: '', // 脉搏(次/分)
onsetDate: '', // 发病日期
complaint: '', // 主诉(必填项)
=======
const props = defineProps({});
const emits = defineEmits(['submitOk']);
@@ -298,28 +180,17 @@ const formData = reactive({
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: [
{
@@ -331,23 +202,6 @@ const rules = reactive({
});
// 提交函数
<<<<<<< HEAD
// 用于触发表单验证并提交数据到父组件
const submit = () => {
// 表单验证
formRef.value.validate((isValid) => {
if (isValid) {
// 触发submitOk事件传递表单数据
emits('submitOk', formData);
// 显示成功消息
ElMessage.success('提交成功');
}
});
};
// 日期格式化工具函数
// 将Date对象格式化为 YYYY-MM-DD HH:mm 格式的字符串
=======
const submit = () => {
formRef.value.validate((isValid) => {
if (isValid) {
@@ -356,7 +210,6 @@ const submit = () => {
});
};
// 日期格式化工具
>>>>>>> v1.3
const formatDateTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
@@ -365,36 +218,17 @@ 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(() => {});
// 生命周期钩子 - 组件挂载后
onMounted(() => {
console.log('当前患者信息:', patientInfo);
// 从store获取患者信息
=======
// 生命周期
onBeforeMount(() => {});
onMounted(() => {
console.log('当前患者信息:', patientInfo);
>>>>>>> v1.3
patient.value = patientInfo.value;
// 初始化发病日期为当前时间
if (!formData.onsetDate) {
@@ -403,10 +237,6 @@ onMounted(() => {
});
// 监听患者信息变化,实现联动显示
<<<<<<< HEAD
// 当patientInfo发生变化时更新本地patient引用
=======
>>>>>>> v1.3
watch(
() => patientInfo.value,
(newPatientInfo) => {
@@ -415,12 +245,7 @@ watch(
{ deep: true }
);
<<<<<<< HEAD
// 暴露接口供父组件调用
// 将formData、submit方法和setFormData方法暴露给父组件使用
=======
// 暴露接口
>>>>>>> v1.3
defineExpose({ formData, submit, setFormData });
</script>
@@ -430,23 +255,15 @@ 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
}
/* 顶部姓名样式 */
@@ -461,19 +278,12 @@ 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;
@@ -489,11 +299,8 @@ defineExpose({ formData, submit, setFormData });
/* 完整表单容器 */
.medical-full-form {
width: 100%;
<<<<<<< HEAD
=======
min-width: 0; /* 防止内容强制拉伸容器 */
box-sizing: border-box;
>>>>>>> v1.3
}
/* 区域通用样式 */
@@ -515,11 +322,8 @@ 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; /* 取消底部间距,避免换行重叠 */
@@ -590,17 +394,11 @@ 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;
@@ -619,8 +417,4 @@ defineExpose({ formData, submit, setFormData });
--el-input-textarea-min-height: 80px;
}
}
<<<<<<< HEAD
</style>
=======
</style>
>>>>>>> v1.3