| | |
| | | <template> |
| | | <div class="organ-allocation-detail"> |
| | | <case-basic-info :case-id="caseId" :show-attachment="true" /> |
| | | <!-- 基本信息部分 --> |
| | | <el-card class="detail-card"> |
| | | <div slot="header" class="clearfix"> |
| | |
| | | <el-button |
| | | type="success" |
| | | @click="handleConfirmAllocation" |
| | | :disabled="form.allocationStatus === '1'" |
| | | :disabled="form.allocationStatus == '1'" |
| | | :loading="confirmLoading" |
| | | > |
| | | 确认分配 |
| | |
| | | |
| | | <el-form :model="form" ref="form" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="住院号" prop="donorno"> |
| | | <el-input v-model="form.donorno" readonly /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <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-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="donationcategory"> |
| | | <el-select v-model="form.donationcategory" style="width: 100%"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_DonationCategory || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </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 |
| | | v-for="dict in dict.type.sys_BloodType || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="证件号码" prop="idcardno"> |
| | | <el-input v-model="form.idcardno" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="记录状态" prop="recordstate"> |
| | | <el-input v-model="form.recordstate" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="疾病诊断" prop="diagnosisname"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="2" |
| | | v-model="form.diagnosisname" |
| | | placeholder="请输入疾病诊断信息" |
| | | /> |
| | | <el-form-item label="分配状态" prop="allocationStatus"> |
| | | <el-select |
| | | v-model="form.allocationStatus" |
| | | placeholder="请选择分配状态" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.organ_allocation_status || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | :disabled="form.allocationStatus === '1'" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所在医疗机构" prop="treatmenthospitalname"> |
| | | <el-input |
| | | v-model="form.treatmenthospitalname" |
| | | placeholder="请输入医疗机构名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="医疗机构编码" prop="treatmenthospitalno"> |
| | | <el-input |
| | | v-model="form.treatmenthospitalno" |
| | | placeholder="请输入医疗机构编码" |
| | | :disabled="form.allocationStatus == '1'" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="登记人" prop="registrationName"> |
| | | <el-input v-model="form.registrationName" readonly /> |
| | | <el-input v-model="form.registrationName" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | readonly |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <div style="float: right;"> |
| | | <el-tag |
| | | :type=" |
| | | form.allocationStatus === '1' |
| | | form.allocationStatus == '1' |
| | | ? 'success' |
| | | : form.allocationStatus === '2' |
| | | : form.allocationStatus == '2' |
| | | ? 'danger' |
| | | : 'warning' |
| | | " |
| | | > |
| | | {{ |
| | | form.allocationStatus === "1" |
| | | form.allocationStatus == "1" |
| | | ? "已分配" |
| | | : form.allocationStatus === "2" |
| | | : form.allocationStatus == "2" |
| | | ? "作废" |
| | | : "未分配" |
| | | }} |
| | |
| | | v-for="dict in dict.type.sys_Organ || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | :disabled="form.allocationStatus === '1'" |
| | | :disabled="form.allocationStatus == '1'" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | |
| | | <el-input |
| | | v-model="scope.row.caseno" |
| | | placeholder="分配系统编号" |
| | | :disabled="form.allocationStatus === '1'" |
| | | :disabled="form.allocationStatus == '1'" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="选择分配接收时间" |
| | | :disabled="form.allocationStatus === '1'" |
| | | :disabled="form.allocationStatus == '1'" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-input |
| | | v-model="scope.row.name" |
| | | placeholder="受体姓氏" |
| | | :disabled="form.allocationStatus === '1'" |
| | | :disabled="form.allocationStatus == '1'" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | clearable |
| | | v-model="scope.row.reallocationreason" |
| | | placeholder="请输入说明" |
| | | :disabled="form.allocationStatus === '1'" |
| | | :disabled="form.allocationStatus == '1'" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <span class="stat-value"> |
| | | <el-tag |
| | | :type=" |
| | | form.allocationStatus === '1' |
| | | form.allocationStatus == '1' |
| | | ? 'success' |
| | | : form.allocationStatus === '2' |
| | | : form.allocationStatus == '2' |
| | | ? 'danger' |
| | | : 'warning' |
| | | " |
| | | > |
| | | {{ |
| | | form.allocationStatus === "1" |
| | | form.allocationStatus == "1" |
| | | ? "已分配" |
| | | : form.allocationStatus === "2" |
| | | : form.allocationStatus == "2" |
| | | ? "作废" |
| | | : "未分配" |
| | | }} |
| | |
| | | </div> |
| | | </el-form> |
| | | |
| | | <div class="dialog-footer" v-if="form.allocationStatus !== '1'"> |
| | | <!-- <div class="dialog-footer" v-if="form.allocationStatus !== '1'"> |
| | | <el-button |
| | | type="primary" |
| | | @click="handleSaveAllocation" |
| | | :loading="saveLoading" |
| | | :disabled=" |
| | | !allocationData.serviceDonateorganList || |
| | | allocationData.serviceDonateorganList.length === 0 |
| | | allocationData.serviceDonateorganList.length == 0 |
| | | " |
| | | > |
| | | 保存分配记录 |
| | |
| | | > |
| | | 确认完成分配 |
| | | </el-button> |
| | | </div> |
| | | </div> --> |
| | | </el-card> |
| | | |
| | | <!-- 附件管理部分优化 --> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | <!-- 附件预览对话框 --> |
| | | <FilePreviewDialog |
| | | :visible="filePreviewVisible" |
| | |
| | | import { |
| | | allocationList, |
| | | allocationadd, |
| | | allocationedit |
| | | allocationedit, |
| | | donateorganBaseinfoInfo |
| | | } from "@/api/businessApi"; |
| | | import UploadAttachment from "@/components/UploadAttachment"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import OrgSelecter from "@/views/project/components/orgselect"; |
| | | |
| | | import CaseBasicInfo from "@/components/CaseBasicInfo"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | |
| | | components: { |
| | | UploadAttachment, |
| | | OrgSelecter, |
| | | FilePreviewDialog |
| | | FilePreviewDialog, |
| | | CaseBasicInfo |
| | | }, |
| | | dicts: [ |
| | | "sys_BloodType", |
| | | "sys_DonationCategory", |
| | | "sys_RecordState", |
| | | "sys_Organ" |
| | | "sys_Organ", |
| | | "organ_allocation_status" |
| | | ], |
| | | data() { |
| | | return { |
| | | caseId: null, |
| | | |
| | | // 表单数据 |
| | | form: { |
| | | id: undefined, |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.caseId = this.$route.query.infoid; |
| | | this.initData(); |
| | | }, |
| | | methods: { |
| | | // 根据字典value获取label |
| | | getOrganLabel(organValue) { |
| | | const dictItem = this.organDict.find(item => item.value === organValue); |
| | | const dictItem = this.organDict.find(item => item.value == organValue); |
| | | return dictItem ? dictItem.label : organValue; |
| | | }, |
| | | |
| | |
| | | .substring(0, 19); |
| | | |
| | | if (infoid) { |
| | | this.getDetail(infoid); |
| | | this.getDetail(infoid, id); |
| | | } else { |
| | | this.generateDonorNo(); |
| | | } |
| | |
| | | this.form.donorno = "D" + timestamp.slice(-8); |
| | | this.form.caseNo = "CASE" + timestamp.slice(-6); |
| | | }, |
| | | |
| | | // 解析 filePatch 字段 |
| | | parseFilePatch(filePatch) { |
| | | if (!filePatch) { |
| | | this.form.attachments = []; |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | this.form.attachments = JSON.parse(filePatch); |
| | | } catch (error) { |
| | | console.error("解析 filePatch 字段失败:", error); |
| | | this.form.attachments = []; |
| | | } |
| | | }, |
| | | // 获取详情 |
| | | async getDetail(infoid) { |
| | | async getDetail(infoid, id) { |
| | | this.loading = true; |
| | | donateorganBaseinfoInfo(id); |
| | | try { |
| | | const response = await allocationList({ infoid }); |
| | | if ( |
| | | response.code === 200 && |
| | | response.data && |
| | | response.data.length > 0 |
| | | ) { |
| | | if (response.code == 200 && response.data && response.data.length > 0) { |
| | | const data = response.data[0]; |
| | | |
| | | data.allocationStatus = JSON.stringify(data.allocationStatus); |
| | | // 填充表单数据 |
| | | Object.assign(this.form, data); |
| | | // 转换附件为集合 |
| | | this.parseFilePatch(this.form.fileName); |
| | | |
| | | // 初始化附件 |
| | | if (this.form.attachments) { |
| | |
| | | if (item.organname) { |
| | | const dictItem = this.organDict.find( |
| | | org => |
| | | org.label === item.organname || |
| | | org.label == item.organname || |
| | | (item.organname && item.organname.includes(org.label)) |
| | | ); |
| | | return dictItem ? dictItem.value : null; |
| | |
| | | let organName = this.getOrganLabel(organValue); |
| | | |
| | | // 如果是"其他"器官且有输入值 |
| | | if (organValue === "C01" && this.otherOrganInput) { |
| | | if (organValue == "C01" && this.otherOrganInput) { |
| | | organName = `其他(${this.otherOrganInput})`; |
| | | } |
| | | |
| | |
| | | // 医院选择变化 |
| | | handleHospitalChange(row, hospitalNo) { |
| | | const hospital = this.hospitalList.find( |
| | | item => item.hospitalNo === hospitalNo |
| | | item => item.hospitalNo == hospitalNo |
| | | ); |
| | | if (hospital) { |
| | | row.transplantHospitalName = hospital.hospitalName; |
| | |
| | | } |
| | | return ""; |
| | | }, |
| | | // 构建 filePatch 字段 |
| | | buildFilePatch() { |
| | | if (!this.attachments || this.attachments.length == 0) { |
| | | return ""; |
| | | } |
| | | return JSON.stringify(this.attachments); |
| | | }, |
| | | // 保存基本信息 |
| | | async handleSave() { |
| | | this.$refs.form.validate(async valid => { |
| | |
| | | try { |
| | | const saveData = { |
| | | ...this.form, |
| | | attachments: this.attachments, |
| | | serviceDonateorganList: |
| | | this.allocationData.serviceDonateorganList || [] |
| | | }; |
| | | console.log(this.form.recordstate); |
| | | saveData.fileName = this.buildFilePatch(); |
| | | saveData.serviceDonateorganList.forEach(item => { |
| | | item.baseid = this.form.id; |
| | | item.infoid = this.form.infoid; |
| | | }); |
| | | this.form.recordstate = 1; |
| | | const apiMethod = this.form.id ? allocationedit : allocationadd; |
| | | const response = await apiMethod(saveData); |
| | | |
| | | if (response.code === 200) { |
| | | if (response.code == 200) { |
| | | this.$message.success("保存成功"); |
| | | if (!this.form.id && response.data && response.data.id) { |
| | | this.form.id = response.data.id; |
| | | this.$router.replace({ |
| | | query: { ...this.$route.query, id: this.form.id } |
| | | }); |
| | | if (!this.form.id && response.data) { |
| | | this.form.id = response.data; |
| | | // this.$router.replace({ |
| | | // query: { ...this.$route.query, id: this.form.id } |
| | | // }); |
| | | } |
| | | } else { |
| | | this.$message.error("保存失败:" + (response.msg || "未知错误")); |
| | |
| | | |
| | | const response = await allocationedit(saveData); |
| | | |
| | | if (response.code === 200) { |
| | | if (response.code == 200) { |
| | | this.$message.success("分配记录保存成功"); |
| | | } else { |
| | | this.$message.error( |
| | |
| | | |
| | | const response = await allocationedit(saveData); |
| | | |
| | | if (response.code === 200) { |
| | | if (response.code == 200) { |
| | | this.$message.success("器官分配已完成"); |
| | | } else { |
| | | this.$message.error( |
| | |
| | | handleAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | item => item.path == file.url || item.fileUrl == file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.attachments.splice(index, 1); |
| | |
| | | |
| | | /** 上传成功处理 */ |
| | | handleUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | if (response.code == 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | |
| | | |
| | | /** 格式化文件大小 */ |
| | | formatFileSize(bytes) { |
| | | if (!bytes || bytes === 0) return "0 B"; |
| | | 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)); |