| | |
| | | <template> |
| | | <div class="death-judgment-detail"> |
| | | <case-basic-info :case-id="caseId" :show-attachment="true" /> |
| | | <el-card class="detail-card"> |
| | | <!-- 基础信息 --> |
| | | <div slot="header" class="clearfix"> |
| | |
| | | <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="!isEdit" |
| | | placeholder="自动生成捐献者编号" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="捐献者姓名" prop="name"> |
| | | <el-input v-model="form.name" :readonly="!isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-select |
| | | v-model="form.sex" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="男" value="1" /> |
| | | <el-option label="女" value="2" /> |
| | | </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" :readonly="!isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="疾病诊断" prop="diagnosisname"> |
| | | <el-input v-model="form.diagnosisname" :readonly="!isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="死亡原因" prop="deathreason"> |
| | | <el-select |
| | | <el-input v-model="form.deathreason" :readonly="!isEdit" /> |
| | | <!-- <el-select |
| | | v-model="form.deathreason" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | |
| | | <el-option label="脑死亡" value="brain_death" /> |
| | | <el-option label="心死亡" value="heart_death" /> |
| | | <el-option label="其他" value="other" /> |
| | | </el-select> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="负责人" prop="responsibleusername"> |
| | | <el-input |
| | | v-model="form.responsibleusername" |
| | | :readonly="!isEdit" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="8"> |
| | | <el-form-item label="记录状态" prop="recordstate"> |
| | | <el-tag :type="getStatusTag(form.recordstate)"> |
| | | {{ getStatusText(form.recordstate) }} |
| | | </el-tag> |
| | | </el-form-item> |
| | | </el-col> --> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="是否恢复遗体仪容" prop="isrestoreremains"> |
| | | <el-form-item label="恢复遗体仪容" prop="isrestoreremains"> |
| | | <el-select |
| | | v-model="form.isrestoreremains" |
| | | :disabled="!isEdit" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="负责人" prop="responsibleusername"> |
| | | <el-input |
| | | v-model="form.responsibleusername" |
| | | :readonly="!isEdit" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="记录状态" prop="recordstate"> |
| | | <el-tag :type="getStatusTag(form.recordstate)"> |
| | | {{ getStatusText(form.recordstate) }} |
| | | </el-tag> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-form-item label="死亡判定说明" prop="judgmentDescription"> |
| | | <el-form-item label="死亡判定说明" prop="remark"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="3" |
| | | v-model="form.judgmentDescription" |
| | | v-model="form.remark" |
| | | :readonly="!isEdit" |
| | | placeholder="详细记录死亡判定过程和依据" |
| | | /> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { deathinfoedit, deathinfoInfo } from "@/api/businessApi"; |
| | | import { |
| | | deathinfoedit, |
| | | deathinfoadd, |
| | | queryDathInfoBaseInfo |
| | | } from "@/api/businessApi"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import CaseBasicInfo from "@/components/CaseBasicInfo"; |
| | | |
| | | export default { |
| | | name: "DeathJudgmentDetail", |
| | | components: { CaseBasicInfo }, |
| | | |
| | | data() { |
| | | return { |
| | | caseId: null, |
| | | // 是否编辑模式 |
| | | isEdit: false, |
| | | // 保存加载状态 |
| | | saveLoading: false, |
| | | infoid: undefined, |
| | | |
| | | // 表单数据 |
| | | form: { |
| | | id: undefined, |
| | |
| | | gainhospitalname: "", |
| | | isspendremember: 0, |
| | | isrestoreremains: 0, |
| | | rememberannex: "", |
| | | rememberAnnex: "", |
| | | responsibleuserid: "", |
| | | responsibleusername: "", |
| | | recordstate: "0", |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.infoid = this.$route.query.infoid; |
| | | this.caseId = this.infoid; |
| | | const id = this.$route.query.id; |
| | | this.isEdit = this.$route.query.isEdit; |
| | | if (id && !this.$route.path.includes("/add")) { |
| | | this.getDetail(id); |
| | | } else if (this.$route.path.includes("/add")) { |
| | | this.generateDonorNo(); |
| | | } |
| | | this.getDetail(this.infoid); |
| | | |
| | | // if (id && !this.$route.path.includes("/add")) { |
| | | // this.getDetail(id); |
| | | // } else if (this.$route.path.includes("/add")) { |
| | | // this.generateDonorNo(); |
| | | // } |
| | | this.getAttachmentList(); |
| | | }, |
| | | methods: { |
| | |
| | | this.form.donorno = "DONOR" + timestamp.slice(-8); |
| | | }, |
| | | // 获取详情 |
| | | async getDetail(id) { |
| | | async getDetail(infoid) { |
| | | try { |
| | | const response = await deathinfoInfo(id); |
| | | const response = await queryDathInfoBaseInfo({ infoid }); |
| | | let realData = {}; |
| | | |
| | | if (response && response.data) { |
| | | realData = response.data; |
| | | realData = response.data[0]; |
| | | } else if (response) { |
| | | realData = response; |
| | | } |
| | |
| | | }; |
| | | |
| | | // 解析附件信息 |
| | | if (realData.rememberannex) { |
| | | this.parseAttachmentData(realData.rememberannex); |
| | | if (realData.rememberAnnex) { |
| | | this.parseAttachmentData(realData.rememberAnnex); |
| | | } |
| | | } catch (error) { |
| | | console.error("获取死亡判定详情失败:", error); |
| | |
| | | } |
| | | |
| | | // 更新附件JSON数据到表单 |
| | | this.form.rememberannex = this.buildAttachmentJson(); |
| | | this.form.rememberAnnex = this.buildAttachmentJson(); |
| | | |
| | | this.$message.success("文件上传成功"); |
| | | this.uploadDialogVisible = false; |
| | |
| | | // } |
| | | |
| | | // // 更新附件JSON数据到表单 |
| | | // this.form.rememberannex = this.buildAttachmentJson(); |
| | | // this.form.rememberAnnex = this.buildAttachmentJson(); |
| | | |
| | | // this.$message.success("文件上传成功"); |
| | | // this.uploadDialogVisible = false; |
| | |
| | | if (index !== -1) { |
| | | this.attachmentList.splice(index, 1); |
| | | // 更新附件JSON数据到表单 |
| | | this.form.rememberannex = this.buildAttachmentJson(); |
| | | this.form.rememberAnnex = this.buildAttachmentJson(); |
| | | this.$message.success("评估表删除成功"); |
| | | } |
| | | }) |
| | |
| | | // 构建提交数据 |
| | | const submitData = { |
| | | ...this.form, |
| | | infoid: this.infoid, |
| | | // 确保附件数据最新 |
| | | rememberannex: this.buildAttachmentJson() |
| | | }; |
| | | let response = null; |
| | | |
| | | const response = await deathinfoedit(submitData); |
| | | if (submitData.id) { |
| | | response = await deathinfoedit(submitData); |
| | | } else { |
| | | response = await deathinfoadd(submitData); |
| | | } |
| | | // const response = await deathinfoedit(submitData); |
| | | |
| | | if (response.code === 200) { |
| | | this.$message.success("保存成功"); |
| | | this.isEdit = false; |
| | | |
| | | if (!this.form.id) { |
| | | this.form.id = response.data; |
| | | } |
| | | if (this.$route.path.includes("/add")) { |
| | | this.$router.push("/case/deathJudgment"); |
| | | } |