From 996206735df06887e3f3e453797b1289a2a793e7 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期六, 25 四月 2026 10:21:31 +0800
Subject: [PATCH] 青岛维护

---
 src/views/business/allocation/allocationInfo.vue |  168 +++++++++++++++++++------------------------------------
 1 files changed, 58 insertions(+), 110 deletions(-)

diff --git a/src/views/business/allocation/allocationInfo.vue b/src/views/business/allocation/allocationInfo.vue
index fa02806..29b9bbe 100644
--- a/src/views/business/allocation/allocationInfo.vue
+++ b/src/views/business/allocation/allocationInfo.vue
@@ -1,5 +1,6 @@
 <template>
   <div class="organ-allocation-detail">
+    <case-basic-info :case-id="caseId" :show-attachment="true" />
     <!-- 鍩烘湰淇℃伅閮ㄥ垎 -->
     <el-card class="detail-card">
       <div slot="header" class="clearfix">
@@ -21,85 +22,19 @@
 
       <el-form :model="form" ref="form" :rules="rules" label-width="120px">
         <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="浣忛櫌鍙�" prop="donorno">
-              <el-input v-model="form.donorno" readonly />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="妗堜緥缂栧彿" prop="caseNo">
-              <el-input v-model="form.caseNo" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎹愮尞鑰呭鍚�" prop="name">
-              <el-input v-model="form.name" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="鎬у埆" prop="sex">
-              <el-select v-model="form.sex" style="width: 100%">
-                <el-option label="鐢�" value="0" />
-                <el-option label="濂�" value="1" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="骞撮緞" prop="age">
-              <el-input v-model="form.age" />
-            </el-form-item>
-          </el-col>
-          <!-- <el-col :span="8">
-            <el-form-item label="鎹愮尞绫诲埆" prop="donationcategory">
-              <el-select v-model="form.donationcategory" style="width: 100%">
-                <el-option
-                  v-for="dict in dict.type.sys_DonationCategory || []"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col> -->
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="琛�鍨�" prop="bloodtype">
-              <el-select v-model="form.bloodtype" style="width: 100%">
-                <el-option
-                  v-for="dict in dict.type.sys_BloodType || []"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="璇佷欢鍙风爜" prop="idcardno">
-              <el-input v-model="form.idcardno" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="璁板綍鐘舵��" prop="recordstate">
-              <el-input v-model="form.recordstate" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="鐤剧梾璇婃柇" prop="diagnosisname">
-              <el-input
-                type="textarea"
-                :rows="2"
-                v-model="form.diagnosisname"
-                placeholder="璇疯緭鍏ョ柧鐥呰瘖鏂俊鎭�"
-              />
+            <el-form-item label="鍒嗛厤鐘舵��" prop="allocationStatus">
+              <el-select
+                v-model="form.allocationStatus"
+                placeholder="璇烽�夋嫨鍒嗛厤鐘舵��"
+              >
+                <el-option
+                  v-for="dict in dict.type.organ_allocation_status || []"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -117,27 +52,8 @@
 
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="鎵�鍦ㄥ尰鐤楁満鏋�" prop="treatmenthospitalname">
-              <el-input
-                v-model="form.treatmenthospitalname"
-                placeholder="璇疯緭鍏ュ尰鐤楁満鏋勫悕绉�"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="鍖荤枟鏈烘瀯缂栫爜" prop="treatmenthospitalno">
-              <el-input
-                v-model="form.treatmenthospitalno"
-                placeholder="璇疯緭鍏ュ尰鐤楁満鏋勭紪鐮�"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="12">
             <el-form-item label="鐧昏浜�" prop="registrationName">
-              <el-input v-model="form.registrationName" readonly />
+              <el-input v-model="form.registrationName" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -147,7 +63,6 @@
                 type="datetime"
                 value-format="yyyy-MM-dd HH:mm:ss"
                 style="width: 100%"
-                readonly
               />
             </el-form-item>
           </el-col>
@@ -410,7 +325,7 @@
         </div>
       </el-form>
 
-      <div class="dialog-footer" v-if="form.allocationStatus !== '1'">
+      <!-- <div class="dialog-footer" v-if="form.allocationStatus !== '1'">
         <el-button
           type="primary"
           @click="handleSaveAllocation"
@@ -430,7 +345,7 @@
         >
           纭瀹屾垚鍒嗛厤
         </el-button>
-      </div>
+      </div> -->
     </el-card>
 
     <!-- 闄勪欢绠$悊閮ㄥ垎浼樺寲 -->
@@ -543,8 +458,6 @@
       </div>
     </el-dialog>
 
-
-
     <!-- 闄勪欢棰勮瀵硅瘽妗� -->
     <FilePreviewDialog
       :visible="filePreviewVisible"
@@ -559,12 +472,13 @@
 import {
   allocationList,
   allocationadd,
-  allocationedit
+  allocationedit,
+  donateorganBaseinfoInfo
 } from "@/api/businessApi";
 import UploadAttachment from "@/components/UploadAttachment";
 import FilePreviewDialog from "@/components/FilePreviewDialog";
 import OrgSelecter from "@/views/project/components/orgselect";
-
+import CaseBasicInfo from "@/components/CaseBasicInfo";
 import dayjs from "dayjs";
 
 export default {
@@ -572,16 +486,20 @@
   components: {
     UploadAttachment,
     OrgSelecter,
-    FilePreviewDialog
+    FilePreviewDialog,
+    CaseBasicInfo
   },
   dicts: [
     "sys_BloodType",
     "sys_DonationCategory",
     "sys_RecordState",
-    "sys_Organ"
+    "sys_Organ",
+    "organ_allocation_status"
   ],
   data() {
     return {
+      caseId: null,
+
       // 琛ㄥ崟鏁版嵁
       form: {
         id: undefined,
@@ -721,6 +639,7 @@
     }
   },
   created() {
+    this.caseId = this.$route.query.infoid;
     this.initData();
   },
   methods: {
@@ -749,7 +668,7 @@
         .substring(0, 19);
 
       if (infoid) {
-        this.getDetail(infoid);
+        this.getDetail(infoid, id);
       } else {
         this.generateDonorNo();
       }
@@ -762,9 +681,25 @@
       this.form.donorno = "D" + timestamp.slice(-8);
       this.form.caseNo = "CASE" + timestamp.slice(-6);
     },
+
+    // 瑙f瀽 filePatch 瀛楁
+    parseFilePatch(filePatch) {
+      if (!filePatch) {
+        this.form.attachments = [];
+        return;
+      }
+
+      try {
+        this.form.attachments = JSON.parse(filePatch);
+      } catch (error) {
+        console.error("瑙f瀽 filePatch 瀛楁澶辫触:", error);
+        this.form.attachments = [];
+      }
+    },
     // 鑾峰彇璇︽儏
-    async getDetail(infoid) {
+    async getDetail(infoid, id) {
       this.loading = true;
+      donateorganBaseinfoInfo(id);
       try {
         const response = await allocationList({ infoid });
         if (
@@ -776,6 +711,8 @@
 
           // 濉厖琛ㄥ崟鏁版嵁
           Object.assign(this.form, data);
+          // 杞崲闄勪欢涓洪泦鍚�
+            this.parseFilePatch(this.form.fileName);
 
           // 鍒濆鍖栭檮浠�
           if (this.form.attachments) {
@@ -1003,6 +940,13 @@
       }
       return "";
     },
+    // 鏋勫缓 filePatch 瀛楁
+    buildFilePatch() {
+      if (!this.attachments || this.attachments.length === 0) {
+        return "";
+      }
+      return JSON.stringify(this.attachments);
+    },
     // 淇濆瓨鍩烘湰淇℃伅
     async handleSave() {
       this.$refs.form.validate(async valid => {
@@ -1015,10 +959,14 @@
         try {
           const saveData = {
             ...this.form,
-            attachments: this.attachments,
             serviceDonateorganList:
               this.allocationData.serviceDonateorganList || []
           };
+          saveData.fileName=this.buildFilePatch();
+          saveData.serviceDonateorganList.forEach(item => {
+            item.baseid = this.form.id;
+            item.infoid = this.form.infoid;
+          });
           console.log(this.form.recordstate);
           this.form.recordstate = 1;
           const apiMethod = this.form.id ? allocationedit : allocationadd;

--
Gitblit v1.9.3