From d4b9b197632366be60796f059030394aef6802ea Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期日, 17 五月 2026 19:29:30 +0800
Subject: [PATCH] 专家类型多选
---
src/views/business/course/components/DeathJudgmentStage.vue | 1004 +++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 712 insertions(+), 292 deletions(-)
diff --git a/src/views/business/course/components/DeathJudgmentStage.vue b/src/views/business/course/components/DeathJudgmentStage.vue
index ce25f7f..b64306c 100644
--- a/src/views/business/course/components/DeathJudgmentStage.vue
+++ b/src/views/business/course/components/DeathJudgmentStage.vue
@@ -1,80 +1,114 @@
<template>
<div class="death-judgment-detail">
- <el-card class="detail-card">
- <!-- 鍩虹淇℃伅 -->
+ <!-- 鍏叡淇℃伅妯″潡锛堢嫭绔嬫樉绀猴級 -->
+
+ <!-- 鍒ゅ畾绫诲瀷鏍囩椤� -->
+ <el-card class="type-card">
+ <el-tabs
+ v-model="activeJudgmentType"
+ type="card"
+ @tab-click="handleTabChange"
+ >
+ <el-tab-pane label="鑴戞浜″垽瀹�" name="brain">
+ <span slot="label">
+ <i class="el-icon-s-promotion" style="margin-right: 5px;"></i>
+ 鑴戞浜″垽瀹�
+ </span>
+ </el-tab-pane>
+ <el-tab-pane label="蹇冩浜″垽瀹�" name="heart">
+ <span slot="label">
+ <i class="el-icon-help" style="margin-right: 5px;"></i>
+ 蹇冩浜″垽瀹�
+ </span>
+ </el-tab-pane>
+ </el-tabs>
+ </el-card>
+ <el-card class="detail-card common-info-card">
<div slot="header" class="clearfix">
- <span class="detail-title">姝讳骸鍒ゅ畾鍩烘湰淇℃伅</span>
+ <span class="detail-title">鍏叡淇℃伅</span>
+ </div>
+
+ <el-form :model="form" label-width="120px">
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="璐熻矗浜�" prop="responsibleusername">
+ <el-input
+ v-model="form.responsibleusername"
+ :readonly="!isEdit"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍣ㄥ畼鑾峰彇鏈烘瀯" prop="gainhospitalname">
+ <el-input v-model="form.gainhospitalname" :readonly="!isEdit" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏄惁榛樺搥缂呮��" prop="isspendremember">
+ <el-select
+ v-model="form.isspendremember"
+ :disabled="!isEdit"
+ style="width: 100%"
+ >
+ <el-option label="鏄�" :value="1" />
+ <el-option label="鍚�" :value="0" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鎭㈠閬椾綋浠" prop="isrestoreremains">
+ <el-select
+ v-model="form.isrestoreremains"
+ :disabled="!isEdit"
+ style="width: 100%"
+ >
+ <el-option label="鏄�" :value="1" />
+ <el-option label="鍚�" :value="0" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-card>
+ <!-- 鑴戞浜″垽瀹氭ā鍧� -->
+ <el-card v-if="activeJudgmentType === 'brain'" class="detail-card">
+ <div slot="header" class="clearfix">
+ <span class="detail-title">鑴戞浜″垽瀹氫俊鎭�</span>
<el-button
v-if="isEdit"
+ style="float: right; margin-left: 10px;"
type="success"
- style="float: right"
@click="handleSave"
:loading="saveLoading"
>
淇濆瓨淇℃伅
</el-button>
<el-button
+ v-if="isEdit"
+ style="float: right; margin-left: 10px;"
+ type="success"
+ @click="accomplish"
+ :loading="saveLoading"
+ >
+ 瀹屾垚鍒ゅ畾
+ </el-button>
+ <el-button
v-else
+ style="float: right; margin-left: 10px;"
type="primary"
- style="float: right"
@click="handleEdit"
>
缂栬緫淇℃伅
</el-button>
</div>
- <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+ <el-form :model="form" ref="brainForm" :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
- 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-input v-model="form.deathreason" :readonly="!isEdit" />
</el-form-item>
</el-col>
</el-row>
@@ -102,198 +136,310 @@
</el-form-item>
</el-col>
</el-row>
+ </el-form>
+ <!-- 鑴戞浜¤瘎浼拌〃闄勪欢 -->
+ <div class="attachment-section">
+ <div class="attachment-header">
+ <h3>鑴戞浜″垽瀹氳瘎浼拌〃闄勪欢</h3>
+ </div>
+
+ <!-- 闄勪欢绫诲瀷閫夐」鍗� -->
+ <el-tabs v-model="activeAttachmentType" type="card">
+ <el-tab-pane
+ v-for="type in brainDeathAttachmentTypes"
+ :key="type.value"
+ :label="type.label"
+ :name="type.value"
+ >
+ <div class="attachment-upload-section">
+ <div class="upload-header">
+ <span class="upload-title">{{ type.label }}</span>
+ <el-tooltip content="鐐瑰嚮涓婁紶璇ョ被鍨嬭瘎浼拌〃" placement="top">
+ <el-button
+ size="mini"
+ 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">
+ <i
+ class="el-icon-document"
+ style="margin-right: 8px; color: #409EFF;"
+ ></i>
+ <span>{{ scope.row.fileName }}</span>
+ </div>
+ </template>
+ </el-table-column>
+
+ <el-table-column label="鏂囦欢绫诲瀷" width="100" 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="100" align="center">
+ <template slot-scope="scope">
+ <span>{{ formatFileSize(scope.row.fileSize) }}</span>
+ </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="100" align="center">
+ <template slot-scope="scope">
+ <span>{{ scope.row.uploader }}</span>
+ </template>
+ </el-table-column>
+
+ <el-table-column label="鎿嶄綔" width="180" align="center">
+ <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-download"
+ @click="handleDownload(scope.row)"
+ >涓嬭浇</el-button
+ >
+ <el-button
+ v-if="isEdit"
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ style="color: #F56C6C;"
+ @click="handleRemoveAttachment(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>
+ </div>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </el-card>
+
+ <!-- 蹇冩浜″垽瀹氭ā鍧� -->
+ <el-card v-else class="detail-card">
+ <div slot="header" class="clearfix">
+ <span class="detail-title">蹇冩浜″垽瀹氫俊鎭�</span>
+ <el-button
+ v-if="isEdit"
+ style="float: right; margin-left: 10px;"
+ type="success"
+ @click="handleSave"
+ :loading="saveLoading"
+ >
+ 淇濆瓨淇℃伅
+ </el-button>
+ <el-button
+ v-else
+ style="float: right; margin-left: 10px;"
+ type="primary"
+ @click="handleEdit"
+ >
+ 缂栬緫淇℃伅
+ </el-button>
+ </div>
+
+ <el-form :model="form" ref="heartForm" :rules="rules" label-width="120px">
<el-row :gutter="20">
<el-col :span="8">
- <el-form-item label="鍣ㄥ畼鑾峰彇鏈烘瀯" prop="gainhospitalname">
- <el-input v-model="form.gainhospitalname" :readonly="!isEdit" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="鏄惁榛樺搥缂呮��" prop="isspendremember">
- <el-select
- v-model="form.isspendremember"
- :disabled="!isEdit"
- style="width: 100%"
- >
- <el-option label="鏄�" :value="1" />
- <el-option label="鍚�" :value="0" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="鏄惁鎭㈠閬椾綋浠" prop="isrestoreremains">
- <el-select
- v-model="form.isrestoreremains"
- :disabled="!isEdit"
- style="width: 100%"
- >
- <el-option label="鏄�" :value="1" />
- <el-option label="鍚�" :value="0" />
- </el-select>
+ <el-form-item label="蹇冩浜″師鍥�" prop="heartdeathreason">
+ <el-input v-model="form.heartdeathreason" :readonly="!isEdit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
- <el-form-item label="璐熻矗浜�" prop="responsibleusername">
+ <el-form-item label="蹇冩浜℃椂闂�" prop="heartdeathtime">
+ <el-date-picker
+ v-model="form.heartdeathtime"
+ type="datetime"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ style="width: 100%"
+ :disabled="!isEdit"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍒ゅ畾鍖荤敓涓�" prop="heartdeathjudgedocto">
<el-input
- v-model="form.responsibleusername"
+ v-model="form.heartdeathjudgedocto"
: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 label="鍒ゅ畾鍖荤敓浜�" prop="heartdeathjudgedoctt">
+ <el-input
+ v-model="form.heartdeathjudgedoctt"
+ :readonly="!isEdit"
+ />
</el-form-item>
</el-col>
</el-row>
-
- <el-form-item label="姝讳骸鍒ゅ畾璇存槑" prop="judgmentDescription">
- <el-input
- type="textarea"
- :rows="3"
- v-model="form.judgmentDescription"
- :readonly="!isEdit"
- 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="openUploadDialog"
- :loading="uploadLoading"
- >
- 涓婁紶闄勪欢
- </el-button> -->
+ <!-- 蹇冩浜¤瘎浼拌〃闄勪欢 -->
+ <div class="attachment-section">
+ <div class="attachment-header">
+ <h3>蹇冩浜″垽瀹氳瘎浼拌〃闄勪欢</h3>
+ </div>
+
+ <!-- 蹇冩浜¢檮浠剁被鍨嬮�夐」鍗� -->
+ <el-tabs v-model="activeHeartDeathAttachmentType" type="card">
+ <el-tab-pane
+ v-for="type in heartDeathAttachmentTypes"
+ :key="type.value"
+ :label="type.label"
+ :name="type.value"
+ >
+ <div class="attachment-upload-section">
+ <div class="upload-header">
+ <span class="upload-title">{{ type.label }}</span>
+ <el-tooltip content="鐐瑰嚮涓婁紶璇ョ被鍨嬭瘎浼拌〃" placement="top">
+ <el-button
+ size="mini"
+ type="primary"
+ icon="el-icon-plus"
+ @click="openHeartDeathUploadDialog(type.value)"
+ :disabled="!isEdit"
+ >
+ 娣诲姞璇勪及琛�
+ </el-button>
+ </el-tooltip>
+ </div>
+
+ <!-- 蹇冩浜¢檮浠跺垪琛� -->
+ <el-table
+ :data="getHeartDeathAttachmentsByType(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">
+ <i
+ class="el-icon-document"
+ style="margin-right: 8px; color: #409EFF;"
+ ></i>
+ <span>{{ scope.row.fileName }}</span>
+ </div>
+ </template>
+ </el-table-column>
+
+ <el-table-column label="鏂囦欢绫诲瀷" width="100" 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="100" align="center">
+ <template slot-scope="scope">
+ <span>{{ formatFileSize(scope.row.fileSize) }}</span>
+ </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="100" align="center">
+ <template slot-scope="scope">
+ <span>{{ scope.row.uploader }}</span>
+ </template>
+ </el-table-column>
+
+ <el-table-column label="鎿嶄綔" width="180" align="center">
+ <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-download"
+ @click="handleDownload(scope.row)"
+ >涓嬭浇</el-button
+ >
+ <el-button
+ v-if="isEdit"
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ style="color: #F56C6C;"
+ @click="handleRemoveHeartDeathAttachment(scope.row)"
+ >鍒犻櫎</el-button
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <div
+ v-if="getHeartDeathAttachmentsByType(type.value).length === 0"
+ class="empty-attachment"
+ >
+ <el-empty
+ description="鏆傛棤璇勪及琛ㄩ檮浠�"
+ :image-size="80"
+ ></el-empty>
+ </div>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
</div>
-
- <!-- 闄勪欢绫诲瀷閫夐」鍗� -->
- <el-tabs v-model="activeAttachmentType" type="card">
- <el-tab-pane
- v-for="type in attachmentTypes"
- :key="type.value"
- :label="type.label"
- :name="type.value"
- >
- <div class="attachment-upload-section">
- <div class="upload-header">
- <span class="upload-title">{{ type.label }}</span>
- <el-tooltip content="鐐瑰嚮涓婁紶璇ョ被鍨嬭瘎浼拌〃" placement="top">
- <el-button
- size="mini"
- 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">
- <i
- class="el-icon-document"
- style="margin-right: 8px; color: #409EFF;"
- ></i>
- <span>{{ scope.row.fileName }}</span>
- </div>
- </template>
- </el-table-column>
-
- <el-table-column label="鏂囦欢绫诲瀷" width="100" 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="100" align="center">
- <template slot-scope="scope">
- <span>{{ formatFileSize(scope.row.fileSize) }}</span>
- </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="100" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.uploader }}</span>
- </template>
- </el-table-column>
-
- <el-table-column label="鎿嶄綔" width="180" align="center">
- <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-download"
- @click="handleDownload(scope.row)"
- >涓嬭浇</el-button
- >
- <el-button
- v-if="isEdit"
- size="mini"
- type="text"
- icon="el-icon-delete"
- style="color: #F56C6C;"
- @click="handleRemoveAttachment(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>
- </div>
- </div>
- </el-tab-pane>
- </el-tabs>
</el-card>
- <!-- 涓婁紶瀵硅瘽妗� -->
+ <!-- 涓婁紶瀵硅瘽妗嗭紙鑴戞浜★級 -->
<el-dialog
- :title="`涓婁紶${getCurrentTypeLabel}璇勪及琛╜"
+ :title="`涓婁紶${getCurrentBrainDeathTypeLabel}璇勪及琛╜"
:visible.sync="uploadDialogVisible"
width="500px"
:close-on-click-modal="false"
@@ -333,15 +479,66 @@
</el-button>
</div>
</el-dialog>
+
+ <!-- 涓婁紶瀵硅瘽妗嗭紙蹇冩浜★級 -->
+ <el-dialog
+ :title="`涓婁紶${getCurrentHeartDeathTypeLabel}璇勪及琛╜"
+ :visible.sync="heartDeathUploadDialogVisible"
+ width="500px"
+ :close-on-click-modal="false"
+ >
+ <el-upload
+ ref="heartDeathUploadRef"
+ class="upload-demo"
+ drag
+ :action="uploadAction"
+ :headers="headers"
+ multiple
+ :file-list="tempHeartDeathFileList"
+ :before-upload="beforeUpload"
+ :on-change="handleHeartDeathFileChange"
+ :on-remove="handleHeartDeathTempRemove"
+ :on-success="handleHeartDeathUploadSuccess"
+ :auto-upload="false"
+ >
+ <i class="el-icon-upload"></i>
+ <div class="el-upload__text">
+ 灏嗚瘎浼拌〃鏂囦欢鎷栧埌姝ゅ锛屾垨<em>鐐瑰嚮涓婁紶</em>
+ </div>
+ <div class="el-upload__tip" slot="tip">
+ 鏀寔涓婁紶pdf銆乯pg銆乸ng銆乨oc銆乨ocx銆亁ls銆亁lsx鏍煎紡鏂囦欢锛屽崟涓枃浠朵笉瓒呰繃10MB
+ </div>
+ </el-upload>
+
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="heartDeathUploadDialogVisible = false"
+ >鍙栨秷</el-button
+ >
+ <el-button
+ type="primary"
+ @click="submitHeartDeathUpload"
+ :loading="heartDeathUploadLoading"
+ :disabled="tempHeartDeathFileList.length === 0"
+ >
+ 纭涓婁紶
+ </el-button>
+ </div>
+ </el-dialog>
</div>
</template>
<script>
-import { deathinfoedit, queryDathInfoBaseInfo } 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 },
props: {
infoid: {
type: String,
@@ -350,10 +547,13 @@
},
data() {
return {
- // 鏄惁缂栬緫妯″紡
+ caseId: null,
isEdit: false,
- // 淇濆瓨鍔犺浇鐘舵��
saveLoading: false,
+
+ // 鍒ゅ畾绫诲瀷鏍囩
+ activeJudgmentType: "brain", // 榛樿鏄剧ず鑴戞浜�
+
// 琛ㄥ崟鏁版嵁
form: {
id: undefined,
@@ -363,19 +563,28 @@
sex: "",
age: "",
diagnosisname: "",
+ // 鑴戞浜$浉鍏冲瓧娈�
deathreason: "",
deathtime: "",
deathjudgedocto: "",
deathjudgedoctt: "",
+ // 蹇冩浜$浉鍏冲瓧娈�
+ heartdeathtime: "",
+ heartdeathreason: "",
+ heartdeathjudgedocto: "",
+ heartdeathjudgedoctt: "",
+ heartDeathRemark: "",
+ // 鍏叡瀛楁
gainhospitalno: "",
gainhospitalname: "",
isspendremember: 0,
isrestoreremains: 0,
- rememberannex: "",
+ rememberAnnex: "",
+ heartdeathjudgeannex: "", // 鏂板蹇冩浜¢檮浠跺瓧娈�
responsibleuserid: "",
responsibleusername: "",
recordstate: "0",
- judgmentDescription: ""
+ remark: ""
},
// 琛ㄥ崟楠岃瘉瑙勫垯
rules: {
@@ -390,56 +599,98 @@
],
deathjudgedocto: [
{ required: true, message: "鍒ゅ畾鍖荤敓涓�涓嶈兘涓虹┖", trigger: "blur" }
+ ],
+ heartdeathreason: [
+ { required: false, message: "蹇冩浜″師鍥犱笉鑳戒负绌�", trigger: "blur" }
+ ],
+ heartdeathtime: [
+ { required: false, message: "蹇冩浜℃椂闂翠笉鑳戒负绌�", trigger: "change" }
+ ],
+ heartdeathjudgedocto: [
+ {
+ required: false,
+ message: "蹇冩浜″垽瀹氬尰鐢熶竴涓嶈兘涓虹┖",
+ trigger: "blur"
+ }
]
},
// 闄勪欢鐩稿叧鏁版嵁
activeAttachmentType: "1",
+ activeHeartDeathAttachmentType: "heart_1", // 蹇冩浜¢檮浠剁被鍨�
attachmentLoading: false,
uploadDialogVisible: false,
+ heartDeathUploadDialogVisible: false, // 蹇冩浜′笂浼犲璇濇
uploadLoading: false,
+ heartDeathUploadLoading: false, // 蹇冩浜′笂浼犲姞杞界姸鎬�
tempFileList: [],
+ tempHeartDeathFileList: [], // 蹇冩浜′复鏃舵枃浠跺垪琛�
currentUploadType: "",
+ currentHeartDeathUploadType: "", // 褰撳墠蹇冩浜′笂浼犵被鍨�
uploadAction: process.env.VUE_APP_BASE_API + "/common/upload",
headers: {
Authorization: "Bearer " + getToken()
},
- // 璇勪及琛ㄧ被鍨嬪畾涔�
- attachmentTypes: [
+ // 鑴戞浜¤瘎浼拌〃绫诲瀷瀹氫箟
+ brainDeathAttachmentTypes: [
{ value: "1", label: "鑴戞浜″垽瀹氳〃" },
{ value: "2", label: "鑴戠數鍥捐瘎浼拌〃" },
{ value: "3", label: "鐭綔浼忔湡浣撴劅璇卞彂鐢典綅璇勪及琛�" },
{ value: "4", label: "缁忛澶氭櫘鍕掕秴澹拌瘎浼拌褰�" },
{ value: "5", label: "鍗仴濮旇剳鎹熶激璐ㄦ帶涓績 - 涓村簥缁煎悎璇勪及琛�" },
- { value: "6", label: "UW璇勫垎琛�" },
- { value: "7", label: "蹇冩浜″垽瀹氳〃" }
+ { value: "6", label: "UW璇勫垎琛�" }
+ ],
+ // 蹇冩浜¤瘎浼拌〃绫诲瀷瀹氫箟
+ heartDeathAttachmentTypes: [
+ { value: "heart_1", label: "蹇冩浜″垽瀹氳〃" },
+ { value: "heart_2", label: "蹇冪數鍥捐瘎浼拌〃" }
],
// 闄勪欢鍒楄〃鏁版嵁
- attachmentList: []
+ attachmentList: [], // 鑴戞浜¢檮浠�
+ heartDeathAttachmentList: [] // 蹇冩浜¢檮浠�
};
},
computed: {
- getCurrentTypeLabel() {
- const type = this.attachmentTypes.find(
+ getCurrentBrainDeathTypeLabel() {
+ const type = this.brainDeathAttachmentTypes.find(
t => t.value === this.currentUploadType
+ );
+ return type ? type.label : "";
+ },
+ getCurrentHeartDeathTypeLabel() {
+ const type = this.heartDeathAttachmentTypes.find(
+ t => t.value === this.currentHeartDeathUploadType
);
return type ? type.label : "";
}
},
created() {
+ this.caseId = this.infoid;
+ // 浠庤矾鐢卞弬鏁拌幏鍙栭粯璁ゆ樉绀虹被鍨�
+ if (this.$route.query.judgmentType) {
+ this.activeJudgmentType = this.$route.query.type;
+ }
+
this.getDetail(this.infoid);
this.getAttachmentList();
},
methods: {
+ // 鏍囩椤靛垏鎹�
+ handleTabChange(tab) {
+ this.activeJudgmentType = tab.name;
+ // 鍙互鍦ㄨ繖閲屾坊鍔犲叾浠栧垏鎹㈤�昏緫
+ },
+
// 鐢熸垚鎹愮尞鑰呯紪鍙�
generateDonorNo() {
const timestamp = Date.now().toString();
this.form.donorno = "DONOR" + timestamp.slice(-8);
},
+
// 鑾峰彇璇︽儏
- async getDetail(id) {
+ async getDetail(infoid) {
try {
- const response = await queryDathInfoBaseInfo({ infoid: id });
+ const response = await queryDathInfoBaseInfo({ infoid });
let realData = {};
if (response && response.data) {
@@ -462,31 +713,48 @@
};
// 瑙f瀽闄勪欢淇℃伅
- if (realData.rememberannex) {
- this.parseAttachmentData(realData.rememberannex);
+ if (realData.rememberAnnex) {
+ this.parseAttachmentData(realData.rememberAnnex, "brain");
+ }
+
+ // 瑙f瀽蹇冩浜¢檮浠朵俊鎭�
+ if (realData.heartdeathjudgeannex) {
+ this.parseAttachmentData(realData.heartdeathjudgeannex, "heart");
}
} catch (error) {
console.error("鑾峰彇姝讳骸鍒ゅ畾璇︽儏澶辫触:", error);
this.$message.error("鏁版嵁鍔犺浇澶辫触");
}
},
+
// 瑙f瀽闄勪欢鏁版嵁
- parseAttachmentData(attachmentJson) {
+ parseAttachmentData(attachmentJson, type = "brain") {
try {
if (attachmentJson) {
const attachments = JSON.parse(attachmentJson);
if (Array.isArray(attachments)) {
- this.attachmentList = attachments;
+ if (type === "brain") {
+ this.attachmentList = attachments;
+ } else if (type === "heart") {
+ this.heartDeathAttachmentList = attachments;
+ }
}
}
} catch (error) {
console.error("瑙f瀽闄勪欢鏁版嵁澶辫触:", error);
}
},
- // 鏋勫缓闄勪欢JSON鏁版嵁
- buildAttachmentJson() {
+
+ // 鏋勫缓鑴戞浜¢檮浠禞SON鏁版嵁
+ buildBrainDeathAttachmentJson() {
return JSON.stringify(this.attachmentList);
},
+
+ // 鏋勫缓蹇冩浜¢檮浠禞SON鏁版嵁
+ buildHeartDeathAttachmentJson() {
+ return JSON.stringify(this.heartDeathAttachmentList);
+ },
+
// 鑾峰彇鐘舵�佹爣绛炬牱寮�
getStatusTag(status) {
const statusMap = {
@@ -496,6 +764,7 @@
};
return statusMap[status] || "info";
},
+
// 鑾峰彇鐘舵�佹枃鏈�
getStatusText(status) {
const textMap = {
@@ -505,18 +774,25 @@
};
return textMap[status] || "鏈煡鐘舵��";
},
+
// 鑾峰彇闄勪欢鍒楄〃
getAttachmentList() {
this.attachmentLoading = true;
- // 瀹為檯椤圭洰涓粠鎺ュ彛鑾峰彇闄勪欢鏁版嵁
setTimeout(() => {
this.attachmentLoading = false;
}, 500);
},
- // 鏍规嵁绫诲瀷鑾峰彇闄勪欢
+
+ // 鏍规嵁绫诲瀷鑾峰彇鑴戞浜¢檮浠�
getAttachmentsByType(type) {
return this.attachmentList.filter(item => item.type === type);
},
+
+ // 鏍规嵁绫诲瀷鑾峰彇蹇冩浜¢檮浠�
+ getHeartDeathAttachmentsByType(type) {
+ return this.heartDeathAttachmentList.filter(item => item.type === type);
+ },
+
// 鑾峰彇鏂囦欢绫诲瀷
getFileType(fileName) {
const ext = fileName
@@ -535,7 +811,8 @@
};
return typeMap[ext] || ext.toUpperCase();
},
- // 鎵撳紑涓婁紶瀵硅瘽妗�
+
+ // 鎵撳紑鑴戞浜′笂浼犲璇濇
openUploadDialog(type = null) {
this.currentUploadType = type || this.activeAttachmentType;
this.tempFileList = [];
@@ -546,6 +823,20 @@
}
});
},
+
+ // 鎵撳紑蹇冩浜′笂浼犲璇濇
+ openHeartDeathUploadDialog(type = null) {
+ this.currentHeartDeathUploadType =
+ type || this.activeHeartDeathAttachmentType;
+ this.tempHeartDeathFileList = [];
+ this.heartDeathUploadDialogVisible = true;
+ this.$nextTick(() => {
+ if (this.$refs.heartDeathUploadRef) {
+ this.$refs.heartDeathUploadRef.clearFiles();
+ }
+ });
+ },
+
// 涓婁紶鍓嶆牎楠�
beforeUpload(file) {
const allowedTypes = [
@@ -585,24 +876,38 @@
return true;
},
- // 鏂囦欢閫夋嫨鍙樺寲
+
+ // 鑴戞浜℃枃浠堕�夋嫨鍙樺寲
handleFileChange(file, fileList) {
this.tempFileList = fileList;
},
- // 绉婚櫎涓存椂鏂囦欢
+
+ // 蹇冩浜℃枃浠堕�夋嫨鍙樺寲
+ handleHeartDeathFileChange(file, fileList) {
+ this.tempHeartDeathFileList = fileList;
+ },
+
+ // 绉婚櫎鑴戞浜′复鏃舵枃浠�
handleTempRemove(file, fileList) {
this.tempFileList = fileList;
},
- /** 涓婁紶鎴愬姛澶勭悊 */
+
+ // 绉婚櫎蹇冩浜′复鏃舵枃浠�
+ handleHeartDeathTempRemove(file, fileList) {
+ this.tempHeartDeathFileList = fileList;
+ },
+
+ // 鑴戞浜′笂浼犳垚鍔熷鐞�
handleUploadSuccess(response, file, fileList) {
if (response.code === 200) {
file.url = response.data || response.url;
this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+
for (const file of this.tempFileList) {
const newAttachment = {
id: Date.now() + Math.random(),
type: this.currentUploadType,
- typeName: this.getCurrentTypeLabel,
+ typeName: this.getCurrentBrainDeathTypeLabel,
fileName: file.name,
fileSize: file.size,
uploadTime: new Date().toISOString(),
@@ -613,8 +918,8 @@
this.attachmentList.push(newAttachment);
}
- // 鏇存柊闄勪欢JSON鏁版嵁鍒拌〃鍗�
- this.form.rememberannex = this.buildAttachmentJson();
+ // 鏇存柊鑴戞浜¢檮浠禞SON鏁版嵁鍒拌〃鍗�
+ this.form.rememberAnnex = this.buildBrainDeathAttachmentJson();
this.$message.success("鏂囦欢涓婁紶鎴愬姛");
this.uploadDialogVisible = false;
@@ -624,45 +929,60 @@
this.$message.error(response.msg || "鏂囦欢涓婁紶澶辫触");
}
},
- // 鎻愪氦涓婁紶
- async submitUpload() {
+
+ // 蹇冩浜′笂浼犳垚鍔熷鐞�
+ handleHeartDeathUploadSuccess(response, file, fileList) {
+ if (response.code === 200) {
+ file.url = response.data || response.url;
+
+ for (const file of this.tempHeartDeathFileList) {
+ const newAttachment = {
+ id: Date.now() + Math.random(),
+ type: this.currentHeartDeathUploadType,
+ typeName: this.getCurrentHeartDeathTypeLabel,
+ fileName: file.name,
+ fileSize: file.size,
+ uploadTime: new Date().toISOString(),
+ uploader: "褰撳墠鐢ㄦ埛",
+ fileUrl: file.url
+ };
+
+ this.heartDeathAttachmentList.push(newAttachment);
+ }
+
+ // 鏇存柊蹇冩浜¢檮浠禞SON鏁版嵁鍒拌〃鍗�
+ this.form.heartdeathjudgeannex = this.buildHeartDeathAttachmentJson();
+
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+ this.heartDeathUploadDialogVisible = false;
+ this.heartDeathUploadLoading = false;
+ this.tempHeartDeathFileList = [];
+ } else {
+ this.$message.error(response.msg || "鏂囦欢涓婁紶澶辫触");
+ }
+ },
+
+ // 鎻愪氦鑴戞浜′笂浼�
+ submitUpload() {
if (this.tempFileList.length === 0) {
this.$message.warning("璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢");
return;
}
this.$refs.uploadRef.submit();
this.uploadLoading = true;
-
- // try {
- // for (const file of this.tempFileList) {
- // const newAttachment = {
- // id: Date.now() + Math.random(),
- // type: this.currentUploadType,
- // typeName: this.getCurrentTypeLabel,
- // fileName: file.name,
- // fileSize: file.size,
- // uploadTime: new Date().toISOString(),
- // uploader: "褰撳墠鐢ㄦ埛",
- // fileUrl: URL.createObjectURL(file.raw)
- // };
-
- // this.attachmentList.push(newAttachment);
- // }
-
- // // 鏇存柊闄勪欢JSON鏁版嵁鍒拌〃鍗�
- // this.form.rememberannex = this.buildAttachmentJson();
-
- // this.$message.success("鏂囦欢涓婁紶鎴愬姛");
- // this.uploadDialogVisible = false;
- // this.tempFileList = [];
- // } catch (error) {
- // this.$message.error("鏂囦欢涓婁紶澶辫触");
- // console.error("涓婁紶澶辫触:", error);
- // } finally {
- // this.uploadLoading = false;
- // }
},
- // 鍒犻櫎闄勪欢
+
+ // 鎻愪氦蹇冩浜′笂浼�
+ submitHeartDeathUpload() {
+ if (this.tempHeartDeathFileList.length === 0) {
+ this.$message.warning("璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢");
+ return;
+ }
+ this.$refs.heartDeathUploadRef.submit();
+ this.heartDeathUploadLoading = true;
+ },
+
+ // 鍒犻櫎鑴戞浜¢檮浠�
handleRemoveAttachment(attachment) {
this.$confirm("纭畾瑕佸垹闄よ繖涓瘎浼拌〃闄勪欢鍚楋紵", "鎻愮ず", {
confirmButtonText: "纭畾",
@@ -675,13 +995,33 @@
);
if (index !== -1) {
this.attachmentList.splice(index, 1);
- // 鏇存柊闄勪欢JSON鏁版嵁鍒拌〃鍗�
- this.form.rememberannex = this.buildAttachmentJson();
+ this.form.rememberAnnex = this.buildBrainDeathAttachmentJson();
this.$message.success("璇勪及琛ㄥ垹闄ゆ垚鍔�");
}
})
.catch(() => {});
},
+
+ // 鍒犻櫎蹇冩浜¢檮浠�
+ handleRemoveHeartDeathAttachment(attachment) {
+ this.$confirm("纭畾瑕佸垹闄よ繖涓瘎浼拌〃闄勪欢鍚楋紵", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ const index = this.heartDeathAttachmentList.findIndex(
+ item => item.id === attachment.id
+ );
+ if (index !== -1) {
+ this.heartDeathAttachmentList.splice(index, 1);
+ this.form.heartdeathjudgeannex = this.buildHeartDeathAttachmentJson();
+ this.$message.success("璇勪及琛ㄥ垹闄ゆ垚鍔�");
+ }
+ })
+ .catch(() => {});
+ },
+
// 棰勮闄勪欢
handlePreview(attachment) {
if (attachment.fileName.endsWith(".pdf")) {
@@ -699,6 +1039,7 @@
this.$message.info("璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅");
}
},
+
// 涓嬭浇闄勪欢
handleDownload(attachment) {
const link = document.createElement("a");
@@ -707,13 +1048,31 @@
link.click();
this.$message.success(`寮�濮嬩笅杞�: ${attachment.fileName}`);
},
+
// 缂栬緫淇℃伅
handleEdit() {
this.isEdit = true;
},
+ accomplish() {
+ this.$confirm("鏄惁纭瀹屾垚璇ユ渚嬫浜″垽瀹氬叏閮ㄤ俊鎭紵", "鎻愰啋", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ this.form.state = 3;
+ this.handleSave();
+ })
+
+ .catch(() => {});
+ },
// 淇濆瓨淇℃伅
async handleSave() {
- this.$refs.form.validate(async valid => {
+ // 鏍规嵁褰撳墠鏍囩閫夋嫨楠岃瘉瑙勫垯
+ let formRef =
+ this.activeJudgmentType === "brain" ? "brainForm" : "heartForm";
+
+ this.$refs[formRef].validate(async valid => {
if (valid) {
this.saveLoading = true;
@@ -721,16 +1080,28 @@
// 鏋勫缓鎻愪氦鏁版嵁
const submitData = {
...this.form,
+ infoid: this.infoid,
// 纭繚闄勪欢鏁版嵁鏈�鏂�
- rememberannex: this.buildAttachmentJson()
+ rememberAnnex: this.buildBrainDeathAttachmentJson(),
+ heartdeathjudgeannex: this.buildHeartDeathAttachmentJson()
};
+ if (submitData.state == 1 || !submitData.state) {
+ submitData.state = 2;
+ }
+ let response = null;
- const response = await deathinfoedit(submitData);
+ if (submitData.id) {
+ response = await deathinfoedit(submitData);
+ } else {
+ response = await deathinfoadd(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");
}
@@ -746,6 +1117,7 @@
}
});
},
+
// 鏂囦欢澶у皬鏍煎紡鍖�
formatFileSize(size) {
if (size === 0) return "0 B";
@@ -754,6 +1126,7 @@
const i = Math.floor(Math.log(size) / Math.log(k));
return parseFloat((size / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
},
+
// 鏃堕棿鏍煎紡鍖�
parseTime(time) {
if (!time) return "";
@@ -780,17 +1153,60 @@
padding: 20px;
}
-.detail-card {
+.type-card {
margin-bottom: 20px;
+ border: none;
+ box-shadow: none;
}
-.attachment-card {
+.type-card >>> .el-tabs__item {
+ font-size: 16px;
+ font-weight: bold;
+ padding: 0 20px;
+ height: 50px;
+ line-height: 50px;
+}
+
+.type-card >>> .el-tabs__item.is-active {
+ color: #409eff;
+ border-bottom: 3px solid #409eff;
+}
+
+.detail-card {
margin-bottom: 20px;
+ border: 1px solid #e6ebf5;
+ border-radius: 8px;
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+}
+
+.common-info-card {
+ border-top: 2px solid #67c23a;
+}
+
+.detail-card >>> .el-card__header {
+ background-color: #f5f7fa;
+ border-bottom: 1px solid #e6ebf5;
+ padding: 15px 20px;
}
.detail-title {
- font-size: 16px;
+ font-size: 18px;
font-weight: bold;
+ color: #303133;
+}
+
+.attachment-section {
+ margin-top: 20px;
+ padding-top: 20px;
+ border-top: 1px solid #e6ebf5;
+}
+
+.attachment-header h3 {
+ font-size: 16px;
+ color: #303133;
+ margin-bottom: 15px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #eee;
}
.attachment-upload-section {
@@ -802,6 +1218,7 @@
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
+ padding: 10px 0;
}
.upload-title {
@@ -819,6 +1236,9 @@
text-align: center;
padding: 40px 0;
color: #909399;
+ border: 1px dashed #dcdfe6;
+ border-radius: 4px;
+ margin-top: 20px;
}
/* 鍥剧墖棰勮瀵硅瘽妗嗘牱寮� */
--
Gitblit v1.9.3