| | |
| | | <el-card class="detail-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">供者基本信息</span> |
| | | <el-button |
| | | v-if="isEdit" |
| | | type="primary" |
| | | style="float: right; padding: 3px 0" |
| | | @click="handleSave" |
| | | > |
| | | <el-button type="success" style="float: right;" @click="handleSave"> |
| | | 保存信息 |
| | | </el-button> |
| | | </div> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="住院号" prop="caseNo"> |
| | | <el-input v-model="form.caseNo" :readonly="!isEdit" /> |
| | | <el-input v-model="form.caseNo" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="捐献者姓名" prop="donorName"> |
| | | <el-input v-model="form.donorName" :readonly="!isEdit" /> |
| | | <el-form-item label="捐献者姓名" prop="name"> |
| | | <el-input v-model="form.name" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="性别" prop="gender"> |
| | | <el-select |
| | | v-model="form.gender" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | | > |
| | | <el-select v-model="form.sex" style="width: 100%"> |
| | | <el-option label="男" value="0" /> |
| | | <el-option label="女" value="1" /> |
| | | </el-select> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="年龄" prop="age"> |
| | | <el-input v-model="form.age" :readonly="!isEdit" /> |
| | | <el-input v-model="form.age" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="疾病诊断" prop="diagnosis"> |
| | | <el-input v-model="form.diagnosis" :readonly="!isEdit" /> |
| | | <el-form-item label="疾病诊断" prop="diagnosisname"> |
| | | <el-input v-model="form.diagnosisname" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="所在医疗机构" prop="hospitalName"> |
| | | <el-input v-model="form.hospitalName" :readonly="!isEdit" /> |
| | | <el-form-item label="首诊医疗机构" prop="treatmenthospitalname"> |
| | | <el-input v-model="form.treatmenthospitalname" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="患者状态" prop="patientStatus"> |
| | | <el-select |
| | | v-model="form.patientStatus" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="DCD" value="1" /> |
| | | <el-option label="DBD" value="2" /> |
| | | <el-option label="DBCD" value="3" /> |
| | | <el-option label="已完成捐献" value="4" /> |
| | | <el-option label="未完成捐献" value="5" /> |
| | | <el-form-item label="患者状态" prop="recordstate"> |
| | | <el-select v-model="form.recordstate" style="width: 100%"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_DonationCategory || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-form-item |
| | | label="未完成原因" |
| | | prop="incompleteReason" |
| | | v-if="form.patientStatus === '5'" |
| | | v-if="form.recordstate === '5'" |
| | | > |
| | | <el-input |
| | | v-model="form.incompleteReason" |
| | | :readonly="!isEdit" |
| | | placeholder="请输入未完成捐献的原因" |
| | | /> |
| | | </el-form-item> |
| | |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="入院时间" prop="admissionTime"> |
| | | <el-form-item label="上报时间" prop="reporttime"> |
| | | <el-date-picker |
| | | v-model="form.admissionTime" |
| | | v-model="form.reporttime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | :disabled="!isEdit" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="出院时间" prop="dischargeTime"> |
| | | <el-form-item label="死亡时间" prop="deathTime"> |
| | | <el-date-picker |
| | | v-model="form.dischargeTime" |
| | | v-model="form.deathTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | :disabled="!isEdit" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="协调员" prop="coordinator"> |
| | | <el-input v-model="form.coordinator" :readonly="!isEdit" /> |
| | | <el-form-item label="协调员" prop="coordinatorName"> |
| | | <el-input v-model="form.coordinatorName" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="血型" prop="bloodType"> |
| | | <el-select |
| | | v-model="form.bloodType" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="A型" value="A" /> |
| | | <el-option label="B型" value="B" /> |
| | | <el-option label="O型" value="O" /> |
| | | <el-option label="AB型" value="AB" /> |
| | | <el-form-item label="血型" prop="bloodtype"> |
| | | <el-select v-model="form.bloodtype" style="width: 100%"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_BloodType" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="RH因子" prop="rhFactor"> |
| | | <el-select |
| | | v-model="form.rhFactor" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="阳性" value="positive" /> |
| | | <el-option label="阴性" value="negative" /> |
| | | </el-select> |
| | | <el-form-item label="Rh(D)" prop="rhYin"> |
| | | <el-radio-group v-model="form.rhYin"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_bloodtype_rhd || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | type="textarea" |
| | | :rows="3" |
| | | v-model="form.specialMedicalHistory" |
| | | :readonly="!isEdit" |
| | | placeholder="记录特殊病史信息" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-card class="assessment-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">供者评估各项记录</span> |
| | |
| | | label="培养类型" |
| | | align="center" |
| | | prop="cultureType" |
| | | > |
| | | <!-- <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="cultureTypeOptions" |
| | | :value="scope.row.cultureType" |
| | | /> |
| | | </template> --> |
| | | </el-table-column> |
| | | /> |
| | | <el-table-column |
| | | label="采样时间" |
| | | align="center" |
| | |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- 附件列 --> |
| | | <el-table-column label="附件" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="cultureTotal > 0" |
| | | :total="cultureTotal" |
| | | :page.sync="cultureQueryParams.pageNum" |
| | | :limit.sync="cultureQueryParams.pageSize" |
| | | @pagination="getCultureList" |
| | | /> |
| | | </el-card> |
| | | </el-tab-pane> |
| | | |
| | |
| | | <el-tab-pane label="肝功能肾功能" name="liverKidney"> |
| | | <liver-kidney-panel |
| | | ref="liverKidney" |
| | | :initial-data="assessmentData.liverKidney" |
| | | :is-editing="isEdit && activeTab === 'liverKidney'" |
| | | @data-change="handleLiverKidneyDataChange" |
| | | /> |
| | |
| | | <el-tab-pane label="血常规" name="bloodRoutine"> |
| | | <blood-routine-panel |
| | | ref="bloodRoutine" |
| | | :initial-data="assessmentData.bloodRoutine" |
| | | :is-editing="isEdit && activeTab === 'bloodRoutine'" |
| | | @data-change="handleBloodRoutineDataChange" |
| | | /> |
| | |
| | | <el-tab-pane label="尿常规" name="urineRoutine"> |
| | | <urine-routine-panel |
| | | ref="urineRoutine" |
| | | :initial-data="assessmentData.urineRoutine" |
| | | :is-editing="isEdit && activeTab === 'urineRoutine'" |
| | | @data-change="handleUrineRoutineDataChange" |
| | | /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-card> |
| | | <!-- 培养结果记录 --> |
| | | |
| | | <!-- 简化后的护理核查记录 --> |
| | | <!-- 护理核查记录 --> |
| | | <el-card class="record-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">护理核查记录</span> |
| | |
| | | min-width="200" |
| | | show-overflow-tooltip |
| | | /> |
| | | <!-- 附件列 --> |
| | | <el-table-column label="附件" align="center" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | |
| | | width="180" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleEditRecord(scope.row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | style="color: #F56C6C;" |
| | | @click="handleDeleteRecord(scope.row)" |
| | | >删除</el-button |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleEditRecord(scope.row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | style="color: #F56C6C;" |
| | | @click="handleDeleteRecord(scope.row)" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="recordTotal > 0" |
| | | :total="recordTotal" |
| | | :page.sync="recordQueryParams.pageNum" |
| | | :limit.sync="recordQueryParams.pageSize" |
| | | @pagination="getRecordList" |
| | | /> |
| | | </el-card> |
| | | |
| | | <!-- 培养记录编辑对话框 --> |
| | | <el-dialog |
| | | :title="cultureDialogTitle" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- 附件上传 --> |
| | | <el-form-item label="附件"> |
| | | <upload-attachment |
| | | :file-list="cultureForm.attachments" |
| | | <UploadAttachment |
| | | ref="cultureUploadAttachment" |
| | | :file-list="cultureFileList" |
| | | :limit="10" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleCultureAttachmentChange" |
| | | @upload-success="handleCultureUploadSuccess" |
| | | @upload-error="handleCultureUploadError" |
| | | @remove="handleCultureAttachmentRemove" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <!-- 附件上传 --> |
| | | <el-form-item label="附件"> |
| | | <upload-attachment |
| | | :file-list="recordForm.attachments" |
| | | <UploadAttachment |
| | | ref="recordUploadAttachment" |
| | | :file-list="recordFileList" |
| | | :limit="10" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleRecordAttachmentChange" |
| | | @upload-success="handleRecordUploadSuccess" |
| | | @upload-error="handleRecordUploadError" |
| | | @remove="handleRecordAttachmentRemove" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- 附件预览对话框 --> |
| | | <attachment-preview |
| | | :visible="attachmentPreviewVisible" |
| | | :file-list="currentAttachmentList" |
| | | <el-dialog |
| | | :title="attachmentPreviewTitle" |
| | | @close="attachmentPreviewVisible = false" |
| | | :visible.sync="attachmentPreviewVisible" |
| | | width="900px" |
| | | @close="handleAttachmentPreviewClose" |
| | | > |
| | | <el-table :data="currentAttachmentList" style="width: 100%" size="small"> |
| | | <el-table-column label="文件名" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | class="el-icon-document" |
| | | :style="{ color: getFileIconColor(scope.row.fileName) }" |
| | | ></i> |
| | | <span class="file-name">{{ scope.row.fileName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="文件类型" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getFileTagType(scope.row.fileName)" size="small"> |
| | | {{ getFileTypeText(scope.row.fileName) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="上传时间" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatDateTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="文件大小" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="150" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="primary" |
| | | @click="handlePreviewAttachment(scope.row)" |
| | | :disabled="!isPreviewable(scope.row.fileName)" |
| | | > |
| | | 预览 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="success" |
| | | @click="handleDownloadAttachment(scope.row)" |
| | | > |
| | | 下载 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | <!-- 文件预览弹窗 --> |
| | | <FilePreviewDialog |
| | | :visible="filePreviewVisible" |
| | | :file="currentPreviewFile" |
| | | @close="filePreviewVisible = false" |
| | | @download="handleDownloadAttachment" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getMaintenanceDetail, updateMaintenance } from "./mockMaintenanceApi"; |
| | | import { |
| | | listCultureResults, |
| | | addCultureResult, |
| | | updateCultureResult, |
| | | deleteCultureResult |
| | | } from "./mockMaintenanceApi"; |
| | | import { |
| | | listNursingRecords, |
| | | addNursingRecord, |
| | | updateNursingRecord, |
| | | deleteNursingRecord |
| | | } from "./mockMaintenanceApi"; |
| | | import { maintainList, maintainedit, maintainAdd } from "@/api/businessApi"; |
| | | import Pagination from "@/components/Pagination"; |
| | | import UploadAttachment from "@/components/UploadAttachment"; |
| | | import AttachmentPreview from "@/components/AttachmentPreview"; |
| | | import LiverKidneyPanel from "./components/LiverKidneyPanel.vue"; |
| | | import BloodRoutinePanel from "./components/BloodRoutinePanel.vue"; |
| | | import UrineRoutinePanel from "./components/UrineRoutinePanel.vue"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import LiverKidneyPanel from "@/components/MaintainComponents/LiverKidneyPanel.vue"; |
| | | import BloodRoutinePanel from "@/components/MaintainComponents/BloodRoutinePanel.vue"; |
| | | import UrineRoutinePanel from "@/components/MaintainComponents/UrineRoutinePanel.vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | name: "MaintenanceDetail", |
| | | components: { |
| | | Pagination, |
| | | UploadAttachment, |
| | | AttachmentPreview, |
| | | FilePreviewDialog, |
| | | LiverKidneyPanel, |
| | | BloodRoutinePanel, |
| | | UrineRoutinePanel |
| | | }, |
| | | dicts: [ |
| | | "sys_donornode", |
| | | "sys_BloodType", |
| | | "sys_EthicalReview", |
| | | "sys_BaseAssessConclusion", |
| | | "sys_bloodtype_rhd", |
| | | "sys_DonationCategory" |
| | | ], |
| | | |
| | | data() { |
| | | return { |
| | | isEdit: true, |
| | | isEdit: false, |
| | | currentMaintenanceId: null, |
| | | isEditMode: false, |
| | | form: { |
| | | id: undefined, |
| | | caseNo: "", |
| | | donorName: "", |
| | | name: "", |
| | | gender: "", |
| | | age: "", |
| | | diagnosis: "", |
| | | hospitalName: "", |
| | | patientStatus: "1", |
| | | admissionTime: "", |
| | | dischargeTime: "", |
| | | coordinator: "", |
| | | bloodType: "", |
| | | diagnosisname: "", |
| | | treatmenthospitalname: "", |
| | | recordstate: "1", |
| | | reporttime: "", |
| | | deathTime: "", |
| | | coordinatorName: "", |
| | | bloodtype: "", |
| | | rhFactor: "", |
| | | specialMedicalHistory: "", |
| | | incompleteReason: "" |
| | | }, |
| | | activeTab: "culture", |
| | | // 培养结果相关数据 |
| | | // 培养结果相关数据 |
| | | cultureList: [ |
| | | { |
| | | id: 1, |
| | | cultureType: "血培养", |
| | | sampleTime: "2024-12-19 10:30:00", |
| | | result: "阴性", |
| | | bacteria: "", |
| | | drugSensitivity: "", |
| | | testingInstitution: "北京医学检验中心", |
| | | specimenType: "血液", |
| | | remarks: "常规检测", |
| | | attachments: [ |
| | | { |
| | | id: 1, |
| | | fileName: "血培养报告.pdf", |
| | | fileUrl: |
| | | "http://localhost:8080/profile/upload/2025/12/27/1.COPO供体评估表.pdf", |
| | | fileSize: 1024000, |
| | | uploadTime: "2024-12-19 11:00:00" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | id: 3, |
| | | cultureType: "血培养", |
| | | sampleTime: "2024-12-20 09:15:00", |
| | | result: "阴性", |
| | | bacteria: "", |
| | | drugSensitivity: "", |
| | | testingInstitution: "广州检测中心", |
| | | specimenType: "尿液", |
| | | remarks: "清洁中段尿标本", |
| | | attachments: [] |
| | | }, |
| | | { |
| | | id: 2, |
| | | cultureType: "痰培养结果", |
| | | sampleTime: "2024-12-19 14:20:00", |
| | | result: "阳性", |
| | | bacteria: "金黄色葡萄球菌", |
| | | drugSensitivity: "对青霉素敏感,对头孢类中介", |
| | | testingInstitution: "上海医学检验所", |
| | | specimenType: "痰液", |
| | | remarks: "药敏试验完成", |
| | | attachments: [ |
| | | { |
| | | id: 2, |
| | | fileName: "痰培养结果.jpg", |
| | | fileUrl: |
| | | "https://img95.699pic.com/photo/40142/8262.jpg_wh860.jpg", |
| | | fileSize: 512000, |
| | | uploadTime: "2024-12-19 15:30:00" |
| | | }, |
| | | { |
| | | id: 3, |
| | | fileName: "药敏报告.pdf", |
| | | fileUrl: |
| | | "http://localhost:8080/profile/upload/2025/12/27/(吴龙8.7)每日工作总结.pdf", |
| | | fileSize: 768000, |
| | | uploadTime: "2024-12-19 16:00:00" |
| | | } |
| | | ] |
| | | }, |
| | | extracontentinfo: {}, |
| | | |
| | | { |
| | | id: 4, |
| | | cultureType: "真菌培养", |
| | | sampleTime: "2024-12-20 11:45:00", |
| | | result: "阳性", |
| | | bacteria: "大肠杆菌", |
| | | drugSensitivity: "对左氧氟沙星敏感", |
| | | testingInstitution: "深圳人民医院", |
| | | specimenType: "伤口分泌物", |
| | | remarks: "术后伤口感染监测", |
| | | attachments: [ |
| | | { |
| | | id: 4, |
| | | fileName: "真菌培养.pdf", |
| | | fileUrl: "/reports/culture4.pdf", |
| | | fileSize: 890000, |
| | | uploadTime: "2024-12-20 13:20:00" |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | // 培养结果相关数据 |
| | | cultureList: [], |
| | | cultureLoading: false, |
| | | cultureTotal: 5, |
| | | cultureQueryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }, |
| | | cultureDialogVisible: false, |
| | | cultureDialogTitle: "", |
| | | cultureSaveLoading: false, |
| | |
| | | cultureType: "", |
| | | sampleTime: "", |
| | | result: "阴性", |
| | | attachments: [] // 新增附件字段 |
| | | attachments: [] |
| | | }, |
| | | cultureFileList: [], |
| | | cultureRules: { |
| | | cultureType: [ |
| | | { required: true, message: "请选择培养类型", trigger: "change" } |
| | |
| | | ], |
| | | |
| | | // 护理核查记录相关数据 |
| | | recordList: [ |
| | | { |
| | | id: 1, |
| | | recordTime: "2024-12-19 08:30:00", |
| | | recorder: "张护士", |
| | | temperature: 36.8, |
| | | heartRate: 78, |
| | | bloodPressure: "120/80", |
| | | respirationRate: 18, |
| | | oxygenSaturation: 98, |
| | | urineOutput: 60, |
| | | cvp: 8, |
| | | checkRecord: "患者生命体征平稳,意识清楚,配合治疗", |
| | | remarks: "夜间睡眠良好", |
| | | attachments: [ |
| | | { |
| | | id: 1, |
| | | fileName: "早班护理记录.jpg", |
| | | fileUrl: "/records/nursing1.jpg", |
| | | fileSize: 1024000, |
| | | uploadTime: "2024-12-19 09:00:00" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | id: 2, |
| | | recordTime: "2024-12-19 14:30:00", |
| | | recorder: "李护士", |
| | | temperature: 37.2, |
| | | heartRate: 82, |
| | | bloodPressure: "118/76", |
| | | respirationRate: 16, |
| | | oxygenSaturation: 97, |
| | | urineOutput: 45, |
| | | cvp: 7.5, |
| | | checkRecord: "患者午后体温略有升高,观察中", |
| | | remarks: "建议增加水分摄入", |
| | | attachments: [] |
| | | }, |
| | | { |
| | | id: 3, |
| | | recordTime: "2024-12-19 20:30:00", |
| | | recorder: "王护士", |
| | | temperature: 36.9, |
| | | heartRate: 75, |
| | | bloodPressure: "122/78", |
| | | respirationRate: 17, |
| | | oxygenSaturation: 98, |
| | | urineOutput: 55, |
| | | cvp: 8.2, |
| | | checkRecord: "晚间生命体征稳定,患者休息良好", |
| | | remarks: "夜间监测无异常", |
| | | attachments: [ |
| | | { |
| | | id: 2, |
| | | fileName: "晚班护理记录.pdf", |
| | | fileUrl: "/records/nursing3.pdf", |
| | | fileSize: 890000, |
| | | uploadTime: "2024-12-19 21:00:00" |
| | | }, |
| | | { |
| | | id: 3, |
| | | fileName: "体征监测表.xlsx", |
| | | fileUrl: "/records/monitoring3.xlsx", |
| | | fileSize: 256000, |
| | | uploadTime: "2024-12-19 21:15:00" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | id: 4, |
| | | recordTime: "2024-12-20 08:30:00", |
| | | recorder: "赵护士", |
| | | temperature: 36.7, |
| | | heartRate: 80, |
| | | bloodPressure: "119/77", |
| | | respirationRate: 18, |
| | | oxygenSaturation: 99, |
| | | urineOutput: 65, |
| | | cvp: 7.8, |
| | | checkRecord: "晨间生命体征正常,患者精神状态良好", |
| | | remarks: "准备今日检查", |
| | | attachments: [] |
| | | }, |
| | | { |
| | | id: 5, |
| | | recordTime: "2024-12-20 12:30:00", |
| | | recorder: "刘护士", |
| | | temperature: 37.1, |
| | | heartRate: 85, |
| | | bloodPressure: "121/79", |
| | | respirationRate: 19, |
| | | oxygenSaturation: 96, |
| | | urineOutput: 40, |
| | | cvp: 8.5, |
| | | checkRecord: "午间体温略有波动,继续观察", |
| | | remarks: "已通知医生", |
| | | attachments: [ |
| | | { |
| | | id: 4, |
| | | fileName: "午间护理记录.jpg", |
| | | fileUrl: "/records/nursing5.jpg", |
| | | fileSize: 765000, |
| | | uploadTime: "2024-12-20 13:00:00" |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | recordList: [], |
| | | recordLoading: false, |
| | | recordTotal: 4, |
| | | recordQueryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }, |
| | | recordDialogVisible: false, |
| | | recordDialogTitle: "", |
| | | recordSaveLoading: false, |
| | |
| | | id: undefined, |
| | | recordTime: "", |
| | | recorder: "", |
| | | checkRecord: "", // 改为单字段记录 |
| | | attachments: [] // 新增附件字段 |
| | | checkRecord: "", |
| | | attachments: [] |
| | | }, |
| | | recordFileList: [], |
| | | recordRules: { |
| | | recordTime: [ |
| | | { required: true, message: "请选择核查时间", trigger: "change" } |
| | |
| | | // 附件预览相关 |
| | | attachmentPreviewVisible: false, |
| | | currentAttachmentList: [], |
| | | attachmentPreviewTitle: "" |
| | | attachmentPreviewTitle: "", |
| | | |
| | | // 文件预览相关 |
| | | filePreviewVisible: false, |
| | | currentPreviewFile: null, |
| | | |
| | | // 附件相关配置 |
| | | attachmentLimit: 10, |
| | | attachmentAccept: ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt", |
| | | |
| | | // 评估数据存储 |
| | | assessmentData: { |
| | | liverKidney: {}, |
| | | bloodRoutine: {}, |
| | | urineRoutine: {}, |
| | | cultureResults: [], |
| | | nursingRecords: [] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | const id = this.$route.query.id; |
| | | // this.isEdit = this.$route.query.edit === "true"; |
| | | if (id) { |
| | | this.getDetail(id); |
| | | this.getCultureList(); |
| | | this.getRecordList(); |
| | | this.loadMaintenanceData(); |
| | | }, |
| | | watch: { |
| | | $route(to, from) { |
| | | this.loadMaintenanceData(); |
| | | } |
| | | }, |
| | | methods: { |
| | | // 获取详情 |
| | | getDetail(id) { |
| | | getMaintenanceDetail(id).then(response => { |
| | | // 加载维护数据 |
| | | async loadMaintenanceData() { |
| | | try { |
| | | this.cultureLoading = true; |
| | | this.recordLoading = true; |
| | | |
| | | const { id, infoid } = this.$route.query; |
| | | const queryParams = {}; |
| | | |
| | | if (id) { |
| | | queryParams.infoid = infoid; |
| | | this.currentMaintenanceId = id; |
| | | this.isEditMode = true; |
| | | } else if (infoid) { |
| | | queryParams.infoid = infoid; |
| | | this.currentMaintenanceId = null; |
| | | this.isEditMode = false; |
| | | } else { |
| | | this.$message.error("缺少必要的路由参数"); |
| | | return; |
| | | } |
| | | |
| | | queryParams.infoid = infoid; |
| | | const response = await maintainList(queryParams); |
| | | if (response.code === 200) { |
| | | this.form = response.data; |
| | | } |
| | | }); |
| | | }, |
| | | // 培养记录附件变更 |
| | | handleCultureAttachmentChange(fileList) { |
| | | this.cultureForm.attachments = fileList; |
| | | }, |
| | | let maintenanceData = response.data[0]; |
| | | |
| | | // 护理记录附件变更 |
| | | handleRecordAttachmentChange(fileList) { |
| | | this.recordForm.attachments = fileList; |
| | | }, |
| | | |
| | | // 查看培养记录附件 |
| | | handleViewCultureAttachments(row) { |
| | | console.log(22, row.attachments); |
| | | |
| | | this.currentAttachmentList = row.attachments || []; |
| | | this.attachmentPreviewTitle = `培养记录附件 - ${row.cultureType}`; |
| | | this.attachmentPreviewVisible = true; |
| | | }, |
| | | handleTabClick(tab) { |
| | | this.$nextTick(() => { |
| | | console.log(tab.name, 88); |
| | | const tableRef=null; |
| | | if (tab.name == "liverKidney") { |
| | | tableRef = this.$refs.liverKidney; // 请替换为您的表格 ref |
| | | } else if (tab.name == "bloodRoutine") { |
| | | tableRef = this.$refs.bloodRoutine; // 请替换为您的表格 ref |
| | | } else if (tab.name == "bloodRoutine") { |
| | | tableRef = this.$refs.bloodRoutine; // 请替换为您的表格 ref |
| | | } |
| | | // 如果是 el-table,尝试调用其 doLayout 方法 |
| | | if (tableRef && tableRef.doLayout) { |
| | | tableRef.doLayout(); |
| | | } |
| | | |
| | | // 或者,更通用的强制重新渲染方式 |
| | | this.$forceUpdate(); // 慎用,可能引发其他问题[1](@ref) |
| | | }); |
| | | }, |
| | | // 查看护理记录附件 |
| | | handleViewRecordAttachments(row) { |
| | | this.currentAttachmentList = row.attachments || []; |
| | | this.attachmentPreviewTitle = `护理核查记录附件 - ${row.recorder}`; |
| | | this.attachmentPreviewVisible = true; |
| | | }, |
| | | // 培养记录相关方法 |
| | | getCultureList() { |
| | | this.cultureLoading = true; |
| | | listCultureResults(this.form.id, this.cultureQueryParams) |
| | | .then(response => { |
| | | if (response.code === 200) { |
| | | // this.cultureList = response.data.rows; |
| | | // this.cultureTotal = response.data.total; |
| | | if (Array.isArray(maintenanceData)) { |
| | | maintenanceData = maintenanceData[0] || {}; |
| | | } |
| | | this.cultureLoading = false; |
| | | }) |
| | | .catch(() => { |
| | | this.cultureLoading = false; |
| | | }); |
| | | if (maintenanceData.extracontent) { |
| | | this.extracontentinfo = JSON.parse(maintenanceData.extracontent); |
| | | if (this.extracontentinfo.specialMedicalHistory) { |
| | | this.form.specialMedicalHistory = this.extracontentinfo.specialMedicalHistory; |
| | | } |
| | | } |
| | | |
| | | if (maintenanceData.itemDesc) { |
| | | try { |
| | | const itemDescData = maintenanceData.itemDesc; |
| | | this.assessmentData = { ...this.assessmentData, ...itemDescData }; |
| | | |
| | | if (itemDescData.cultureResults) { |
| | | this.cultureList = itemDescData.cultureResults; |
| | | } |
| | | if (itemDescData.nursingRecords) { |
| | | this.recordList = itemDescData.nursingRecords; |
| | | } |
| | | if (itemDescData.liverKidney) { |
| | | this.assessmentData.liverKidney = itemDescData.liverKidney; |
| | | } |
| | | if (itemDescData.bloodRoutine) { |
| | | this.assessmentData.bloodRoutine = itemDescData.bloodRoutine; |
| | | } |
| | | if (itemDescData.urineRoutine) { |
| | | this.assessmentData.urineRoutine = itemDescData.urineRoutine; |
| | | } |
| | | } catch (error) { |
| | | console.error("解析itemDesc JSON失败:", error); |
| | | } |
| | | } |
| | | |
| | | this.form = { ...this.form, ...maintenanceData }; |
| | | this.$message.success("数据加载成功"); |
| | | } else { |
| | | this.$message.error("数据加载失败:" + (response.msg || "未知错误")); |
| | | } |
| | | } catch (error) { |
| | | console.error("加载维护数据失败:", error); |
| | | this.$message.error("数据加载失败"); |
| | | } finally { |
| | | this.cultureLoading = false; |
| | | this.recordLoading = false; |
| | | } |
| | | }, |
| | | |
| | | // 保存所有数据 |
| | | async handleSave() { |
| | | try { |
| | | const saveData = { |
| | | ...this.form, |
| | | itemDesc: { |
| | | liverKidney: this.assessmentData.liverKidney, |
| | | bloodRoutine: this.assessmentData.bloodRoutine, |
| | | urineRoutine: this.assessmentData.urineRoutine, |
| | | cultureResults: this.cultureList, |
| | | nursingRecords: this.recordList |
| | | } |
| | | }; |
| | | this.extracontentinfo.specialMedicalHistory = this.form.specialMedicalHistory; |
| | | let response; |
| | | if (this.isEditMode && this.currentMaintenanceId) { |
| | | saveData.id = this.currentMaintenanceId; |
| | | response = await maintainedit(saveData); |
| | | } else { |
| | | response = await maintainAdd(saveData); |
| | | } |
| | | |
| | | if (response.code === 200) { |
| | | this.$message.success("保存成功"); |
| | | this.isEdit = false; |
| | | this.donatebaseinfoEdit({ |
| | | id: this.$route.query.infoid, |
| | | extracontent: JSON.stringify(this.extracontentinfo) |
| | | }); |
| | | if (!this.isEditMode && response.data && response.data.id) { |
| | | this.currentMaintenanceId = response.data.id; |
| | | this.isEditMode = true; |
| | | } |
| | | } else { |
| | | this.$message.error("保存失败:" + (response.msg || "未知错误")); |
| | | } |
| | | } catch (error) { |
| | | console.error("保存数据失败:", error); |
| | | this.$message.error("保存失败"); |
| | | } |
| | | }, |
| | | |
| | | // 切换编辑模式 |
| | | toggleEditMode() { |
| | | this.isEdit = !this.isEdit; |
| | | if (!this.isEdit) { |
| | | this.handleSave(); |
| | | } |
| | | }, |
| | | |
| | | // 培养记录相关方法 |
| | | handleAddCulture() { |
| | | this.cultureDialogTitle = "新增培养记录"; |
| | | this.cultureForm = { |
| | |
| | | cultureType: "", |
| | | sampleTime: "", |
| | | result: "阴性", |
| | | bacteria: "", |
| | | drugSensitivity: "", |
| | | testingInstitution: "", |
| | | specimenType: "", |
| | | remarks: "" |
| | | attachments: [] |
| | | }; |
| | | this.cultureFileList = []; |
| | | this.cultureDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.cultureForm && this.$refs.cultureForm.clearValidate(); |
| | |
| | | handleEditCulture(row) { |
| | | this.cultureDialogTitle = "编辑培养记录"; |
| | | this.cultureForm = { ...row }; |
| | | this.cultureFileList = row.attachments ? row.attachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })) : []; |
| | | this.cultureDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.cultureForm && this.$refs.cultureForm.clearValidate(); |
| | | }); |
| | | }, |
| | | |
| | | handleViewCulture(row) { |
| | | this.$alert( |
| | | ` |
| | | <div> |
| | | <p><strong>培养类型:</strong>${this.getCultureTypeLabel( |
| | | row.cultureType |
| | | )}</p> |
| | | <p><strong>采样时间:</strong>${row.sampleTime}</p> |
| | | <p><strong>培养结果:</strong>${row.result}</p> |
| | | <p><strong>检测机构:</strong>${row.testingInstitution}</p> |
| | | </div> |
| | | `, |
| | | "培养记录详情", |
| | | { |
| | | dangerouslyUseHTMLString: true, |
| | | customClass: "detail-dialog" |
| | | } |
| | | ); |
| | | }, |
| | | toggleEditMode() { |
| | | this.isEdit = !this.isEdit; |
| | | // if (!this.isEdit) { |
| | | // this.saveAllData(); |
| | | // } |
| | | }, |
| | | handleLiverKidneyDataChange(data) { |
| | | console.log("肝功能肾功能数据变更:", data); |
| | | // 处理数据保存或临时存储 |
| | | }, |
| | | handleBloodRoutineDataChange(data) { |
| | | console.log("血常规功能数据变更:", data); |
| | | // 处理数据保存或临时存储 |
| | | }, |
| | | handleUrineRoutineDataChange(data) { |
| | | console.log("尿常规功能数据变更:", data); |
| | | // 处理数据保存或临时存储 |
| | | }, |
| | | // 保存培养记录 |
| | | handleSaveCulture() { |
| | | this.$refs.cultureForm.validate(valid => { |
| | | if (valid) { |
| | | this.cultureSaveLoading = true; |
| | | const api = this.cultureForm.id |
| | | ? updateCultureResult |
| | | : addCultureResult; |
| | | const requestData = { |
| | | ...this.cultureForm, |
| | | maintenanceId: this.form.id |
| | | }; |
| | | |
| | | api(requestData) |
| | | .then(response => { |
| | | if (response.code === 200) { |
| | | this.$message.success( |
| | | this.cultureForm.id ? "修改成功" : "新增成功" |
| | | ); |
| | | this.cultureDialogVisible = false; |
| | | this.getCultureList(); |
| | | } |
| | | this.cultureSaveLoading = false; |
| | | }) |
| | | .catch(() => { |
| | | this.cultureSaveLoading = false; |
| | | }); |
| | | if (this.cultureForm.id) { |
| | | const index = this.cultureList.findIndex( |
| | | item => item.id === this.cultureForm.id |
| | | ); |
| | | if (index !== -1) { |
| | | this.cultureList.splice(index, 1, { ...this.cultureForm }); |
| | | } |
| | | } else { |
| | | this.cultureForm.id = Date.now(); |
| | | this.cultureList.push({ ...this.cultureForm }); |
| | | } |
| | | |
| | | this.$message.success(this.cultureForm.id ? "修改成功" : "新增成功"); |
| | | this.cultureDialogVisible = false; |
| | | this.cultureSaveLoading = false; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | deleteCultureResult(row.id).then(response => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功"); |
| | | this.getCultureList(); |
| | | } |
| | | }); |
| | | this.cultureList = this.cultureList.filter( |
| | | item => item.id !== row.id |
| | | ); |
| | | this.$message.success("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | getCultureTypeLabel(value) { |
| | | const type = this.cultureTypeOptions.find(item => item.value === value); |
| | | return type ? type.label : "未知"; |
| | | }, |
| | | |
| | | // 护理核查记录相关方法 |
| | | getRecordList() { |
| | | this.recordLoading = true; |
| | | listNursingRecords(this.form.id, this.recordQueryParams) |
| | | .then(response => { |
| | | if (response.code === 200) { |
| | | // this.recordList = response.data.rows; |
| | | // this.recordTotal = response.data.total; |
| | | } |
| | | this.recordLoading = false; |
| | | }) |
| | | .catch(() => { |
| | | this.recordLoading = false; |
| | | }); |
| | | }, |
| | | |
| | | // 护理记录相关方法 |
| | | handleAddRecord() { |
| | | this.recordDialogTitle = "新增护理核查记录"; |
| | | this.recordForm = { |
| | |
| | | .toISOString() |
| | | .replace("T", " ") |
| | | .substring(0, 19), |
| | | recorder: "当前用户", // 实际项目中从用户信息获取 |
| | | temperature: 36.5, |
| | | heartRate: 80, |
| | | bloodPressure: "120/80", |
| | | respirationRate: 18, |
| | | oxygenSaturation: 98, |
| | | urineOutput: 50, |
| | | cvp: 8, |
| | | remarks: "" |
| | | recorder: "当前用户", |
| | | checkRecord: "", |
| | | attachments: [] |
| | | }; |
| | | this.recordFileList = []; |
| | | this.recordDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.recordForm && this.$refs.recordForm.clearValidate(); |
| | |
| | | handleEditRecord(row) { |
| | | this.recordDialogTitle = "编辑护理核查记录"; |
| | | this.recordForm = { ...row }; |
| | | this.recordFileList = row.attachments ? row.attachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })) : []; |
| | | this.recordDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.recordForm && this.$refs.recordForm.clearValidate(); |
| | | }); |
| | | }, |
| | | |
| | | handleViewRecord(row) { |
| | | this.$alert( |
| | | ` |
| | | <div> |
| | | <p><strong>核查时间:</strong>${row.recordTime}</p> |
| | | <p><strong>核查人:</strong>${row.recorder}</p> |
| | | <p><strong>生命体征:</strong></p> |
| | | <ul> |
| | | <li>体温:${row.temperature}℃</li> |
| | | <li>心率:${row.heartRate}次/分</li> |
| | | <li>血压:${row.bloodPressure}mmHg</li> |
| | | <li>呼吸:${row.respirationRate}次/分</li> |
| | | <li>血氧饱和度:${row.oxygenSaturation}%</li> |
| | | <li>尿量:${row.urineOutput}ml/h</li> |
| | | </ul> |
| | | <p><strong>备注:</strong>${row.remarks || "无"}</p> |
| | | </div> |
| | | `, |
| | | "护理核查记录详情", |
| | | { |
| | | dangerouslyUseHTMLString: true, |
| | | customClass: "detail-dialog" |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | handleSaveRecord() { |
| | | this.$refs.recordForm.validate(valid => { |
| | | if (valid) { |
| | | this.recordSaveLoading = true; |
| | | const api = this.recordForm.id |
| | | ? updateNursingRecord |
| | | : addNursingRecord; |
| | | const requestData = { |
| | | ...this.recordForm, |
| | | maintenanceId: this.form.id |
| | | }; |
| | | |
| | | api(requestData) |
| | | .then(response => { |
| | | if (response.code === 200) { |
| | | this.$message.success( |
| | | this.recordForm.id ? "修改成功" : "新增成功" |
| | | ); |
| | | this.recordDialogVisible = false; |
| | | this.getRecordList(); |
| | | } |
| | | this.recordSaveLoading = false; |
| | | }) |
| | | .catch(() => { |
| | | this.recordSaveLoading = false; |
| | | }); |
| | | if (this.recordForm.id) { |
| | | const index = this.recordList.findIndex( |
| | | item => item.id === this.recordForm.id |
| | | ); |
| | | if (index !== -1) { |
| | | this.recordList.splice(index, 1, { ...this.recordForm }); |
| | | } |
| | | } else { |
| | | this.recordForm.id = Date.now(); |
| | | this.recordList.push({ ...this.recordForm }); |
| | | } |
| | | |
| | | this.$message.success(this.recordForm.id ? "修改成功" : "新增成功"); |
| | | this.recordDialogVisible = false; |
| | | this.recordSaveLoading = false; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | deleteNursingRecord(row.id).then(response => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功"); |
| | | this.getRecordList(); |
| | | } |
| | | }); |
| | | this.recordList = this.recordList.filter(item => item.id !== row.id); |
| | | this.$message.success("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | // 保存基本信息 |
| | | handleSave() { |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | updateMaintenance(this.form).then(response => { |
| | | if (response.code === 200) { |
| | | this.$message.success("保存成功"); |
| | | this.isEdit = false; |
| | | } |
| | | }); |
| | | // 培养记录附件相关方法 |
| | | handleCultureAttachmentChange(fileList) { |
| | | this.cultureFileList = fileList; |
| | | }, |
| | | |
| | | handleCultureUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | if (!Array.isArray(this.cultureForm.attachments)) { |
| | | this.cultureForm.attachments = []; |
| | | } |
| | | |
| | | this.cultureForm.attachments.push(attachmentObj); |
| | | this.cultureFileList = fileList; |
| | | this.$message.success("文件上传成功"); |
| | | } |
| | | }, |
| | | |
| | | handleCultureUploadError({ file, fileList, error }) { |
| | | console.error("培养记录附件上传失败:", error); |
| | | this.$message.error("文件上传失败,请重试"); |
| | | }, |
| | | |
| | | handleCultureAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.cultureForm.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.cultureForm.attachments.splice(index, 1); |
| | | this.$message.success("附件删除成功"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 护理记录附件相关方法 |
| | | handleRecordAttachmentChange(fileList) { |
| | | this.recordFileList = fileList; |
| | | }, |
| | | |
| | | handleRecordUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | if (!Array.isArray(this.recordForm.attachments)) { |
| | | this.recordForm.attachments = []; |
| | | } |
| | | |
| | | this.recordForm.attachments.push(attachmentObj); |
| | | this.recordFileList = fileList; |
| | | this.$message.success("文件上传成功"); |
| | | } |
| | | }, |
| | | |
| | | handleRecordUploadError({ file, fileList, error }) { |
| | | console.error("护理记录附件上传失败:", error); |
| | | this.$message.error("文件上传失败,请重试"); |
| | | }, |
| | | |
| | | handleRecordAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.recordForm.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.recordForm.attachments.splice(index, 1); |
| | | this.$message.success("附件删除成功"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleViewCultureAttachments(row) { |
| | | this.currentAttachmentList = row.attachments || []; |
| | | this.attachmentPreviewTitle = `培养记录附件 - ${row.cultureType}`; |
| | | this.attachmentPreviewVisible = true; |
| | | }, |
| | | |
| | | handleViewRecordAttachments(row) { |
| | | this.currentAttachmentList = row.attachments || []; |
| | | this.attachmentPreviewTitle = `护理核查记录附件 - ${row.recorder}`; |
| | | this.attachmentPreviewVisible = true; |
| | | }, |
| | | |
| | | handleAttachmentPreviewClose() { |
| | | this.currentAttachmentList = []; |
| | | this.attachmentPreviewTitle = ""; |
| | | }, |
| | | |
| | | handlePreviewAttachment(file) { |
| | | this.currentPreviewFile = { |
| | | fileName: file.fileName, |
| | | fileUrl: file.path || file.fileUrl, |
| | | fileType: this.getFileType(file.fileName) |
| | | }; |
| | | this.filePreviewVisible = true; |
| | | }, |
| | | |
| | | handleDownloadAttachment(file) { |
| | | const fileUrl = file.path || file.fileUrl; |
| | | const fileName = file.fileName; |
| | | |
| | | if (fileUrl) { |
| | | const link = document.createElement("a"); |
| | | link.href = fileUrl; |
| | | link.download = fileName; |
| | | link.style.display = "none"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | this.$message.success("开始下载文件"); |
| | | } else { |
| | | this.$message.warning("文件路径不存在,无法下载"); |
| | | } |
| | | }, |
| | | |
| | | /** 获取文件类型 */ |
| | | getFileType(fileName) { |
| | | if (!fileName) return "other"; |
| | | const extension = fileName.split(".").pop().toLowerCase(); |
| | | const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"]; |
| | | const pdfTypes = ["pdf"]; |
| | | const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"]; |
| | | if (imageTypes.includes(extension)) return "image"; |
| | | if (pdfTypes.includes(extension)) return "pdf"; |
| | | if (officeTypes.includes(extension)) return "office"; |
| | | return "other"; |
| | | }, |
| | | |
| | | /** 获取文件图标颜色 */ |
| | | getFileIconColor(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const colorMap = { |
| | | image: "#67C23A", |
| | | pdf: "#F56C6C", |
| | | office: "#409EFF", |
| | | other: "#909399" |
| | | }; |
| | | return colorMap[type] || "#909399"; |
| | | }, |
| | | |
| | | /** 获取文件标签类型 */ |
| | | getFileTagType(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const typeMap = { |
| | | image: "success", |
| | | pdf: "danger", |
| | | office: "primary", |
| | | other: "info" |
| | | }; |
| | | return typeMap[type] || "info"; |
| | | }, |
| | | |
| | | /** 获取文件类型文本 */ |
| | | getFileTypeText(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const textMap = { |
| | | image: "图片", |
| | | pdf: "PDF", |
| | | office: "文档", |
| | | other: "其他" |
| | | }; |
| | | return textMap[type] || "未知"; |
| | | }, |
| | | |
| | | /** 检查是否可预览 */ |
| | | isPreviewable(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | return ["image", "pdf"].includes(type); |
| | | }, |
| | | |
| | | /** 获取文件扩展名 */ |
| | | getFileExtension(filename) { |
| | | return filename.split(".").pop().toLowerCase(); |
| | | }, |
| | | |
| | | /** 格式化文件大小 */ |
| | | formatFileSize(bytes) { |
| | | if (!bytes || bytes === 0) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| | | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }, |
| | | |
| | | /** 日期时间格式化 */ |
| | | formatDateTime(dateTime) { |
| | | if (!dateTime) return ""; |
| | | try { |
| | | const date = new Date(dateTime); |
| | | if (isNaN(date.getTime())) return dateTime; |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}`; |
| | | } catch (error) { |
| | | return dateTime; |
| | | } |
| | | }, |
| | | |
| | | // 评估数据变更处理 |
| | | handleLiverKidneyDataChange(data) { |
| | | this.assessmentData.liverKidney = data; |
| | | }, |
| | | |
| | | handleBloodRoutineDataChange(data) { |
| | | this.assessmentData.bloodRoutine = data; |
| | | }, |
| | | |
| | | handleUrineRoutineDataChange(data) { |
| | | this.assessmentData.urineRoutine = data; |
| | | }, |
| | | |
| | | handleTabClick(tab) { |
| | | this.$nextTick(() => { |
| | | let tableRef = null; |
| | | if (tab.name === "liverKidney") { |
| | | tableRef = this.$refs.liverKidney; |
| | | } else if (tab.name === "bloodRoutine") { |
| | | tableRef = this.$refs.bloodRoutine; |
| | | } else if (tab.name === "urineRoutine") { |
| | | tableRef = this.$refs.urineRoutine; |
| | | } |
| | | |
| | | if (tableRef && tableRef.doLayout) { |
| | | tableRef.doLayout(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .culture-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .record-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .detail-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | .maintenance-detail { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .detail-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .culture-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .record-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .detail-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | .medical-panel { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .attachment-section { |
| | | margin-top: 20px; |
| | | padding: 15px; |
| | | border: 1px solid #ebeef5; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .attachment-title { |
| | | font-weight: bold; |
| | | margin-bottom: 10px; |
| | | color: #409eff; |
| | | } |
| | | |
| | | .required-item::before { |
| | | content: "*"; |
| | | color: #f56c6c; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .assessment-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .medical-table { |
| | | width: 100%; |
| | | .record-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .dynamic-column { |
| | | min-width: 120px; |
| | | .detail-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .culture-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .fixed-width .el-button { |
| | | margin: 0 2px; |
| | | } |
| | | |
| | | /* 详情对话框样式 */ |
| | | :deep(.detail-dialog) { |
| | | width: 500px; |
| | | } |
| | | |
| | | :deep(.detail-dialog .el-message-box__content) { |
| | | line-height: 1.8; |
| | | } |
| | | |
| | | :deep(.detail-dialog ul) { |
| | | margin: 10px 0; |
| | | padding-left: 20px; |
| | | } |
| | | |
| | | :deep(.detail-dialog li) { |
| | | margin-bottom: 5px; |
| | | .file-name { |
| | | font-size: 13px; |
| | | margin-left: 8px; |
| | | } |
| | | </style> |