| | |
| | | <!--拆机界面--> |
| | | <template> |
| | | <el-form |
| | | class="patient-compact-form" |
| | | ref="formRef" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="100px" |
| | | v-loading="formLoading" |
| | | > |
| | | <!-- ===== 编辑区(需要录入的字段)===== --> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="患者编号" prop="patId"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="申请单号" prop="applyNo"> |
| | | <el-input v-model="formData.applyNo" placeholder="请输入申请单号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="检查项目" prop=""> |
| | | {{ formData?.checkType && getCheckTypeName(formData?.checkType) }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="患者编号" prop=""> |
| | | <el-input v-model="formData.patId" placeholder="请输入患者编号" @input="getRentInfoByPatId" /> |
| | | </el-form-item> |
| | | <el-form-item label="患者名称" prop="patName"> |
| | | <el-input v-model="formData.patName" placeholder="请输入患者名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="患者描述" prop="patDeptDesc"> |
| | | 科室: {{formData.patDeptDesc}} 病区: {{formData.patWardDesc}} 床位: {{formData.patBedNo}} |
| | | </el-form-item> |
| | | <el-form-item label="装机时间" prop="rentTime"> |
| | | <el-date-picker |
| | | v-model="formData.rentTime" |
| | | type="date" |
| | | value-format="x" |
| | | placeholder="选择装机时间" |
| | | :readonly="true" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="患者姓名" prop="patName"> |
| | | <el-input v-model="formData.episodeId" placeholder="请输入患者姓名" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="设备编号" prop="devId"> |
| | | <el-input v-model="formData.devId" placeholder="请输入设备编号" @input="getRentInfoByDevId" /> |
| | | </el-form-item> |
| | | <el-form-item label="设备描述" prop=""> |
| | | {{formData.brand + " " + formData.model}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="拆机时间" prop="returnTime"> |
| | | <el-date-picker |
| | | v-model="formData.returnTime" |
| | |
| | | placeholder="选择拆机时间" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="干扰数" prop="interference"> |
| | | <el-input v-model="formData.interference" placeholder="请输入干扰数" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="脱落" prop="detachment"> |
| | | <el-switch |
| | | v-model="formData.detachment" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | /> |
| | | <el-switch v-model="formData.detachment" :active-value="1" :inactive-value="0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="基线粗" prop="baseline"> |
| | | <el-switch |
| | | v-model="formData.baseline" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | /> |
| | | <el-switch v-model="formData.baseline" :active-value="1" :inactive-value="0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- ===== 患者信息(需求1:18 项统一展示,**一行四列**)===== |
| | | 后端 DevRentRespVO 已扩字段并回填 --> |
| | | <PatientInfoBlock :data="formData" check-type-field="checkType" :span="6" /> |
| | | |
| | | <!-- ===== 设备信息(一行四列)===== |
| | | 「设备编号 / 拆机时间 / 干扰数 / 脱落 / 基线粗」已在上方编辑区录入, |
| | | 此处只读展示其余设备字段(装机时间、登记时间、设备描述等) --> |
| | | <DeviceInfoBlock :data="formData" time-label-mode="dismantle" :span="6" /> |
| | | |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-button @click="submitForm" type="primary" :disabled="formLoading">拆机完成</el-button> |
| | | <el-button @click="resetForm()">重 置</el-button> |
| | | <el-button @click="loseDismantle" :disabled="formLoading">遗 失</el-button> |
| | | <el-button @click="damageDismantle" :disabled="formLoading">损 毁</el-button> |
| | | <!-- 【本次需求】操作功能区:与其它三个工作台同款容器(浅主色底 + 左侧主色竖条) --> |
| | | <div class="patient-actions"> |
| | | <el-button @click="submitForm" type="primary" :disabled="formLoading">拆机完成</el-button> |
| | | <el-button @click="resetForm()">重 置</el-button> |
| | | <el-button @click="loseDismantle" :disabled="formLoading">遗 失</el-button> |
| | | <el-button @click="damageDismantle" :disabled="formLoading">损 毁</el-button> |
| | | </div> |
| | | |
| | | <!-- 【本次需求】操作功能区与已完成记录之间的标题栏(与检查/领用/装机三个工作台同款) --> |
| | | <div class="records-title"> |
| | | <span class="records-title__bar"></span> |
| | | <span class="records-title__text">已完成列表</span> |
| | | </div> |
| | | |
| | | <!-- 医生拆机列表 --> |
| | | <ContentWrap> |
| | |
| | | import {dateFormatter} from "@/utils/formatTime"; |
| | | import {JobRecordApi, JobRecordVO} from "@/api/ecg/jobrecord"; |
| | | import {isStringEmpty} from "@/utils/stringUtil"; |
| | | import {curDayEnd, curDayStart} from "@/utils/dateUtil"; |
| | | import {calculateHours, curDayEnd, curDayStart} from "@/utils/dateUtil"; |
| | | import {AppointmentApi} from "@/api/ecg/appointment"; |
| | | import {tranlateDevState} from "../../../utils/statusFormatter"; |
| | | // 需求1:患者信息 18 项统一展示块 |
| | | import PatientInfoBlock from "@/views/ecg/doctor/components/PatientInfoBlock.vue"; |
| | | import DeviceInfoBlock from "@/views/ecg/doctor/components/DeviceInfoBlock.vue"; |
| | | |
| | | /** 装机拆机 表单 */ |
| | | defineOptions({ name: 'DevrDismantle' }) |
| | |
| | | |
| | | /** 提交表单 */ |
| | | const submitForm = async () => { |
| | | const data = formData.value as unknown as DevRentVO |
| | | const durationHours = calculateHours(data.rentTime!, data.returnTime!) |
| | | if (durationHours > 20) { |
| | | _submitForm() |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm( |
| | | '离装机不到20小时,确定要拆机吗?', |
| | | 'Warning', |
| | | { |
| | | confirmButtonText: '好的', |
| | | cancelButtonText: '不用', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(async () => { |
| | | _submitForm() |
| | | }) |
| | | .catch(() => { |
| | | /* |
| | | ElNotification({ |
| | | title: '温馨提示', |
| | | message: '确认失败', |
| | | type: 'warning' |
| | | }) |
| | | */ |
| | | }) |
| | | } |
| | | |
| | | const _submitForm = async () => { |
| | | // 校验表单 |
| | | await formRef.value.validate() |
| | | // 提交请求 |
| | |
| | | category: '', |
| | | brand: '', |
| | | model: '', |
| | | devState: undefined, |
| | | // 需求1:患者信息 18 项(PatientInfoBlock 依赖这些字段, |
| | | // 不初始化会导致 Vue 在模板中读取未定义属性并告警) |
| | | applyNo: undefined, |
| | | episodeId: undefined, |
| | | patGender: undefined, |
| | | patBirthday: undefined, |
| | | registerDate: undefined, |
| | | doctor: undefined, |
| | | doctorTime: undefined, |
| | | patSrc: undefined, |
| | | patMobile: undefined, |
| | | patPhone: undefined, |
| | | medicalCard: undefined, |
| | | outpatientNo: undefined, |
| | | patIdentityId: undefined, |
| | | tolerance: undefined, |
| | | status: undefined, |
| | | seqNum: undefined, |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | |
| | | } |
| | | |
| | | const getRentInfo = async () => { |
| | | const data = await DevRentApi.getInstalledRent(formData.value) |
| | | const data = await DevRentApi.getExistingRent(formData.value) |
| | | if (null === data) |
| | | return |
| | | |
| | |
| | | } |
| | | |
| | | const getSelectedRent = async (rentId) => { |
| | | formData.value = await DevRentApi.getDevRent(rentId) |
| | | // ⚠️ 原实现是整体替换 formData,会把患者信息冲成 null(详见 DevReadyPanel 中同类修复的说明) |
| | | const _record = await DevRentApi.getDevRent(rentId) |
| | | if (_record) { |
| | | const _merged = { ...formData.value } as Record<string, any> |
| | | Object.keys(_record as Record<string, any>).forEach((k) => { |
| | | const v = (_record as Record<string, any>)[k] |
| | | if (v !== null && v !== undefined && v !== '') _merged[k] = v |
| | | }) |
| | | formData.value = _merged as typeof formData.value |
| | | } |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | /* |
| | | 【本次需求】按钮统一尺寸 / 字号(与其它三个工作台一致;本页不使用 DoctorPageLayout) |
| | | 普通按钮 32px / 14px 字;表格内行内按钮 28px / 13px 字;链接式按钮只放大字号。 |
| | | */ |
| | | .patient-actions :deep(.el-button) { |
| | | height: 32px; |
| | | padding: 0 14px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .el-table :deep(.el-button:not(.is-link)) { |
| | | height: 28px; |
| | | padding: 0 10px; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .patient-actions :deep(.el-button.is-link), |
| | | .el-table :deep(.el-button.is-link) { |
| | | height: auto; |
| | | padding: 0 4px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* |
| | | 【本次需求】操作功能区:与检查/领用/装机三个工作台完全一致 —— |
| | | 极浅主色底 + 细边框 + 左侧 3px 主色竖条(与「已完成列表」标题条同款语言)。 |
| | | */ |
| | | .patient-actions { |
| | | display: flex; |
| | | flex: none; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | align-items: center; |
| | | padding: 8px 10px; |
| | | margin: 2px 0 10px; |
| | | background-color: var(--el-color-primary-light-9); |
| | | border: 1px solid var(--el-color-primary-light-7); |
| | | border-left: 3px solid var(--el-color-primary); |
| | | border-radius: 4px; |
| | | |
| | | /* Element Plus 给相邻 el-button 默认加了 margin-left:12px,会与 gap 叠加,清掉 */ |
| | | :deep(.el-button + .el-button) { |
| | | margin-left: 0; |
| | | } |
| | | } |
| | | |
| | | /* 【本次需求】「已完成列表」标题栏:与检查/领用/装机三个工作台完全一致 |
| | | (左侧主色竖线 + 14px 加粗,紧凑高度不挤压表格) */ |
| | | .records-title { |
| | | display: flex; |
| | | align-items: center; |
| | | flex: none; |
| | | gap: 6px; |
| | | padding: 2px 0 6px; |
| | | |
| | | &__bar { |
| | | width: 3px; |
| | | height: 14px; |
| | | background-color: var(--el-color-primary); |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | &__text { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: var(--el-text-color-primary); |
| | | } |
| | | } |
| | | |
| | | /* ========================================================================== |
| | | 需求:表单内容挤占了下方记录表格的空间 —— 压缩行间距。 |
| | | Element Plus 默认 `.el-form-item { margin-bottom: 18px }`; |
| | | 本页表单含 18 项患者信息(4 列 = 5 行)+ 9 项设备信息, |
| | | 仅间距就要上百 px,把 el-table 挤到看不见。 |
| | | 这里统一压到 4px。注意 :deep 是必需的(el-form-item 是本组件的子组件渲染)。 |
| | | ========================================================================== */ |
| | | .patient-compact-form :deep(.el-form-item) { |
| | | margin-bottom: 4px; |
| | | } |
| | | </style> |