| | |
| | | <template> |
| | | <div class="maintenance-detail"> |
| | | <!-- 基础信息 --> |
| | | <el-card class="detail-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">供者基本信息</span> |
| | | <el-button type="success" style="float: right;" @click="handleSave"> |
| | | 保存信息 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <el-form :model="form" ref="form" label-width="120px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="住院号" prop="caseNo"> |
| | | <el-input v-model="form.caseNo" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <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.sex" style="width: 100%"> |
| | | <el-option label="男" value="0" /> |
| | | <el-option label="女" value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="年龄" prop="age"> |
| | | <el-input v-model="form.age" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <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="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="recordstate"> |
| | | <el-select v-model="form.recordstate" 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-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-form-item |
| | | align="left" |
| | | label="患者捐献状态" |
| | | prop="donationcategory" |
| | | > |
| | | <el-radio-group v-model="form.recordstate"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_DonationCategory || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> --> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item |
| | | label="未完成原因" |
| | | prop="incompleteReason" |
| | | v-if="form.recordstate === '5'" |
| | | > |
| | | <el-input |
| | | v-model="form.incompleteReason" |
| | | placeholder="请输入未完成捐献的原因" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="上报时间" prop="reporttime"> |
| | | <el-date-picker |
| | | v-model="form.reporttime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="死亡时间" prop="deathTime"> |
| | | <el-date-picker |
| | | v-model="form.deathTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <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" 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-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(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> |
| | | |
| | | <el-form-item label="特殊病史" prop="specialMedicalHistory"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="3" |
| | | v-model="form.specialMedicalHistory" |
| | | placeholder="记录特殊病史信息" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | <case-basic-info :case-id="caseId" :show-attachment="true" /> |
| | | |
| | | <el-card class="assessment-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">供者评估各项记录</span> |
| | | <span class="detail-title">评估各项记录</span> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | @click="toggleEditMode" |
| | | style="float: right;" |
| | | style="float: right;margin-left: 20px;" |
| | | > |
| | | {{ isEdit ? "完成编辑" : "开始编辑" }} |
| | | 保存编辑 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | size="mini" |
| | | @click="accomplish" |
| | | style="float: right;margin-left: 20px;" |
| | | > |
| | | 完成编辑 |
| | | </el-button> |
| | | </div> |
| | | |
| | |
| | | <el-tag |
| | | :type="scope.row.result === '阴性' ? 'success' : 'danger'" |
| | | effect="plain" |
| | | @click="handleResultClick(scope.row)" |
| | | style="cursor: pointer;" |
| | | > |
| | | {{ scope.row.result }} |
| | | <i |
| | | v-if=" |
| | | scope.row.result === '阳性' && scope.row.positiveDetails |
| | | " |
| | | class="el-icon-info" |
| | | style="margin-left: 4px;" |
| | | ></i> |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-table> |
| | | </el-card> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="护理核查记录" name="hlihc"> |
| | | <el-card class="record-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">护理核查记录</span> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-plus" |
| | | @click="handleAddRecord" |
| | | > |
| | | 新增核查记录 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <el-table :data="recordList" v-loading="recordLoading"> |
| | | <el-table-column |
| | | label="核查时间" |
| | | align="center" |
| | | prop="recordTime" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | label="核查人" |
| | | align="center" |
| | | prop="recorder" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | label="核查记录" |
| | | align="center" |
| | | prop="checkRecord" |
| | | min-width="200" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="附件" align="center" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if=" |
| | | scope.row.attachments && scope.row.attachments.length > 0 |
| | | " |
| | | size="mini" |
| | | type="text" |
| | | @click="handleViewRecordAttachments(scope.row)" |
| | | > |
| | | 查看附件({{ scope.row.attachments.length }}) |
| | | </el-button> |
| | | <span v-else>无附件</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="180" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <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> |
| | | </el-card> |
| | | </el-tab-pane> |
| | | |
| | | <!-- 肝功能肾功能 --> |
| | | <el-tab-pane label="肝功能肾功能" name="liverKidney"> |
| | |
| | | </el-card> |
| | | |
| | | <!-- 护理核查记录 --> |
| | | <el-card class="record-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">护理核查记录</span> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-plus" |
| | | @click="handleAddRecord" |
| | | > |
| | | 新增核查记录 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <el-table :data="recordList" v-loading="recordLoading"> |
| | | <el-table-column |
| | | label="核查时间" |
| | | align="center" |
| | | prop="recordTime" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | label="核查人" |
| | | align="center" |
| | | prop="recorder" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | label="核查记录" |
| | | align="center" |
| | | prop="checkRecord" |
| | | min-width="200" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="附件" align="center" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.attachments && scope.row.attachments.length > 0" |
| | | size="mini" |
| | | type="text" |
| | | @click="handleViewRecordAttachments(scope.row)" |
| | | > |
| | | 查看附件({{ scope.row.attachments.length }}) |
| | | </el-button> |
| | | <span v-else>无附件</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="180" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <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> |
| | | </el-card> |
| | | |
| | | <!-- 培养记录编辑对话框 --> |
| | | <el-dialog |
| | |
| | | v-model="cultureForm.result" |
| | | placeholder="请选择培养结果" |
| | | style="width: 100%" |
| | | @change="handleResultChange" |
| | | > |
| | | <el-option label="阴性" value="阴性" /> |
| | | <el-option label="阳性" value="阳性" /> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-form-item |
| | | v-if="cultureForm.result === '阳性'" |
| | | label="阳性详情" |
| | | prop="positiveDetails" |
| | | > |
| | | <el-input |
| | | type="textarea" |
| | | :rows="2" |
| | | v-model="cultureForm.positiveDetails" |
| | | placeholder="请输入阳性结果的详细信息" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <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> |
| | |
| | | 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 CaseBasicInfo from "@/components/CaseBasicInfo"; |
| | | import store from "@/store"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | name: "MaintenanceDetail", |
| | | components: { |
| | | Pagination, |
| | | UploadAttachment, |
| | | AttachmentPreview, |
| | | FilePreviewDialog, |
| | | LiverKidneyPanel, |
| | | BloodRoutinePanel, |
| | | UrineRoutinePanel |
| | | UrineRoutinePanel, |
| | | CaseBasicInfo |
| | | }, |
| | | dicts: [ |
| | | "sys_donornode", |
| | |
| | | |
| | | data() { |
| | | return { |
| | | isEdit: false, |
| | | caseId: null, |
| | | isEdit: true, |
| | | currentMaintenanceId: null, |
| | | isEditMode: false, |
| | | form: { |
| | |
| | | incompleteReason: "" |
| | | }, |
| | | activeTab: "culture", |
| | | liverKidneyData: {}, // 从 maintainList 接口获取的数据 |
| | | bloodRoutineData: {}, // 从 maintainList 接口获取的数据 |
| | | liverKidneyData: {}, // 从 maintainList 接口获取的数据 |
| | | extracontentinfo: {}, |
| | | |
| | | // 培养结果相关数据 |
| | | cultureList: [], |
| | | cultureLoading: false, |
| | |
| | | cultureType: "", |
| | | sampleTime: "", |
| | | result: "阴性", |
| | | positiveDetails: "", // 新增:阳性详情 |
| | | attachments: [] |
| | | }, |
| | | cultureFileList: [], |
| | | cultureRules: { |
| | | cultureType: [ |
| | | { required: true, message: "请选择培养类型", trigger: "change" } |
| | |
| | | ], |
| | | result: [ |
| | | { required: true, message: "请选择培养结果", trigger: "change" } |
| | | ] |
| | | ], |
| | | positiveDetails: [] // 动态验证规则 |
| | | }, |
| | | cultureTypeOptions: [ |
| | | { value: "1", label: "血培养" }, |
| | |
| | | checkRecord: "", |
| | | attachments: [] |
| | | }, |
| | | recordFileList: [], |
| | | recordRules: { |
| | | recordTime: [ |
| | | { required: true, message: "请选择核查时间", trigger: "change" } |
| | |
| | | currentAttachmentList: [], |
| | | attachmentPreviewTitle: "", |
| | | |
| | | // 文件预览相关 |
| | | filePreviewVisible: false, |
| | | currentPreviewFile: null, |
| | | |
| | | // 附件相关配置 |
| | | attachmentLimit: 10, |
| | | attachmentAccept: |
| | | ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt", |
| | | |
| | | // 评估数据存储 |
| | | assessmentData: { |
| | | liverKidney: {}, |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.caseId = this.$route.query.infoid; |
| | | |
| | | this.loadMaintenanceData(); |
| | | }, |
| | | watch: { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | // 加载维护数据[1,3](@ref) |
| | | // 加载维护数据 |
| | | async loadMaintenanceData() { |
| | | try { |
| | | this.cultureLoading = true; |
| | |
| | | const queryParams = {}; |
| | | |
| | | if (id) { |
| | | queryParams.id = id; |
| | | queryParams.infoid = infoid; |
| | | this.currentMaintenanceId = id; |
| | | this.isEditMode = true; |
| | | } else if (infoid) { |
| | |
| | | this.$message.error("缺少必要的路由参数"); |
| | | return; |
| | | } |
| | | |
| | | queryParams.infoid = infoid; |
| | | const response = await maintainList(queryParams); |
| | | if (response.code === 200) { |
| | | let maintenanceData = response.data[0]; |
| | | |
| | | // 处理数组响应 |
| | | if (Array.isArray(maintenanceData)) { |
| | | maintenanceData = maintenanceData[0] || {}; |
| | | } |
| | | if (maintenanceData.extracontent) { |
| | | this.extracontentinfo = JSON.parse(maintenanceData.extracontent); |
| | | this.extracontentinfo = JSON.parse(maintenanceData.extracontent); |
| | | if (this.extracontentinfo.specialMedicalHistory) { |
| | | this.form.specialMedicalHistory = |
| | | this.extracontentinfo.specialMedicalHistory; |
| | | this.form.specialMedicalHistory = this.extracontentinfo.specialMedicalHistory; |
| | | } |
| | | } |
| | | |
| | | // 解析itemDesc字段中的JSON数据[6,8](@ref) |
| | | if (maintenanceData.itemDesc) { |
| | | try { |
| | | const itemDescData = maintenanceData.itemDesc; |
| | | this.assessmentData = { ...this.assessmentData, ...itemDescData }; |
| | | |
| | | // 填充各个模块的数据 |
| | | if (itemDescData.cultureResults) { |
| | | this.cultureList = itemDescData.cultureResults; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // 填充基础表单数据 |
| | | this.form = { ...this.form, ...maintenanceData }; |
| | | this.$message.success("数据加载成功"); |
| | | } else { |
| | |
| | | this.recordLoading = false; |
| | | } |
| | | }, |
| | | // 处理培养结果选择变化 |
| | | handleResultChange(value) { |
| | | this.$nextTick(() => { |
| | | if (value === "阳性") { |
| | | this.cultureRules.positiveDetails = [ |
| | | { required: true, message: "请输入阳性详情", trigger: "blur" } |
| | | ]; |
| | | } else { |
| | | this.cultureRules.positiveDetails = []; |
| | | this.cultureForm.positiveDetails = ""; |
| | | } |
| | | // 清除验证 |
| | | if (this.$refs.cultureForm) { |
| | | this.$refs.cultureForm.clearValidate("positiveDetails"); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 保存所有数据[1,2](@ref) |
| | | // 处理点击培养结果标签 |
| | | handleResultClick(row) { |
| | | if (row.result === "阳性" && row.positiveDetails) { |
| | | this.$alert( |
| | | `<div style="padding: 10px;"> |
| | | <h4 style="margin-bottom: 10px; color: #f56c6c;">阳性详情:</h4> |
| | | <div style="background: #fef0f0; padding: 15px; border-radius: 4px; border-left: 4px solid #f56c6c;"> |
| | | <p style="margin: 0; white-space: pre-wrap; line-height: 1.5;">${row.positiveDetails}</p> |
| | | </div> |
| | | </div>`, |
| | | "阳性结果详情", |
| | | { |
| | | dangerouslyUseHTMLString: true, |
| | | confirmButtonText: "关闭", |
| | | customClass: "result-details-dialog", |
| | | showClose: false |
| | | } |
| | | ); |
| | | } else if (row.result === "阳性") { |
| | | this.$message.warning("该阳性记录暂无详情信息"); |
| | | } |
| | | }, |
| | | // 保存所有数据 |
| | | async handleSave() { |
| | | try { |
| | | // 构建保存数据 |
| | | const saveData = { |
| | | ...this.form, |
| | | itemDesc: { |
| | |
| | | nursingRecords: this.recordList |
| | | } |
| | | }; |
| | | if (saveData.state == 1 || !saveData.state) { |
| | | saveData.state = 2; |
| | | } |
| | | this.extracontentinfo.specialMedicalHistory = this.form.specialMedicalHistory; |
| | | let response; |
| | | if (this.isEditMode && this.currentMaintenanceId) { |
| | | // 编辑模式,调用maintainedit接口[1](@ref) |
| | | saveData.id = this.currentMaintenanceId; |
| | | response = await maintainedit(saveData); |
| | | } else { |
| | | // 新增模式,调用maintainAdd接口[2](@ref) |
| | | 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) |
| | | }); |
| | | // 如果是新增保存,更新当前ID |
| | | if (!this.currentMaintenanceId) { |
| | | this.currentMaintenanceId = response.data; |
| | | } |
| | | // 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; |
| | |
| | | this.handleSave(); |
| | | } |
| | | }, |
| | | accomplish() { |
| | | this.$confirm("是否完成该案例捐献确认步骤?", "提醒", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.form.state = 3; |
| | | this.handleSave(); |
| | | }) |
| | | |
| | | .catch(() => {}); |
| | | }, |
| | | // 培养记录相关方法 |
| | | handleAddCulture() { |
| | | this.cultureDialogTitle = "新增培养记录"; |
| | |
| | | result: "阴性", |
| | | attachments: [] |
| | | }; |
| | | this.cultureFileList = []; |
| | | this.cultureDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.cultureForm && this.$refs.cultureForm.clearValidate(); |
| | | }); |
| | | }, |
| | | |
| | | // 5. 修改编辑培养记录方法 |
| | | handleEditCulture(row) { |
| | | this.cultureDialogTitle = "编辑培养记录"; |
| | | this.cultureForm = { ...row }; |
| | | this.cultureForm = { |
| | | ...row, |
| | | positiveDetails: row.positiveDetails || "" // 确保有positiveDetails字段 |
| | | }; |
| | | 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(); |
| | | // 如果编辑时是阳性结果,设置验证规则 |
| | | if (row.result === "阳性") { |
| | | this.cultureRules.positiveDetails = [ |
| | | { required: true, message: "请输入阳性详情", trigger: "blur" } |
| | | ]; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 6. 修改保存培养记录方法 |
| | | handleSaveCulture() { |
| | | this.$refs.cultureForm.validate(valid => { |
| | | if (valid) { |
| | | this.cultureSaveLoading = true; |
| | | |
| | | if (this.cultureForm.id) { |
| | | // 编辑现有记录 |
| | | // 构建保存数据 |
| | | const saveData = { |
| | | ...this.cultureForm, |
| | | // 如果是阴性,清空阳性详情 |
| | | positiveDetails: |
| | | this.cultureForm.result === "阳性" |
| | | ? this.cultureForm.positiveDetails || "" |
| | | : "" |
| | | }; |
| | | |
| | | if (saveData.id) { |
| | | const index = this.cultureList.findIndex( |
| | | item => item.id === this.cultureForm.id |
| | | item => item.id === saveData.id |
| | | ); |
| | | if (index !== -1) { |
| | | this.cultureList.splice(index, 1, { ...this.cultureForm }); |
| | | this.cultureList.splice(index, 1, { ...saveData }); |
| | | } |
| | | } else { |
| | | // 新增记录 |
| | | this.cultureForm.id = Date.now(); |
| | | this.cultureList.push({ ...this.cultureForm }); |
| | | saveData.id = Date.now(); |
| | | this.cultureList.push({ ...saveData }); |
| | | } |
| | | |
| | | this.$message.success(this.cultureForm.id ? "修改成功" : "新增成功"); |
| | | this.$message.success(saveData.id ? "修改成功" : "新增成功"); |
| | | this.cultureDialogVisible = false; |
| | | this.cultureSaveLoading = false; |
| | | } |
| | |
| | | .toISOString() |
| | | .replace("T", " ") |
| | | .substring(0, 19), |
| | | recorder: "当前用户", |
| | | recorder: store.getters.name, |
| | | 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(); |
| | |
| | | this.recordSaveLoading = true; |
| | | |
| | | if (this.recordForm.id) { |
| | | // 编辑现有记录 |
| | | const index = this.recordList.findIndex( |
| | | item => item.id === this.recordForm.id |
| | | ); |
| | |
| | | this.recordList.splice(index, 1, { ...this.recordForm }); |
| | | } |
| | | } else { |
| | | // 新增记录 |
| | | this.recordForm.id = Date.now(); |
| | | this.recordList.push({ ...this.recordForm }); |
| | | } |
| | |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | // 附件相关方法 |
| | | // 培养记录附件相关方法 |
| | | handleCultureAttachmentChange(fileList) { |
| | | this.cultureForm.attachments = 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.recordForm.attachments = 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.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; |
| | | } |
| | | }, |
| | | |
| | | // 评估数据变更处理 |
| | |
| | | .fixed-width .el-button { |
| | | margin: 0 2px; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 13px; |
| | | margin-left: 8px; |
| | | } |
| | | /* 7. 添加一些样式 */ |
| | | .result-details-dialog { |
| | | width: 500px; |
| | | } |
| | | |
| | | .result-details-dialog .el-message-box__content { |
| | | padding: 0; |
| | | } |
| | | |
| | | .result-details-dialog .el-message-box__header { |
| | | background: #fef0f0; |
| | | border-bottom: 1px solid #fde2e2; |
| | | } |
| | | |
| | | .result-details-dialog .el-message-box__title { |
| | | color: #f56c6c; |
| | | font-weight: bold; |
| | | } |
| | | </style> |