From 4c9fdc87987140e8b2c3f0dfc2f6608cdb6be774 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 21 十月 2026 17:39:24 +0800
Subject: [PATCH] 青岛维护

---
 src/views/business/allocation/allocationInfo.vue |  236 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 180 insertions(+), 56 deletions(-)

diff --git a/src/views/business/allocation/allocationInfo.vue b/src/views/business/allocation/allocationInfo.vue
index 1ab3aab..6f0d7b5 100644
--- a/src/views/business/allocation/allocationInfo.vue
+++ b/src/views/business/allocation/allocationInfo.vue
@@ -1,43 +1,36 @@
 <template>
   <div class="organ-allocation-detail">
-    <case-basic-info :case-id="caseId" :show-attachment="true" />
+    <case-basic-info :case-id="caseId" :show-attachment="true":column="3" />
     <!-- 鍩烘湰淇℃伅閮ㄥ垎 -->
-    <el-card class="detail-card">
+    <el-card class="detail-card paper-card">
       <div slot="header" class="clearfix">
         <span class="detail-title">鍣ㄥ畼鍒嗛厤鍩烘湰淇℃伅</span>
       </div>
 
-      <el-form :model="form" ref="form" :rules="rules" label-width="120px">
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <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">
-            <el-form-item label="鍒嗛厤鏃堕棿" prop="allocationTime">
-              <el-date-picker v-model="form.allocationTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
-                style="width: 100%" :disabled="form.allocationStatus == '1'" />
-            </el-form-item>
-          </el-col>
-        </el-row>
+      <el-form :model="form" ref="form" :rules="rules" label-width="120px" class="paper-form">
+        <div class="form-row">
+          <el-form-item label="鍒嗛厤鐘舵��" prop="allocationStatus" class="col-half">
+            <el-select v-model="form.allocationStatus" placeholder="璇烽�夋嫨鍒嗛厤鐘舵��" :disabled="isReadOnly">
+              <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-form-item label="鍒嗛厤鏃堕棿" prop="allocationTime" class="col-half">
+            <el-date-picker v-model="form.allocationTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+              style="width: 100%" :disabled="form.allocationStatus == '1' || isReadOnly" />
+          </el-form-item>
+        </div>
 
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="璐熻矗浜�" prop="registrationName">
-              <el-input v-model="form.registrationName" />
-            </el-form-item>
-          </el-col>
-
-        </el-row>
+        <div class="form-row">
+          <el-form-item label="璐熻矗浜�" prop="registrationName" class="col-half">
+              <el-input v-model="form.registrationName" :disabled="isReadOnly" />
+          </el-form-item>
+        </div>
       </el-form>
     </el-card>
 
     <!-- 鍣ㄥ畼鍒嗛厤璁板綍閮ㄥ垎 -->
-    <el-card class="allocation-card">
+    <el-card class="allocation-card paper-card">
       <div slot="header" class="clearfix">
         <span class="detail-title">鍣ㄥ畼鍒嗛厤璁板綍</span>
         <div style="float: right;">
@@ -45,25 +38,22 @@
         </div>
       </div>
 
-      <el-form ref="allocationForm" :rules="allocationRules" :model="allocationData" label-position="right">
-        <el-row>
-          <el-col>
-            <el-form-item label-width="100px" label="鍒嗛厤鍣ㄥ畼">
+      <el-form ref="allocationForm" :rules="allocationRules" :model="allocationData" label-position="right" class="paper-form">
+        <div class="form-row">
+          <el-form-item label-width="100px" label="鍒嗛厤鍣ㄥ畼" class="col-full">
               <el-checkbox-group v-model="selectedOrgans" @change="handleOrganSelectionChange">
                 <el-checkbox v-for="dict in dict.type.sys_Organ || []" :key="dict.value" :label="dict.value"
-                  :disabled="form.allocationStatus == '1'">
+                  :disabled="form.allocationStatus == '1' || isReadOnly">
                   {{ dict.label }}
                 </el-checkbox>
               </el-checkbox-group>
               <el-input v-if="showOtherInput" v-model="otherOrganInput" placeholder="璇疯緭鍏ュ叾浠栧櫒瀹樺悕绉�"
-                style="margin-top: 10px; width: 300px;" :disabled="form.allocationStatus == '1'" />
-            </el-form-item>
-          </el-col>
-        </el-row>
+                style="margin-top: 10px; width: 300px;" :disabled="form.allocationStatus == '1' || isReadOnly" />
+          </el-form-item>
+        </div>
 
-        <el-row>
-          <el-col>
-            <el-form-item>
+        <div class="form-row">
+          <el-form-item class="col-full">
               <el-table :data="displayOrgans" v-loading="loading" border style="width: 100%"
                 :row-class-name="getOrganRowClassName">
                 <el-table-column label="搴忓彿" type="index" width="60" align="center" fixed></el-table-column>
@@ -105,7 +95,7 @@
                   <template slot-scope="scope">
                     <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.applicanttime"
                       type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨寮�濮嬫帴鏀舵椂闂�" :disabled="form.allocationStatus == '1' ||
-                        scope.row.allocationstatus == '3'
+                        scope.row.allocationstatus == '3' || isReadOnly
                         " />
                   </template>
                 </el-table-column>
@@ -113,7 +103,7 @@
                   <template slot-scope="scope">
                     <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.organgettime"
                       type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨鍒嗛厤鎺ユ敹鏃堕棿" :disabled="form.allocationStatus == '1' ||
-                        scope.row.allocationstatus == '3'
+                        scope.row.allocationstatus == '3' || isReadOnly
                         " />
                   </template>
                 </el-table-column>
@@ -121,7 +111,7 @@
                 <el-table-column label="鍙椾綋濮撴皬" align="center" width="120" prop="name">
                   <template slot-scope="scope">
                     <el-input v-model="scope.row.name" placeholder="鍙椾綋濮撴皬" :disabled="form.allocationStatus == '1' ||
-                      scope.row.allocationstatus == '3'
+                      scope.row.allocationstatus == '3' || isReadOnly
                       " />
                   </template>
                 </el-table-column>
@@ -129,7 +119,7 @@
                 <el-table-column label="绉绘鍖婚櫌" align="center" width="200" prop="transplanthospitalname">
                   <template slot-scope="scope">
                     <el-autocomplete v-model="scope.row.transplanthospitalname" :fetch-suggestions="queryHospitalSearch"
-                      placeholder="璇烽�夋嫨鎴栬緭鍏ョЩ妞嶅尰闄�" style="width: 100%" clearable></el-autocomplete>
+                      placeholder="璇烽�夋嫨鎴栬緭鍏ョЩ妞嶅尰闄�" style="width: 100%" :disabled="isReadOnly" clearable></el-autocomplete>
                   </template>
                   <!-- <template slot-scope="scope">
                     <el-select
@@ -153,7 +143,7 @@
                     <div v-if="scope.row.allocationstatus != '3'">
                       <el-input type="textarea" clearable v-model="scope.row.reallocationreason" placeholder="璇疯緭鍏ヨ鏄�"
                         :disabled="form.allocationStatus == '1' ||
-                          scope.row.allocationstatus == '3'
+                          scope.row.allocationstatus == '3' || isReadOnly
                           " />
                     </div>
                     <div v-else>
@@ -179,7 +169,7 @@
                 </el-table-column>
 
                 <el-table-column label="鎿嶄綔" align="center" width="120" class-name="small-padding fixed-width"
-                  v-if="form.allocationStatus !== '1'" fixed="right">
+                  v-if="!isReadOnly && form.allocationStatus !== '1'" fixed="right">
                   <template slot-scope="scope">
                     <el-button size="mini" type="text" icon="el-icon-copy-document"
                       @click="handleRedistribution(scope.row)" :disabled="scope.row.allocationstatus == '3'"
@@ -202,8 +192,7 @@
                 </el-table-column>
               </el-table>
             </el-form-item>
-          </el-col>
-        </el-row>
+        </div>
 
         <!-- 鍒嗛厤缁熻淇℃伅 -->
         <!-- <div
@@ -263,7 +252,7 @@
       </div>
 
       <!-- 浣跨敤 UploadAttachment 缁勪欢 -->
-      <UploadAttachment ref="uploadAttachment" :file-list="attachmentFileList" :limit="attachmentLimit"
+      <UploadAttachment v-if="!isReadOnly" ref="uploadAttachment" :file-list="attachmentFileList" :limit="attachmentLimit"
         :accept="attachmentAccept" :multiple="true" @change="handleAttachmentChange"
         @upload-success="handleUploadSuccess" @upload-error="handleUploadError" @remove="handleAttachmentRemove" />
 
@@ -303,7 +292,7 @@
               <el-button size="mini" type="success" @click="handleDownloadAttachment(scope.row)">
                 涓嬭浇
               </el-button>
-              <el-button size="mini" type="danger" @click="handleRemoveAttachment(scope.$index)">
+              <el-button v-if="!isReadOnly" size="mini" type="danger" @click="handleRemoveAttachment(scope.$index)">
                 鍒犻櫎
               </el-button>
             </template>
@@ -311,7 +300,7 @@
         </el-table>
       </div>
     </el-card>
-    <div style="text-align: center; margin: 30px 0;">
+    <div v-if="!isReadOnly" style="text-align: center; margin: 30px 0;">
       <el-button type="primary" @click="handleSave" :loading="saveLoading">
         淇濆瓨
       </el-button>
@@ -458,6 +447,7 @@
   allocationedit,
   donateorganBaseinfoInfo
 } from "@/api/businessApi";
+import { getDonatebaseinfo } from "@/api/project/donatebaseinfo";
 import UploadAttachment from "@/components/UploadAttachment";
 import FilePreviewDialog from "@/components/FilePreviewDialog";
 import OrgSelecter from "@/views/project/components/orgselect";
@@ -575,6 +565,10 @@
     };
   },
   computed: {
+    // 鏌ョ湅妯″紡锛氬彧璇伙紝绂佺敤琛ㄥ崟骞堕殣钘忎繚瀛樻寜閽�
+    isReadOnly() {
+      return this.$route.query.mode === "view";
+    },
     // 褰撳墠鐢ㄦ埛淇℃伅
     currentUser() {
       return JSON.parse(sessionStorage.getItem("user") || "{}");
@@ -583,15 +577,16 @@
     return (this.allocationData.serviceDonateorganList || [])
       .filter(item => item.delFlag !== 1);
   },
-    // 涓嶅畬鏁寸殑璁板綍鏁伴噺
+    // 涓嶅畬鏁寸殑璁板綍鏁伴噺锛堥噸鍒嗛厤璁板綍涓嶅弬涓庢牎楠岋級
     incompleteRecords() {
       if (!this.allocationData.serviceDonateorganList) return 0;
       return this.allocationData.serviceDonateorganList.filter(
         record =>
-          !record.applicanttime ||
-          !record.organgettime ||
-          !record.name ||
-          !record.transplanthospitalname
+          record.allocationstatus != "3" &&
+          (!record.applicanttime ||
+            !record.organgettime ||
+            !record.name ||
+            !record.transplanthospitalname)
       ).length;
     },
     // 寰呭鏍歌褰曟暟閲�
@@ -1304,6 +1299,7 @@
 
     // 淇濆瓨鍩烘湰淇℃伅
     async handleSave() {
+      if (this.saveLoading) return;
       this.$refs.form.validate(async valid => {
         if (!valid) {
           this.$message.warning("璇峰畬鍠勮〃鍗曚俊鎭�");
@@ -1312,6 +1308,14 @@
 
         this.saveLoading = true;
         try {
+          // 鏂板鏃舵牎楠屾槸鍚﹀凡鏈夌浉鍚屾偅鑰�
+          if (!this.form.id) {
+            const exists = await this.checkPatientExists();
+            if (exists) {
+              this.$message.warning("璇ユ偅鑰呭凡瀛樺湪锛岃鍕块噸澶嶆坊鍔�");
+              return;
+            }
+          }
           const saveData = {
             ...this.form,
             serviceDonateorganList:
@@ -1355,6 +1359,27 @@
           this.saveLoading = false;
         }
       });
+    },
+
+    // 鏂板鏃舵牎楠屾槸鍚﹀凡鏈夌浉鍚屾偅鑰咃紙鎸変綇闄㈠彿锛�
+    async checkPatientExists() {
+      let inpatientno = this.form.inpatientno;
+      if (!inpatientno && this.caseId) {
+        try {
+          const caseRes = await getDonatebaseinfo(this.caseId);
+          inpatientno = (caseRes.data && caseRes.data.inpatientno) || "";
+        } catch (e) {
+          inpatientno = "";
+        }
+      }
+      if (!inpatientno) return false;
+      try {
+        const res = await allocationList({ inpatientno, pageNum: 1, pageSize: 1 });
+        const list = res.data || [];
+        return list.some(item => item && item.id != null && item.id !== "");
+      } catch (e) {
+        return false;
+      }
     },
 
     // 纭瀹屾垚鍒嗛厤
@@ -1887,4 +1912,103 @@
     font-size: 11px;
   }
 }
+
+/* ===== 绾歌川琛ㄦ牸缃戞牸鏍峰紡 ===== */
+.paper-card >>> .el-card__body {
+  padding: 16px;
+}
+
+.paper-form {
+  border-left: 1px solid #d0d3db;
+  background: #fff;
+}
+
+.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