根因: - Bug #请修复 Bug #591 存在的问题 修复: - ### 变更摘要 - 全链路数据流分析**:录取(弹窗输入)→ 保存(API传入)→ 查询(Mapper返回)→ 修改(Service记录)→ 删除/停止(状态变更)→ 关联(列表展示) - ### 后端变更(4个文件) - 1. `AdviceBatchOpParam.java`** — 停嘱参数添加 `stopTime` 字段 - 新增 `@JsonFormat Date stopTime`,支持前端传入停嘱时间 - 2. `RequestBaseDto.java`** — 查询DTO添加 `stopUserName`、`stopTime` 字段 - 新增 `String stopUserName`(停嘱医生姓名) - 新增 `Date stopTime`(停嘱时间) - 3. `AdviceManageAppServiceImpl.java`** — 停嘱Service增强 - 优先使用前端传入的 `stopTime`,兜底用当前时间 - 通过 `SecurityUtils.getNickName()` 获取当前操作用户昵称,记录到 `updateBy` - 药品和诊疗两个更新入口均已同步修改 - 4. `AdviceManageAppMapper.xml`** — 三个UNION ALL子查询添加字段 - 药品子查询:`T1.effective_dose_end AS stop_time` + `T1.update_by AS stop_user_name` - 耗材子查询:`NULL AS stop_time` + `'' AS stop_user_name` - 诊疗子查询:`T1.occurrence_end_time AS stop_time` + `T1.update_by AS stop_user_name` - ### 前端变更(1个文件) - `order/index.vue`**: - 1. **停嘱时间弹窗** — 点击「停嘱」后弹出 `el-dialog`,内含 `el-date-picker`(datetime类型,默认当前时间),确定后才调用API - 2. **表格列** — 在「皮试」列后面、「诊断」列前面新增两列: - 「停嘱医生」`prop="stopUserName"`,宽度120px - 「停嘱时间」`prop="stopTime"`,宽度170px - 3. **`handleStopAdvice`** — 保留原有校验(未保存/未签发/已停止检查),校验通过后弹出时间选择弹窗而非直接调API - 4. **`confirmStopAdvice`** — 新增确认函数,将 `stopTime` 拼入请求参数后调用 `stopAdvice` API - ### 验证结果 - ✅ 前端 Lint 检查通过(仅1个预存的 `vue/no-dupe-keys` 警告) - ✅ 后端 Maven 编译通过(BUILD SUCCESS)
366 lines
9.0 KiB
Vue
Executable File
366 lines
9.0 KiB
Vue
Executable File
<template>
|
||
<div class="assessment-page">
|
||
<div class="page-container">
|
||
<!-- 医院头部 -->
|
||
<div class="hospital-header">
|
||
<h1 class="hospital-name">
|
||
<span class="hospital-text">{{ userStore.hospitalName }}</span>
|
||
</h1>
|
||
</div>
|
||
<!-- 页面标题 -->
|
||
<h2 class="form-title">
|
||
住院病人风险评估表
|
||
</h2>
|
||
|
||
<!-- 表单卡片 -->
|
||
<el-form
|
||
:model="formData"
|
||
label-width="100px"
|
||
>
|
||
<el-row>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="科室"
|
||
label-position="top"
|
||
>
|
||
<el-input
|
||
v-model="formData.department"
|
||
readonly="true"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="床号"
|
||
label-position="top"
|
||
class="comment-padding"
|
||
>
|
||
<el-input
|
||
v-model="formData.bedNo"
|
||
readonly="true"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="住院号"
|
||
label-position="top"
|
||
class="comment-padding"
|
||
>
|
||
<el-input
|
||
v-model="formData.busNo"
|
||
readonly="true"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="姓名"
|
||
label-position="top"
|
||
>
|
||
<el-input
|
||
v-model="formData.patientName"
|
||
readonly="true"
|
||
class="auto-resize-input"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="性别"
|
||
label-position="top"
|
||
class="comment-padding"
|
||
>
|
||
<el-input
|
||
v-model="formData.gender"
|
||
readonly="true"
|
||
class="auto-resize-input"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="年龄"
|
||
label-position="top"
|
||
class="comment-padding"
|
||
>
|
||
<el-input
|
||
v-model="formData.age"
|
||
readonly="true"
|
||
class="auto-resize-input"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-form-item
|
||
label="病情简介"
|
||
label-position="top"
|
||
>
|
||
<el-input
|
||
v-model="formData.adm_cond"
|
||
type="textarea"
|
||
:autosize="{ minRows: 1, maxRows: 100 }"
|
||
class="full-width-textarea"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
label="可能发生的不良后果及预后"
|
||
label-position="top"
|
||
>
|
||
<el-input
|
||
v-model="formData.effectless"
|
||
type="textarea"
|
||
:autosize="{ minRows: 1, maxRows: 100 }"
|
||
class="full-width-textarea"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
label="评估等级"
|
||
label-position="top"
|
||
>
|
||
<el-radio-group v-model="formData.evalLevel">
|
||
<el-radio label="一般">
|
||
一般
|
||
</el-radio>
|
||
<el-radio label="病重">
|
||
病重
|
||
</el-radio>
|
||
<el-radio label="病危">
|
||
病危
|
||
</el-radio>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
<el-form-item
|
||
label="护理等级"
|
||
label-position="top"
|
||
>
|
||
<el-radio-group v-model="formData.nurseLevel">
|
||
<el-radio label="特级护理">
|
||
特级护理
|
||
</el-radio>
|
||
<el-radio label="一级护理">
|
||
一级护理
|
||
</el-radio>
|
||
<el-radio label="二级护理">
|
||
二级护理
|
||
</el-radio>
|
||
<el-radio label="三级护理">
|
||
三级护理
|
||
</el-radio>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
<el-form-item label="收集资料时间:">
|
||
<span class="date-display">{{ currentDate }}</span>
|
||
</el-form-item>
|
||
<el-row>
|
||
<el-col :span="8">
|
||
<el-form-item label="评估医师签名:">
|
||
<el-input
|
||
v-model="formData.sign_doc"
|
||
disabled
|
||
:autosize="{ minRows: 1 }"
|
||
class="auto-resize-input"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="主治医师签名:"
|
||
class="comment-padding"
|
||
>
|
||
<el-input
|
||
v-model="formData.sign_maindoc"
|
||
:autosize="{ minRows: 1 }"
|
||
class="auto-resize-input"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item
|
||
label="科主任签名:"
|
||
class="comment-padding"
|
||
>
|
||
<el-input
|
||
v-model="formData.sign_leader"
|
||
:autosize="{ minRows: 1 }"
|
||
class="auto-resize-input"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
</div>
|
||
</div>
|
||
<inAssessmentForm
|
||
v-if="isShowprintDom"
|
||
ref="recordPrintRef"
|
||
/>
|
||
</template>
|
||
|
||
<script setup>
|
||
import {computed, nextTick, onMounted, reactive, ref} from 'vue';
|
||
import inAssessmentForm from '../views/hospitalRecord/components/inAssessmentForm.vue';
|
||
import useUserStore from '@/store/modules/user';
|
||
import {previewPrint} from '../utils/printUtils';
|
||
|
||
defineOptions({
|
||
name: 'InHospitalCaseForm',
|
||
});
|
||
const isShowprintDom = ref(false);
|
||
const recordPrintRef = ref();
|
||
const props = defineProps({
|
||
patientInfo: {
|
||
type: Object,
|
||
required: true,
|
||
},
|
||
});
|
||
|
||
const patient = props.patientInfo;
|
||
const userStore = useUserStore();
|
||
|
||
// 表单数据 - 修复:将 formData 定义移到 patient 之后
|
||
const formData = reactive({
|
||
department: patient?.inHospitalOrgName || '',
|
||
bedNo: patient?.bedName || '',
|
||
busNo: patient?.busNo || '',
|
||
patientName: patient?.patientName || '',
|
||
gender: patient?.genderEnum_enumText || '',
|
||
age: patient?.age || '',
|
||
adm_cond: '',
|
||
effectless: '',
|
||
evalLevel: '',
|
||
nurseLevel: '',
|
||
sign_doc: userStore.nickName || '',
|
||
sign_maindoc: '',
|
||
sign_leader: '',
|
||
});
|
||
|
||
// 当前日期(YYYY-MM-DD)
|
||
const currentDate = computed(() => {
|
||
const d = new Date();
|
||
const yyyy = d.getFullYear();
|
||
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
||
const dd = String(d.getDate()).padStart(2, '0');
|
||
return `${yyyy}-${mm}-${dd}`;
|
||
});
|
||
|
||
//表单引用
|
||
const formRef = ref(null);
|
||
|
||
//提交表单
|
||
const submit = () => {
|
||
// 如果需要表单验证,可以使用以下代码
|
||
// formRef.value.validate((valid) => {
|
||
// if (valid) {
|
||
// emits('submitOk', formData);
|
||
// }
|
||
// });
|
||
// 简化版本:
|
||
emits('submitOk', formData);
|
||
};
|
||
|
||
//表单数据赋值
|
||
const setFormData = (data) => {
|
||
if (data) {
|
||
Object.assign(formData, data);
|
||
}
|
||
};
|
||
|
||
// 定义 emits
|
||
const emits = defineEmits(['submitOk']);
|
||
|
||
onMounted(() => {
|
||
// 页面加载完成后触发一次 resize 事件,确保输入框高度正确
|
||
setTimeout(() => {
|
||
window.dispatchEvent(new Event('resize'));
|
||
}, 100);
|
||
console.log('@@@@@=======>', JSON.stringify(props.patientInfo));
|
||
});
|
||
// 打印方法
|
||
const printFun = () => {
|
||
console.log('入院记录打印');
|
||
isShowprintDom.value = true;
|
||
nextTick(() => {
|
||
recordPrintRef?.value.setData(formData);
|
||
nextTick(() => {
|
||
previewPrint(recordPrintRef?.value.getDom());
|
||
isShowprintDom.value = false;
|
||
});
|
||
});
|
||
};
|
||
//暴露接口
|
||
defineExpose({ formData, submit, setFormData, printFun });
|
||
</script>
|
||
|
||
<style scoped>
|
||
/* ===== 页面容器与背景 ===== */
|
||
.comment-padding {
|
||
padding-left: 10px;
|
||
}
|
||
.assessment-page {
|
||
font-family: 'Microsoft YaHei', 宋体, sans-serif;
|
||
width: 100%;
|
||
}
|
||
|
||
.page-container {
|
||
width: 100%;
|
||
}
|
||
|
||
/* ===== 医院头部 ===== */
|
||
.hospital-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-top: 40px;
|
||
}
|
||
|
||
.hospital-name {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 0.5rem;
|
||
font-size: 1.5rem;
|
||
font-weight: 700;
|
||
color: #1f2937;
|
||
margin: 0;
|
||
}
|
||
|
||
.hospital-text {
|
||
line-height: 1;
|
||
}
|
||
|
||
/* ===== 表单标题与操作 ===== */
|
||
.form-title {
|
||
margin-top: 10px;
|
||
font-size: 1.25rem;
|
||
font-weight: 600;
|
||
text-align: center;
|
||
margin: 1.25rem 0;
|
||
color: #1f2937;
|
||
}
|
||
|
||
/* ===== 表单卡片 ===== */
|
||
.form-card {
|
||
border: 1px solid #e5e7eb;
|
||
border-radius: 4px;
|
||
}
|
||
|
||
/* ===== Textarea 自动扩展样式 ===== */
|
||
.full-width-textarea {
|
||
width: 100%;
|
||
}
|
||
|
||
:deep(.full-width-textarea textarea) {
|
||
overflow: hidden;
|
||
resize: none;
|
||
min-height: auto;
|
||
}
|
||
|
||
/* ===== 日期显示 ===== */
|
||
.date-display {
|
||
font-size: 0.95rem;
|
||
color: #666;
|
||
}
|
||
</style>
|