From 7f67f2e6fbb7d47249fef0905a40a66f13ae2f2b Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期五, 21 八月 2026 10:05:32 +0800
Subject: [PATCH] 青岛维护

---
 src/views/business/OrganUtilization/OrganUtilizationInfo.vue | 1266 +++++++++++++++++++++++++++++++++------------------------
 1 files changed, 728 insertions(+), 538 deletions(-)

diff --git a/src/views/business/OrganUtilization/OrganUtilizationInfo.vue b/src/views/business/OrganUtilization/OrganUtilizationInfo.vue
index 416b83c..181ffa6 100644
--- a/src/views/business/OrganUtilization/OrganUtilizationInfo.vue
+++ b/src/views/business/OrganUtilization/OrganUtilizationInfo.vue
@@ -1,93 +1,46 @@
 <template>
   <div class="organ-utilization-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>
-        <div style="float: right;">
-          <el-button type="primary" @click="handleSave" :loading="saveLoading">
-            淇濆瓨
-          </el-button>
-          <el-button
-            type="success"
-            @click="handleComplete"
-            :disabled="form.recordstate === 'completed'"
-            :loading="confirmLoading"
-          >
-            瀹屾垚鍒╃敤
-          </el-button>
+    <case-basic-info :case-id="caseId" :show-attachment="true":column="3" />
+    <el-form :model="form" ref="form" :rules="rules" label-width="120px" class="paper-form">
+      <!-- 鍩烘湰淇℃伅 -->
+      <el-card class="detail-card paper-card">
+        <div slot="header" class="clearfix">
+          <span class="detail-title">鍣ㄥ畼鍒╃敤鍩烘湰淇℃伅</span>
         </div>
-      </div>
 
-      <el-form :model="form" ref="form" :rules="rules" label-width="120px">
-        <el-row :gutter="20">
-          <el-col :span="6">
-            <el-form-item align="left" label="閬椾綋鎹愮尞" prop="isbodydonation">
-              <el-radio-group v-model="form.isbodydonation">
-                <el-radio
-                  v-for="dict in dict.type.sys_0_1 || []"
-                  :key="dict.value"
-                  :label="dict.value"
-                  >{{ dict.label }}</el-radio
-                >
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-          <el-col :span="18">
-            <el-form-item align="left" label="鎺ユ敹鍗曚綅" prop="receivingunit">
-              <el-input
-                v-model="form.receivingunit"
-                placeholder="璇疯緭鍏ユ帴鏀跺崟浣�"
-                :disabled="form.isbodydonation !== '1'"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
+        <div class="form-row">
+          <el-form-item label="璐熻矗浜�" prop="responsibleusername" class="col-1-3">
+            <el-input
+              v-model="form.responsibleusername"
+              placeholder="璇疯緭鍏ヨ礋璐d汉濮撳悕"
+            />
+          </el-form-item>
+          <el-form-item label="鍗忚皟鍛樹竴" prop="coordinatedusernameo" class="col-1-3">
+            <el-input
+              v-model="form.coordinatedusernameo"
+              placeholder="璇疯緭鍏ュ崗璋冨憳涓�濮撳悕"
+            />
+          </el-form-item>
+          <el-form-item label="鍗忚皟鍛樹簩" prop="coordinatedusernamet" class="col-1-3">
+            <el-input
+              v-model="form.coordinatedusernamet"
+              placeholder="璇疯緭鍏ュ崗璋冨憳浜屽鍚�"
+            />
+          </el-form-item>
+          <el-form-item label="瀹屾垚鏃堕棿" prop="completetime" class="col-1-3">
+            <el-date-picker
+              v-model="form.completetime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              style="width: 100%"
+            />
+          </el-form-item>
+        </div>
 
-        <el-row :gutter="20">
-          <el-col :span="6">
-            <el-form-item label="璐熻矗浜�" prop="responsibleusername">
-              <el-input
-                v-model="form.responsibleusername"
-                placeholder="璇疯緭鍏ヨ礋璐d汉濮撳悕"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="鍗忚皟鍛樹竴" prop="coordinatedusernameo">
-              <el-input
-                v-model="form.coordinatedusernameo"
-                placeholder="璇疯緭鍏ュ崗璋冨憳涓�濮撳悕"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="鍗忚皟鍛樹簩" prop="coordinatedusernamet">
-              <el-input
-                v-model="form.coordinatedusernamet"
-                placeholder="璇疯緭鍏ュ崗璋冨憳浜屽鍚�"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="瀹屾垚鏃堕棿" prop="completetime">
-              <el-date-picker
-                v-model="form.completetime"
-                type="datetime"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                style="width: 100%"
-                :disabled="form.recordstate === 'completed'"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
+        <!-- <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="鐧昏浜�" prop="createBy">
-              <el-input v-model="form.createBy" readonly />
+              <el-input v-model="form.createBy" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -97,22 +50,58 @@
                 type="datetime"
                 value-format="yyyy-MM-dd HH:mm:ss"
                 style="width: 100%"
-                readonly
               />
             </el-form-item>
           </el-col>
-        </el-row>
-      </el-form>
-    </el-card>
+        </el-row> -->
+      </el-card>
+      <el-card class="detail-card paper-card">
+        <div slot="header" class="clearfix">
+          <span class="detail-title">閬椾綋鎹愮尞淇℃伅</span>
+        </div>
+        <div class="form-row">
+          <el-form-item align="left" label="閬椾綋鎺ユ敹" prop="isbodydonation" class="col-1-3">
+            <el-radio-group v-model="form.isbodydonation">
+              <el-radio
+                v-for="dict in dict.type.sys_0_1 || []"
+                :key="dict.value"
+                :label="dict.value"
+                >{{ dict.label }}</el-radio
+              >
+            </el-radio-group>
+          </el-form-item>
 
+          <el-form-item align="left" label="鎺ユ敹瀹跺睘" prop="relationname" class="col-1-3">
+            <el-input
+              v-model="form.relationname"
+              placeholder="璇疯緭鍏ユ帴鏀跺灞�"
+            />
+          </el-form-item>
+          <el-form-item label="涓庢崘鐚�呭叧绯�" prop="signfamilyrelations" class="col-1-3">
+            <el-select
+              v-model="form.signfamilyrelations"
+              placeholder="璇烽�夋嫨涓庢崘鐚�呭叧绯�"
+            >
+              <el-option
+                v-for="dict in dict.type.sys_FamilyRelation || []"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </div>
+      </el-card>
+    </el-form>
     <!-- 鍣ㄥ畼鍒╃敤璁板綍閮ㄥ垎 - 鏁村悎鍙楄�呰鎯� -->
     <el-card class="utilization-card">
       <div slot="header" class="clearfix">
         <span class="detail-title">鍣ㄥ畼鍒╃敤璁板綍</span>
         <div style="float: right;">
-          <el-tag :type="getStatusTagType(form.recordstate)">
-            {{ getStatusText(form.recordstate) }}
-          </el-tag>
+          <dict-tag
+            :options="dict.type.utilize_statue"
+            :value="form.completeState"
+          />
         </div>
       </div>
 
@@ -133,7 +122,6 @@
                   v-for="dict in dict.type.sys_Organ || []"
                   :key="dict.value"
                   :label="dict.value"
-                  :disabled="form.recordstate === 'completed'"
                 >
                   {{ dict.label }}
                 </el-checkbox>
@@ -146,7 +134,7 @@
           <el-col>
             <el-form-item>
               <el-table
-                :data="utilizationData.serviceDonatecomporganList"
+                :data="displayOrgans"
                 v-loading="loading"
                 border
                 style="width: 100%"
@@ -162,14 +150,14 @@
                       <div class="recipient-header">
                         <span class="recipient-title">鍙楄�呰缁嗕俊鎭�</span>
                         <el-tag
-                          v-if="scope.row.transplantstate === '1'"
+                          v-if="scope.row.transplantstate == '1'"
                           type="success"
                           size="small"
                         >
                           宸茬Щ妞�
                         </el-tag>
                         <el-tag
-                          v-else-if="scope.row.transplantstate === '0'"
+                          v-else-if="scope.row.transplantstate == '0'"
                           type="warning"
                           size="small"
                         >
@@ -194,7 +182,6 @@
                                 <el-input
                                   v-model="scope.row.name"
                                   placeholder="璇疯緭鍏ュ彈鑰呭鍚�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -206,7 +193,6 @@
                                   value-format="yyyy-MM-dd"
                                   placeholder="閫夋嫨鍑虹敓鏃ユ湡"
                                   style="width: 100%"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -216,10 +202,9 @@
                                   v-model="scope.row.sex"
                                   placeholder="璇烽�夋嫨鎬у埆"
                                   style="width: 100%"
-                                  :disabled="form.recordstate === 'completed'"
                                 >
-                                  <el-option label="鐢�" value="0" />
-                                  <el-option label="濂�" value="1" />
+                                  <el-option label="鐢�" :value="0" />
+                                  <el-option label="濂�" :value="1" />
                                 </el-select>
                               </el-form-item>
                             </el-col>
@@ -231,7 +216,6 @@
                                 <el-input
                                   v-model="scope.row.age"
                                   placeholder="骞撮緞"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -241,12 +225,11 @@
                                   v-model="scope.row.idcardtype"
                                   placeholder="璇烽�夋嫨璇佷欢绫诲瀷"
                                   style="width: 100%"
-                                  :disabled="form.recordstate === 'completed'"
                                 >
-                                  <el-option label="韬唤璇�" value="1" />
-                                  <el-option label="鎶ょ収" value="2" />
-                                  <el-option label="鍐涘畼璇�" value="3" />
-                                  <el-option label="鍏朵粬" value="4" />
+                                  <el-option label="韬唤璇�" :value="1" />
+                                  <el-option label="鎶ょ収" :value="2" />
+                                  <el-option label="鍐涘畼璇�" :value="3" />
+                                  <el-option label="鍏朵粬" :value="4" />
                                 </el-select>
                               </el-form-item>
                             </el-col>
@@ -255,7 +238,6 @@
                                 <el-input
                                   v-model="scope.row.idcardno"
                                   placeholder="璇佷欢鍙风爜"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -271,7 +253,6 @@
                                 <el-input
                                   v-model="scope.row.hospitalname"
                                   placeholder="璇疯緭鍏ョЩ妞嶄腑蹇冨悕绉�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -280,7 +261,6 @@
                                 <el-input
                                   v-model="scope.row.phone"
                                   placeholder="鑱旂郴鐢佃瘽"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -294,7 +274,6 @@
                                   :rows="2"
                                   v-model="scope.row.residenceaddress"
                                   placeholder="璇疯緭鍏ヨ缁嗗湴鍧�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -304,7 +283,7 @@
                         <!-- 绉绘淇℃伅閮ㄥ垎 -->
                         <div
                           class="form-section"
-                          v-if="scope.row.transplantstate === '1'"
+                          v-if="scope.row.transplantstate == '1'"
                         >
                           <h4 class="section-title">绉绘淇℃伅</h4>
                           <el-row :gutter="20">
@@ -313,10 +292,9 @@
                                 <el-date-picker
                                   v-model="scope.row.transplanttime"
                                   type="datetime"
-                                  value-format="YYYY-MM-DD HH:mm:ss"
+                                  value-format="yyyy-MM-dd HH:mm:ss"
                                   placeholder="閫夋嫨绉绘鏃ユ湡"
                                   style="width: 100%"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -325,7 +303,6 @@
                                 <el-input
                                   v-model="scope.row.transplantdoct"
                                   placeholder="璇疯緭鍏ョЩ妞嶅尰鐢�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -335,7 +312,7 @@
                         <!-- 鏈Щ妞嶅師鍥� -->
                         <div
                           class="form-section"
-                          v-if="scope.row.transplantstate === '0'"
+                          v-if="scope.row.transplantstate == '0'"
                         >
                           <h4 class="section-title">鏈Щ妞嶄俊鎭�</h4>
                           <el-row :gutter="20">
@@ -346,7 +323,6 @@
                                   :rows="3"
                                   v-model="scope.row.abandonreason"
                                   placeholder="璇疯緭鍏ユ湭绉绘鍘熷洜"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -371,14 +347,14 @@
                   </template>
                 </el-table-column>
 
-                <el-table-column label="绯荤粺缂栧彿" align="center" prop="caseNo">
+                <!-- <el-table-column label="绯荤粺缂栧彿" align="center" prop="caseNo">
                   <template slot-scope="scope">
                     <el-input
                       v-model="scope.row.caseNo"
                       placeholder="绯荤粺缂栧彿"
                     />
                   </template>
-                </el-table-column>
+                </el-table-column> -->
 
                 <el-table-column
                   label="绉绘鍖婚櫌"
@@ -387,22 +363,15 @@
                   prop="hospitalno"
                 >
                   <template slot-scope="scope">
-                    <el-select
-                      v-model="scope.row.hospitalno"
-                      placeholder="璇烽�夋嫨绉绘鍖婚櫌"
+                    <el-autocomplete
+                      v-model="scope.row.hospitalname"
+                      :fetch-suggestions="queryHospitalSearch"
+                      placeholder="璇烽�夋嫨鎴栬緭鍏ョЩ妞嶅尰闄�"
                       style="width: 100%"
-                      @change="handleHospitalChange(scope.row, $event)"
-                    >
-                      <el-option
-                        v-for="hospital in hospitalList"
-                        :key="hospital.hospitalNo"
-                        :label="hospital.hospitalName"
-                        :value="hospital.hospitalNo"
-                      />
-                    </el-select>
+                      clearable
+                    ></el-autocomplete>
                   </template>
                 </el-table-column>
-
                 <el-table-column
                   label="绉绘鐘舵��"
                   align="center"
@@ -438,7 +407,7 @@
                       style="width: 100%"
                       v-model="scope.row.transplanttime"
                       type="datetime"
-                      value-format="YYYY-MM-DD HH:mm:ss"
+                      value-format="yyyy-MM-dd HH:mm:ss"
                       placeholder="閫夋嫨绉绘鏃堕棿"
                     />
                   </template>
@@ -459,39 +428,7 @@
 
                 <el-table-column label="鍙楄�呭鍚�" align="center" prop="name">
                   <template slot-scope="scope">
-                    <el-input
-                      v-model="scope.row.name"
-                      placeholder="鍙楄�呭鍚�"
-                      :disabled="form.recordstate === 'completed'"
-                    />
-                  </template>
-                </el-table-column>
-
-                <el-table-column
-                  label="鎿嶄綔"
-                  align="center"
-                  class-name="small-padding fixed-width"
-                  v-if="form.recordstate !== 'completed'"
-                >
-                  <template slot-scope="scope">
-                    <el-button
-                      size="mini"
-                      type="text"
-                      icon="el-icon-edit"
-                      @click="handleEditUtilization(scope.row)"
-                    >
-                      缂栬緫
-                    </el-button>
-                    <el-button
-                      size="mini"
-                      type="text"
-                      icon="el-icon-delete"
-                      style="color: #F56C6C;"
-                      @click="handleRemoveOrgan(scope.$index)"
-                      v-if="!scope.row.id"
-                    >
-                      鍒犻櫎
-                    </el-button>
+                    <el-input v-model="scope.row.name" placeholder="鍙楄�呭鍚�" />
                   </template>
                 </el-table-column>
               </el-table>
@@ -516,157 +453,156 @@
     </el-card>
 
     <!-- 闄勪欢绠$悊閮ㄥ垎 -->
-    <!-- 闄勪欢绠$悊閮ㄥ垎 - 浼樺寲涓哄畬鏁村姛鑳� -->
+    <!-- 闄勪欢绠$悊閮ㄥ垎 - 鍒嗙被Tab灞曠ず -->
     <el-card class="attachment-card">
-      <div class="attachment-header">
-        <i class="el-icon-paperclip"></i>
-        <span class="attachment-title">鐩稿叧闄勪欢</span>
-        <span class="attachment-tip"
-          >鏀寔涓婁紶鍣ㄥ畼鍒╃敤鐩稿叧鏂囦欢 (鏈�澶歿{ attachmentLimit }}涓�)</span
-        >
+      <div slot="header" class="clearfix">
+        <span class="detail-title">鐩稿叧闄勪欢</span>
       </div>
 
-      <!-- 浣跨敤 UploadAttachment 缁勪欢 -->
-      <UploadAttachment
-        ref="uploadAttachment"
-        :file-list="attachmentFileList"
-        :limit="attachmentLimit"
-        :accept="attachmentAccept"
-        :multiple="true"
-        @change="handleAttachmentChange"
-        @upload-success="handleUploadSuccess"
-        @upload-error="handleUploadError"
-        @remove="handleAttachmentRemove"
-      />
-
-      <!-- 闄勪欢鍒楄〃灞曠ず -->
-      <div class="attachment-list" v-if="attachments && attachments.length > 0">
-        <div class="list-title">宸蹭笂浼犻檮浠� ({{ attachments.length }})</div>
-        <el-table :data="attachments" style="width: 100%" size="small">
-          <el-table-column label="鏂囦欢鍚�" min-width="200">
-            <template slot-scope="scope">
-              <i
-                class="el-icon-document"
-                :style="{ color: getFileIconColor(scope.row.fileName) }"
-              ></i>
-              <span class="file-name">{{ scope.row.fileName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="鏂囦欢绫诲瀷" width="100">
-            <template slot-scope="scope">
-              <el-tag :type="getFileTagType(scope.row.fileName)" size="small">
-                {{ getFileTypeText(scope.row.fileName) }}
-              </el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column label="涓婁紶鏃堕棿" width="200">
-            <template slot-scope="scope">
-              <span>{{ formatDateTime(scope.row.uploadTime) }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="鏂囦欢澶у皬" width="180">
-            <template slot-scope="scope">
-              <span>{{ formatFileSize(scope.row.fileSize) }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="鎿嶄綔" width="260" fixed="right">
-            <template slot-scope="scope">
-              <el-button
-                size="mini"
-                type="primary"
-                @click="handlePreview(scope.row)"
-                :disabled="!isPreviewable(scope.row.fileName)"
-              >
-                棰勮
-              </el-button>
-              <el-button
-                size="mini"
-                type="success"
-                @click="handleDownloadAttachment(scope.row)"
-              >
-                涓嬭浇
-              </el-button>
-              <el-button
-                size="mini"
-                type="danger"
-                @click="handleRemoveAttachment(scope.$index)"
-              >
-                鍒犻櫎
-              </el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </el-card>
-
-    <!-- 缂栬緫鍒╃敤璁板綍瀵硅瘽妗� -->
-    <el-dialog
-      title="缂栬緫鍣ㄥ畼鍒╃敤璁板綍"
-      :visible.sync="editDialogVisible"
-      width="600px"
-    >
-      <el-form :model="currentRecord" label-width="120px">
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="鍣ㄥ畼鍚嶇О">
-              <el-input v-model="currentRecord.organname" readonly />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="绉绘鐘舵��">
-              <el-select
-                v-model="currentRecord.transplantstate"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="dict in transplantStatusList"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-form-item
-          label="鏈Щ妞嶅師鍥�"
-          v-if="currentRecord.transplantstate === '0'"
+      <!-- 闄勪欢鍒楄〃 - 鍒嗙被Tab灞曠ず锛屾敮鎸佷慨鏀瑰垎绫� -->
+      <el-tabs v-model="activeTab" type="border-card">
+        <el-tab-pane
+          v-for="category in categories"
+          :key="category"
+          :label="category + '(' + getCategoryCount(category) + ')'"
+          :name="category"
         >
-          <el-input
-            type="textarea"
-            :rows="3"
-            v-model="currentRecord.abandonreason"
-            placeholder="璇疯緭鍏ユ湭绉绘鍘熷洜"
-          />
-        </el-form-item>
-        <el-form-item
-          label="绉绘鍖婚櫌"
-          v-if="currentRecord.transplantstate === '1'"
-        >
-          <el-select
-            v-model="currentRecord.hospitalno"
-            placeholder="璇烽�夋嫨绉绘鍖婚櫌"
+          <div style="margin-bottom: 10px; text-align: right;">
+            <el-button
+              size="mini"
+              type="primary"
+              icon="el-icon-plus"
+              @click="openUploadDialog(category)"
+            >
+              娣诲姞闄勪欢
+            </el-button>
+          </div>
+          <el-table
+            :data="getCategoryFiles(category)"
             style="width: 100%"
+            size="small"
+            border
           >
-            <el-option
-              v-for="hospital in hospitalList"
-              :key="hospital.hospitalNo"
-              :label="hospital.hospitalName"
-              :value="hospital.hospitalNo"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="鍙楄�呭鍚�"
-          v-if="currentRecord.transplantstate === '1'"
+            <el-table-column label="鏂囦欢鍚�" min-width="180">
+              <template #default="scope">
+                <i
+                  class="el-icon-document"
+                  style="margin-right: 8px; color: #409EFF;"
+                ></i>
+                <span class="file-name">{{ scope.row.fileName }}</span>
+              </template>
+            </el-table-column>
+            <!-- 鍙紪杈戝垎绫讳笅鎷� -->
+            <el-table-column label="鍒嗙被" width="150">
+              <template #default="scope">
+                <el-select
+                  v-model="scope.row.fileType"
+                  size="small"
+                  @change="updateAttachmentCategory(scope.row, $event)"
+                  placeholder="閫夋嫨鍒嗙被"
+                >
+                  <el-option label="鍘熻〃鎷嶇収" value="鍘熻〃鎷嶇収" />
+                  <el-option label="鎺ュ彈纭涔�" value="鎺ュ彈纭涔�" />
+                  <el-option label="寮冪敤璇存槑" value="寮冪敤璇存槑" />
+                  <el-option label="鎹愮尞璇佷功鐓х墖" value="鎹愮尞璇佷功鐓х墖" />
+                  <el-option label="鏈垎绫�" value="" />
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="鏂囦欢绫诲瀷" width="100">
+              <template #default="scope">
+                <el-tag size="small">{{
+                  getFileTypeText(scope.row.fileName)
+                }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column label="涓婁紶鏃堕棿" width="160">
+              <template #default="scope">
+                <span>{{ formatDateTime(scope.row.uploadTime) }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="鏂囦欢澶у皬" width="120">
+              <template #default="scope">
+                <span>{{ formatFileSize(scope.row.fileSize) }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="鎿嶄綔" width="180" fixed="right">
+              <template #default="scope">
+                <el-button
+                  size="mini"
+                  type="primary"
+                  @click="handlePreview(scope.row)"
+                  >棰勮</el-button
+                >
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click="handleRemoveAttachmentByFile(scope.row)"
+                  >鍒犻櫎</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+          <div
+            v-if="getCategoryFiles(category).length == 0"
+            style="text-align:center; padding:20px; color:#909399;"
+          >
+            鏆傛棤闄勪欢
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+    </el-card>
+    <div style="text-align: center; margin: 30px 0;">
+      <el-button type="primary" @click="handleSave" :loading="saveLoading">
+        淇濆瓨
+      </el-button>
+      <el-button
+        type="success"
+        @click="handleComplete"
+        :loading="confirmLoading"
+      >
+        瀹屾垚鍒╃敤
+      </el-button>
+    </div>
+    <!-- 涓婁紶瀵硅瘽妗� -->
+    <el-dialog
+      :title="`涓婁紶${currentUploadCategory}闄勪欢`"
+      :visible.sync="uploadDialogVisible"
+      width="480px"
+      :close-on-click-modal="false"
+    >
+      <el-upload
+        ref="uploadRef"
+        class="upload-demo"
+        drag
+        :action="uploadAction"
+        :headers="headers"
+        multiple
+        :file-list="tempFileList"
+        :before-upload="beforeUpload"
+        :on-change="handleFileChange"
+        :on-remove="handleTempRemove"
+        :on-success="handleUploadSuccess"
+        :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鏍煎紡鏂囦欢锛屽崟涓枃浠朵笉瓒呰繃10MB
+        </div>
+      </el-upload>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="uploadDialogVisible = false">鍙栨秷</el-button>
+        <el-button
+          type="primary"
+          @click="submitUpload"
+          :loading="uploadLoading"
+          :disabled="tempFileList.length == 0"
         >
-          <el-input v-model="currentRecord.name" placeholder="璇疯緭鍏ュ彈鑰呭鍚�" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer">
-        <el-button @click="editDialogVisible = false">鍙栨秷</el-button>
-        <el-button type="primary" @click="handleEditConfirm">纭</el-button>
-      </div>
+          纭涓婁紶
+        </el-button>
+      </span>
     </el-dialog>
 
     <!-- 鏂囦欢棰勮瀵硅瘽妗� -->
@@ -685,29 +621,36 @@
   completionadd,
   completionedit
 } from "@/api/businessApi";
-import UploadAttachment from "@/components/UploadAttachment"; // 鏂板瀵煎叆
-import FilePreviewDialog from "@/components/FilePreviewDialog"; // 鏂板瀵煎叆
+import FilePreviewDialog from "@/components/FilePreviewDialog";
 import CaseBasicInfo from "@/components/CaseBasicInfo";
-import dayjs from "dayjs"; // 鏂板瀵煎叆锛岀敤浜庢椂闂村鐞�
+import { getToken } from "@/utils/auth";
+import dayjs from "dayjs";
 
 export default {
   name: "OrganUtilizationDetail",
   components: {
-    UploadAttachment,
     FilePreviewDialog,
     CaseBasicInfo
   },
-  dicts: ["sys_BloodType", "sys_Organ", "sys_0_1"],
+  dicts: [
+    "Geta_hospital",
+    "sys_BloodType",
+    "sys_Organ",
+    "sys_FamilyRelation",
+    "sys_0_1",
+    "utilize_statue"
+  ],
   data() {
     return {
       caseId: null,
-
+      activeTab: "鍘熻〃鎷嶇収", // 褰撳墠婵�娲荤殑闄勪欢鍒嗙被Tab
+      presetCategories: ["鍘熻〃鎷嶇収", "鎺ュ彈纭涔�", "寮冪敤璇存槑", "鎹愮尞璇佷功鐓х墖"], // 棰勮鍒嗙被
       // 琛ㄥ崟鏁版嵁 - 鏍规嵁鎺ュ彛鍙傛暟璋冩暣
       form: {
         id: undefined,
         infoid: undefined,
         inpatientno: "",
-        recordstate: "pending",
+        completeState: "2",
         caseNo: "",
         donorno: "",
         treatmenthospitalname: "",
@@ -727,8 +670,8 @@
         coordinatedusernamet: "",
         assessannex: "",
         donateorgan: "",
-        isbodydonation: "0",
-        receivingunit: "",
+        isbodydonation: "1",
+        receivingunitname: "",
         createBy: "",
         createTime: "",
         updateBy: "",
@@ -762,8 +705,13 @@
       transplantStatusList: [
         { value: "1", label: "宸茬Щ妞�" },
         { value: "0", label: "鏈Щ妞�" },
-        { value: "2", label: "绉绘涓�" }
+        { value: "2", label: "绉绘涓�" },
+        { value: "3", label: "搴撳瓨" }
       ],
+      organExpansionMap: {
+        C64: { subItems: ["C64L", "C64R"], subNames: ["宸﹁偩", "鍙宠偩"] },
+        C34: { subItems: ["C34L", "C34R"], subNames: ["宸﹁偤", "鍙宠偤"] }
+      },
       // 鍒╃敤璁板綍鏁版嵁
       utilizationData: {
         serviceDonatecomporganList: []
@@ -780,13 +728,17 @@
       editDialogVisible: false,
       currentRecord: {},
       currentEditIndex: -1,
-      // 闄勪欢鐩稿叧閰嶇疆 - 鏂板
-      attachmentFileList: [],
-      attachmentLimit: 10,
-      attachmentAccept:
-        ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt",
+      // 涓婁紶鐩稿叧
+      uploadAction: process.env.VUE_APP_BASE_API + "/common/upload",
+      headers: {
+        Authorization: "Bearer " + getToken()
+      },
+      uploadDialogVisible: false,
+      uploadLoading: false,
+      tempFileList: [],
+      currentUploadCategory: "",
 
-      // 鏂囦欢棰勮鐩稿叧 - 鏂板
+      // 鏂囦欢棰勮鐩稿叧
       filePreviewVisible: false,
       currentPreviewFile: null,
       currentFollowup: {},
@@ -798,11 +750,22 @@
     currentUser() {
       return JSON.parse(sessionStorage.getItem("user") || "{}");
     },
+    categories() {
+      // 濮嬬粓杩斿洖鎵�鏈夐璁惧垎绫� + 鏈垎绫伙紝鍗充娇娌℃湁鏁版嵁涔熸樉绀�
+      const allCategories = [
+        "鍘熻〃鎷嶇収",
+        "鎺ュ彈纭涔�",
+        "寮冪敤璇存槑",
+        "鎹愮尞璇佷功鐓х墖",
+        "鏈垎绫�"
+      ];
+      return allCategories;
+    },
     // 宸茬Щ妞嶆暟閲�
     transplantedCount() {
       if (!this.utilizationData.serviceDonatecomporganList) return 0;
       return this.utilizationData.serviceDonatecomporganList.filter(
-        record => record.transplantstate === "1"
+        record => record.transplantstate == "1"
       ).length;
     },
     // 鍞竴鍖婚櫌鏁伴噺
@@ -813,6 +776,22 @@
         .filter(Boolean);
       return new Set(hospitals).size;
     },
+    organReverseMap() {
+      const map = {};
+      for (const key in this.organExpansionMap) {
+        const { subItems } = this.organExpansionMap[key];
+        subItems.forEach(item => {
+          map[item] = key;
+        });
+      }
+      return map;
+    },
+    // 杩囨护鎺� delFlag=1 鐨勮褰曪紙鐢ㄤ簬琛ㄦ牸灞曠ず锛�
+    displayOrgans() {
+      return (this.utilizationData.serviceDonatecomporganList || []).filter(
+        item => item.delFlag !== 1
+      );
+    },
     // 鑾峰彇鍣ㄥ畼瀛楀吀
     organDict() {
       return this.dict.type.sys_Organ || [];
@@ -820,22 +799,6 @@
   },
   created() {
     this.initData();
-  },
-  watch: {
-    // 鐩戝惉闄勪欢鏁版嵁鍙樺寲 - 鏂板
-    attachments: {
-      handler(newAttachments) {
-        this.attachmentFileList = newAttachments.map(item => ({
-          uid: item.id || Math.random(),
-          name: item.fileName,
-          fileSize: item.fileSize,
-          url: item.path || item.fileUrl,
-          uploadTime: item.uploadTime,
-          status: "success"
-        }));
-      },
-      deep: true
-    }
   },
   methods: {
     // 鍒濆鍖栨暟鎹�
@@ -856,33 +819,47 @@
         .replace("T", " ")
         .substring(0, 19);
 
-      this.generateDonorNo();
       this.getDetail();
-      this.getHospitalData();
     },
+    syncOrgansFromSelection() {
+      const records = this.utilizationData.serviceDonatecomporganList || [];
+      const targetNos = [];
+      this.selectedOrgans.forEach(val => {
+        if (this.organExpansionMap[val]) {
+          targetNos.push(...this.organExpansionMap[val].subItems);
+        } else {
+          targetNos.push(val);
+        }
+      });
 
-    // 鐢熸垚鎹愮尞鑰呯紪鍙�
-    generateDonorNo() {
-      const timestamp = Date.now().toString();
-      this.form.donorno = "D" + timestamp.slice(-8);
-      this.form.caseNo = "CASE" + timestamp.slice(-6);
-      this.form.inpatientno = "IP" + timestamp.slice(-6);
+      targetNos.forEach(no => {
+        const existing = records.find(r => r.organno == no);
+        if (existing) {
+          if (existing.delFlag == 1) existing.delFlag = 0;
+        } else {
+          // 浣跨敤鍒涘缓鏂规硶锛岃嚜鍔ㄥ寘鍚� delFlag:0
+          this.createOrganRecord(no);
+        }
+      });
+
+      // 寮哄埗鎵�鏈夎褰� delFlag=0锛堝姞杞芥椂搴旇鍏ㄩ儴鏈夋晥锛�
+      records.forEach(r => (r.delFlag = 0));
+      this.form.donateorgan = this.selectedOrgans.join(",");
     },
-
     // 鑾峰彇璇︽儏
     async getDetail() {
       this.loading = true;
       try {
         const response = await completionList({ infoid: this.caseId });
-        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];
+          if (!data.completeState || data.completeState == 1) {
+            data.completeState = "2";
+          }
+          this.form = data;
           // 濉厖琛ㄥ崟鏁版嵁
-          Object.assign(this.form, data);
-
+          // Object.assign(this.form, data);
+          this.form.signfamilyrelations = this.form.signfamilyrelations || "";
           // 澶勭悊鎹愮尞鍣ㄥ畼瀛楁
           if (data.donateorgan) {
             const organArray = Array.isArray(data.donateorgan)
@@ -898,22 +875,31 @@
             )
               ? data.serviceDonatecomporganList.map(record => ({
                   ...record,
-                  transplantstate: record.transplantstate
-                    ? record.transplantstate.toString()
-                    : "1"
+                  transplanttime: record.transplanttime || "",
+                  transplantstate:
+                    record.transplantstate != null
+                      ? record.transplantstate.toString()
+                      : "1"
                 }))
               : [];
           }
+          console.log(this.utilizationData.serviceDonatecomporganList);
 
           // 鍒濆鍖栭檮浠�
+          // 鏀逛负锛堢‘淇濇瘡涓檮浠堕兘鏈� fileType 瀛楁锛�
           if (this.form.assessannex) {
-            this.form.attachments = JSON.parse(this.form.assessannex);
-            this.attachments = Array.isArray(this.form.attachments)
-              ? [...this.form.attachments]
-              : [];
+            const parsed = JSON.parse(this.form.assessannex);
+            this.attachments = parsed.map(item => ({
+              ...item,
+              fileType: item.fileType || "" // 榛樿绌哄瓧绗︿覆琛ㄧず鏈垎绫�
+            }));
+            this.form.attachments = this.attachments;
+          } else {
+            this.attachments = [];
           }
 
           this.$message.success("鏁版嵁鍔犺浇鎴愬姛");
+          this.syncOrgansFromSelection();
         } else {
           this.$message.warning("鏈壘鍒板搴旂殑鍣ㄥ畼鍒╃敤鏁版嵁");
         }
@@ -926,81 +912,125 @@
     },
 
     // 鑾峰彇鍖婚櫌鏁版嵁
-    async getHospitalData() {
-      try {
-        // TODO: 鏇挎崲涓哄疄闄呯殑鍖婚櫌鍒楄〃鎺ュ彛
-        // 鏆傛椂浣跨敤妯℃嫙鏁版嵁
-        this.hospitalList = [
-          { hospitalNo: "H001", hospitalName: "鍖椾含鍗忓拰鍖婚櫌" },
-          { hospitalNo: "H002", hospitalName: "涓婃捣鍗庡北鍖婚櫌" },
-          { hospitalNo: "H003", hospitalName: "涓婃捣鐟為噾鍖婚櫌" },
-          { hospitalNo: "H004", hospitalName: "骞垮窞涓北鍖婚櫌" },
-          { hospitalNo: "H005", hospitalName: "姝︽眽鍚屾祹鍖婚櫌" },
-          { hospitalNo: "H006", hospitalName: "鎴愰兘鍗庤タ鍖婚櫌" }
-        ];
-      } catch (error) {
-        console.error("鑾峰彇鍖婚櫌鏁版嵁澶辫触:", error);
-        this.$message.error("鑾峰彇鍖婚櫌鏁版嵁澶辫触");
-      }
-    },
+    // async getHospitalData() {
+    //   try {
+    //     // TODO: 鏇挎崲涓哄疄闄呯殑鍖婚櫌鍒楄〃鎺ュ彛
+    //     // 鏆傛椂浣跨敤妯℃嫙鏁版嵁
+    //     this.hospitalList = [
+    //       { hospitalNo: "H001", hospitalName: "鍖椾含鍗忓拰鍖婚櫌" },
+    //       { hospitalNo: "H002", hospitalName: "涓婃捣鍗庡北鍖婚櫌" },
+    //       { hospitalNo: "H003", hospitalName: "涓婃捣鐟為噾鍖婚櫌" },
+    //       { hospitalNo: "H004", hospitalName: "骞垮窞涓北鍖婚櫌" },
+    //       { hospitalNo: "H005", hospitalName: "姝︽眽鍚屾祹鍖婚櫌" },
+    //       { hospitalNo: "H006", hospitalName: "鎴愰兘鍗庤タ鍖婚櫌" }
+    //     ];
+    //   } catch (error) {
+    //     console.error("鑾峰彇鍖婚櫌鏁版嵁澶辫触:", error);
+    //     this.$message.error("鑾峰彇鍖婚櫌鏁版嵁澶辫触");
+    //   }
+    // },
 
     // 鍣ㄥ畼閫夋嫨鐘舵�佸彉鍖�
-    handleOrganSelectionChange(selectedValues) {
-      if (!this.utilizationData.serviceDonatecomporganList) {
-        this.utilizationData.serviceDonatecomporganList = [];
-      }
-
-      const currentOrganValues = this.utilizationData.serviceDonatecomporganList.map(
-        item => item.organno
-      );
-
-      // 澶勭悊浜掓枼閫昏緫
+    async handleOrganSelectionChange(selectedValues) {
+      // 1. 澶勭悊浜掓枼閫昏緫锛堜慨鏀� this.selectedOrgans锛�
       this.handleExclusiveSelections(selectedValues);
 
-      // 鏇存柊鎹愮尞鍣ㄥ畼瀛楁
-      this.form.donateorgan = selectedValues.join(",");
+      const finalSelected = this.selectedOrgans;
+      const records = this.utilizationData.serviceDonatecomporganList || [];
 
-      // 鏂板閫夋嫨鐨勫櫒瀹�
-      selectedValues.forEach(organValue => {
-        if (!currentOrganValues.includes(organValue)) {
-          this.createOrganRecord(organValue);
+      // 2. 鏋勫缓鐩爣鍣ㄥ畼缂栧彿鍒楄〃锛堝睍寮�缁勫悎鍣ㄥ畼锛�
+      const targetOrganNos = [];
+      finalSelected.forEach(val => {
+        if (this.organExpansionMap[val]) {
+          targetOrganNos.push(...this.organExpansionMap[val].subItems);
+        } else {
+          targetOrganNos.push(val);
         }
       });
 
-      // 绉婚櫎鍙栨秷閫夋嫨鐨勫櫒瀹�
-      this.utilizationData.serviceDonatecomporganList = this.utilizationData.serviceDonatecomporganList.filter(
-        record => {
-          if (selectedValues.includes(record.organno)) {
-            return true;
-          } else {
-            if (record.id) {
-              this.$confirm(
-                "鍒犻櫎鍣ㄥ畼鍒╃敤鏁版嵁鍚庡皢鏃犳硶鎭㈠锛屾偍纭鍒犻櫎璇ユ潯璁板綍鍚楋紵",
-                "鎻愮ず",
-                {
-                  confirmButtonText: "纭畾",
-                  cancelButtonText: "鍙栨秷",
-                  type: "warning"
-                }
-              )
-                .then(() => {
-                  this.utilizationData.serviceDonatecomporganList = this.utilizationData.serviceDonatecomporganList.filter(
-                    r => r.organno !== record.organno
-                  );
-                  this.$message.success("鍒犻櫎鎴愬姛");
-                })
-                .catch(() => {
-                  this.selectedOrgans.push(record.organno);
-                });
-              return true;
-            } else {
-              return false;
-            }
+      // 3. 鏂板鎴栨仮澶嶈褰曪紙鏃犻渶寮圭獥锛�
+      targetOrganNos.forEach(no => {
+        const existing = records.find(r => r.organno == no);
+        if (existing) {
+          if (existing.delFlag == 1) {
+            existing.delFlag = 0; // 鎭㈠鏄剧ず
           }
+        } else {
+          this.createOrganRecord(no); // 鏂板璁板綍锛堝寘鍚� delFlag:0锛�
         }
-      );
-    },
+      });
 
+      // 4. 鎵惧嚭闇�瑕佸彇娑堢殑璁板綍锛堜笉鍦ㄧ洰鏍囬泦鍚堜腑鐨勶級
+      const toRemove = records.filter(r => !targetOrganNos.includes(r.organno));
+      const toRemoveSaved = toRemove.filter(r => r.id); // 宸蹭繚瀛橈紝闇�纭
+      const toRemoveUnsaved = toRemove.filter(r => !r.id); // 鏈繚瀛橈紝鐩存帴绉婚櫎
+
+      // 4.1 鐩存帴绉婚櫎鏈繚瀛樼殑璁板綍
+      toRemoveUnsaved.forEach(r => {
+        const idx = records.indexOf(r);
+        if (idx !== -1) records.splice(idx, 1);
+      });
+
+      // 4.2 澶勭悊宸蹭繚瀛樼殑璁板綍锛氬脊绐楃‘璁�
+      if (toRemoveSaved.length > 0) {
+        const organNames = toRemoveSaved.map(r => r.organname).join("銆�");
+        try {
+          await this.$confirm(
+            `鎮ㄧ‘瀹氳鍙栨秷浠ヤ笅宸蹭繚瀛樼殑鍣ㄥ畼鍒╃敤璁板綍鍚楋紵\n${organNames}\n鍙栨秷鍚庯紝杩欎簺璁板綍灏嗕粠鍒楄〃涓Щ闄わ紙鏁版嵁浠嶄繚鐣欙紝鍙仮澶嶏級銆俙,
+            "鎻愮ず",
+            {
+              confirmButtonText: "纭畾绉婚櫎",
+              cancelButtonText: "鍙栨秷",
+              type: "warning"
+            }
+          );
+          // 鐢ㄦ埛纭锛氭爣璁� delFlag=1
+          toRemoveSaved.forEach(r => {
+            r.delFlag = 1;
+          });
+        } catch (error) {
+          // 鐢ㄦ埛鍙栨秷锛氭仮澶嶉�変腑鐘舵��
+          // 灏嗗彇娑堢殑鍣ㄥ畼閲嶆柊鍔犲叆 this.selectedOrgans
+          const parentToRestore = new Set();
+          toRemoveSaved.forEach(r => {
+            const parent = this.organReverseMap[r.organno];
+            if (parent) {
+              parentToRestore.add(parent);
+            } else {
+              parentToRestore.add(r.organno);
+            }
+          });
+          parentToRestore.forEach(val => {
+            if (!this.selectedOrgans.includes(val)) {
+              this.selectedOrgans.push(val);
+            }
+          });
+          // 鎻愮ず鐢ㄦ埛鎿嶄綔宸插彇娑�
+          this.$message.info("宸插彇娑堝垹闄ゆ搷浣�");
+          // 鏇存柊琛ㄥ崟瀛楁锛堜繚鎸佷竴鑷存�э級
+          this.form.donateorgan = this.selectedOrgans.join(",");
+          // 娉ㄦ剰锛氭鏃� records 涓凡鏂板浜嗙洰鏍囧櫒瀹橈紝骞朵笖涔嬪墠鐨勮褰曟湭琚爣璁板垹闄わ紝鐘舵�佷竴鑷淬��
+          // 浣嗘槸锛屾垜浠繕闇�瑕佺Щ闄や箣鍓嶆柊澧炰絾鐢ㄦ埛鍙兘涓嶆兂淇濈暀鐨勮褰曪紵涓嶄細锛屽洜涓烘柊澧炵殑鏄洰鏍囧櫒瀹橈紝鐢ㄦ埛鏄兂淇濈暀鐨勩��
+          // 鍥犳鐩存帴杩斿洖鍗冲彲銆�
+          return;
+        }
+      }
+
+      // 5. 鏇存柊琛ㄥ崟瀛楁
+      this.form.donateorgan = this.selectedOrgans.join(",");
+    },
+    // 绉绘鍖婚櫌妯$硦鎼滅储
+    queryHospitalSearch(queryString, cb) {
+      const hospitals = this.dict.type.Geta_hospital || [];
+      const results = queryString
+        ? hospitals.filter(item =>
+            item.label.toLowerCase().includes(queryString.toLowerCase())
+          )
+        : hospitals;
+
+      // el-autocomplete 闇�瑕� value 瀛楁
+      cb(results.map(item => ({ value: item.label })));
+    },
     // 澶勭悊浜掓枼閫夋嫨
     handleExclusiveSelections(selectedValues) {
       // 濡傛灉閫夋嫨浜�"鍙岃偩"(鍋囪瀛楀吀鍊间负C64)锛岃嚜鍔ㄥ彇娑堝崟鐙殑"宸﹁偩"(C64L)鍜�"鍙宠偩"(C64R)閫夋嫨
@@ -1037,6 +1067,7 @@
       const organName = this.getOrganLabel(organValue);
 
       this.utilizationData.serviceDonatecomporganList.push({
+        infoid: this.caseId,
         organname: organName,
         organno: organValue,
         caseNo: "",
@@ -1047,6 +1078,7 @@
         transplanttime: "",
         transplantstate: "1",
         abandonreason: "",
+        delFlag: 0, // 鏂板
         sex: "",
         age: "",
         birthday: "",
@@ -1070,29 +1102,19 @@
 
     // 鏍规嵁瀛楀吀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;
-    },
-
-    // 鍖婚櫌閫夋嫨鍙樺寲
-    handleHospitalChange(row, hospitalNo) {
-      const hospital = this.hospitalList.find(
-        item => item.hospitalNo === hospitalNo
-      );
-      if (hospital) {
-        row.hospitalname = hospital.hospitalName;
-      }
     },
 
     // 绉绘鐘舵�佸彉鍖栧鐞�
     handleTransplantStatusChange(row, status) {
-      if (status === "0") {
+      if (status == "0") {
         // 濡傛灉鐘舵�佷负鏈Щ妞嶏紝娓呴櫎鐩稿叧瀛楁
         // row.transplanttime = "";
         // row.transplantdoct = "";
         // row.hospitalno = "";
         // row.hospitalname = "";
-      } else if (status === "1") {
+      } else if (status == "1") {
         // 濡傛灉鐘舵�佷负宸茬Щ妞嶏紝鑷姩璁剧疆绉绘鏃堕棿涓哄綋鍓嶆椂闂�
         if (!row.transplanttime) {
           row.transplanttime = new Date().toISOString().split("T")[0];
@@ -1103,31 +1125,6 @@
     // 琛屽睍寮�浜嬩欢
     handleExpandChange(row, expandedRows) {
       this.expandedRows = expandedRows.map(item => item.organno);
-    },
-
-    // 缂栬緫鍒╃敤璁板綍
-    handleEditUtilization(row) {
-      const index = this.utilizationData.serviceDonatecomporganList.findIndex(
-        item => item.organno === row.organno
-      );
-      if (index !== -1) {
-        this.currentRecord = { ...row };
-        this.currentEditIndex = index;
-        this.editDialogVisible = true;
-      }
-    },
-
-    // 纭缂栬緫
-    handleEditConfirm() {
-      if (this.currentEditIndex !== -1) {
-        this.utilizationData.serviceDonatecomporganList[
-          this.currentEditIndex
-        ] = {
-          ...this.currentRecord
-        };
-        this.$message.success("鍒╃敤璁板綍鏇存柊鎴愬姛");
-        this.editDialogVisible = false;
-      }
     },
 
     // 鍒犻櫎鍣ㄥ畼璁板綍
@@ -1156,12 +1153,12 @@
     // 鍣ㄥ畼琛屾牱寮�
     getOrganRowClassName({ row }) {
       if (
-        row.transplantstate === "1" &&
-        (!row.caseNo || !row.hospitalno || !row.name || !row.transplanttime)
+        row.transplantstate == "1" &&
+        (!row.hospitalno || !row.name || !row.transplanttime)
       ) {
         return "warning-row";
       }
-      if (row.transplantstate === "0" && !row.abandonreason) {
+      if (row.transplantstate == "0" && !row.abandonreason) {
         return "warning-row";
       }
       return "";
@@ -1170,9 +1167,9 @@
     // 鑾峰彇鐘舵�佹爣绛剧被鍨�
     getStatusTagType(status) {
       const typeMap = {
-        completed: "success",
-        processing: "warning",
-        pending: "info"
+        3: "success",
+        2: "warning",
+        1: "info"
       };
       return typeMap[status] || "info";
     },
@@ -1180,9 +1177,9 @@
     // 鑾峰彇鐘舵�佹枃鏈�
     getStatusText(status) {
       const textMap = {
-        completed: "宸插畬鎴�",
-        processing: "杩涜涓�",
-        pending: "寰呭鐞�"
+        3: "宸插畬鎴�",
+        2: "杩涜涓�",
+        1: "寰呭鐞�"
       };
       return textMap[status] || "鏈煡";
     },
@@ -1224,7 +1221,7 @@
             const apiMethod = this.form.id ? completionedit : completionadd;
             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;
@@ -1249,7 +1246,7 @@
     async handleSaveUtilization() {
       if (
         !this.utilizationData.serviceDonatecomporganList ||
-        this.utilizationData.serviceDonatecomporganList.length === 0
+        this.utilizationData.serviceDonatecomporganList.length == 0
       ) {
         this.$message.warning("璇峰厛娣诲姞鍒╃敤璁板綍");
         return;
@@ -1267,7 +1264,7 @@
 
         const response = await completionedit(saveData);
 
-        if (response.code === 200) {
+        if (response.code == 200) {
           this.$message.success("鍒╃敤璁板綍淇濆瓨鎴愬姛");
         } else {
           this.$message.error(
@@ -1287,14 +1284,9 @@
       // 妫�鏌ュ埄鐢ㄨ褰曟槸鍚﹀畬鏁�
       const incompleteRecords = this.utilizationData.serviceDonatecomporganList.filter(
         record => {
-          if (record.transplantstate === "1") {
-            return (
-              !record.caseNo ||
-              !record.hospitalno ||
-              !record.name ||
-              !record.transplanttime
-            );
-          } else if (record.transplantstate === "0") {
+          if (record.transplantstate == "1") {
+            return !record.hospitalno || !record.name || !record.transplanttime;
+          } else if (record.transplantstate == "0") {
             return !record.abandonreason;
           }
           return false;
@@ -1313,7 +1305,7 @@
       })
         .then(async () => {
           this.confirmLoading = true;
-          this.form.recordstate = "completed";
+          this.form.completeState = "3";
           this.form.completetime =
             this.form.completetime ||
             new Date()
@@ -1332,19 +1324,19 @@
 
             const response = await completionedit(saveData);
 
-            if (response.code === 200) {
+            if (response.code == 200) {
               this.$message.success("鍣ㄥ畼鍒╃敤宸插畬鎴�");
             } else {
               this.$message.error(
                 "纭鍒╃敤澶辫触锛�" + (response.msg || "鏈煡閿欒")
               );
-              this.form.recordstate = "pending";
+              this.form.completeState = "2";
               this.form.completetime = "";
             }
           } catch (error) {
             console.error("纭鍒╃敤澶辫触:", error);
             this.$message.error("纭鍒╃敤澶辫触");
-            this.form.recordstate = "pending";
+            this.form.completeState = "2";
             this.form.completetime = "";
           } finally {
             this.confirmLoading = false;
@@ -1374,7 +1366,7 @@
 
       // 鑾峰彇鍣ㄥ畼鍚嶇О
       const organRecord = this.utilizationData.serviceDonatecomporganList.find(
-        item => item.organno === this.currentFollowup.organNo
+        item => item.organno == this.currentFollowup.organNo
       );
       const organName = organRecord ? organRecord.organname : "";
 
@@ -1389,7 +1381,7 @@
         if (this.isEditingFollowup) {
           // 鏇存柊鐜版湁璁板綍
           const index = this.followupData.records.findIndex(
-            item => item.id === this.currentFollowup.id
+            item => item.id == this.currentFollowup.id
           );
           if (index !== -1) {
             this.followupData.records[index] = {
@@ -1406,59 +1398,153 @@
         this.saveLoading = false;
       }, 1000);
     },
-    /** 闄勪欢鍙樺寲澶勭悊 */
-    handleAttachmentChange(fileList) {
-      this.attachmentFileList = fileList;
+    // ==== 闄勪欢鐩稿叧鏂规硶 ====
+    // 鎵撳紑涓婁紶瀵硅瘽妗�
+    openUploadDialog(category) {
+      this.currentUploadCategory = category;
+      this.tempFileList = [];
+      this.uploadDialogVisible = true;
+      this.$nextTick(() => {
+        if (this.$refs.uploadRef) {
+          this.$refs.uploadRef.clearFiles();
+        }
+      });
     },
 
-    /** 闄勪欢绉婚櫎澶勭悊 */
-    handleAttachmentRemove(file) {
-      if (file.url) {
-        const index = this.attachments.findIndex(
-          item => item.path === file.url || item.fileUrl === file.url
+    // 涓婁紶鍓嶆牎楠�
+    beforeUpload(file) {
+      const allowedTypes = [
+        "application/pdf",
+        "image/jpeg",
+        "image/png",
+        "application/msword",
+        "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
+      ];
+      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(
+          "鏂囦欢鏍煎紡涓嶆敮鎸侊紝璇蜂笂浼爌df銆乯pg銆乸ng銆乨oc鎴杁ocx鏍煎紡鏂囦欢"
         );
-        if (index > -1) {
-          this.attachments.splice(index, 1);
-          this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+        return false;
+      }
+      if (file.size > maxSize) {
+        this.$message.error("鏂囦欢澶у皬涓嶈兘瓒呰繃10MB");
+        return false;
+      }
+      return true;
+    },
+
+    // 鏂囦欢閫夋嫨鍙樺寲
+    handleFileChange(file, fileList) {
+      this.tempFileList = fileList;
+    },
+
+    // 涓存椂绉婚櫎
+    handleTempRemove(file, fileList) {
+      this.tempFileList = fileList;
+    },
+
+    // 涓婁紶鎴愬姛澶勭悊
+    handleUploadSuccess(response, file, fileList) {
+      if (response.code !== 200) {
+        this.$message.error(response.msg || "涓婁紶澶辫触");
+        return;
+      }
+      // 鏈垎绫诲搴旂┖瀛楃涓诧紝涓庡睍绀�/淇濆瓨閫昏緫涓�鑷�
+      const category =
+        this.currentUploadCategory == "鏈垎绫�"
+          ? ""
+          : this.currentUploadCategory;
+      const attachmentObj = {
+        fileName: file.name,
+        path: response.fileUrl || response.url || response.data || file.url,
+        fileUrl: response.fileUrl || response.url || response.data || file.url,
+        fileType: category,
+        fileSize: file.size,
+        uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
+      };
+      if (!Array.isArray(this.attachments)) {
+        this.attachments = [];
+      }
+      this.attachments.push(attachmentObj);
+      this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+      this.uploadLoading = false;
+      this.uploadDialogVisible = false;
+      this.tempFileList = [];
+    },
+
+    // 鎻愪氦涓婁紶
+    submitUpload() {
+      if (this.tempFileList.length == 0) {
+        this.$message.warning("璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢");
+        return;
+      }
+      this.uploadLoading = true;
+      this.$refs.uploadRef.submit();
+    },
+
+    // 鑾峰彇鏌愬垎绫荤殑鏂囦欢鏁伴噺
+    getCategoryCount(category) {
+      return this.attachments.filter(item => {
+        const type = item.fileType || "";
+        if (category == "鏈垎绫�") {
+          return !this.presetCategories.includes(type);
+        }
+        return type == category;
+      }).length;
+    },
+
+    // 鑾峰彇鏌愬垎绫荤殑鏂囦欢鍒楄〃
+    getCategoryFiles(category) {
+      return this.attachments.filter(item => {
+        const type = item.fileType || "";
+        if (category == "鏈垎绫�") {
+          return !this.presetCategories.includes(type);
+        }
+        return type == category;
+      });
+    },
+
+    // 鏇存柊闄勪欢鍒嗙被锛堜笅鎷変慨鏀规椂瑙﹀彂锛�
+    updateAttachmentCategory(row, newVal) {
+      const target = this.attachments.find(item => item == row);
+      if (target) {
+        target.fileType = newVal;
+        const currentTabHasFiles =
+          this.getCategoryFiles(this.activeTab).length > 0;
+        if (!currentTabHasFiles) {
+          const firstCategory = this.categories[0];
+          if (firstCategory) this.activeTab = firstCategory;
         }
       }
     },
-    /** 涓婁紶鎴愬姛澶勭悊 */
-    handleUploadSuccess({ file, fileList, response }) {
-      if (response.code === 200) {
-        const attachmentObj = {
-          fileName: file.name,
-          path: response.fileUrl || file.url,
-          fileUrl: response.fileUrl || file.url,
-          fileType: this.getFileExtension(file.name),
-          fileSize: file.size,
-          uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
-        };
 
-        if (!Array.isArray(this.attachments)) {
-          this.attachments = [];
-        }
-
-        this.attachments.push(attachmentObj);
-        this.attachmentFileList = fileList;
-        this.$message.success("鏂囦欢涓婁紶鎴愬姛");
-      }
+    // 鎸夋枃浠跺璞″垹闄わ紙鐢ㄤ簬琛ㄦ牸涓殑鍒犻櫎鎸夐挳锛�
+    handleRemoveAttachmentByFile(file) {
+      this.$confirm("纭畾瑕佸垹闄よ繖涓檮浠跺悧锛�", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          const index = this.attachments.findIndex(item => item == file);
+          if (index > -1) {
+            this.attachments.splice(index, 1);
+            this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+          }
+        })
+        .catch(() => {});
     },
 
-    /** 涓婁紶閿欒澶勭悊 */
-    handleUploadError({ file, fileList, error }) {
-      console.error("闄勪欢涓婁紶澶辫触:", error);
-      this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
-    },
-
-    /** 鎵嬪姩鍒犻櫎闄勪欢 */
-    handleRemoveAttachment(index) {
-      this.attachments.splice(index, 1);
-      this.attachmentFileList.splice(index, 1);
-      this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
-    },
-
-    /** 鏂囦欢棰勮 */
+    // 鏂囦欢棰勮
     handlePreview(file) {
       this.currentPreviewFile = {
         fileName: file.fileName,
@@ -1467,7 +1553,8 @@
       };
       this.filePreviewVisible = true;
     },
-    /** 鏂囦欢涓嬭浇 */
+
+    // 鏂囦欢涓嬭浇
     handleDownloadAttachment(file) {
       const fileUrl = file.path || file.fileUrl;
       const fileName = file.fileName;
@@ -1554,7 +1641,7 @@
 
     /** 鏍煎紡鍖栨枃浠跺ぇ灏� */
     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));
@@ -1864,6 +1951,7 @@
   .recipient-form {
     padding: 15px;
   }
+
   .attachment-header {
     flex-wrap: wrap;
   }
@@ -1873,6 +1961,7 @@
     margin-top: 8px;
     margin-left: 0;
   }
+
   .form-section {
     margin-bottom: 20px;
     padding-bottom: 15px;
@@ -1975,4 +2064,105 @@
     padding: 10px 15px;
   }
 }
+
+/* ===== 绾歌川琛ㄦ牸缃戞牸鏍峰紡 ===== */
+.paper-card >>> .el-card__body {
+  padding: 16px;
+}
+
+.paper-form {
+  border-left: 1px solid #d0d3db;
+  background: #fff;
+  /* 瓒呭灞忛檺鍒惰〃鍗曟渶澶у搴︼紝鍙充晶鐣欑櫧锛岄伩鍏嶅瓧娈靛垎甯冭繃寮� */
+  max-width: 1400px;
+}
+
+.paper-form >>> .form-row {
+  display: flex;
+  width: 100%;
+  border-top: 1px solid #d0d3db;
+  /* 涓婄Щ1px涓庝笂涓�琛岀殑border-bottom閲嶅彔锛屼袱琛屼箣闂村彧鏄剧ず涓�鏉�1px缁嗙嚎 */
+  margin-top: -1px;
+}
+.paper-form >>> .form-row:first-child {
+  margin-top: 0;
+}
+
+/* 琛屽熬绌虹櫧濉厖锛氫笉婊℃暣琛岀殑鍙充晶鑷姩琛ヤ竴涓┖鐧芥牸瀛愶紝缃戞牸淇濇寔闂悎锛堝彸渚ч�傚綋鐣欑櫧锛� */
+.paper-form >>> .form-row::after {
+  content: "";
+  flex: 1 1 0;
+  min-height: 42px;
+  background: linear-gradient(to left, #d0d3db 1px, transparent 1px),
+    linear-gradient(to top, #d0d3db 1px, transparent 1px);
+  background-color: #fff;
+}
+
+.paper-form >>> .el-form-item {
+  flex: 0 0 33.3333%;
+  display: flex;
+  margin: 0;
+  background: #fff;
+  border-right: 1px solid #d0d3db;
+  border-bottom: 1px solid #d0d3db;
+}
+.paper-form >>> .el-form-item::after,
+.paper-form >>> .el-form-item::before {
+  display: none;
+}
+
+.paper-form >>> .col-1-3 { flex: 0 0 33.3333%; }
+.paper-form >>> .col-half { flex: 0 0 50%; }
+.paper-form >>> .col-2-3 { flex: 0 0 66.6666%; }
+.paper-form >>> .col-full { flex: 0 0 100%; }
+
+.paper-form >>> .el-form-item__label {
+  flex: 0 0 150px;
+  width: 150px !important;
+  float: none;
+  padding: 0 8px !important;
+  background: #ecf5ff;
+  border-right: 1px solid #d0d3db;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  font-size: 13px;
+  font-weight: 600;
+  color: #2c3038;
+  line-height: 1.3;
+  white-space: nowrap;
+}
+.paper-form >>> .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
+  color: #f56c6c;
+  margin-right: 2px;
+}
+
+.paper-form >>> .el-form-item__content {
+  flex: 1;
+  margin-left: 0 !important;
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  padding: 6px 10px;
+  background: #fff;
+  min-height: 42px;
+  line-height: 1.4;
+}
+
+/* 鎺т欢瀹藉害閫備腑锛屼笉閾烘弧鏁存牸锛堝唴瀹圭煭鏃惰緭鍏ユ涓嶅啀鎷夊緱寰堥暱锛� */
+.paper-form >>> .el-form-item__content .el-input,
+.paper-form >>> .el-form-item__content .el-select,
+.paper-form >>> .el-form-item__content .el-cascader {
+  width: 220px;
+  max-width: 100%;
+}
+.paper-form >>> .el-form-item__content .el-date-editor {
+  width: 240px;
+  max-width: 100%;
+}
+.paper-form >>> .el-form-item__content .el-range-editor {
+  width: 360px;
+  max-width: 100%;
+}
 </style>

--
Gitblit v1.9.3