From c8e9849cb5f24848df0174c13bfbbff37bb08a5a Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 七月 2026 15:45:30 +0800
Subject: [PATCH] 维护

---
 src/views/business/course/components/DeathJudgmentStage.vue |  316 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 225 insertions(+), 91 deletions(-)

diff --git a/src/views/business/course/components/DeathJudgmentStage.vue b/src/views/business/course/components/DeathJudgmentStage.vue
index 8550177..b71bcf0 100644
--- a/src/views/business/course/components/DeathJudgmentStage.vue
+++ b/src/views/business/course/components/DeathJudgmentStage.vue
@@ -1,5 +1,6 @@
 <template>
   <div class="death-judgment-detail">
+    <!-- <case-basic-info :case-id="caseId" :show-attachment="true" /> -->
     <!-- 鍏叡淇℃伅妯″潡锛堢嫭绔嬫樉绀猴級 -->
 
     <!-- 鍒ゅ畾绫诲瀷鏍囩椤� -->
@@ -45,30 +46,7 @@
               <el-input v-model="form.gainhospitalname" :readonly="!isEdit" />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="鏄惁榛樺搥缂呮��" prop="isspendremember">
-              <el-select
-                v-model="form.isspendremember"
-                :disabled="!isEdit"
-                style="width: 100%"
-              >
-                <el-option label="鏄�" :value="1" />
-                <el-option label="鍚�" :value="0" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎭㈠閬椾綋浠" prop="isrestoreremains">
-              <el-select
-                v-model="form.isrestoreremains"
-                :disabled="!isEdit"
-                style="width: 100%"
-              >
-                <el-option label="鏄�" :value="1" />
-                <el-option label="鍚�" :value="0" />
-              </el-select>
-            </el-form-item>
-          </el-col>
+
         </el-row>
       </el-form>
     </el-card> -->
@@ -76,32 +54,6 @@
     <el-card v-if="activeJudgmentType === 'brain'" class="detail-card">
       <div slot="header" class="clearfix">
         <span class="detail-title">鑴戞浜″垽瀹氫俊鎭�</span>
-        <el-button
-          v-if="isEdit"
-          style="float: right; margin-left: 10px;"
-          type="success"
-          @click="handleSave"
-          :loading="saveLoading"
-        >
-          淇濆瓨淇℃伅
-        </el-button>
-        <el-button
-          v-if="isEdit"
-          style="float: right; margin-left: 10px;"
-          type="success"
-          @click="accomplish"
-          :loading="saveLoading"
-        >
-          瀹屾垚鍒ゅ畾
-        </el-button>
-        <el-button
-          v-else
-          style="float: right; margin-left: 10px;"
-          type="primary"
-          @click="handleEdit"
-        >
-          缂栬緫淇℃伅
-        </el-button>
       </div>
 
       <el-form :model="form" ref="brainForm" :rules="rules" label-width="120px">
@@ -133,6 +85,32 @@
           <el-col :span="8">
             <el-form-item label="鍒ゅ畾鍖荤敓浜�" prop="deathjudgedoctt">
               <el-input v-model="form.deathjudgedoctt" :readonly="!isEdit" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="24">
+            <el-form-item label="鍏朵粬鍒ゅ畾鍖荤敓">
+              <div
+                v-for="(doctor, index) in brainExtraDoctors"
+                :key="index"
+                style="display: flex; align-items: center; margin-bottom: 8px;"
+              >
+                <el-input
+                  v-model="brainExtraDoctors[index]"
+                  placeholder="璇疯緭鍏ュ尰鐢熷鍚�"
+                  style="flex: 1; margin-right: 10px;"
+                  :readonly="!isEdit"
+                />
+                <el-button
+                  v-if="isEdit"
+                  type="danger"
+                  icon="el-icon-minus"
+                  circle
+                  size="mini"
+                  @click="removeBrainDoctor(index)"
+                />
+              </div>
             </el-form-item>
           </el-col>
         </el-row>
@@ -290,7 +268,7 @@
 
         <el-row :gutter="20">
           <el-col :span="8">
-            <el-form-item label="蹇冩浜℃椂闂�" prop="heartdeathtime">
+            <el-form-item label="蹇冩浜″垽瀹氬畬鎴愭椂闂�" prop="heartdeathtime">
               <el-date-picker
                 v-model="form.heartdeathtime"
                 type="datetime"
@@ -314,6 +292,41 @@
                 v-model="form.heartdeathjudgedoctt"
                 :readonly="!isEdit"
               />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="24">
+            <el-form-item label="鍏朵粬鍒ゅ畾鍖荤敓">
+              <div
+                v-for="(doctor, index) in heartExtraDoctors"
+                :key="index"
+                style="display: flex; align-items: center; margin-bottom: 8px;"
+              >
+                <el-input
+                  v-model="heartExtraDoctors[index]"
+                  placeholder="璇疯緭鍏ュ尰鐢熷鍚�"
+                  style="flex: 1; margin-right: 10px;"
+                  :readonly="!isEdit"
+                />
+                <el-button
+                  v-if="isEdit"
+                  type="danger"
+                  icon="el-icon-minus"
+                  circle
+                  size="mini"
+                  @click="removeHeartDoctor(index)"
+                />
+              </div>
+              <el-button
+                v-if="isEdit"
+                type="primary"
+                icon="el-icon-plus"
+                size="small"
+                @click="addHeartDoctor"
+              >
+                娣诲姞鍖荤敓
+              </el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -436,7 +449,25 @@
         </el-tabs>
       </div>
     </el-card>
-
+    <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+    <div style="text-align: center; margin: 30px 0;">
+      <el-button
+        v-if="isEdit"
+        type="primary"
+        @click="handleSave"
+        :loading="saveLoading"
+      >
+        淇濆瓨淇℃伅
+      </el-button>
+      <el-button
+        v-if="isEdit"
+        type="success"
+        @click="accomplish"
+        :loading="saveLoading"
+      >
+        瀹屾垚鍒ゅ畾
+      </el-button>
+    </div>
     <!-- 涓婁紶瀵硅瘽妗嗭紙鑴戞浜★級 -->
     <el-dialog
       :title="`涓婁紶${getCurrentBrainDeathTypeLabel}璇勪及琛╜"
@@ -524,6 +555,13 @@
         </el-button>
       </div>
     </el-dialog>
+    <!-- 闄勪欢棰勮 -->
+    <FilePreviewDialog
+      :visible="previewVisible"
+      :file="currentPreviewFile"
+      @close="previewVisible = false"
+      @download="handleDownload"
+    />
   </div>
 </template>
 
@@ -535,10 +573,11 @@
 } from "@/api/businessApi";
 import { getToken } from "@/utils/auth";
 import CaseBasicInfo from "@/components/CaseBasicInfo";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
 
 export default {
   name: "DeathJudgmentDetail",
-  components: { CaseBasicInfo },
+  components: { CaseBasicInfo, FilePreviewDialog },
   props: {
     infoid: {
       type: String,
@@ -548,12 +587,15 @@
   data() {
     return {
       caseId: null,
-      isEdit: false,
+      isEdit: true,
       saveLoading: false,
-
+      brainExtraDoctors: [], // 鑴戞浜″叾浠栧垽瀹氬尰鐢�
+      heartExtraDoctors: [], // 蹇冩浜″叾浠栧垽瀹氬尰鐢�
       // 鍒ゅ畾绫诲瀷鏍囩
       activeJudgmentType: "brain", // 榛樿鏄剧ず鑴戞浜�
-
+      // 棰勮鐩稿叧
+      previewVisible: false,
+      currentPreviewFile: null,
       // 琛ㄥ崟鏁版嵁
       form: {
         id: undefined,
@@ -604,7 +646,11 @@
           { required: false, message: "蹇冩浜″師鍥犱笉鑳戒负绌�", trigger: "blur" }
         ],
         heartdeathtime: [
-          { required: false, message: "蹇冩浜℃椂闂翠笉鑳戒负绌�", trigger: "change" }
+          {
+            required: false,
+            message: "蹇冩浜″垽瀹氬畬鎴愭椂闂翠笉鑳戒负绌�",
+            trigger: "change"
+          }
         ],
         heartdeathjudgedocto: [
           {
@@ -637,12 +683,14 @@
         { value: "3", label: "鐭綔浼忔湡浣撴劅璇卞彂鐢典綅璇勪及琛�" },
         { value: "4", label: "缁忛澶氭櫘鍕掕秴澹拌瘎浼拌褰�" },
         { value: "5", label: "鍗仴濮旇剳鎹熶激璐ㄦ帶涓績 - 涓村簥缁煎悎璇勪及琛�" },
-        { value: "6", label: "UW璇勫垎琛�" }
+        { value: "7", label: "AT鍓�" },
+        { value: "8", label: "AT鍚�" },
+        { value: "6", label: "UW璇勫垎琛�(鑴戞浜�)" }
       ],
       // 蹇冩浜¤瘎浼拌〃绫诲瀷瀹氫箟
       heartDeathAttachmentTypes: [
         { value: "heart_1", label: "蹇冩浜″垽瀹氳〃" },
-        { value: "heart_2", label: "蹇冪數鍥捐瘎浼拌〃" }
+        { value: "heart_2", label: "UW璇勫垎琛�(蹇冩浜�)" }
       ],
 
       // 闄勪欢鍒楄〃鏁版嵁
@@ -665,10 +713,13 @@
     }
   },
   created() {
+    this.infoid = this.infoid;
     this.caseId = this.infoid;
+
+    this.activeJudgmentType = this.$route.query.type;
     // 浠庤矾鐢卞弬鏁拌幏鍙栭粯璁ゆ樉绀虹被鍨�
     if (this.$route.query.judgmentType) {
-      this.activeJudgmentType = this.$route.query.type;
+      this.activeJudgmentType = this.$route.query.judgmentType;
     }
 
     this.getDetail(this.infoid);
@@ -680,7 +731,32 @@
       this.activeJudgmentType = tab.name;
       // 鍙互鍦ㄨ繖閲屾坊鍔犲叾浠栧垏鎹㈤�昏緫
     },
+    addBrainDoctor() {
+      this.brainExtraDoctors.push("");
+    },
+    removeBrainDoctor(index) {
+      this.brainExtraDoctors.splice(index, 1);
+    },
+    addHeartDoctor() {
+      this.heartExtraDoctors.push("");
+    },
+    removeHeartDoctor(index) {
+      this.heartExtraDoctors.splice(index, 1);
+    },
 
+    // 搴忓垪鍖栭澶栧尰鐢熷垪琛ㄤ负瀛楃涓诧紙鐢ㄤ腑鏂囬�楀彿鍒嗛殧锛�
+    serializeExtraDoctors(list) {
+      return list.filter(name => name && name.trim()).join("锛�");
+    },
+
+    // 浠庡瓧绗︿覆瑙f瀽鍑哄尰鐢熷垪琛紙鎸変腑鏂囬�楀彿鎷嗗垎锛�
+    parseExtraDoctors(str) {
+      if (!str) return [];
+      return str
+        .split("锛�")
+        .map(s => s.trim())
+        .filter(s => s);
+    },
     // 鐢熸垚鎹愮尞鑰呯紪鍙�
     generateDonorNo() {
       const timestamp = Date.now().toString();
@@ -691,13 +767,8 @@
     async getDetail(infoid) {
       try {
         const response = await queryDathInfoBaseInfo({ infoid });
-        let realData = {};
 
-        if (response && response.data) {
-          realData = response.data[0];
-        } else if (response) {
-          realData = response;
-        }
+        let realData = response?.data?.[0] || response || {};
 
         // 鏄犲皠瀛楁鍒拌〃鍗�
         this.form = {
@@ -716,7 +787,18 @@
         if (realData.rememberAnnex) {
           this.parseAttachmentData(realData.rememberAnnex, "brain");
         }
-
+        if (realData.remark) {
+          const parts = realData.remark.split(" | ");
+          parts.forEach(part => {
+            if (part.includes("鑴戞浜″叾浠栧尰鐢燂細")) {
+              const doctorsStr = part.replace("鑴戞浜″叾浠栧尰鐢燂細", "");
+              this.brainExtraDoctors = this.parseExtraDoctors(doctorsStr);
+            } else if (part.includes("蹇冩浜″叾浠栧尰鐢燂細")) {
+              const doctorsStr = part.replace("蹇冩浜″叾浠栧尰鐢燂細", "");
+              this.heartExtraDoctors = this.parseExtraDoctors(doctorsStr);
+            }
+          });
+        }
         // 瑙f瀽蹇冩浜¢檮浠朵俊鎭�
         if (realData.heartdeathjudgeannex) {
           this.parseAttachmentData(realData.heartdeathjudgeannex, "heart");
@@ -1023,30 +1105,63 @@
     },
 
     // 棰勮闄勪欢
-    handlePreview(attachment) {
-      if (attachment.fileName.endsWith(".pdf")) {
-        window.open(attachment.fileUrl, "_blank");
-      } else if (attachment.fileName.match(/\.(jpg|jpeg|png)$/i)) {
-        this.$alert(
-          `<img src="${attachment.fileUrl}" style="max-width: 100%;" alt="${attachment.fileName}">`,
-          "鍥剧墖棰勮",
-          {
-            dangerouslyUseHTMLString: true,
-            customClass: "image-preview-dialog"
-          }
-        );
-      } else {
-        this.$message.info("璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅");
-      }
-    },
+    handlePreview(file) {
+      console.log(file, "file");
 
+      this.currentPreviewFile = {
+        fileName: file.fileName,
+        fileUrl: file.path || file.fileUrl,
+        fileType: this.getFileType(file.fileName)
+      };
+      this.previewVisible = true;
+      // if (attachment.fileName.endsWith(".pdf")) {
+      //   window.open(attachment.fileUrl, "_blank");
+      // } else if (attachment.fileName.match(/\.(jpg|jpeg|png)$/i)) {
+      //   this.$alert(
+      //     `<img src="${attachment.fileUrl}" style="max-width: 100%;" alt="${attachment.fileName}">`,
+      //     "鍥剧墖棰勮",
+      //     {
+      //       dangerouslyUseHTMLString: true,
+      //       customClass: "image-preview-dialog"
+      //     }
+      //   );
+      // } else {
+      //   this.$message.info("璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅");
+      // }
+    },
+    getFileType(fileName) {
+      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"];
+
+      if (imageTypes.includes(extension)) return "image";
+      if (pdfTypes.includes(extension)) return "pdf";
+      if (officeTypes.includes(extension)) return "office";
+      return "other";
+    },
     // 涓嬭浇闄勪欢
-    handleDownload(attachment) {
-      const link = document.createElement("a");
-      link.href = attachment.fileUrl;
-      link.download = attachment.fileName;
-      link.click();
-      this.$message.success(`寮�濮嬩笅杞�: ${attachment.fileName}`);
+    handleDownload(file) {
+      const fileUrl = file.path || file.fileUrl;
+      const fileName = file.fileName;
+
+      if (fileUrl) {
+        const link = document.createElement("a");
+        link.href = fileUrl;
+        link.download = fileName;
+        link.style.display = "none";
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        this.$message.success("寮�濮嬩笅杞芥枃浠�");
+      } else {
+        this.$message.warning("鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇");
+      }
     },
 
     // 缂栬緫淇℃伅
@@ -1077,13 +1192,32 @@
           this.saveLoading = true;
 
           try {
+            // 鏋勫缓棰濆鍖荤敓瀛楃涓�
+            const brainExtraStr = this.serializeExtraDoctors(
+              this.brainExtraDoctors
+            );
+            const heartExtraStr = this.serializeExtraDoctors(
+              this.heartExtraDoctors
+            );
+
+            let remark = this.form.remark || "";
+            // 濡傛灉宸叉湁澶囨敞锛岀敤 ' | ' 鍒嗛殧锛涘惁鍒欑洿鎺ヨ祴鍊�
+            if (brainExtraStr) {
+              remark +=
+                (remark ? " | " : "") + "鑴戞浜″叾浠栧尰鐢燂細" + brainExtraStr;
+            }
+            if (heartExtraStr) {
+              remark +=
+                (remark ? " | " : "") + "蹇冩浜″叾浠栧尰鐢燂細" + heartExtraStr;
+            }
             // 鏋勫缓鎻愪氦鏁版嵁
             const submitData = {
               ...this.form,
               infoid: this.infoid,
               // 纭繚闄勪欢鏁版嵁鏈�鏂�
-              rememberAnnex: this.buildBrainDeathAttachmentJson(),
-              heartdeathjudgeannex: this.buildHeartDeathAttachmentJson()
+              rememberannex: this.buildBrainDeathAttachmentJson(),
+              heartdeathjudgeannex: this.buildHeartDeathAttachmentJson(),
+              remark: remark // 浣跨敤鍚堝苟鍚庣殑 remark
             };
             if (submitData.state == 1 || !submitData.state) {
               submitData.state = 2;

--
Gitblit v1.9.3