| | |
| | | <template> |
| | | <div class="confirmation-detail"> |
| | | <case-basic-info :case-id="caseId" :show-attachment="true" /> |
| | | |
| | | <el-card class="detail-card"> |
| | | <!-- 基础信息 --> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">捐献确认基本信息</span> |
| | | <el-button |
| | | v-if="$route.query.confirm" |
| | | <span class="detail-title">捐献确认信息</span> |
| | | <!-- <el-button |
| | | type="primary" |
| | | style="float: right; padding: 3px 0" |
| | | style="float: right;margin-left: 20px;" |
| | | @click="handleSave" |
| | | :loading="saveLoading" |
| | | > |
| | | 保存确认信息 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | style="float: right;margin-left: 20px;" |
| | | @click="accomplish" |
| | | :loading="saveLoading" |
| | | > |
| | | 确认完成 |
| | | </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" :readonly="!isEdit" /> |
| | | <el-form-item label="协调员1" prop="coordinatedusernameo"> |
| | | <el-input v-model="form.coordinatedusernameo" /> |
| | | </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="协调员2" prop="coordinatedusernamet"> |
| | | <el-input v-model="form.coordinatedusernamet" /> |
| | | </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-option label="男" value="0" /> |
| | | <el-option label="女" value="1" /> |
| | | </el-select> |
| | | <!-- <el-col :span="8"> |
| | | <el-form-item label="业务人员" prop="responsibleusername"> |
| | | <el-input v-model="form.responsibleusername" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <!-- <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="diagnosis"> |
| | | <el-input v-model="form.diagnosis" :readonly="!isEdit" /> |
| | | </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> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="协调员1" prop="coordinator1"> |
| | | <el-input v-model="form.coordinator1" :readonly="!isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="协调员2" prop="coordinator2"> |
| | | <el-input v-model="form.coordinator2" :readonly="!isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="业务人员" prop="assignee"> |
| | | <el-input v-model="form.assignee" :readonly="!isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="确认状态" prop="confirmationStatus"> |
| | | <el-select |
| | | v-model="form.confirmationStatus" |
| | | :disabled="!isEdit" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="未确认" value="0" /> |
| | | <el-option label="家属确认" value="1" /> |
| | | <el-option label="不同意捐献" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="确认时间" prop="confirmationTime"> |
| | | <el-form-item label="签字时间" prop="signdate"> |
| | | <el-date-picker |
| | | v-model="form.confirmationTime" |
| | | v-model="form.signdate" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%" |
| | | :disabled="!isEdit" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> --> |
| | | |
| | | <!-- 亲属信息 --> |
| | | <el-divider content-position="left">亲属确认信息</el-divider> |
| | | |
| | | <el-alert |
| | | title="第一条数据为主要亲属,需填写完整的姓名、关系、身份证和电话信息" |
| | | type="info" |
| | | show-icon |
| | | :closable="false" |
| | | style="margin-bottom: 15px;" |
| | | > |
| | | </el-alert> |
| | | <el-row style="margin-top: 15px;"> |
| | | <el-button |
| | | style="float: right; margin-bottom: 5px;" |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-plus" |
| | | @click="openFamilyDialog(false)" |
| | | > |
| | | 添加其他家属 |
| | | </el-button> |
| | | </el-row> |
| | | <el-table :data="familyMemberList" size="small" border> |
| | | <el-table-column label="序号" width="60" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.$index + 1 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="姓名" prop="name" min-width="120"> |
| | | <template slot-scope="scope"> |
| | | <span :class="{ 'main-family': scope.$index === 0 }">{{ |
| | | scope.row.name |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="与捐赠者关系" prop="relation" min-width="140"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_FamilyRelation" |
| | | :value="scope.row.relation" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="身份证号" prop="idcard" min-width="180"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.$index === 0">{{ scope.row.idcard }}</span> |
| | | <span v-else style="color: #909399;">-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="联系电话" prop="phone" min-width="130"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.$index === 0">{{ scope.row.phone }}</span> |
| | | <span v-else style="color: #909399;">-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="类型" width="70" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.$index === 0" type="warning" size="small" |
| | | >主要</el-tag |
| | | > |
| | | <el-tag v-else type="info" size="small">其他</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="150" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | @click="editFamilyMember(scope.$index)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="scope.$index > 0" |
| | | size="mini" |
| | | type="text" |
| | | style="color:red" |
| | | @click="deleteFamilyMember(scope.$index)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | <span v-else style="color: #909399; font-size: 12px;" |
| | | >不可删除</span |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-row> |
| | | <el-form-item label-width="100px" label="捐献决定"> |
| | | <el-checkbox-group v-model="organdecision"> |
| | | <el-checkbox |
| | | v-for="item in organselection" |
| | | :key="item" |
| | | :label="item" |
| | | >{{ item }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | <el-input |
| | | v-if="organdecision.includes('其他')" |
| | | v-model="organdecisionOther" |
| | | placeholder="请输入其他捐献决定的具体内容" |
| | | style="margin-top: 10px; width: 300px;" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-row> |
| | | |
| | | <el-form-item label="家属意见备注" prop="familyRemark"> |
| | | <el-form-item label="家属意见备注" prop="relativeRemark"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="3" |
| | | v-model="form.familyRemark" |
| | | :readonly="!isEdit" |
| | | v-model="form.relativeRemark" |
| | | placeholder="记录家属的意见和沟通情况" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <!-- 附件列表 --> |
| | | <!-- 添加这里:底部居中按钮 --> |
| | | |
| | | <!-- 附件信息 - 按类型分类 --> |
| | | <el-card class="attachment-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span class="detail-title">相关附件上传</span> |
| | | <el-button |
| | | v-if="isEdit" |
| | | type="primary" |
| | | size="mini" |
| | | @click="handleSaveAll" |
| | | :loading="saveLoading" |
| | | > |
| | | 保存所有附件 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <!-- 附件类型选项卡 --> |
| | | <el-tabs v-model="activeAttachmentType" type="card"> |
| | | <el-tab-pane |
| | | v-for="type in attachmentTypes" |
| | |
| | | :label="type.label" |
| | | :name="type.value" |
| | | > |
| | | <div class="attachment-upload-section"> |
| | | <div class="upload-header"> |
| | | <div class="attachment-section"> |
| | | <div class="attachment-header"> |
| | | <span class="upload-title">{{ type.label }}</span> |
| | | <el-tooltip content="点击上传该类型附件" placement="top"> |
| | | <el-button |
| | |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="openUploadDialog(type.value)" |
| | | :disabled="!isEdit" |
| | | > |
| | | 添加附件 |
| | | </el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | <!-- 附件列表 --> |
| | | <el-table |
| | | :data="getAttachmentsByType(type.value)" |
| | | v-loading="attachmentLoading" |
| | | style="width: 100%; margin-top: 15px;" |
| | | > |
| | | <el-table-column label="文件名称" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <div class="file-info"> |
| | | <div class="attachment-list"> |
| | | <el-table |
| | | :data="getAttachmentsByType(type.value)" |
| | | size="small" |
| | | v-loading="attachmentLoading" |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="文件名" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | class="el-icon-document" |
| | | style="margin-right: 8px; color: #409EFF;" |
| | | style="color: #409EFF; margin-right: 8px;" |
| | | ></i> |
| | | <span>{{ scope.row.fileName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <span class="file-name">{{ scope.row.fileName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="文件大小" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="文件类型" width="90" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="small">{{ |
| | | getFileType(scope.row.fileName) |
| | | }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="上传时间" width="160" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="文件大小" width="90" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="上传人" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.uploader }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="上传时间" width="155" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatDateTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | width="120" |
| | | align="center" |
| | | v-if="isEdit" |
| | | <el-table-column label="操作" width="145" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="primary" |
| | | @click="handlePreview(scope.row)" |
| | | > |
| | | 预览 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="danger" |
| | | @click="handleRemoveAttachment(type.value, scope.$index)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div |
| | | v-if="getAttachmentsByType(type.value).length === 0" |
| | | class="empty-attachment" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handlePreview(scope.row)" |
| | | >预览</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | style="color: #F56C6C;" |
| | | @click="handleRemoveAttachment(scope.row, type.value)" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="操作" width="80" align="center" v-else> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handlePreview(scope.row)" |
| | | >预览</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div |
| | | v-if="getAttachmentsByType(type.value).length === 0" |
| | | class="empty-attachment" |
| | | > |
| | | <el-empty description="暂无附件" :image-size="80"></el-empty> |
| | | <el-empty |
| | | :description="`暂无${type.label}附件`" |
| | | :image-size="80" |
| | | ></el-empty> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-card> |
| | | <!-- 底部操作按钮 --> |
| | | <div style="text-align: center; margin: 30px 0;"> |
| | | <el-button |
| | | type="primary" |
| | | @click="handleSave" |
| | | :loading="saveLoading" |
| | | style="margin-right: 20px; min-width: 140px;" |
| | | > |
| | | 保存确认信息 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | @click="accomplish" |
| | | :loading="saveLoading" |
| | | style="min-width: 140px;" |
| | | > |
| | | 确认完成 |
| | | </el-button> |
| | | </div> |
| | | <!-- 家属弹窗 --> |
| | | <el-dialog |
| | | :title="familyDialogTitle" |
| | | :visible.sync="familyDialogVisible" |
| | | width="420px" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form :model="currentFamilyMember" label-width="110px"> |
| | | <el-form-item label="姓名" prop="name"> |
| | | <el-input |
| | | v-model="currentFamilyMember.name" |
| | | placeholder="请输入姓名" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="与捐赠者关系" prop="relation"> |
| | | <el-select |
| | | v-model="currentFamilyMember.relation" |
| | | style="width:100%" |
| | | placeholder="请选择关系" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.sys_FamilyRelation" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <template v-if="currentFamilyMember.isMain"> |
| | | <el-form-item label="身份证号" prop="idcard"> |
| | | <el-input |
| | | v-model="currentFamilyMember.idcard" |
| | | placeholder="请输入身份证号" |
| | | maxlength="18" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="联系电话" prop="phone"> |
| | | <el-input |
| | | v-model="currentFamilyMember.phone" |
| | | placeholder="请输入联系电话" |
| | | maxlength="11" |
| | | /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-form> |
| | | |
| | | <span slot="footer"> |
| | | <el-button @click="familyDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="saveFamilyMember">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 上传对话框 --> |
| | | <el-dialog |
| | | :title="`上传${getCurrentTypeLabel}附件`" |
| | | :visible.sync="uploadDialogVisible" |
| | | width="500px" |
| | | width="480px" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-upload |
| | | ref="uploadRef" |
| | | class="upload-demo" |
| | | drag |
| | | action="#" |
| | | :action="uploadAction" |
| | | :headers="headers" |
| | | multiple |
| | | :file-list="tempFileList" |
| | | :before-upload="beforeUpload" |
| | | :on-change="handleFileChange" |
| | | :on-remove="handleTempRemove" |
| | | :on-success="handleUploadSuccess" |
| | | :auto-upload="false" |
| | | :http-request="handleHttpRequest" |
| | | > |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
| | |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 文件预览弹窗 --> |
| | | <FilePreviewDialog |
| | | :visible="previewVisible" |
| | | :file="currentPreviewFile" |
| | | @close="previewVisible = false" |
| | | @download="handleDownload" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getConfirmationDetail, |
| | | updateConfirmation |
| | | } from "./mockConfirmationApi"; |
| | | import { relativesList, relativesEdit, relativesAdd } from "@/api/businessApi"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import CaseBasicInfo from "@/components/CaseBasicInfo"; |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | export default { |
| | | name: "ConfirmationDetail", |
| | | components: { |
| | | FilePreviewDialog, |
| | | CaseBasicInfo |
| | | }, |
| | | dicts: ["sys_FamilyRelation"], |
| | | data() { |
| | | return { |
| | | // 是否编辑模式 |
| | | caseId: null, |
| | | isEdit: false, |
| | | // 表单数据 |
| | | form: { |
| | | id: undefined, |
| | | infoid: undefined, |
| | | caseNo: "", |
| | | donorName: "", |
| | | gender: "", |
| | | name: "", |
| | | sex: "", |
| | | age: "", |
| | | diagnosis: "", |
| | | hospitalName: "", |
| | | coordinator1: "", |
| | | coordinator2: "", |
| | | assignee: "", |
| | | confirmationStatus: "0", |
| | | confirmationTime: "", |
| | | familyRemark: "" |
| | | diagnosisname: "", |
| | | treatmenthospitalname: "", |
| | | coordinatedusernameo: "", |
| | | coordinatedusernamet: "", |
| | | responsibleusername: "", |
| | | relativeconfirmationsign: "0", |
| | | signdate: "", |
| | | relativeconfirmationsignname: "", |
| | | signfamilyrelations: "", |
| | | relativeidcardno: "", |
| | | relativephone: "", |
| | | relativeRemark: "", |
| | | assessannex: "", |
| | | otherFamilyMembers: "" |
| | | }, |
| | | // 附件列表 |
| | | // 附件相关数据 |
| | | // 统一亲属列表(第一条为主要亲属,其余为其他亲属) |
| | | familyMemberList: [], |
| | | // 当前编辑的家属(弹窗用) |
| | | currentFamilyMember: { |
| | | name: "", |
| | | relation: "", |
| | | phone: "", |
| | | idcard: "", |
| | | isMain: false |
| | | }, |
| | | isEditFamilyMember: false, |
| | | editFamilyMemberIndex: -1, |
| | | familyDialogVisible: false, |
| | | familyDialogTitle: "添加家属", |
| | | |
| | | uploadAction: process.env.VUE_APP_BASE_API + "/common/upload", |
| | | headers: { |
| | | Authorization: "Bearer " + getToken() |
| | | }, |
| | | organdecision: [], |
| | | organdecisionOther: "", |
| | | organselection: [ |
| | | "肝脏", |
| | | "肾脏", |
| | | "心脏", |
| | | "肺脏", |
| | | "胰腺", |
| | | "小肠", |
| | | "眼角膜", |
| | | "其他" |
| | | ], |
| | | loading: false, |
| | | saveLoading: false, |
| | | infoid: null, |
| | | activeAttachmentType: "1", |
| | | attachmentLoading: false, |
| | | uploadDialogVisible: false, |
| | | uploadLoading: false, |
| | | saveLoading: false, |
| | | tempFileList: [], |
| | | currentUploadType: "", |
| | | |
| | | // 附件类型定义 |
| | | previewVisible: false, |
| | | currentPreviewFile: null, |
| | | attachmentTypes: [ |
| | | { value: "1", label: "人体器官潜在捐献者登记表" }, |
| | | { value: "2", label: "人体器官捐献亲属确认登记表" }, |
| | |
| | | { value: "5", label: "脑死亡判定知情同意书" }, |
| | | { value: "6", label: "心死亡判定知情同意书" } |
| | | ], |
| | | |
| | | // 附件列表数据 |
| | | attachmentList: [ |
| | | // 模拟数据 - 实际项目中从接口获取 |
| | | { |
| | | id: 1, |
| | | type: "1", |
| | | typeName: "人体器官潜在捐献者登记表", |
| | | fileName: "潜在捐献者登记表_202312001.pdf", |
| | | fileSize: 2548321, |
| | | uploadTime: "2023-12-01 10:30:00", |
| | | uploader: "张三", |
| | | fileUrl: "/attachments/1.pdf" |
| | | }, |
| | | { |
| | | id: 2, |
| | | type: "1", |
| | | typeName: "人体器官潜在捐献者登记表", |
| | | fileName: "补充说明.docx", |
| | | fileSize: 512345, |
| | | uploadTime: "2023-12-01 14:20:00", |
| | | uploader: "李四", |
| | | fileUrl: "/attachments/2.docx" |
| | | } |
| | | ] |
| | | attachmentData: { |
| | | "1": [], |
| | | "2": [], |
| | | "3": [], |
| | | "4": [], |
| | | "5": [], |
| | | "6": [] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | isEdit() { |
| | | return this.$route.query.confirm === "true"; |
| | | }, |
| | | getCurrentTypeLabel() { |
| | | const type = this.attachmentTypes.find( |
| | | t => t.value === this.currentUploadType |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | const id = this.$route.query.id; |
| | | this.infoid = this.$route.query.infoid; |
| | | this.caseId = this.$route.query.infoid; |
| | | this.isEdit = this.$route.query.confirm === "true"; |
| | | if (id) { |
| | | this.getDetail(id); |
| | | if (this.infoid) { |
| | | this.getDetail(this.infoid); |
| | | } |
| | | this.getAttachmentList(); |
| | | }, |
| | | methods: { |
| | | // 获取详情 |
| | | getDetail(id) { |
| | | getConfirmationDetail(id).then(response => { |
| | | async getDetail(infoid) { |
| | | this.loading = true; |
| | | try { |
| | | const response = await relativesList({ infoid }); |
| | | if (response.code === 200) { |
| | | this.form = response.data; |
| | | this.handleDetailData(response); |
| | | } else { |
| | | this.$message.error("获取详情失败:" + (response.msg || "未知错误")); |
| | | } |
| | | }); |
| | | }, |
| | | // 获取附件列表 |
| | | getAttachmentList() { |
| | | this.attachmentLoading = true; |
| | | // 模拟附件数据 |
| | | this.attachmentList = [ |
| | | { |
| | | id: 1, |
| | | type: "1", |
| | | typeName: "人体器官潜在捐献者登记表", |
| | | fileName: "潜在捐献者登记表_202312001.pdf", |
| | | uploadTime: "2023-12-01 10:30:00", |
| | | uploader: "张三", |
| | | fileSize: "2.5MB", |
| | | fileUrl: "/attachments/1.pdf" |
| | | }, |
| | | { |
| | | id: 2, |
| | | type: "2", |
| | | typeName: "人体器官捐献亲属确认登记表", |
| | | fileName: "亲属确认登记表_202312001.pdf", |
| | | uploadTime: "2023-12-01 14:20:00", |
| | | uploader: "李四", |
| | | fileSize: "1.8MB", |
| | | fileUrl: "/attachments/2.pdf" |
| | | }, |
| | | { |
| | | id: 3, |
| | | type: "3", |
| | | typeName: "捐献者及直系亲属身份证、户口簿相关证明", |
| | | fileName: "身份证明_202312001.zip", |
| | | uploadTime: "2023-12-01 16:45:00", |
| | | uploader: "王五", |
| | | fileSize: "5.2MB", |
| | | fileUrl: "/attachments/3.zip" |
| | | }, |
| | | { |
| | | id: 4, |
| | | type: "4", |
| | | typeName: "公民身故后人体器官(角膜)遗体捐献告知书", |
| | | fileName: "捐献告知书_202312001.pdf", |
| | | uploadTime: "2023-12-02 09:15:00", |
| | | uploader: "张三", |
| | | fileSize: "1.2MB", |
| | | fileUrl: "/attachments/4.pdf" |
| | | }, |
| | | { |
| | | id: 5, |
| | | type: "5", |
| | | typeName: "脑死亡判定知情同意书", |
| | | fileName: "脑死亡判定同意书_202312001.pdf", |
| | | uploadTime: "2023-12-02 11:30:00", |
| | | uploader: "李四", |
| | | fileSize: "0.8MB", |
| | | fileUrl: "/attachments/5.pdf" |
| | | }, |
| | | { |
| | | id: 6, |
| | | type: "6", |
| | | typeName: "心死亡判定知情同意书", |
| | | fileName: "心死亡判定同意书_202312001.pdf", |
| | | uploadTime: "2023-12-02 13:20:00", |
| | | uploader: "王五", |
| | | fileSize: "0.9MB", |
| | | fileUrl: "/attachments/6.pdf" |
| | | } |
| | | ]; |
| | | this.attachmentLoading = false; |
| | | }, |
| | | // 下载附件 |
| | | handleDownload(row) { |
| | | // 实际项目中这里调用文件下载接口 |
| | | this.$message.success(`下载文件: ${row.fileName}`); |
| | | console.log("下载文件:", row.fileUrl); |
| | | }, |
| | | // 保存确认信息 |
| | | handleSave() { |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | updateConfirmation(this.form).then(response => { |
| | | if (response.code === 200) { |
| | | this.$message.success("保存成功"); |
| | | this.isEdit = false; |
| | | this.$router.push("/case/confirmation"); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | // 根据类型获取附件 |
| | | getAttachmentsByType(type) { |
| | | return this.attachmentList.filter(item => item.type === type); |
| | | } catch (error) { |
| | | console.error("获取捐献确认详情失败:", error); |
| | | this.$message.error("获取详情失败"); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | // 打开上传对话框 |
| | | handleDetailData(response) { |
| | | let detailData = null; |
| | | if (response.data) { |
| | | if (Array.isArray(response.data)) { |
| | | detailData = response.data[0] || {}; |
| | | } else if (response.data.rows && Array.isArray(response.data.rows)) { |
| | | detailData = response.data.rows[0] || {}; |
| | | } else if (Array.isArray(response.data.list)) { |
| | | detailData = response.data.list[0] || {}; |
| | | } else { |
| | | detailData = response.data; |
| | | } |
| | | } else { |
| | | detailData = response; |
| | | } |
| | | |
| | | this.form = { |
| | | ...this.form, |
| | | id: detailData.id || this.$route.query.id, |
| | | infoid: detailData.infoid || this.infoid, |
| | | caseNo: detailData.caseNo || "", |
| | | name: detailData.name || "", |
| | | sex: detailData.sex || "", |
| | | age: detailData.age || "", |
| | | diagnosisname: detailData.diagnosisname || "", |
| | | treatmenthospitalname: detailData.treatmenthospitalname || "", |
| | | coordinatedusernameo: detailData.coordinatedusernameo || "", |
| | | coordinatedusernamet: detailData.coordinatedusernamet || "", |
| | | responsibleusername: detailData.responsibleusername || "", |
| | | relativeconfirmationsign: detailData.relativeconfirmationsign || "0", |
| | | signdate: detailData.signdate, |
| | | relativeconfirmationsignname: |
| | | detailData.relativeconfirmationsignname || "", |
| | | signfamilyrelations: detailData.signfamilyrelations || "", |
| | | relativeidcardno: detailData.relativeidcardno || "", |
| | | relativephone: detailData.relativephone || "", |
| | | relativeRemark: detailData.relativeRemark || "", |
| | | assessannex: detailData.assessannex || "" |
| | | }; |
| | | |
| | | // 初始化家属列表 |
| | | this.familyMemberList = []; |
| | | if (detailData.relativeconfirmationsignname) { |
| | | this.familyMemberList.push({ |
| | | name: detailData.relativeconfirmationsignname, |
| | | relation: detailData.signfamilyrelations || "", |
| | | phone: detailData.relativephone || "", |
| | | idcard: detailData.relativeidcardno || "" |
| | | }); |
| | | } |
| | | if (detailData.otherFamilyMembers) { |
| | | try { |
| | | const otherMembers = |
| | | typeof detailData.otherFamilyMembers === "string" |
| | | ? JSON.parse(detailData.otherFamilyMembers) |
| | | : detailData.otherFamilyMembers || []; |
| | | otherMembers.forEach(member => { |
| | | this.familyMemberList.push({ |
| | | name: member.name, |
| | | relation: member.relation, |
| | | phone: member.phone || "", |
| | | idcard: member.idcard || "" |
| | | }); |
| | | }); |
| | | } catch (e) { |
| | | console.warn("解析其他家属数据失败:", e); |
| | | } |
| | | } |
| | | |
| | | if (detailData.organdecision) { |
| | | this.organdecision = Array.isArray(detailData.organdecision) |
| | | ? detailData.organdecision |
| | | : detailData.organdecision.split(","); |
| | | } |
| | | |
| | | this.processAssessannexData(); |
| | | }, |
| | | |
| | | processAssessannexData() { |
| | | if (this.form.assessannex) { |
| | | try { |
| | | const annexData = |
| | | typeof this.form.assessannex === "string" |
| | | ? JSON.parse(this.form.assessannex) |
| | | : this.form.assessannex; |
| | | Object.keys(this.attachmentData).forEach(key => { |
| | | this.attachmentData[key] = []; |
| | | }); |
| | | if (Array.isArray(annexData)) { |
| | | annexData.forEach(attachment => { |
| | | const type = attachment.type || "1"; |
| | | if (this.attachmentData[type]) { |
| | | this.attachmentData[type].push(attachment); |
| | | } |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.warn("assessannex数据解析失败:", error); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | getAttachmentsByType(type) { |
| | | return this.attachmentData[type] || []; |
| | | }, |
| | | |
| | | openUploadDialog(type) { |
| | | this.currentUploadType = type; |
| | | this.tempFileList = []; |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | const allowedTypes = [ |
| | | 'application/pdf', |
| | | 'image/jpeg', |
| | | 'image/png', |
| | | 'application/msword', |
| | | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' |
| | | "application/pdf", |
| | | "image/jpeg", |
| | | "image/png", |
| | | "application/msword", |
| | | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" |
| | | ]; |
| | | |
| | | const maxSize = 10 * 1024 * 1024; // 10MB |
| | | |
| | | // 校验文件类型 |
| | | const isTypeOk = allowedTypes.includes(file.type) || |
| | | file.name.endsWith('.pdf') || |
| | | file.name.endsWith('.jpg') || |
| | | file.name.endsWith('.jpeg') || |
| | | file.name.endsWith('.png') || |
| | | file.name.endsWith('.doc') || |
| | | file.name.endsWith('.docx'); |
| | | |
| | | const maxSize = 10 * 1024 * 1024; |
| | | const isTypeOk = |
| | | allowedTypes.includes(file.type) || |
| | | file.name.endsWith(".pdf") || |
| | | file.name.endsWith(".jpg") || |
| | | file.name.endsWith(".jpeg") || |
| | | file.name.endsWith(".png") || |
| | | file.name.endsWith(".doc") || |
| | | file.name.endsWith(".docx"); |
| | | if (!isTypeOk) { |
| | | this.$message.error('文件格式不支持,请上传pdf、jpg、png、doc或docx格式文件'); |
| | | this.$message.error( |
| | | "文件格式不支持,请上传pdf、jpg、png、doc或docx格式文件" |
| | | ); |
| | | return false; |
| | | } |
| | | |
| | | // 校验文件大小 |
| | | if (file.size > maxSize) { |
| | | this.$message.error('文件大小不能超过10MB'); |
| | | this.$message.error("文件大小不能超过10MB"); |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | }, |
| | | |
| | | // 文件选择变化 |
| | | handleFileChange(file, fileList) { |
| | | this.tempFileList = fileList; |
| | | }, |
| | | |
| | | // 移除临时文件 |
| | | handleTempRemove(file, fileList) { |
| | | this.tempFileList = fileList; |
| | | }, |
| | | |
| | | // 自定义上传请求 |
| | | handleHttpRequest(options) { |
| | | // 模拟上传过程 |
| | | return new Promise((resolve, reject) => { |
| | | this.uploadLoading = true; |
| | | |
| | | // 模拟上传延迟 |
| | | setTimeout(() => { |
| | | const newAttachment = { |
| | | id: Date.now(), |
| | | type: this.currentUploadType, |
| | | typeName: this.getCurrentTypeLabel, |
| | | fileName: options.file.name, |
| | | fileSize: options.file.size, |
| | | uploadTime: new Date().toISOString(), |
| | | uploader: '当前用户', // 实际项目中从用户信息获取 |
| | | fileUrl: URL.createObjectURL(options.file) // 临时URL,实际项目中为服务器返回的URL |
| | | }; |
| | | |
| | | this.attachmentList.push(newAttachment); |
| | | this.uploadLoading = false; |
| | | resolve({ code: 200, data: newAttachment }); |
| | | }, 1500); |
| | | }); |
| | | handleUploadSuccess(response, file) { |
| | | if (response.code !== 200) { |
| | | this.$message.error(response.msg || "上传失败"); |
| | | return; |
| | | } |
| | | const newAttachment = { |
| | | id: Date.now(), |
| | | fileName: file.name, |
| | | fileUrl: response.url, |
| | | fileSize: file.size, |
| | | fileType: this.getFileExtension(file.name), |
| | | type: this.currentUploadType, |
| | | uploadTime: this.getCurrentTime(), |
| | | uploader: "当前用户" |
| | | }; |
| | | this.attachmentData[this.currentUploadType].push(newAttachment); |
| | | this.updateAssessannexField(); |
| | | this.$message.success("上传成功"); |
| | | this.uploadLoading = false; |
| | | this.uploadDialogVisible = false; |
| | | this.tempFileList = []; |
| | | }, |
| | | |
| | | // 提交上传 |
| | | async submitUpload() { |
| | | submitUpload() { |
| | | if (this.tempFileList.length === 0) { |
| | | this.$message.warning('请先选择要上传的文件'); |
| | | this.$message.warning("请先选择要上传的文件"); |
| | | return; |
| | | } |
| | | this.uploadLoading = true; |
| | | this.$refs.uploadRef.submit(); |
| | | }, |
| | | |
| | | handleRemoveAttachment(type, index) { |
| | | this.$confirm("确定要删除这个附件吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | if (this.attachmentData[type] && this.attachmentData[type][index]) { |
| | | this.attachmentData[type].splice(index, 1); |
| | | this.$message.success("附件删除成功"); |
| | | this.updateAssessannexField(); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | // 家属操作方法 |
| | | openFamilyDialog(isMain) { |
| | | this.isEditFamilyMember = false; |
| | | this.editFamilyMemberIndex = -1; |
| | | this.familyDialogTitle = "添加其他家属"; |
| | | |
| | | // 如果还没有任何家属,则添加主要亲属 |
| | | if (this.familyMemberList.length === 0) { |
| | | this.currentFamilyMember = { |
| | | name: "", |
| | | relation: "", |
| | | phone: "", |
| | | idcard: "", |
| | | isMain: true |
| | | }; |
| | | this.familyDialogTitle = "添加主要亲属"; |
| | | } else { |
| | | this.currentFamilyMember = { |
| | | name: "", |
| | | relation: "", |
| | | phone: "", |
| | | idcard: "", |
| | | isMain: false |
| | | }; |
| | | } |
| | | |
| | | this.familyDialogVisible = true; |
| | | }, |
| | | |
| | | editFamilyMember(index) { |
| | | this.isEditFamilyMember = true; |
| | | this.editFamilyMemberIndex = index; |
| | | const member = this.familyMemberList[index]; |
| | | this.currentFamilyMember = { |
| | | name: member.name, |
| | | relation: member.relation, |
| | | phone: member.phone || "", |
| | | idcard: member.idcard || "", |
| | | isMain: index === 0 |
| | | }; |
| | | this.familyDialogTitle = index === 0 ? "编辑主要亲属" : "编辑其他家属"; |
| | | this.familyDialogVisible = true; |
| | | }, |
| | | |
| | | deleteFamilyMember(index) { |
| | | if (index === 0) { |
| | | this.$message.warning("主要亲属不可删除"); |
| | | return; |
| | | } |
| | | this.$confirm("确认删除该家属?", "提示", { type: "warning" }) |
| | | .then(() => { |
| | | this.familyMemberList.splice(index, 1); |
| | | this.updateFamilyMemberField(); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | saveFamilyMember() { |
| | | if (!this.currentFamilyMember.name) { |
| | | this.$message.warning("请输入姓名"); |
| | | return; |
| | | } |
| | | if (!this.currentFamilyMember.relation) { |
| | | this.$message.warning("请选择与捐赠者关系"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | // 依次上传所有文件 |
| | | for (const file of this.tempFileList) { |
| | | await this.$refs.uploadRef.submit(); |
| | | // 如果是主要亲属,验证身份证和电话 |
| | | if (this.currentFamilyMember.isMain) { |
| | | if (!this.currentFamilyMember.idcard) { |
| | | this.$message.warning("请输入主要亲属的身份证号"); |
| | | return; |
| | | } |
| | | |
| | | this.$message.success('文件上传成功'); |
| | | this.uploadDialogVisible = false; |
| | | this.tempFileList = []; |
| | | } catch (error) { |
| | | this.$message.error('文件上传失败'); |
| | | console.error('上传失败:', error); |
| | | if ( |
| | | !/^(\d{15}|\d{18}|\d{17}(\d|X|x))$/.test( |
| | | this.currentFamilyMember.idcard |
| | | ) |
| | | ) { |
| | | this.$message.warning("请输入正确的身份证号"); |
| | | return; |
| | | } |
| | | if (!this.currentFamilyMember.phone) { |
| | | this.$message.warning("请输入主要亲属的联系电话"); |
| | | return; |
| | | } |
| | | if (!/^1[3-9]\d{9}$/.test(this.currentFamilyMember.phone)) { |
| | | this.$message.warning("请输入正确的手机号"); |
| | | return; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 删除附件 |
| | | handleRemoveAttachment(attachment, type) { |
| | | this.$confirm('确定要删除这个附件吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = this.attachmentList.findIndex(item => item.id === attachment.id); |
| | | if (index !== -1) { |
| | | this.attachmentList.splice(index, 1); |
| | | this.$message.success('附件删除成功'); |
| | | const memberData = { |
| | | name: this.currentFamilyMember.name, |
| | | relation: this.currentFamilyMember.relation, |
| | | phone: this.currentFamilyMember.isMain |
| | | ? this.currentFamilyMember.phone |
| | | : "", |
| | | idcard: this.currentFamilyMember.isMain |
| | | ? this.currentFamilyMember.idcard |
| | | : "" |
| | | }; |
| | | |
| | | // 实际项目中调用删除接口 |
| | | // this.deleteAttachment(attachment.id); |
| | | } |
| | | }).catch(() => {}); |
| | | }, |
| | | |
| | | // 预览附件 |
| | | handlePreview(attachment) { |
| | | // 实际项目中根据文件类型调用不同的预览方式 |
| | | if (attachment.fileName.endsWith('.pdf')) { |
| | | // PDF预览 |
| | | window.open(attachment.fileUrl, '_blank'); |
| | | } else if (attachment.fileName.match(/\.(jpg|jpeg|png)$/i)) { |
| | | // 图片预览 |
| | | this.$alert(`<img src="${attachment.fileUrl}" style="max-width: 100%;" alt="${attachment.fileName}">`, |
| | | '图片预览', { |
| | | dangerouslyUseHTMLString: true, |
| | | customClass: 'image-preview-dialog' |
| | | }); |
| | | if (this.isEditFamilyMember) { |
| | | this.familyMemberList.splice(this.editFamilyMemberIndex, 1, memberData); |
| | | } else { |
| | | // 其他文件类型提示下载 |
| | | this.$message.info('该文件类型暂不支持在线预览,请下载后查看'); |
| | | this.familyMemberList.push(memberData); |
| | | } |
| | | |
| | | this.updateFamilyMemberField(); |
| | | this.familyDialogVisible = false; |
| | | this.$message.success(this.isEditFamilyMember ? "编辑成功" : "添加成功"); |
| | | }, |
| | | |
| | | updateFamilyMemberField() { |
| | | if (this.familyMemberList.length > 0) { |
| | | const mainMember = this.familyMemberList[0]; |
| | | this.form.relativeconfirmationsignname = mainMember.name; |
| | | this.form.signfamilyrelations = mainMember.relation; |
| | | this.form.relativeidcardno = mainMember.idcard || ""; |
| | | this.form.relativephone = mainMember.phone || ""; |
| | | |
| | | const otherMembers = this.familyMemberList.slice(1).map(member => ({ |
| | | name: member.name, |
| | | relation: member.relation, |
| | | phone: member.phone || "", |
| | | idcard: member.idcard || "" |
| | | })); |
| | | this.form.otherFamilyMembers = JSON.stringify(otherMembers); |
| | | } else { |
| | | this.form.relativeconfirmationsignname = ""; |
| | | this.form.signfamilyrelations = ""; |
| | | this.form.relativeidcardno = ""; |
| | | this.form.relativephone = ""; |
| | | this.form.otherFamilyMembers = "[]"; |
| | | } |
| | | }, |
| | | |
| | | // 保存所有附件信息 |
| | | handleSaveAll() { |
| | | this.saveLoading = true; |
| | | |
| | | // 模拟保存过程 |
| | | setTimeout(() => { |
| | | this.$message.success('附件信息保存成功'); |
| | | this.saveLoading = false; |
| | | |
| | | // 实际项目中调用保存接口 |
| | | // this.saveAttachments(); |
| | | }, 1000); |
| | | updateAssessannexField() { |
| | | const allAttachments = []; |
| | | Object.values(this.attachmentData).forEach(attachments => { |
| | | allAttachments.push(...attachments); |
| | | }); |
| | | this.form.assessannex = JSON.stringify(allAttachments); |
| | | }, |
| | | |
| | | // 文件大小格式化 |
| | | handlePreview(file) { |
| | | this.currentPreviewFile = { |
| | | fileName: file.fileName, |
| | | fileUrl: file.fileUrl, |
| | | fileType: this.getFileType(file.fileName) |
| | | }; |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | handleDownload(file) { |
| | | const fileUrl = 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 = this.getFileExtension(fileName); |
| | | const imageTypes = ["jpg", "jpeg", "png"]; |
| | | const pdfTypes = ["pdf"]; |
| | | const officeTypes = ["doc", "docx"]; |
| | | if (imageTypes.includes(extension)) return "image"; |
| | | if (pdfTypes.includes(extension)) return "pdf"; |
| | | if (officeTypes.includes(extension)) return "office"; |
| | | return "other"; |
| | | }, |
| | | |
| | | getFileExtension(filename) { |
| | | return filename |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | }, |
| | | |
| | | formatFileSize(size) { |
| | | if (size === 0) return '0 B'; |
| | | if (!size) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ['B', 'KB', 'MB', 'GB']; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(size) / Math.log(k)); |
| | | return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; |
| | | return parseFloat((size / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }, |
| | | |
| | | // 时间格式化 |
| | | parseTime(time) { |
| | | if (!time) return ''; |
| | | const date = new Date(time); |
| | | return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; |
| | | 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; |
| | | } |
| | | }, |
| | | |
| | | getCurrentTime() { |
| | | const now = new Date(); |
| | | return `${now.getFullYear()}-${(now.getMonth() + 1) |
| | | .toString() |
| | | .padStart(2, "0")}-${now |
| | | .getDate() |
| | | .toString() |
| | | .padStart(2, "0")} ${now |
| | | .getHours() |
| | | .toString() |
| | | .padStart(2, "0")}:${now |
| | | .getMinutes() |
| | | .toString() |
| | | .padStart(2, "0")}:${now |
| | | .getSeconds() |
| | | .toString() |
| | | .padStart(2, "0")}`; |
| | | }, |
| | | |
| | | accomplish() { |
| | | this.$confirm("是否完成该案例捐献确认步骤?", "提醒", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.form.state = 3; |
| | | this.handleSave(); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | async handleSave() { |
| | | try { |
| | | await this.$refs.form.validate(); |
| | | this.saveLoading = true; |
| | | |
| | | this.updateFamilyMemberField(); |
| | | this.updateAssessannexField(); |
| | | |
| | | const saveData = { |
| | | ...this.form, |
| | | infoid: this.infoid, |
| | | organdecision: this.organdecision.join(","), |
| | | organdecisionOther: this.organdecisionOther |
| | | }; |
| | | if (saveData.state == 1 || !saveData.state) { |
| | | saveData.state = 2; |
| | | } |
| | | |
| | | let response = null; |
| | | if (saveData.id) { |
| | | response = await relativesEdit(saveData); |
| | | } else { |
| | | response = await relativesAdd(saveData); |
| | | } |
| | | |
| | | if (response.code === 200) { |
| | | this.$message.success("保存成功"); |
| | | this.$router.push("/case/affirm"); |
| | | } else { |
| | | this.$message.error("保存失败:" + (response.msg || "未知错误")); |
| | | } |
| | | } catch (error) { |
| | | if (error !== "cancel") { |
| | | console.error("保存失败:", error); |
| | | this.$message.error("保存失败"); |
| | | } |
| | | } finally { |
| | | this.saveLoading = false; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .attachment-card { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .detail-title { |
| | | font-size: 16px; |
| | | .main-family { |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .fixed-width .el-button { |
| | | margin: 0 5px; |
| | | } |
| | | .confirmation-detail { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .detail-card { |
| | | margin-bottom: 20px; |
| | | color: #e6a23c; |
| | | } |
| | | |
| | | .attachment-card { |
| | |
| | | .detail-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .attachment-upload-section { |
| | | padding: 10px; |
| | | .attachment-section { |
| | | padding: 15px; |
| | | } |
| | | |
| | | .upload-header { |
| | | .attachment-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .upload-title { |
| | |
| | | color: #303133; |
| | | } |
| | | |
| | | .file-info { |
| | | display: flex; |
| | | align-items: center; |
| | | .attachment-list { |
| | | margin-top: 15px; |
| | | } |
| | | |
| | | .empty-attachment { |
| | | text-align: center; |
| | | padding: 40px 0; |
| | | padding: 30px 0; |
| | | color: #909399; |
| | | } |
| | | |
| | | /* 图片预览对话框样式 */ |
| | | :deep(.image-preview-dialog) { |
| | | width: auto; |
| | | max-width: 90vw; |
| | | } |
| | | |
| | | :deep(.image-preview-dialog .el-message-box__content) { |
| | | text-align: center; |
| | | .file-name { |
| | | font-size: 13px; |
| | | color: #606266; |
| | | } |
| | | </style> |