From d27451a2c24fcc785d02619d5840378df7cfc939 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 18:12:05 +0800
Subject: [PATCH] 限制取消

---
 src/views/business/transfer/TransportEdit.vue |  274 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 199 insertions(+), 75 deletions(-)

diff --git a/src/views/business/transfer/TransportEdit.vue b/src/views/business/transfer/TransportEdit.vue
index a42de59..bae6f58 100644
--- a/src/views/business/transfer/TransportEdit.vue
+++ b/src/views/business/transfer/TransportEdit.vue
@@ -7,6 +7,41 @@
     :close-on-click-modal="false"
     @close="handleClose"
   >
+    <!-- 妗堜緥淇℃伅灞曠ず鍖哄煙 -->
+    <div v-if="selectedCase && !isEdit" class="selected-case-info">
+      <el-alert
+        title="鍏宠仈妗堜緥淇℃伅"
+        type="success"
+        :closable="false"
+        style="margin-bottom: 16px;"
+      />
+      <el-card shadow="never" class="case-info-card">
+        <el-descriptions :column="2" border>
+          <el-descriptions-item label="妗堜緥缂栧彿">{{
+            selectedCase.caseNo
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鎮h�呭鍚�">{{
+            selectedCase.name
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鎬у埆">
+            <dict-tag
+              :options="dict.type.sys_user_sex"
+              :value="selectedCase.sex"
+            />
+          </el-descriptions-item>
+          <el-descriptions-item label="骞撮緞">{{
+            selectedCase.age
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鐤剧梾璇婃柇">{{
+            selectedCase.diagnosisname
+          }}</el-descriptions-item>
+          <el-descriptions-item label="娌荤枟鍖婚櫌">{{
+            selectedCase.treatmenthospitalname
+          }}</el-descriptions-item>
+        </el-descriptions>
+      </el-card>
+    </div>
+
     <el-form
       ref="editForm"
       :model="formData"
@@ -16,25 +51,20 @@
       <!-- 鍩虹淇℃伅 -->
       <el-card class="form-section" shadow="never">
         <div slot="header" class="section-header">
-          <i class="el-icon-document" style="color: #409EFF; margin-right: 8px;"></i>
+          <i
+            class="el-icon-document"
+            style="color: #409EFF; margin-right: 8px;"
+          ></i>
           <span>鍩虹淇℃伅</span>
         </div>
 
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="杞繍鍗曞彿" prop="reportId">
-              <el-input
-                v-model="formData.reportId"
-                :disabled="isEdit"
-                placeholder="绯荤粺鑷姩鐢熸垚"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
             <el-form-item label="妗堜緥缂栧彿" prop="caseNo">
               <el-input
                 v-model="formData.caseNo"
-                placeholder="璇疯緭鍏ユ渚嬬紪鍙�"
+                :disabled="true"
+                placeholder="鑷姩浠庢渚嬭幏鍙�"
               />
             </el-form-item>
           </el-col>
@@ -45,7 +75,8 @@
             <el-form-item label="鎮h�呭鍚�" prop="patName">
               <el-input
                 v-model="formData.patName"
-                placeholder="璇疯緭鍏ユ偅鑰呭鍚�"
+                :disabled="true"
+                placeholder="鑷姩浠庢渚嬭幏鍙�"
               />
             </el-form-item>
           </el-col>
@@ -53,6 +84,7 @@
             <el-form-item label="鎬у埆" prop="sex">
               <el-select
                 v-model="formData.sex"
+                :disabled="true"
                 placeholder="璇烽�夋嫨鎬у埆"
                 style="width: 100%"
               >
@@ -70,7 +102,8 @@
                 v-model="formData.age"
                 :min="0"
                 :max="120"
-                placeholder="璇疯緭鍏ュ勾榫�"
+                :disabled="true"
+                placeholder="鑷姩浠庢渚嬭幏鍙�"
                 style="width: 100%"
               />
             </el-form-item>
@@ -79,7 +112,8 @@
             <el-form-item label="鐤剧梾璇婃柇" prop="diagnosisname">
               <el-input
                 v-model="formData.diagnosisname"
-                placeholder="璇疯緭鍏ョ柧鐥呰瘖鏂悕绉�"
+                :disabled="true"
+                placeholder="鑷姩浠庢渚嬭幏鍙�"
               />
             </el-form-item>
           </el-col>
@@ -89,7 +123,10 @@
       <!-- 鍖婚櫌淇℃伅 -->
       <el-card class="form-section" shadow="never">
         <div slot="header" class="section-header">
-          <i class="el-icon-office-building" style="color: #67C23A; margin-right: 8px;"></i>
+          <i
+            class="el-icon-office-building"
+            style="color: #67C23A; margin-right: 8px;"
+          ></i>
           <span>鍖婚櫌淇℃伅</span>
         </div>
 
@@ -98,7 +135,8 @@
             <el-form-item label="娌荤枟鍖婚櫌" prop="treatmentHospitalName">
               <el-input
                 v-model="formData.treatmentHospitalName"
-                placeholder="璇疯緭鍏ユ不鐤楀尰闄㈠悕绉�"
+                :disabled="true"
+                placeholder="鑷姩浠庢渚嬭幏鍙�"
               />
             </el-form-item>
           </el-col>
@@ -116,7 +154,10 @@
       <!-- 杞繍淇℃伅 -->
       <el-card class="form-section" shadow="never">
         <div slot="header" class="section-header">
-          <i class="el-icon-location-information" style="color: #E6A23C; margin-right: 8px;"></i>
+          <i
+            class="el-icon-location-information"
+            style="color: #E6A23C; margin-right: 8px;"
+          ></i>
           <span>杞繍淇℃伅</span>
         </div>
 
@@ -172,7 +213,10 @@
       <!-- 鍖绘姢浜哄憳淇℃伅 -->
       <el-card class="form-section" shadow="never">
         <div slot="header" class="section-header">
-          <i class="el-icon-user" style="color: #F56C6C; margin-right: 8px;"></i>
+          <i
+            class="el-icon-user"
+            style="color: #F56C6C; margin-right: 8px;"
+          ></i>
           <span>鍖绘姢浜哄憳淇℃伅</span>
         </div>
 
@@ -253,7 +297,10 @@
       <!-- 闄勪欢淇℃伅 -->
       <el-card class="form-section" shadow="never">
         <div slot="header" class="section-header">
-          <i class="el-icon-folder" style="color: #909399; margin-right: 8px;"></i>
+          <i
+            class="el-icon-folder"
+            style="color: #909399; margin-right: 8px;"
+          ></i>
           <span>闄勪欢淇℃伅</span>
         </div>
 
@@ -261,7 +308,9 @@
           <div class="attachment-header">
             <i class="el-icon-paperclip"></i>
             <span class="attachment-title">闄勪欢涓婁紶</span>
-            <span class="attachment-tip">鏀寔涓婁紶妫�楠屾姤鍛婂崟绛夋枃浠� (鏈�澶歿{ attachmentLimit }}涓�)</span>
+            <span class="attachment-tip"
+              >鏀寔涓婁紶妫�楠屾姤鍛婂崟绛夋枃浠� (鏈�澶歿{ attachmentLimit }}涓�)</span
+            >
           </div>
 
           <!-- 浣跨敤 UploadAttachment 缁勪欢 -->
@@ -278,18 +327,32 @@
         </div>
 
         <!-- 闄勪欢鍒楄〃 -->
-        <div class="attachment-list" v-if="formData.annexfilesList && formData.annexfilesList.length > 0">
-          <div class="list-title">宸蹭笂浼犻檮浠� ({{ formData.annexfilesList.length }})</div>
-          <el-table :data="formData.annexfilesList" style="width: 100%" size="small">
+        <div
+          class="attachment-list"
+          v-if="formData.annexfilesList && formData.annexfilesList.length > 0"
+        >
+          <div class="list-title">
+            宸蹭笂浼犻檮浠� ({{ formData.annexfilesList.length }})
+          </div>
+          <el-table
+            :data="formData.annexfilesList"
+            style="width: 100%"
+            size="small"
+          >
             <el-table-column label="鏂囦欢鍚�" min-width="200">
               <template slot-scope="scope">
-                <i class="el-icon-document" style="margin-right: 8px; color: #409EFF;"></i>
+                <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="100">
               <template slot-scope="scope">
-                <el-tag size="small">{{ getFileType(scope.row.fileName) }}</el-tag>
+                <el-tag size="small">{{
+                  getFileType(scope.row.fileName)
+                }}</el-tag>
               </template>
             </el-table-column>
             <el-table-column label="鍒涘缓鏃堕棿" width="160">
@@ -297,7 +360,7 @@
                 <span>{{ formatDateTime(scope.row.createTime) }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="鎿嶄綔" width="180">
+            <el-table-column label="鎿嶄綔" width="266">
               <template slot-scope="scope">
                 <el-button
                   size="mini"
@@ -329,7 +392,10 @@
       <!-- 澶囨敞淇℃伅 -->
       <el-card class="form-section" shadow="never">
         <div slot="header" class="section-header">
-          <i class="el-icon-edit" style="color: #409EFF; margin-right: 8px;"></i>
+          <i
+            class="el-icon-edit"
+            style="color: #409EFF; margin-right: 8px;"
+          ></i>
           <span>澶囨敞淇℃伅</span>
         </div>
         <el-form-item prop="remark">
@@ -347,7 +413,9 @@
 
     <div slot="footer" class="dialog-footer">
       <el-button @click="handleClose">鍙栨秷</el-button>
-      <el-button type="primary" :loading="saveLoading" @click="handleSave">淇濆瓨</el-button>
+      <el-button type="primary" :loading="saveLoading" @click="handleSave"
+        >淇濆瓨</el-button
+      >
     </div>
 
     <!-- 鏂囦欢棰勮寮圭獥 -->
@@ -372,6 +440,7 @@
     UploadAttachment,
     FilePreviewDialog
   },
+  dicts: ["sys_user_sex", "sys_BloodType"],
   props: {
     editOpen: {
       type: Boolean,
@@ -384,6 +453,10 @@
     isEdit: {
       type: Boolean,
       default: false
+    },
+    selectedCase: {
+      type: Object,
+      default: null
     }
   },
   data() {
@@ -428,9 +501,23 @@
   watch: {
     editOpen(val) {
       if (val) {
-        this.formData = this.isEdit
-          ? { ...this.getDefaultFormData(), ...this.transportData }
-          : this.getDefaultFormData();
+
+        if (this.isEdit) {
+          // 缂栬緫妯″紡锛屼娇鐢ㄤ紶鍏ョ殑杞繍鍗曟暟鎹�
+
+          this.formData = {
+            ...this.getDefaultFormData(),
+            ...this.transportData
+          };
+        } else {
+          // 鏂板妯″紡
+          this.formData = this.getDefaultFormData();
+
+          // 濡傛灉鏈夐�変腑鐨勬渚嬶紝鐢ㄦ渚嬩俊鎭~鍏呰〃鍗�
+          if (this.selectedCase) {
+            this.fillFormWithCaseData(this.selectedCase);
+          }
+        }
 
         this.initAttachmentList();
 
@@ -438,6 +525,15 @@
           this.$refs.editForm && this.$refs.editForm.clearValidate();
         });
       }
+    },
+
+    selectedCase: {
+      handler(newVal) {
+        if (newVal && !this.isEdit) {
+          this.fillFormWithCaseData(newVal);
+        }
+      },
+      deep: true
     }
   },
   methods: {
@@ -445,7 +541,6 @@
     getDefaultFormData() {
       return {
         id: undefined,
-        reportId: undefined,
         caseNo: undefined,
         patName: undefined,
         sex: undefined,
@@ -475,16 +570,37 @@
       };
     },
 
+    /** 鐢ㄦ渚嬫暟鎹~鍏呰〃鍗� */
+    fillFormWithCaseData(caseData) {
+
+      this.formData = {
+        ...this.formData,
+        caseNo: caseData.caseNo || "",
+        patName: caseData.name || "",
+        sex: caseData.sex || "",
+        age: caseData.age || "",
+        reportId: caseData.id || null,
+        diagnosisname: caseData.diagnosisname || "",
+        treatmentHospitalName: caseData.treatmenthospitalname || "",
+        treatmentDeptName: caseData.treatmentdeptname || "",
+        // 鍙互璁剧疆涓�浜涢粯璁ゅ��
+        transportStartPlace: caseData.treatmenthospitalname || "",
+        contactPerson: caseData.coordinatorName || ""
+      };
+    },
+
     /** 鍒濆鍖栭檮浠跺垪琛� */
     initAttachmentList() {
       if (this.isEdit && this.transportData.annexfilesList) {
         this.formData.annexfilesList = [...this.transportData.annexfilesList];
-        this.attachmentFileList = this.transportData.annexfilesList.map(item => ({
-          uid: item.id || Math.random(),
-          name: item.fileName,
-          url: item.path || item.fileUrl,
-          status: 'success'
-        }));
+        this.attachmentFileList = this.transportData.annexfilesList.map(
+          item => ({
+            uid: item.id || Math.random(),
+            name: item.fileName,
+            url: item.path || item.fileUrl,
+            status: "success"
+          })
+        );
       } else {
         this.formData.annexfilesList = [];
         this.attachmentFileList = [];
@@ -499,8 +615,8 @@
     /** 闄勪欢绉婚櫎澶勭悊 */
     handleAttachmentRemove(file) {
       if (file.url) {
-        const index = this.formData.annexfilesList.findIndex(item =>
-          item.path === file.url || item.fileUrl === file.url
+        const index = this.formData.annexfilesList.findIndex(
+          item => item.path === file.url || item.fileUrl === file.url
         );
         if (index > -1) {
           this.formData.annexfilesList.splice(index, 1);
@@ -512,7 +628,7 @@
     handleRemoveAttachment(index) {
       this.formData.annexfilesList.splice(index, 1);
       this.attachmentFileList.splice(index, 1);
-      this.$message.success('闄勪欢鍒犻櫎鎴愬姛');
+      this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
     },
 
     /** 涓婁紶鎴愬姛澶勭悊 */
@@ -523,21 +639,21 @@
           path: response.data || file.url,
           fileUrl: response.data || file.url,
           type: this.getFileExtension(file.name),
-          createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+          createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
           transportId: this.formData.id,
           delFlag: 0,
-          caseNo:this.formData.caseNo
+          caseNo: this.formData.caseNo
         };
 
         this.formData.annexfilesList.push(attachmentObj);
-        this.$message.success('鏂囦欢涓婁紶鎴愬姛');
+        this.$message.success("鏂囦欢涓婁紶鎴愬姛");
       }
     },
 
     /** 涓婁紶閿欒澶勭悊 */
     handleUploadError({ file, fileList, error }) {
-      console.error('闄勪欢涓婁紶澶辫触:', error);
-      this.$message.error('鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯');
+      console.error("闄勪欢涓婁紶澶辫触:", error);
+      this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
     },
 
     /** 鏂囦欢棰勮 */
@@ -556,53 +672,59 @@
       const fileName = file.fileName;
 
       if (fileUrl) {
-        const link = document.createElement('a');
+        const link = document.createElement("a");
         link.href = fileUrl;
         link.download = fileName;
-        link.style.display = 'none';
+        link.style.display = "none";
         document.body.appendChild(link);
         link.click();
         document.body.removeChild(link);
-        this.$message.success('寮�濮嬩笅杞芥枃浠�');
+        this.$message.success("寮�濮嬩笅杞芥枃浠�");
       } else {
-        this.$message.warning('鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇');
+        this.$message.warning("鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇");
       }
     },
 
     /** 鑾峰彇鏂囦欢绫诲瀷 */
     getFileType(fileName) {
-      if (!fileName) return 'other';
+      if (!fileName) return "other";
 
-      const extension = fileName.split('.').pop().toLowerCase();
-      const imageTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
-      const pdfTypes = ['pdf'];
-      const officeTypes = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'];
+      const extension = fileName
+        .split(".")
+        .pop()
+        .toLowerCase();
+      const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"];
+      const pdfTypes = ["pdf"];
+      const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"];
 
-      if (imageTypes.includes(extension)) return 'image';
-      if (pdfTypes.includes(extension)) return 'pdf';
-      if (officeTypes.includes(extension)) return 'office';
-      return 'other';
+      if (imageTypes.includes(extension)) return "image";
+      if (pdfTypes.includes(extension)) return "pdf";
+      if (officeTypes.includes(extension)) return "office";
+      return "other";
     },
 
     /** 鑾峰彇鏂囦欢鎵╁睍鍚� */
     getFileExtension(filename) {
-      return filename.split('.').pop().toLowerCase();
+      return filename
+        .split(".")
+        .pop()
+        .toLowerCase();
     },
 
     /** 鏃ユ湡鏃堕棿鏍煎紡鍖� */
     formatDateTime(dateTime) {
-      if (!dateTime) return '';
+      if (!dateTime) return "";
 
       try {
         const date = new Date(dateTime);
         if (isNaN(date.getTime())) return dateTime;
 
         const year = date.getFullYear();
-        const month = String(date.getMonth() + 1).padStart(2, '0');
-        const day = String(date.getDate()).padStart(2, '0');
-        const hours = String(date.getHours()).padStart(2, '0');
-        const minutes = String(date.getMinutes()).padStart(2, '0');
-        const seconds = String(date.getSeconds()).padStart(2, '0');
+        const month = String(date.getMonth() + 1).padStart(2, "0");
+        const day = String(date.getDate()).padStart(2, "0");
+        const hours = String(date.getHours()).padStart(2, "0");
+        const minutes = String(date.getMinutes()).padStart(2, "0");
+        const seconds = String(date.getSeconds()).padStart(2, "0");
 
         return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
       } catch (error) {
@@ -621,9 +743,13 @@
         const valid = await this.$refs.editForm.validate();
         if (!valid) return;
 
-        const pendingFiles = this.attachmentFileList.filter(item => item.status !== 'success');
+        const pendingFiles = this.attachmentFileList.filter(
+          item => item.status !== "success"
+        );
         if (pendingFiles.length > 0) {
-          this.$message.warning('杩樻湁鏂囦欢鏈笂浼犲畬鎴愶紝璇峰厛涓婁紶鎵�鏈夋枃浠舵垨绉婚櫎鏈笂浼犵殑鏂囦欢');
+          this.$message.warning(
+            "杩樻湁鏂囦欢鏈笂浼犲畬鎴愶紝璇峰厛涓婁紶鎵�鏈夋枃浠舵垨绉婚櫎鏈笂浼犵殑鏂囦欢"
+          );
           return;
         }
 
@@ -631,7 +757,6 @@
 
         const requestData = { ...this.formData };
         let response;
-
         if (this.isEdit) {
           response = await transportEdit(requestData);
         } else {
@@ -709,13 +834,12 @@
   font-size: 13px;
 }
 
-.file-path {
-  font-size: 12px;
-  color: #909399;
+/* 妗堜緥淇℃伅灞曠ず鏍峰紡 */
+.selected-case-info {
+  margin-bottom: 20px;
 }
 
-::v-deep .el-card__header {
-  background: #f5f7fa;
-  border-bottom: 1px solid #ebeef5;
+.case-info-card {
+  border-left: 4px solid #67c23a;
 }
 </style>

--
Gitblit v1.9.3