From dc082351978a1e9f75d7a1471a0ca7ebeac552a5 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 01 六月 2026 11:07:50 +0800
Subject: [PATCH] opo维护

---
 src/views/business/OrganUtilization/OrganUtilizationInfo.vue |  332 ++++++++++++++++++-------------------------------------
 1 files changed, 108 insertions(+), 224 deletions(-)

diff --git a/src/views/business/OrganUtilization/OrganUtilizationInfo.vue b/src/views/business/OrganUtilization/OrganUtilizationInfo.vue
index 416b83c..d6a0daa 100644
--- a/src/views/business/OrganUtilization/OrganUtilizationInfo.vue
+++ b/src/views/business/OrganUtilization/OrganUtilizationInfo.vue
@@ -1,50 +1,28 @@
 <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>
+    <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+      <!-- 鍩烘湰淇℃伅 -->
+      <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"
+              :loading="confirmLoading"
+            >
+              瀹屾垚鍒╃敤
+            </el-button>
+          </div>
         </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>
 
         <el-row :gutter="20">
           <el-col :span="6">
@@ -78,7 +56,6 @@
                 type="datetime"
                 value-format="yyyy-MM-dd HH:mm:ss"
                 style="width: 100%"
-                :disabled="form.recordstate === 'completed'"
               />
             </el-form-item>
           </el-col>
@@ -87,7 +64,7 @@
         <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 +74,64 @@
                 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-card>
+      <el-card class="detail-card">
+        <div slot="header" class="clearfix">
+          <span class="detail-title">閬椾綋鎹愮尞淇℃伅</span>
+        </div>
+        <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="8">
+            <el-form-item align="left" label="鎺ユ敹瀹跺睘" prop="relationname">
+              <el-input
+                v-model="form.relationname"
+                placeholder="璇疯緭鍏ユ帴鏀跺灞�"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="涓庢崘鐚�呭叧绯�" prop="signfamilyrelations">
+              <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>
+          </el-col>
+        </el-row>
+      </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 +152,6 @@
                   v-for="dict in dict.type.sys_Organ || []"
                   :key="dict.value"
                   :label="dict.value"
-                  :disabled="form.recordstate === 'completed'"
                 >
                   {{ dict.label }}
                 </el-checkbox>
@@ -194,7 +212,6 @@
                                 <el-input
                                   v-model="scope.row.name"
                                   placeholder="璇疯緭鍏ュ彈鑰呭鍚�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -206,7 +223,6 @@
                                   value-format="yyyy-MM-dd"
                                   placeholder="閫夋嫨鍑虹敓鏃ユ湡"
                                   style="width: 100%"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -216,10 +232,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 +246,6 @@
                                 <el-input
                                   v-model="scope.row.age"
                                   placeholder="骞撮緞"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -241,12 +255,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 +268,6 @@
                                 <el-input
                                   v-model="scope.row.idcardno"
                                   placeholder="璇佷欢鍙风爜"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -271,7 +283,6 @@
                                 <el-input
                                   v-model="scope.row.hospitalname"
                                   placeholder="璇疯緭鍏ョЩ妞嶄腑蹇冨悕绉�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -280,7 +291,6 @@
                                 <el-input
                                   v-model="scope.row.phone"
                                   placeholder="鑱旂郴鐢佃瘽"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -294,7 +304,6 @@
                                   :rows="2"
                                   v-model="scope.row.residenceaddress"
                                   placeholder="璇疯緭鍏ヨ缁嗗湴鍧�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -313,10 +322,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 +333,6 @@
                                 <el-input
                                   v-model="scope.row.transplantdoct"
                                   placeholder="璇疯緭鍏ョЩ妞嶅尰鐢�"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -346,7 +353,6 @@
                                   :rows="3"
                                   v-model="scope.row.abandonreason"
                                   placeholder="璇疯緭鍏ユ湭绉绘鍘熷洜"
-                                  :disabled="form.recordstate === 'completed'"
                                 />
                               </el-form-item>
                             </el-col>
@@ -438,7 +444,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 +465,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>
@@ -599,76 +573,6 @@
       </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'"
-        >
-          <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="璇烽�夋嫨绉绘鍖婚櫌"
-            style="width: 100%"
-          >
-            <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-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-dialog>
-
     <!-- 鏂囦欢棰勮瀵硅瘽妗� -->
     <FilePreviewDialog
       :visible="filePreviewVisible"
@@ -697,7 +601,13 @@
     FilePreviewDialog,
     CaseBasicInfo
   },
-  dicts: ["sys_BloodType", "sys_Organ", "sys_0_1"],
+  dicts: [
+    "sys_BloodType",
+    "sys_Organ",
+    "sys_FamilyRelation",
+    "sys_0_1",
+    "utilize_statue"
+  ],
   data() {
     return {
       caseId: null,
@@ -707,7 +617,7 @@
         id: undefined,
         infoid: undefined,
         inpatientno: "",
-        recordstate: "pending",
+        completeState: "2",
         caseNo: "",
         donorno: "",
         treatmenthospitalname: "",
@@ -727,8 +637,8 @@
         coordinatedusernamet: "",
         assessannex: "",
         donateorgan: "",
-        isbodydonation: "0",
-        receivingunit: "",
+        isbodydonation: "1",
+        receivingunitname: "",
         createBy: "",
         createTime: "",
         updateBy: "",
@@ -856,17 +766,8 @@
         .replace("T", " ")
         .substring(0, 19);
 
-      this.generateDonorNo();
       this.getDetail();
       this.getHospitalData();
-    },
-
-    // 鐢熸垚鎹愮尞鑰呯紪鍙�
-    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);
     },
 
     // 鑾峰彇璇︽儏
@@ -880,9 +781,13 @@
           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,12 +803,14 @@
             )
               ? data.serviceDonatecomporganList.map(record => ({
                   ...record,
+                  transplanttime: record.transplanttime || "",
                   transplantstate: record.transplantstate
                     ? record.transplantstate.toString()
                     : "1"
                 }))
               : [];
           }
+          console.log(this.utilizationData.serviceDonatecomporganList);
 
           // 鍒濆鍖栭檮浠�
           if (this.form.assessannex) {
@@ -1105,31 +1012,6 @@
       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;
-      }
-    },
-
     // 鍒犻櫎鍣ㄥ畼璁板綍
     handleRemoveOrgan(index) {
       this.$confirm("纭鍒犻櫎杩欐潯鍣ㄥ畼璁板綍鍚楋紵", "鎻愮ず", {
@@ -1170,9 +1052,9 @@
     // 鑾峰彇鐘舵�佹爣绛剧被鍨�
     getStatusTagType(status) {
       const typeMap = {
-        completed: "success",
-        processing: "warning",
-        pending: "info"
+        3: "success",
+        2: "warning",
+        1: "info"
       };
       return typeMap[status] || "info";
     },
@@ -1180,9 +1062,9 @@
     // 鑾峰彇鐘舵�佹枃鏈�
     getStatusText(status) {
       const textMap = {
-        completed: "宸插畬鎴�",
-        processing: "杩涜涓�",
-        pending: "寰呭鐞�"
+        3: "宸插畬鎴�",
+        2: "杩涜涓�",
+        1: "寰呭鐞�"
       };
       return textMap[status] || "鏈煡";
     },
@@ -1313,7 +1195,7 @@
       })
         .then(async () => {
           this.confirmLoading = true;
-          this.form.recordstate = "completed";
+          this.form.completeState = "3";
           this.form.completetime =
             this.form.completetime ||
             new Date()
@@ -1338,13 +1220,13 @@
               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;
@@ -1864,6 +1746,7 @@
   .recipient-form {
     padding: 15px;
   }
+
   .attachment-header {
     flex-wrap: wrap;
   }
@@ -1873,6 +1756,7 @@
     margin-top: 8px;
     margin-left: 0;
   }
+
   .form-section {
     margin-bottom: 20px;
     padding-bottom: 15px;

--
Gitblit v1.9.3